@nyaruka/temba-components 0.31.9 → 0.32.0

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.
Files changed (46) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/demo/index.html +53 -12
  3. package/dist/{4be064bd.js → 193d2225.js} +493 -404
  4. package/dist/index.js +493 -404
  5. package/dist/sw.js +1 -1
  6. package/dist/sw.js.map +1 -1
  7. package/dist/templates/components-body.html +1 -1
  8. package/dist/templates/components-head.html +1 -1
  9. package/out-tsc/src/FormElement.js +8 -0
  10. package/out-tsc/src/FormElement.js.map +1 -1
  11. package/out-tsc/src/contacts/ContactFieldEditor.js +58 -37
  12. package/out-tsc/src/contacts/ContactFieldEditor.js.map +1 -1
  13. package/out-tsc/src/contacts/ContactFields.js +9 -2
  14. package/out-tsc/src/contacts/ContactFields.js.map +1 -1
  15. package/out-tsc/src/datepicker/DatePicker.js +196 -46
  16. package/out-tsc/src/datepicker/DatePicker.js.map +1 -1
  17. package/out-tsc/src/tabpane/TabPane.js +2 -0
  18. package/out-tsc/src/tabpane/TabPane.js.map +1 -1
  19. package/out-tsc/src/textinput/TextInput.js +9 -113
  20. package/out-tsc/src/textinput/TextInput.js.map +1 -1
  21. package/out-tsc/temba-modules.js +2 -0
  22. package/out-tsc/temba-modules.js.map +1 -1
  23. package/out-tsc/test/temba-datepicker.test.js +66 -0
  24. package/out-tsc/test/temba-datepicker.test.js.map +1 -0
  25. package/out-tsc/test/temba-textinput.test.js +0 -47
  26. package/out-tsc/test/temba-textinput.test.js.map +1 -1
  27. package/out-tsc/test/temba-tip.test.js +5 -1
  28. package/out-tsc/test/temba-tip.test.js.map +1 -1
  29. package/package.json +1 -2
  30. package/screenshots/truth/datepicker/date.png +0 -0
  31. package/screenshots/truth/datepicker/datetime.png +0 -0
  32. package/screenshots/truth/datepicker/initial-timezone.png +0 -0
  33. package/screenshots/truth/datepicker/initial-value.png +0 -0
  34. package/screenshots/truth/datepicker/updated-keyboard-date.png +0 -0
  35. package/screenshots/truth/datepicker/updated-keyboard.png +0 -0
  36. package/src/FormElement.ts +6 -0
  37. package/src/contacts/ContactFieldEditor.ts +62 -38
  38. package/src/contacts/ContactFields.ts +9 -2
  39. package/src/datepicker/DatePicker.ts +201 -39
  40. package/src/tabpane/TabPane.ts +2 -0
  41. package/src/textinput/TextInput.ts +13 -129
  42. package/temba-modules.ts +2 -0
  43. package/test/temba-datepicker.test.ts +94 -0
  44. package/test/temba-textinput.test.ts +0 -73
  45. package/test/temba-tip.test.ts +5 -1
  46. package/test-assets/style.css +4 -0
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(r<3?o(s):r>3?o(e,i,s):o(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s}const e=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,i=Symbol(),n=new WeakMap;class o{constructor(t,e,n){if(this._$cssResult$=!0,n!==i)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const i=this.t;if(e&&void 0===t){const e=void 0!==i&&1===i.length;e&&(t=n.get(i)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&n.set(i,t))}return t}toString(){return this.cssText}}const r=(t,...e)=>{const n=1===t.length?t[0]:e.reduce(((e,i,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[n+1]),t[0]);return new o(n,t,i)},s=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new o("string"==typeof t?t:t+"",void 0,i))(e)})(t):t;var a;const l=window.trustedTypes,c=l?l.emptyScript:"",h=window.reactiveElementPolyfillSupport,d={toAttribute(t,e){switch(e){case Boolean:t=t?c:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},u=(t,e)=>e!==t&&(e==e||t==t),p={attribute:!0,type:String,converter:d,reflect:!1,hasChanged:u};class m extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(t){var e;null!==(e=this.h)&&void 0!==e||(this.h=[]),this.h.push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,i)=>{const n=this._$Ep(i,e);void 0!==n&&(this._$Ev.set(n,i),t.push(n))})),t}static createProperty(t,e=p){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const i="symbol"==typeof t?Symbol():"__"+t,n=this.getPropertyDescriptor(t,i,e);void 0!==n&&Object.defineProperty(this.prototype,t,n)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(n){const o=this[t];this[e]=n,this.requestUpdate(t,o,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||p}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const i of e)this.createProperty(i,t[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(s(t))}else void 0!==t&&e.push(s(t));return e}static _$Ep(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}u(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,i;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(i=t.hostConnected)||void 0===i||i.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const i=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,i)=>{e?t.adoptedStyleSheets=i.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):i.forEach((e=>{const i=document.createElement("style"),n=window.litNonce;void 0!==n&&i.setAttribute("nonce",n),i.textContent=e.cssText,t.appendChild(i)}))})(i,this.constructor.elementStyles),i}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EO(t,e,i=p){var n,o;const r=this.constructor._$Ep(t,i);if(void 0!==r&&!0===i.reflect){const s=(null!==(o=null===(n=i.converter)||void 0===n?void 0:n.toAttribute)&&void 0!==o?o:d.toAttribute)(e,i.type);this._$El=t,null==s?this.removeAttribute(r):this.setAttribute(r,s),this._$El=null}}_$AK(t,e){var i,n;const o=this.constructor,r=o._$Ev.get(t);if(void 0!==r&&this._$El!==r){const t=o.getPropertyOptions(r),s=t.converter,a=null!==(n=null!==(i=null==s?void 0:s.fromAttribute)&&void 0!==i?i:"function"==typeof s?s:null)&&void 0!==n?n:d.fromAttribute;this._$El=r,this[r]=a(e,t.type),this._$El=null}}requestUpdate(t,e,i){let n=!0;void 0!==t&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||u)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,i))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,e)=>this[e]=t)),this._$Ei=void 0);let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(i)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;null===(e=this._$ES)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$EO(e,this[e],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}}var f;m.finalized=!0,m.elementProperties=new Map,m.elementStyles=[],m.shadowRootOptions={mode:"open"},null==h||h({ReactiveElement:m}),(null!==(a=globalThis.reactiveElementVersions)&&void 0!==a?a:globalThis.reactiveElementVersions=[]).push("1.3.4");const g=globalThis.trustedTypes,v=g?g.createPolicy("lit-html",{createHTML:t=>t}):void 0,y=`lit$${(Math.random()+"").slice(9)}$`,b="?"+y,_=`<${b}>`,x=document,w=(t="")=>x.createComment(t),k=t=>null===t||"object"!=typeof t&&"function"!=typeof t,C=Array.isArray,S=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,E=/-->/g,T=/>/g,M=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),$=/'/g,D=/"/g,A=/^(?:script|style|textarea|title)$/i,O=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),P=Symbol.for("lit-noChange"),I=Symbol.for("lit-nothing"),z=new WeakMap,N=x.createTreeWalker(x,129,null,!1),R=(t,e)=>{const i=t.length-1,n=[];let o,r=2===e?"<svg>":"",s=S;for(let e=0;e<i;e++){const i=t[e];let a,l,c=-1,h=0;for(;h<i.length&&(s.lastIndex=h,l=s.exec(i),null!==l);)h=s.lastIndex,s===S?"!--"===l[1]?s=E:void 0!==l[1]?s=T:void 0!==l[2]?(A.test(l[2])&&(o=RegExp("</"+l[2],"g")),s=M):void 0!==l[3]&&(s=M):s===M?">"===l[0]?(s=null!=o?o:S,c=-1):void 0===l[1]?c=-2:(c=s.lastIndex-l[2].length,a=l[1],s=void 0===l[3]?M:'"'===l[3]?D:$):s===D||s===$?s=M:s===E||s===T?s=S:(s=M,o=void 0);const d=s===M&&t[e+1].startsWith("/>")?" ":"";r+=s===S?i+_:c>=0?(n.push(a),i.slice(0,c)+"$lit$"+i.slice(c)+y+d):i+y+(-2===c?(n.push(void 0),e):d)}const a=r+(t[i]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==v?v.createHTML(a):a,n]};class B{constructor({strings:t,_$litType$:e},i){let n;this.parts=[];let o=0,r=0;const s=t.length-1,a=this.parts,[l,c]=R(t,e);if(this.el=B.createElement(l,i),N.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(n=N.nextNode())&&a.length<s;){if(1===n.nodeType){if(n.hasAttributes()){const t=[];for(const e of n.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(y)){const i=c[r++];if(t.push(e),void 0!==i){const t=n.getAttribute(i.toLowerCase()+"$lit$").split(y),e=/([.?@])?(.*)/.exec(i);a.push({type:1,index:o,name:e[2],strings:t,ctor:"."===e[1]?H:"?"===e[1]?V:"@"===e[1]?W:Z})}else a.push({type:6,index:o})}for(const e of t)n.removeAttribute(e)}if(A.test(n.tagName)){const t=n.textContent.split(y),e=t.length-1;if(e>0){n.textContent=g?g.emptyScript:"";for(let i=0;i<e;i++)n.append(t[i],w()),N.nextNode(),a.push({type:2,index:++o});n.append(t[e],w())}}}else if(8===n.nodeType)if(n.data===b)a.push({type:2,index:o});else{let t=-1;for(;-1!==(t=n.data.indexOf(y,t+1));)a.push({type:7,index:o}),t+=y.length-1}o++}}static createElement(t,e){const i=x.createElement("template");return i.innerHTML=t,i}}function F(t,e,i=t,n){var o,r,s,a;if(e===P)return e;let l=void 0!==n?null===(o=i._$Cl)||void 0===o?void 0:o[n]:i._$Cu;const c=k(e)?void 0:e._$litDirective$;return(null==l?void 0:l.constructor)!==c&&(null===(r=null==l?void 0:l._$AO)||void 0===r||r.call(l,!1),void 0===c?l=void 0:(l=new c(t),l._$AT(t,i,n)),void 0!==n?(null!==(s=(a=i)._$Cl)&&void 0!==s?s:a._$Cl=[])[n]=l:i._$Cu=l),void 0!==l&&(e=F(t,l._$AS(t,e.values),l,n)),e}class q{constructor(t,e){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var e;const{el:{content:i},parts:n}=this._$AD,o=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:x).importNode(i,!0);N.currentNode=o;let r=N.nextNode(),s=0,a=0,l=n[0];for(;void 0!==l;){if(s===l.index){let e;2===l.type?e=new j(r,r.nextSibling,this,t):1===l.type?e=new l.ctor(r,l.name,l.strings,this,t):6===l.type&&(e=new G(r,this,t)),this.v.push(e),l=n[++a]}s!==(null==l?void 0:l.index)&&(r=N.nextNode(),s++)}return o}m(t){let e=0;for(const i of this.v)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class j{constructor(t,e,i,n){var o;this.type=2,this._$AH=I,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=n,this._$C_=null===(o=null==n?void 0:n.isConnected)||void 0===o||o}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$C_}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=F(this,t,e),k(t)?t===I||null==t||""===t?(this._$AH!==I&&this._$AR(),this._$AH=I):t!==this._$AH&&t!==P&&this.T(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.k(t):(t=>C(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.S(t):this.T(t)}j(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}k(t){this._$AH!==t&&(this._$AR(),this._$AH=this.j(t))}T(t){this._$AH!==I&&k(this._$AH)?this._$AA.nextSibling.data=t:this.k(x.createTextNode(t)),this._$AH=t}$(t){var e;const{values:i,_$litType$:n}=t,o="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=B.createElement(n.h,this.options)),n);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===o)this._$AH.m(i);else{const t=new q(o,this),e=t.p(this.options);t.m(i),this.k(e),this._$AH=t}}_$AC(t){let e=z.get(t.strings);return void 0===e&&z.set(t.strings,e=new B(t)),e}S(t){C(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,n=0;for(const o of t)n===e.length?e.push(i=new j(this.j(w()),this.j(w()),this,this.options)):i=e[n],i._$AI(o),n++;n<e.length&&(this._$AR(i&&i._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){var i;for(null===(i=this._$AP)||void 0===i||i.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$C_=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class Z{constructor(t,e,i,n,o){this.type=1,this._$AH=I,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=o,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=I}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,n){const o=this.strings;let r=!1;if(void 0===o)t=F(this,t,e,0),r=!k(t)||t!==this._$AH&&t!==P,r&&(this._$AH=t);else{const n=t;let s,a;for(t=o[0],s=0;s<o.length-1;s++)a=F(this,n[i+s],e,s),a===P&&(a=this._$AH[s]),r||(r=!k(a)||a!==this._$AH[s]),a===I?t=I:t!==I&&(t+=(null!=a?a:"")+o[s+1]),this._$AH[s]=a}r&&!n&&this.P(t)}P(t){t===I?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class H extends Z{constructor(){super(...arguments),this.type=3}P(t){this.element[this.name]=t===I?void 0:t}}const U=g?g.emptyScript:"";class V extends Z{constructor(){super(...arguments),this.type=4}P(t){t&&t!==I?this.element.setAttribute(this.name,U):this.element.removeAttribute(this.name)}}class W extends Z{constructor(t,e,i,n,o){super(t,e,i,n,o),this.type=5}_$AI(t,e=this){var i;if((t=null!==(i=F(this,t,e,0))&&void 0!==i?i:I)===P)return;const n=this._$AH,o=t===I&&n!==I||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,r=t!==I&&(n===I||o);o&&this.element.removeEventListener(this.name,this,n),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==i?i:this.element,t):this._$AH.handleEvent(t)}}class G{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){F(this,t)}}const Y=window.litHtmlPolyfillSupport;var K,J;null==Y||Y(B,j),(null!==(f=globalThis.litHtmlVersions)&&void 0!==f?f:globalThis.litHtmlVersions=[]).push("2.2.7");class X extends m{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,i)=>{var n,o;const r=null!==(n=null==i?void 0:i.renderBefore)&&void 0!==n?n:e;let s=r._$litPart$;if(void 0===s){const t=null!==(o=null==i?void 0:i.renderBefore)&&void 0!==o?o:null;r._$litPart$=s=new j(e.insertBefore(w(),t),t,void 0,null!=i?i:{})}return s._$AI(t),s})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return P}}X.finalized=!0,X._$litElement$=!0,null===(K=globalThis.litElementHydrateSupport)||void 0===K||K.call(globalThis,{LitElement:X});const Q=globalThis.litElementPolyfillSupport;null==Q||Q({LitElement:X}),(null!==(J=globalThis.litElementVersions)&&void 0!==J?J:globalThis.litElementVersions=[]).push("3.2.2");class tt extends X{constructor(){super(...arguments),this.eles={}}getEventHandlers(){return[]}connectedCallback(){super.connectedCallback();for(const t of this.getEventHandlers())t.isDocument?document.addEventListener(t.event,t.method.bind(this)):this.addEventListener(t.event,t.method.bind(this))}disconnectedCallback(){for(const t of this.getEventHandlers())t.isDocument?document.removeEventListener(t.event,t.method):this.removeEventListener(t.event,t.method);super.disconnectedCallback()}fireEvent(t){return this.dispatchEvent(new Event(t,{bubbles:!0,composed:!0}))}fireCustomEvent(t,e={}){const i=new CustomEvent(t,{detail:e,bubbles:!0,composed:!0});return this.dispatchEvent(i)}dispatchEvent(t){super.dispatchEvent(t);const e=t.target;if(e){const i=e["-"+t.type];if(i)return i(t);return new Function("event",`with(document) {\n with(this) {\n let handler = ${e.getAttribute("-"+t.type)};\n if(typeof handler === 'function') { \n handler(event) ;\n }\n }\n }`).call(e,t)}}closestElement(t,e=this){return function e(i){if(!i||i===document||i===window)return null;i.assignedSlot&&(i=i.assignedSlot);const n=i.closest(t);return n||e(i.getRootNode().host)}(e)}getDiv(t){let e=this.eles[t];return e||(e=this.shadowRoot.querySelector(t),e&&(this.eles[t]=e),e)}}const et=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(i){i.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(i){i.createProperty(e.key,t)}};function it(t){return(e,i)=>void 0!==i?((t,e,i)=>{e.constructor.createProperty(i,t)})(t,e,i):et(t,e)}var nt;null===(nt=window.HTMLSlotElement)||void 0===nt||nt.prototype.assignedElements;class ot extends tt{constructor(){super(...arguments),this.hiddenInputs=[],this.values=[],this.value="",this.inputRoot=this}setValue(t){t?this.setValues([t]):this.setValues([]),this.value=t}setValues(t){this.values=t,this.requestUpdate("values")}addValue(t){this.values.push(t),this.requestUpdate("values")}removeValue(t){this.values=this.values.filter((e=>e!==t)),this.requestUpdate("values")}popValue(){this.values.pop(),this.requestUpdate("values")}clear(){this.values=[],this.requestUpdate("values")}serializeValue(t){return JSON.stringify(t)}updateInputs(){for(let t=null;t=this.hiddenInputs.pop();)t.remove();for(const t of this.values){const e=document.createElement("input");e.setAttribute("type","hidden"),e.setAttribute("name",this.getAttribute("name")),e.setAttribute("value",this.serializeValue(t)),this.hiddenInputs.push(e),this.inputRoot.parentElement.appendChild(e)}}updated(t){super.updated(t),t.has("values")&&this.updateInputs()}}t([it({type:String,attribute:"help_text"})],ot.prototype,"helpText",void 0),t([it({type:Boolean,attribute:"help_always"})],ot.prototype,"helpAlways",void 0),t([it({type:Boolean,attribute:"widget_only"})],ot.prototype,"widgetOnly",void 0),t([it({type:Boolean,attribute:"hide_label"})],ot.prototype,"hideLabel",void 0),t([it({type:String})],ot.prototype,"label",void 0),t([it({type:Array})],ot.prototype,"errors",void 0),t([it({type:Array})],ot.prototype,"values",void 0),t([it({type:String})],ot.prototype,"value",void 0),t([it({attribute:!1})],ot.prototype,"inputRoot",void 0);class rt extends ot{constructor(){super(...arguments),this.name="",this.disabled=!1,this.size=1.2,this.animateChange="pulse"}static get styles(){return r`
1
+ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(r=(s<3?o(r):s>3?o(e,i,r):o(e,i))||r);return s>3&&r&&Object.defineProperty(e,i,r),r}const e=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,i=Symbol(),n=new WeakMap;class o{constructor(t,e,n){if(this._$cssResult$=!0,n!==i)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const i=this.t;if(e&&void 0===t){const e=void 0!==i&&1===i.length;e&&(t=n.get(i)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&n.set(i,t))}return t}toString(){return this.cssText}}const s=(t,...e)=>{const n=1===t.length?t[0]:e.reduce(((e,i,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[n+1]),t[0]);return new o(n,t,i)},r=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new o("string"==typeof t?t:t+"",void 0,i))(e)})(t):t;var a;const l=window.trustedTypes,c=l?l.emptyScript:"",h=window.reactiveElementPolyfillSupport,u={toAttribute(t,e){switch(e){case Boolean:t=t?c:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},d=(t,e)=>e!==t&&(e==e||t==t),p={attribute:!0,type:String,converter:u,reflect:!1,hasChanged:d};class m extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(t){var e;null!==(e=this.h)&&void 0!==e||(this.h=[]),this.h.push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,i)=>{const n=this._$Ep(i,e);void 0!==n&&(this._$Ev.set(n,i),t.push(n))})),t}static createProperty(t,e=p){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const i="symbol"==typeof t?Symbol():"__"+t,n=this.getPropertyDescriptor(t,i,e);void 0!==n&&Object.defineProperty(this.prototype,t,n)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(n){const o=this[t];this[e]=n,this.requestUpdate(t,o,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||p}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const i of e)this.createProperty(i,t[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(r(t))}else void 0!==t&&e.push(r(t));return e}static _$Ep(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}u(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,i;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(i=t.hostConnected)||void 0===i||i.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const i=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,i)=>{e?t.adoptedStyleSheets=i.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):i.forEach((e=>{const i=document.createElement("style"),n=window.litNonce;void 0!==n&&i.setAttribute("nonce",n),i.textContent=e.cssText,t.appendChild(i)}))})(i,this.constructor.elementStyles),i}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EO(t,e,i=p){var n,o;const s=this.constructor._$Ep(t,i);if(void 0!==s&&!0===i.reflect){const r=(null!==(o=null===(n=i.converter)||void 0===n?void 0:n.toAttribute)&&void 0!==o?o:u.toAttribute)(e,i.type);this._$El=t,null==r?this.removeAttribute(s):this.setAttribute(s,r),this._$El=null}}_$AK(t,e){var i,n;const o=this.constructor,s=o._$Ev.get(t);if(void 0!==s&&this._$El!==s){const t=o.getPropertyOptions(s),r=t.converter,a=null!==(n=null!==(i=null==r?void 0:r.fromAttribute)&&void 0!==i?i:"function"==typeof r?r:null)&&void 0!==n?n:u.fromAttribute;this._$El=s,this[s]=a(e,t.type),this._$El=null}}requestUpdate(t,e,i){let n=!0;void 0!==t&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||d)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,i))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,e)=>this[e]=t)),this._$Ei=void 0);let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(i)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;null===(e=this._$ES)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$EO(e,this[e],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}}var f;m.finalized=!0,m.elementProperties=new Map,m.elementStyles=[],m.shadowRootOptions={mode:"open"},null==h||h({ReactiveElement:m}),(null!==(a=globalThis.reactiveElementVersions)&&void 0!==a?a:globalThis.reactiveElementVersions=[]).push("1.3.4");const g=globalThis.trustedTypes,v=g?g.createPolicy("lit-html",{createHTML:t=>t}):void 0,y=`lit$${(Math.random()+"").slice(9)}$`,b="?"+y,_=`<${b}>`,x=document,w=(t="")=>x.createComment(t),k=t=>null===t||"object"!=typeof t&&"function"!=typeof t,S=Array.isArray,C=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,T=/-->/g,E=/>/g,$=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),A=/'/g,O=/"/g,M=/^(?:script|style|textarea|title)$/i,P=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),z=Symbol.for("lit-noChange"),I=Symbol.for("lit-nothing"),D=new WeakMap,N=x.createTreeWalker(x,129,null,!1),R=(t,e)=>{const i=t.length-1,n=[];let o,s=2===e?"<svg>":"",r=C;for(let e=0;e<i;e++){const i=t[e];let a,l,c=-1,h=0;for(;h<i.length&&(r.lastIndex=h,l=r.exec(i),null!==l);)h=r.lastIndex,r===C?"!--"===l[1]?r=T:void 0!==l[1]?r=E:void 0!==l[2]?(M.test(l[2])&&(o=RegExp("</"+l[2],"g")),r=$):void 0!==l[3]&&(r=$):r===$?">"===l[0]?(r=null!=o?o:C,c=-1):void 0===l[1]?c=-2:(c=r.lastIndex-l[2].length,a=l[1],r=void 0===l[3]?$:'"'===l[3]?O:A):r===O||r===A?r=$:r===T||r===E?r=C:(r=$,o=void 0);const u=r===$&&t[e+1].startsWith("/>")?" ":"";s+=r===C?i+_:c>=0?(n.push(a),i.slice(0,c)+"$lit$"+i.slice(c)+y+u):i+y+(-2===c?(n.push(void 0),e):u)}const a=s+(t[i]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==v?v.createHTML(a):a,n]};class B{constructor({strings:t,_$litType$:e},i){let n;this.parts=[];let o=0,s=0;const r=t.length-1,a=this.parts,[l,c]=R(t,e);if(this.el=B.createElement(l,i),N.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(n=N.nextNode())&&a.length<r;){if(1===n.nodeType){if(n.hasAttributes()){const t=[];for(const e of n.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(y)){const i=c[s++];if(t.push(e),void 0!==i){const t=n.getAttribute(i.toLowerCase()+"$lit$").split(y),e=/([.?@])?(.*)/.exec(i);a.push({type:1,index:o,name:e[2],strings:t,ctor:"."===e[1]?j:"?"===e[1]?H:"@"===e[1]?G:V})}else a.push({type:6,index:o})}for(const e of t)n.removeAttribute(e)}if(M.test(n.tagName)){const t=n.textContent.split(y),e=t.length-1;if(e>0){n.textContent=g?g.emptyScript:"";for(let i=0;i<e;i++)n.append(t[i],w()),N.nextNode(),a.push({type:2,index:++o});n.append(t[e],w())}}}else if(8===n.nodeType)if(n.data===b)a.push({type:2,index:o});else{let t=-1;for(;-1!==(t=n.data.indexOf(y,t+1));)a.push({type:7,index:o}),t+=y.length-1}o++}}static createElement(t,e){const i=x.createElement("template");return i.innerHTML=t,i}}function q(t,e,i=t,n){var o,s,r,a;if(e===z)return e;let l=void 0!==n?null===(o=i._$Cl)||void 0===o?void 0:o[n]:i._$Cu;const c=k(e)?void 0:e._$litDirective$;return(null==l?void 0:l.constructor)!==c&&(null===(s=null==l?void 0:l._$AO)||void 0===s||s.call(l,!1),void 0===c?l=void 0:(l=new c(t),l._$AT(t,i,n)),void 0!==n?(null!==(r=(a=i)._$Cl)&&void 0!==r?r:a._$Cl=[])[n]=l:i._$Cu=l),void 0!==l&&(e=q(t,l._$AS(t,e.values),l,n)),e}class Z{constructor(t,e){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var e;const{el:{content:i},parts:n}=this._$AD,o=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:x).importNode(i,!0);N.currentNode=o;let s=N.nextNode(),r=0,a=0,l=n[0];for(;void 0!==l;){if(r===l.index){let e;2===l.type?e=new F(s,s.nextSibling,this,t):1===l.type?e=new l.ctor(s,l.name,l.strings,this,t):6===l.type&&(e=new W(s,this,t)),this.v.push(e),l=n[++a]}r!==(null==l?void 0:l.index)&&(s=N.nextNode(),r++)}return o}m(t){let e=0;for(const i of this.v)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class F{constructor(t,e,i,n){var o;this.type=2,this._$AH=I,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=n,this._$C_=null===(o=null==n?void 0:n.isConnected)||void 0===o||o}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$C_}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=q(this,t,e),k(t)?t===I||null==t||""===t?(this._$AH!==I&&this._$AR(),this._$AH=I):t!==this._$AH&&t!==z&&this.T(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.k(t):(t=>S(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.S(t):this.T(t)}j(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}k(t){this._$AH!==t&&(this._$AR(),this._$AH=this.j(t))}T(t){this._$AH!==I&&k(this._$AH)?this._$AA.nextSibling.data=t:this.k(x.createTextNode(t)),this._$AH=t}$(t){var e;const{values:i,_$litType$:n}=t,o="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=B.createElement(n.h,this.options)),n);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===o)this._$AH.m(i);else{const t=new Z(o,this),e=t.p(this.options);t.m(i),this.k(e),this._$AH=t}}_$AC(t){let e=D.get(t.strings);return void 0===e&&D.set(t.strings,e=new B(t)),e}S(t){S(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,n=0;for(const o of t)n===e.length?e.push(i=new F(this.j(w()),this.j(w()),this,this.options)):i=e[n],i._$AI(o),n++;n<e.length&&(this._$AR(i&&i._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){var i;for(null===(i=this._$AP)||void 0===i||i.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$C_=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class V{constructor(t,e,i,n,o){this.type=1,this._$AH=I,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=o,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=I}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,n){const o=this.strings;let s=!1;if(void 0===o)t=q(this,t,e,0),s=!k(t)||t!==this._$AH&&t!==z,s&&(this._$AH=t);else{const n=t;let r,a;for(t=o[0],r=0;r<o.length-1;r++)a=q(this,n[i+r],e,r),a===z&&(a=this._$AH[r]),s||(s=!k(a)||a!==this._$AH[r]),a===I?t=I:t!==I&&(t+=(null!=a?a:"")+o[r+1]),this._$AH[r]=a}s&&!n&&this.P(t)}P(t){t===I?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class j extends V{constructor(){super(...arguments),this.type=3}P(t){this.element[this.name]=t===I?void 0:t}}const U=g?g.emptyScript:"";class H extends V{constructor(){super(...arguments),this.type=4}P(t){t&&t!==I?this.element.setAttribute(this.name,U):this.element.removeAttribute(this.name)}}class G extends V{constructor(t,e,i,n,o){super(t,e,i,n,o),this.type=5}_$AI(t,e=this){var i;if((t=null!==(i=q(this,t,e,0))&&void 0!==i?i:I)===z)return;const n=this._$AH,o=t===I&&n!==I||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,s=t!==I&&(n===I||o);o&&this.element.removeEventListener(this.name,this,n),s&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==i?i:this.element,t):this._$AH.handleEvent(t)}}class W{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){q(this,t)}}const K=window.litHtmlPolyfillSupport;var Y,J;null==K||K(B,F),(null!==(f=globalThis.litHtmlVersions)&&void 0!==f?f:globalThis.litHtmlVersions=[]).push("2.2.7");class X extends m{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,i)=>{var n,o;const s=null!==(n=null==i?void 0:i.renderBefore)&&void 0!==n?n:e;let r=s._$litPart$;if(void 0===r){const t=null!==(o=null==i?void 0:i.renderBefore)&&void 0!==o?o:null;s._$litPart$=r=new F(e.insertBefore(w(),t),t,void 0,null!=i?i:{})}return r._$AI(t),r})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return z}}X.finalized=!0,X._$litElement$=!0,null===(Y=globalThis.litElementHydrateSupport)||void 0===Y||Y.call(globalThis,{LitElement:X});const Q=globalThis.litElementPolyfillSupport;null==Q||Q({LitElement:X}),(null!==(J=globalThis.litElementVersions)&&void 0!==J?J:globalThis.litElementVersions=[]).push("3.2.2");class tt extends X{constructor(){super(...arguments),this.eles={}}getEventHandlers(){return[]}connectedCallback(){super.connectedCallback();for(const t of this.getEventHandlers())t.isDocument?document.addEventListener(t.event,t.method.bind(this)):this.addEventListener(t.event,t.method.bind(this))}disconnectedCallback(){for(const t of this.getEventHandlers())t.isDocument?document.removeEventListener(t.event,t.method):this.removeEventListener(t.event,t.method);super.disconnectedCallback()}fireEvent(t){return this.dispatchEvent(new Event(t,{bubbles:!0,composed:!0}))}fireCustomEvent(t,e={}){const i=new CustomEvent(t,{detail:e,bubbles:!0,composed:!0});return this.dispatchEvent(i)}dispatchEvent(t){super.dispatchEvent(t);const e=t.target;if(e){const i=e["-"+t.type];if(i)return i(t);return new Function("event",`with(document) {\n with(this) {\n let handler = ${e.getAttribute("-"+t.type)};\n if(typeof handler === 'function') { \n handler(event) ;\n }\n }\n }`).call(e,t)}}closestElement(t,e=this){return function e(i){if(!i||i===document||i===window)return null;i.assignedSlot&&(i=i.assignedSlot);const n=i.closest(t);return n||e(i.getRootNode().host)}(e)}getDiv(t){let e=this.eles[t];return e||(e=this.shadowRoot.querySelector(t),e&&(this.eles[t]=e),e)}}const et=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(i){i.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(i){i.createProperty(e.key,t)}};function it(t){return(e,i)=>void 0!==i?((t,e,i)=>{e.constructor.createProperty(i,t)})(t,e,i):et(t,e)}var nt;null===(nt=window.HTMLSlotElement)||void 0===nt||nt.prototype.assignedElements;class ot extends tt{constructor(){super(...arguments),this.hiddenInputs=[],this.name="",this.values=[],this.value="",this.inputRoot=this,this.disabled=!1}setValue(t){t?this.setValues([t]):this.setValues([]),this.value=t}setValues(t){this.values=t,this.requestUpdate("values")}addValue(t){this.values.push(t),this.requestUpdate("values")}removeValue(t){this.values=this.values.filter((e=>e!==t)),this.requestUpdate("values")}popValue(){this.values.pop(),this.requestUpdate("values")}clear(){this.values=[],this.requestUpdate("values")}serializeValue(t){return JSON.stringify(t)}updateInputs(){for(let t=null;t=this.hiddenInputs.pop();)t.remove();for(const t of this.values){const e=document.createElement("input");e.setAttribute("type","hidden"),e.setAttribute("name",this.getAttribute("name")),e.setAttribute("value",this.serializeValue(t)),this.hiddenInputs.push(e),this.inputRoot.parentElement.appendChild(e)}}updated(t){super.updated(t),t.has("values")&&this.updateInputs()}}t([it({type:String})],ot.prototype,"name",void 0),t([it({type:String,attribute:"help_text"})],ot.prototype,"helpText",void 0),t([it({type:Boolean,attribute:"help_always"})],ot.prototype,"helpAlways",void 0),t([it({type:Boolean,attribute:"widget_only"})],ot.prototype,"widgetOnly",void 0),t([it({type:Boolean,attribute:"hide_label"})],ot.prototype,"hideLabel",void 0),t([it({type:String})],ot.prototype,"label",void 0),t([it({type:Array})],ot.prototype,"errors",void 0),t([it({type:Array})],ot.prototype,"values",void 0),t([it({type:String})],ot.prototype,"value",void 0),t([it({attribute:!1})],ot.prototype,"inputRoot",void 0),t([it({type:Boolean})],ot.prototype,"disabled",void 0);class st extends ot{constructor(){super(...arguments),this.name="",this.disabled=!1,this.size=1.2,this.animateChange="pulse"}static get styles(){return s`
2
2
  :host {
3
3
  color: var(--color-text);
4
4
  display: inline-block;
@@ -48,11 +48,11 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
48
48
  cursor: not-allowed;
49
49
  --icon-color: #ccc;
50
50
  }
51
- `}updated(t){super.updated(t),t.has("checked")&&(this.checked?this.setValue(1):this.setValue(""),this.fireEvent("change"))}serializeValue(t){return t}handleClick(){this.disabled||(this.checked=!this.checked)}click(){this.handleClick(),super.click()}render(){const t=O`<temba-icon
51
+ `}updated(t){super.updated(t),t.has("checked")&&(this.checked?this.setValue(1):this.setValue(""),this.fireEvent("change"))}serializeValue(t){return t}handleClick(){this.disabled||(this.checked=!this.checked)}click(){this.handleClick(),super.click()}render(){const t=P`<temba-icon
52
52
  name="${this.checked?"check-":""}square"
53
53
  size="${this.size}"
54
54
  animatechange="${this.animateChange}"
55
- />`;return this.label=this.label?this.label.trim():null,O`
55
+ />`;return this.label=this.label?this.label.trim():null,P`
56
56
  <div class="wrapper ${this.label?"label":""}">
57
57
  <temba-field
58
58
  name=${this.name}
@@ -65,39 +65,11 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
65
65
  >
66
66
  <div class="checkbox-container ${this.disabled?"disabled":""}">
67
67
  ${t}
68
- ${this.label?O`<div class="checkbox-label">${this.label}</div>`:null}
68
+ ${this.label?P`<div class="checkbox-label">${this.label}</div>`:null}
69
69
  </div>
70
70
  </temba-field>
71
71
  </div>
72
- `}}t([it({type:String})],rt.prototype,"name",void 0),t([it({type:Boolean})],rt.prototype,"checked",void 0),t([it({type:Boolean})],rt.prototype,"disabled",void 0),t([it({type:Number})],rt.prototype,"size",void 0),t([it({type:String})],rt.prototype,"animateChange",void 0);const st=t=>null!=t?t:I,at=1,lt=2,ct=t=>(...e)=>({_$litDirective$:t,values:e});class ht{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}const dt=ct(class extends ht{constructor(t){var e;if(super(t),t.type!==at||"style"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce(((e,i)=>{const n=t[i];return null==n?e:e+`${i=i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${n};`}),"")}update(t,[e]){const{style:i}=t.element;if(void 0===this.vt){this.vt=new Set;for(const t in e)this.vt.add(t);return this.render(e)}this.vt.forEach((t=>{null==e[t]&&(this.vt.delete(t),t.includes("-")?i.removeProperty(t):i[t]="")}));for(const t in e){const n=e[t];null!=n&&(this.vt.add(t),t.includes("-")?i.setProperty(t,n):i[t]=n)}return P}});var ut=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],pt={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:"object"==typeof window&&-1===window.navigator.userAgent.indexOf("MSIE"),ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(t){return"undefined"!=typeof console&&console.warn(t)},getWeek:function(t){var e=new Date(t.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var i=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-i.getTime())/864e5-3+(i.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},mt={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(t){var e=t%100;if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},ft=function(t,e){return void 0===e&&(e=2),("000"+t).slice(-1*e)},gt=function(t){return!0===t?1:0};function vt(t,e){var i;return function(){var n=this,o=arguments;clearTimeout(i),i=setTimeout((function(){return t.apply(n,o)}),e)}}var yt=function(t){return t instanceof Array?t:[t]};function bt(t,e,i){if(!0===i)return t.classList.add(e);t.classList.remove(e)}function _t(t,e,i){var n=window.document.createElement(t);return e=e||"",i=i||"",n.className=e,void 0!==i&&(n.textContent=i),n}function xt(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function wt(t,e){return e(t)?t:t.parentNode?wt(t.parentNode,e):void 0}function kt(t,e){var i=_t("div","numInputWrapper"),n=_t("input","numInput "+t),o=_t("span","arrowUp"),r=_t("span","arrowDown");if(-1===navigator.userAgent.indexOf("MSIE 9.0")?n.type="number":(n.type="text",n.pattern="\\d*"),void 0!==e)for(var s in e)n.setAttribute(s,e[s]);return i.appendChild(n),i.appendChild(o),i.appendChild(r),i}function Ct(t){try{return"function"==typeof t.composedPath?t.composedPath()[0]:t.target}catch(e){return t.target}}var St=function(){},Et=function(t,e,i){return i.months[e?"shorthand":"longhand"][t]},Tt={D:St,F:function(t,e,i){t.setMonth(i.months.longhand.indexOf(e))},G:function(t,e){t.setHours((t.getHours()>=12?12:0)+parseFloat(e))},H:function(t,e){t.setHours(parseFloat(e))},J:function(t,e){t.setDate(parseFloat(e))},K:function(t,e,i){t.setHours(t.getHours()%12+12*gt(new RegExp(i.amPM[1],"i").test(e)))},M:function(t,e,i){t.setMonth(i.months.shorthand.indexOf(e))},S:function(t,e){t.setSeconds(parseFloat(e))},U:function(t,e){return new Date(1e3*parseFloat(e))},W:function(t,e,i){var n=parseInt(e),o=new Date(t.getFullYear(),0,2+7*(n-1),0,0,0,0);return o.setDate(o.getDate()-o.getDay()+i.firstDayOfWeek),o},Y:function(t,e){t.setFullYear(parseFloat(e))},Z:function(t,e){return new Date(e)},d:function(t,e){t.setDate(parseFloat(e))},h:function(t,e){t.setHours((t.getHours()>=12?12:0)+parseFloat(e))},i:function(t,e){t.setMinutes(parseFloat(e))},j:function(t,e){t.setDate(parseFloat(e))},l:St,m:function(t,e){t.setMonth(parseFloat(e)-1)},n:function(t,e){t.setMonth(parseFloat(e)-1)},s:function(t,e){t.setSeconds(parseFloat(e))},u:function(t,e){return new Date(parseFloat(e))},w:St,y:function(t,e){t.setFullYear(2e3+parseFloat(e))}},Mt={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},$t={Z:function(t){return t.toISOString()},D:function(t,e,i){return e.weekdays.shorthand[$t.w(t,e,i)]},F:function(t,e,i){return Et($t.n(t,e,i)-1,!1,e)},G:function(t,e,i){return ft($t.h(t,e,i))},H:function(t){return ft(t.getHours())},J:function(t,e){return void 0!==e.ordinal?t.getDate()+e.ordinal(t.getDate()):t.getDate()},K:function(t,e){return e.amPM[gt(t.getHours()>11)]},M:function(t,e){return Et(t.getMonth(),!0,e)},S:function(t){return ft(t.getSeconds())},U:function(t){return t.getTime()/1e3},W:function(t,e,i){return i.getWeek(t)},Y:function(t){return ft(t.getFullYear(),4)},d:function(t){return ft(t.getDate())},h:function(t){return t.getHours()%12?t.getHours()%12:12},i:function(t){return ft(t.getMinutes())},j:function(t){return t.getDate()},l:function(t,e){return e.weekdays.longhand[t.getDay()]},m:function(t){return ft(t.getMonth()+1)},n:function(t){return t.getMonth()+1},s:function(t){return t.getSeconds()},u:function(t){return t.getTime()},w:function(t){return t.getDay()},y:function(t){return String(t.getFullYear()).substring(2)}},Dt=function(t){var e=t.config,i=void 0===e?pt:e,n=t.l10n,o=void 0===n?mt:n,r=t.isMobile,s=void 0!==r&&r;return function(t,e,n){var r=n||o;return void 0===i.formatDate||s?e.split("").map((function(e,n,o){return $t[e]&&"\\"!==o[n-1]?$t[e](t,r,i):"\\"!==e?e:""})).join(""):i.formatDate(t,e,r)}},At=function(t){var e=t.config,i=void 0===e?pt:e,n=t.l10n,o=void 0===n?mt:n;return function(t,e,n,r){if(0===t||t){var s,a=r||o,l=t;if(t instanceof Date)s=new Date(t.getTime());else if("string"!=typeof t&&void 0!==t.toFixed)s=new Date(t);else if("string"==typeof t){var c=e||(i||pt).dateFormat,h=String(t).trim();if("today"===h)s=new Date,n=!0;else if(i&&i.parseDate)s=i.parseDate(t,c);else if(/Z$/.test(h)||/GMT$/.test(h))s=new Date(t);else{for(var d=void 0,u=[],p=0,m=0,f="";p<c.length;p++){var g=c[p],v="\\"===g,y="\\"===c[p-1]||v;if(Mt[g]&&!y){f+=Mt[g];var b=new RegExp(f).exec(t);b&&(d=!0)&&u["Y"!==g?"push":"unshift"]({fn:Tt[g],val:b[++m]})}else v||(f+=".")}s=i&&i.noCalendar?new Date((new Date).setHours(0,0,0,0)):new Date((new Date).getFullYear(),0,1,0,0,0,0),u.forEach((function(t){var e=t.fn,i=t.val;return s=e(s,i,a)||s})),s=d?s:void 0}}if(s instanceof Date&&!isNaN(s.getTime()))return!0===n&&s.setHours(0,0,0,0),s;i.errorHandler(new Error("Invalid date provided: "+l))}}};function Lt(t,e,i){return void 0===i&&(i=!0),!1!==i?new Date(t.getTime()).setHours(0,0,0,0)-new Date(e.getTime()).setHours(0,0,0,0):t.getTime()-e.getTime()}var Ot=function(t,e,i){return 3600*t+60*e+i},Pt=864e5;function It(t){var e=t.defaultHour,i=t.defaultMinute,n=t.defaultSeconds;if(void 0!==t.minDate){var o=t.minDate.getHours(),r=t.minDate.getMinutes(),s=t.minDate.getSeconds();e<o&&(e=o),e===o&&i<r&&(i=r),e===o&&i===r&&n<s&&(n=t.minDate.getSeconds())}if(void 0!==t.maxDate){var a=t.maxDate.getHours(),l=t.maxDate.getMinutes();(e=Math.min(e,a))===a&&(i=Math.min(l,i)),e===a&&i===l&&(n=t.maxDate.getSeconds())}return{hours:e,minutes:i,seconds:n}}"function"!=typeof Object.assign&&(Object.assign=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];if(!t)throw TypeError("Cannot convert undefined or null to object");for(var n=function(e){e&&Object.keys(e).forEach((function(i){return t[i]=e[i]}))},o=0,r=e;o<r.length;o++){var s=r[o];n(s)}return t});var zt=function(){return zt=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var o in e=arguments[i])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},zt.apply(this,arguments)},Nt=function(){for(var t=0,e=0,i=arguments.length;e<i;e++)t+=arguments[e].length;var n=Array(t),o=0;for(e=0;e<i;e++)for(var r=arguments[e],s=0,a=r.length;s<a;s++,o++)n[o]=r[s];return n};function Rt(t,e){var i={config:zt(zt({},pt),Ft.defaultConfig),l10n:mt};function n(){var t;return(null===(t=i.calendarContainer)||void 0===t?void 0:t.getRootNode()).activeElement||document.activeElement}function o(t){return t.bind(i)}function r(){var t=i.config;!1===t.weekNumbers&&1===t.showMonths||!0!==t.noCalendar&&window.requestAnimationFrame((function(){if(void 0!==i.calendarContainer&&(i.calendarContainer.style.visibility="hidden",i.calendarContainer.style.display="block"),void 0!==i.daysContainer){var e=(i.days.offsetWidth+1)*t.showMonths;i.daysContainer.style.width=e+"px",i.calendarContainer.style.width=e+(void 0!==i.weekWrapper?i.weekWrapper.offsetWidth:0)+"px",i.calendarContainer.style.removeProperty("visibility"),i.calendarContainer.style.removeProperty("display")}}))}function s(t){if(0===i.selectedDates.length){var e=void 0===i.config.minDate||Lt(new Date,i.config.minDate)>=0?new Date:new Date(i.config.minDate.getTime()),n=It(i.config);e.setHours(n.hours,n.minutes,n.seconds,e.getMilliseconds()),i.selectedDates=[e],i.latestSelectedDateObj=e}void 0!==t&&"blur"!==t.type&&function(t){t.preventDefault();var e="keydown"===t.type,n=Ct(t),o=n;void 0!==i.amPM&&n===i.amPM&&(i.amPM.textContent=i.l10n.amPM[gt(i.amPM.textContent===i.l10n.amPM[0])]);var r=parseFloat(o.getAttribute("min")),s=parseFloat(o.getAttribute("max")),a=parseFloat(o.getAttribute("step")),l=parseInt(o.value,10),c=t.delta||(e?38===t.which?1:-1:0),h=l+a*c;if(void 0!==o.value&&2===o.value.length){var d=o===i.hourElement,u=o===i.minuteElement;h<r?(h=s+h+gt(!d)+(gt(d)&&gt(!i.amPM)),u&&f(void 0,-1,i.hourElement)):h>s&&(h=o===i.hourElement?h-s-gt(!i.amPM):r,u&&f(void 0,1,i.hourElement)),i.amPM&&d&&(1===a?h+l===23:Math.abs(h-l)>a)&&(i.amPM.textContent=i.l10n.amPM[gt(i.amPM.textContent===i.l10n.amPM[0])]),o.value=ft(h)}}(t);var o=i._input.value;a(),Q(),i._input.value!==o&&i._debouncedChange()}function a(){if(void 0!==i.hourElement&&void 0!==i.minuteElement){var t,e,n=(parseInt(i.hourElement.value.slice(-2),10)||0)%24,o=(parseInt(i.minuteElement.value,10)||0)%60,r=void 0!==i.secondElement?(parseInt(i.secondElement.value,10)||0)%60:0;void 0!==i.amPM&&(t=n,e=i.amPM.textContent,n=t%12+12*gt(e===i.l10n.amPM[1]));var s=void 0!==i.config.minTime||i.config.minDate&&i.minDateHasTime&&i.latestSelectedDateObj&&0===Lt(i.latestSelectedDateObj,i.config.minDate,!0),a=void 0!==i.config.maxTime||i.config.maxDate&&i.maxDateHasTime&&i.latestSelectedDateObj&&0===Lt(i.latestSelectedDateObj,i.config.maxDate,!0);if(void 0!==i.config.maxTime&&void 0!==i.config.minTime&&i.config.minTime>i.config.maxTime){var l=Ot(i.config.minTime.getHours(),i.config.minTime.getMinutes(),i.config.minTime.getSeconds()),h=Ot(i.config.maxTime.getHours(),i.config.maxTime.getMinutes(),i.config.maxTime.getSeconds()),d=Ot(n,o,r);if(d>h&&d<l){var u=function(t){var e=Math.floor(t/3600),i=(t-3600*e)/60;return[e,i,t-3600*e-60*i]}(l);n=u[0],o=u[1],r=u[2]}}else{if(a){var p=void 0!==i.config.maxTime?i.config.maxTime:i.config.maxDate;(n=Math.min(n,p.getHours()))===p.getHours()&&(o=Math.min(o,p.getMinutes())),o===p.getMinutes()&&(r=Math.min(r,p.getSeconds()))}if(s){var m=void 0!==i.config.minTime?i.config.minTime:i.config.minDate;(n=Math.max(n,m.getHours()))===m.getHours()&&o<m.getMinutes()&&(o=m.getMinutes()),o===m.getMinutes()&&(r=Math.max(r,m.getSeconds()))}}c(n,o,r)}}function l(t){var e=t||i.latestSelectedDateObj;e&&e instanceof Date&&c(e.getHours(),e.getMinutes(),e.getSeconds())}function c(t,e,n){void 0!==i.latestSelectedDateObj&&i.latestSelectedDateObj.setHours(t%24,e,n||0,0),i.hourElement&&i.minuteElement&&!i.isMobile&&(i.hourElement.value=ft(i.config.time_24hr?t:(12+t)%12+12*gt(t%12==0)),i.minuteElement.value=ft(e),void 0!==i.amPM&&(i.amPM.textContent=i.l10n.amPM[gt(t>=12)]),void 0!==i.secondElement&&(i.secondElement.value=ft(n)))}function h(t){var e=Ct(t),i=parseInt(e.value)+(t.delta||0);(i/1e3>1||"Enter"===t.key&&!/[^\d]/.test(i.toString()))&&D(i)}function d(t,e,n,o){return e instanceof Array?e.forEach((function(e){return d(t,e,n,o)})):t instanceof Array?t.forEach((function(t){return d(t,e,n,o)})):(t.addEventListener(e,n,o),void i._handlers.push({remove:function(){return t.removeEventListener(e,n,o)}}))}function u(){G("onChange")}function p(t,e){var n=void 0!==t?i.parseDate(t):i.latestSelectedDateObj||(i.config.minDate&&i.config.minDate>i.now?i.config.minDate:i.config.maxDate&&i.config.maxDate<i.now?i.config.maxDate:i.now),o=i.currentYear,r=i.currentMonth;try{void 0!==n&&(i.currentYear=n.getFullYear(),i.currentMonth=n.getMonth())}catch(t){t.message="Invalid date supplied: "+n,i.config.errorHandler(t)}e&&i.currentYear!==o&&(G("onYearChange"),w()),!e||i.currentYear===o&&i.currentMonth===r||G("onMonthChange"),i.redraw()}function m(t){var e=Ct(t);~e.className.indexOf("arrow")&&f(t,e.classList.contains("arrowUp")?1:-1)}function f(t,e,i){var n=t&&Ct(t),o=i||n&&n.parentNode&&n.parentNode.firstChild,r=Y("increment");r.delta=e,o&&o.dispatchEvent(r)}function g(t,e,n,o){var r=A(e,!0),s=_t("span",t,e.getDate().toString());return s.dateObj=e,s.$i=o,s.setAttribute("aria-label",i.formatDate(e,i.config.ariaDateFormat)),-1===t.indexOf("hidden")&&0===Lt(e,i.now)&&(i.todayDateElem=s,s.classList.add("today"),s.setAttribute("aria-current","date")),r?(s.tabIndex=-1,K(e)&&(s.classList.add("selected"),i.selectedDateElem=s,"range"===i.config.mode&&(bt(s,"startRange",i.selectedDates[0]&&0===Lt(e,i.selectedDates[0],!0)),bt(s,"endRange",i.selectedDates[1]&&0===Lt(e,i.selectedDates[1],!0)),"nextMonthDay"===t&&s.classList.add("inRange")))):s.classList.add("flatpickr-disabled"),"range"===i.config.mode&&function(t){return!("range"!==i.config.mode||i.selectedDates.length<2)&&(Lt(t,i.selectedDates[0])>=0&&Lt(t,i.selectedDates[1])<=0)}(e)&&!K(e)&&s.classList.add("inRange"),i.weekNumbers&&1===i.config.showMonths&&"prevMonthDay"!==t&&o%7==6&&i.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+i.config.getWeek(e)+"</span>"),G("onDayCreate",s),s}function v(t){t.focus(),"range"===i.config.mode&&I(t)}function y(t){for(var e=t>0?0:i.config.showMonths-1,n=t>0?i.config.showMonths:-1,o=e;o!=n;o+=t)for(var r=i.daysContainer.children[o],s=t>0?0:r.children.length-1,a=t>0?r.children.length:-1,l=s;l!=a;l+=t){var c=r.children[l];if(-1===c.className.indexOf("hidden")&&A(c.dateObj))return c}}function b(t,e){var o=n(),r=L(o||document.body),s=void 0!==t?t:r?o:void 0!==i.selectedDateElem&&L(i.selectedDateElem)?i.selectedDateElem:void 0!==i.todayDateElem&&L(i.todayDateElem)?i.todayDateElem:y(e>0?1:-1);void 0===s?i._input.focus():r?function(t,e){for(var n=-1===t.className.indexOf("Month")?t.dateObj.getMonth():i.currentMonth,o=e>0?i.config.showMonths:-1,r=e>0?1:-1,s=n-i.currentMonth;s!=o;s+=r)for(var a=i.daysContainer.children[s],l=n-i.currentMonth===s?t.$i+e:e<0?a.children.length-1:0,c=a.children.length,h=l;h>=0&&h<c&&h!=(e>0?c:-1);h+=r){var d=a.children[h];if(-1===d.className.indexOf("hidden")&&A(d.dateObj)&&Math.abs(t.$i-h)>=Math.abs(e))return v(d)}i.changeMonth(r),b(y(r),0)}(s,e):v(s)}function _(t,e){for(var n=(new Date(t,e,1).getDay()-i.l10n.firstDayOfWeek+7)%7,o=i.utils.getDaysInMonth((e-1+12)%12,t),r=i.utils.getDaysInMonth(e,t),s=window.document.createDocumentFragment(),a=i.config.showMonths>1,l=a?"prevMonthDay hidden":"prevMonthDay",c=a?"nextMonthDay hidden":"nextMonthDay",h=o+1-n,d=0;h<=o;h++,d++)s.appendChild(g("flatpickr-day "+l,new Date(t,e-1,h),0,d));for(h=1;h<=r;h++,d++)s.appendChild(g("flatpickr-day",new Date(t,e,h),0,d));for(var u=r+1;u<=42-n&&(1===i.config.showMonths||d%7!=0);u++,d++)s.appendChild(g("flatpickr-day "+c,new Date(t,e+1,u%r),0,d));var p=_t("div","dayContainer");return p.appendChild(s),p}function x(){if(void 0!==i.daysContainer){xt(i.daysContainer),i.weekNumbers&&xt(i.weekNumbers);for(var t=document.createDocumentFragment(),e=0;e<i.config.showMonths;e++){var n=new Date(i.currentYear,i.currentMonth,1);n.setMonth(i.currentMonth+e),t.appendChild(_(n.getFullYear(),n.getMonth()))}i.daysContainer.appendChild(t),i.days=i.daysContainer.firstChild,"range"===i.config.mode&&1===i.selectedDates.length&&I()}}function w(){if(!(i.config.showMonths>1||"dropdown"!==i.config.monthSelectorType)){var t=function(t){return!(void 0!==i.config.minDate&&i.currentYear===i.config.minDate.getFullYear()&&t<i.config.minDate.getMonth())&&!(void 0!==i.config.maxDate&&i.currentYear===i.config.maxDate.getFullYear()&&t>i.config.maxDate.getMonth())};i.monthsDropdownContainer.tabIndex=-1,i.monthsDropdownContainer.innerHTML="";for(var e=0;e<12;e++)if(t(e)){var n=_t("option","flatpickr-monthDropdown-month");n.value=new Date(i.currentYear,e).getMonth().toString(),n.textContent=Et(e,i.config.shorthandCurrentMonth,i.l10n),n.tabIndex=-1,i.currentMonth===e&&(n.selected=!0),i.monthsDropdownContainer.appendChild(n)}}}function k(){var t,e=_t("div","flatpickr-month"),n=window.document.createDocumentFragment();i.config.showMonths>1||"static"===i.config.monthSelectorType?t=_t("span","cur-month"):(i.monthsDropdownContainer=_t("select","flatpickr-monthDropdown-months"),i.monthsDropdownContainer.setAttribute("aria-label",i.l10n.monthAriaLabel),d(i.monthsDropdownContainer,"change",(function(t){var e=Ct(t),n=parseInt(e.value,10);i.changeMonth(n-i.currentMonth),G("onMonthChange")})),w(),t=i.monthsDropdownContainer);var o=kt("cur-year",{tabindex:"-1"}),r=o.getElementsByTagName("input")[0];r.setAttribute("aria-label",i.l10n.yearAriaLabel),i.config.minDate&&r.setAttribute("min",i.config.minDate.getFullYear().toString()),i.config.maxDate&&(r.setAttribute("max",i.config.maxDate.getFullYear().toString()),r.disabled=!!i.config.minDate&&i.config.minDate.getFullYear()===i.config.maxDate.getFullYear());var s=_t("div","flatpickr-current-month");return s.appendChild(t),s.appendChild(o),n.appendChild(s),e.appendChild(n),{container:e,yearElement:r,monthElement:t}}function C(){xt(i.monthNav),i.monthNav.appendChild(i.prevMonthNav),i.config.showMonths&&(i.yearElements=[],i.monthElements=[]);for(var t=i.config.showMonths;t--;){var e=k();i.yearElements.push(e.yearElement),i.monthElements.push(e.monthElement),i.monthNav.appendChild(e.container)}i.monthNav.appendChild(i.nextMonthNav)}function S(){i.weekdayContainer?xt(i.weekdayContainer):i.weekdayContainer=_t("div","flatpickr-weekdays");for(var t=i.config.showMonths;t--;){var e=_t("div","flatpickr-weekdaycontainer");i.weekdayContainer.appendChild(e)}return E(),i.weekdayContainer}function E(){if(i.weekdayContainer){var t=i.l10n.firstDayOfWeek,e=Nt(i.l10n.weekdays.shorthand);t>0&&t<e.length&&(e=Nt(e.splice(t,e.length),e.splice(0,t)));for(var n=i.config.showMonths;n--;)i.weekdayContainer.children[n].innerHTML="\n <span class='flatpickr-weekday'>\n "+e.join("</span><span class='flatpickr-weekday'>")+"\n </span>\n "}}function T(t,e){void 0===e&&(e=!0);var n=e?t:t-i.currentMonth;n<0&&!0===i._hidePrevMonthArrow||n>0&&!0===i._hideNextMonthArrow||(i.currentMonth+=n,(i.currentMonth<0||i.currentMonth>11)&&(i.currentYear+=i.currentMonth>11?1:-1,i.currentMonth=(i.currentMonth+12)%12,G("onYearChange"),w()),x(),G("onMonthChange"),J())}function M(t){return i.calendarContainer.contains(t)}function $(t){if(i.isOpen&&!i.config.inline){var e=Ct(t),n=M(e),o=!(e===i.input||e===i.altInput||i.element.contains(e)||t.path&&t.path.indexOf&&(~t.path.indexOf(i.input)||~t.path.indexOf(i.altInput)))&&!n&&!M(t.relatedTarget),r=!i.config.ignoredFocusElements.some((function(t){return t.contains(e)}));o&&r&&(i.config.allowInput&&i.setDate(i._input.value,!1,i.config.altInput?i.config.altFormat:i.config.dateFormat),void 0!==i.timeContainer&&void 0!==i.minuteElement&&void 0!==i.hourElement&&""!==i.input.value&&void 0!==i.input.value&&s(),i.close(),i.config&&"range"===i.config.mode&&1===i.selectedDates.length&&i.clear(!1))}}function D(t){if(!(!t||i.config.minDate&&t<i.config.minDate.getFullYear()||i.config.maxDate&&t>i.config.maxDate.getFullYear())){var e=t,n=i.currentYear!==e;i.currentYear=e||i.currentYear,i.config.maxDate&&i.currentYear===i.config.maxDate.getFullYear()?i.currentMonth=Math.min(i.config.maxDate.getMonth(),i.currentMonth):i.config.minDate&&i.currentYear===i.config.minDate.getFullYear()&&(i.currentMonth=Math.max(i.config.minDate.getMonth(),i.currentMonth)),n&&(i.redraw(),G("onYearChange"),w())}}function A(t,e){var n;void 0===e&&(e=!0);var o=i.parseDate(t,void 0,e);if(i.config.minDate&&o&&Lt(o,i.config.minDate,void 0!==e?e:!i.minDateHasTime)<0||i.config.maxDate&&o&&Lt(o,i.config.maxDate,void 0!==e?e:!i.maxDateHasTime)>0)return!1;if(!i.config.enable&&0===i.config.disable.length)return!0;if(void 0===o)return!1;for(var r=!!i.config.enable,s=null!==(n=i.config.enable)&&void 0!==n?n:i.config.disable,a=0,l=void 0;a<s.length;a++){if("function"==typeof(l=s[a])&&l(o))return r;if(l instanceof Date&&void 0!==o&&l.getTime()===o.getTime())return r;if("string"==typeof l){var c=i.parseDate(l,void 0,!0);return c&&c.getTime()===o.getTime()?r:!r}if("object"==typeof l&&void 0!==o&&l.from&&l.to&&o.getTime()>=l.from.getTime()&&o.getTime()<=l.to.getTime())return r}return!r}function L(t){return void 0!==i.daysContainer&&(-1===t.className.indexOf("hidden")&&-1===t.className.indexOf("flatpickr-disabled")&&i.daysContainer.contains(t))}function O(t){var e=t.target===i._input,n=i._input.value.trimEnd()!==X();!e||!n||t.relatedTarget&&M(t.relatedTarget)||i.setDate(i._input.value,!0,t.target===i.altInput?i.config.altFormat:i.config.dateFormat)}function P(e){var o=Ct(e),r=i.config.wrap?t.contains(o):o===i._input,l=i.config.allowInput,c=i.isOpen&&(!l||!r),h=i.config.inline&&r&&!l;if(13===e.keyCode&&r){if(l)return i.setDate(i._input.value,!0,o===i.altInput?i.config.altFormat:i.config.dateFormat),i.close(),o.blur();i.open()}else if(M(o)||c||h){var d=!!i.timeContainer&&i.timeContainer.contains(o);switch(e.keyCode){case 13:d?(e.preventDefault(),s(),j()):Z(e);break;case 27:e.preventDefault(),j();break;case 8:case 46:r&&!i.config.allowInput&&(e.preventDefault(),i.clear());break;case 37:case 39:if(d||r)i.hourElement&&i.hourElement.focus();else{e.preventDefault();var u=n();if(void 0!==i.daysContainer&&(!1===l||u&&L(u))){var p=39===e.keyCode?1:-1;e.ctrlKey?(e.stopPropagation(),T(p),b(y(1),0)):b(void 0,p)}}break;case 38:case 40:e.preventDefault();var m=40===e.keyCode?1:-1;i.daysContainer&&void 0!==o.$i||o===i.input||o===i.altInput?e.ctrlKey?(e.stopPropagation(),D(i.currentYear-m),b(y(1),0)):d||b(void 0,7*m):o===i.currentYearElement?D(i.currentYear-m):i.config.enableTime&&(!d&&i.hourElement&&i.hourElement.focus(),s(e),i._debouncedChange());break;case 9:if(d){var f=[i.hourElement,i.minuteElement,i.secondElement,i.amPM].concat(i.pluginElements).filter((function(t){return t})),g=f.indexOf(o);if(-1!==g){var v=f[g+(e.shiftKey?-1:1)];e.preventDefault(),(v||i._input).focus()}}else!i.config.noCalendar&&i.daysContainer&&i.daysContainer.contains(o)&&e.shiftKey&&(e.preventDefault(),i._input.focus())}}if(void 0!==i.amPM&&o===i.amPM)switch(e.key){case i.l10n.amPM[0].charAt(0):case i.l10n.amPM[0].charAt(0).toLowerCase():i.amPM.textContent=i.l10n.amPM[0],a(),Q();break;case i.l10n.amPM[1].charAt(0):case i.l10n.amPM[1].charAt(0).toLowerCase():i.amPM.textContent=i.l10n.amPM[1],a(),Q()}(r||M(o))&&G("onKeyDown",e)}function I(t,e){if(void 0===e&&(e="flatpickr-day"),1===i.selectedDates.length&&(!t||t.classList.contains(e)&&!t.classList.contains("flatpickr-disabled"))){for(var n=t?t.dateObj.getTime():i.days.firstElementChild.dateObj.getTime(),o=i.parseDate(i.selectedDates[0],void 0,!0).getTime(),r=Math.min(n,i.selectedDates[0].getTime()),s=Math.max(n,i.selectedDates[0].getTime()),a=!1,l=0,c=0,h=r;h<s;h+=Pt)A(new Date(h),!0)||(a=a||h>r&&h<s,h<o&&(!l||h>l)?l=h:h>o&&(!c||h<c)&&(c=h));Array.from(i.rContainer.querySelectorAll("*:nth-child(-n+"+i.config.showMonths+") > ."+e)).forEach((function(e){var r,s,h,d=e.dateObj.getTime(),u=l>0&&d<l||c>0&&d>c;if(u)return e.classList.add("notAllowed"),void["inRange","startRange","endRange"].forEach((function(t){e.classList.remove(t)}));a&&!u||(["startRange","inRange","endRange","notAllowed"].forEach((function(t){e.classList.remove(t)})),void 0!==t&&(t.classList.add(n<=i.selectedDates[0].getTime()?"startRange":"endRange"),o<n&&d===o?e.classList.add("startRange"):o>n&&d===o&&e.classList.add("endRange"),d>=l&&(0===c||d<=c)&&(s=o,h=n,(r=d)>Math.min(s,h)&&r<Math.max(s,h))&&e.classList.add("inRange")))}))}}function z(){!i.isOpen||i.config.static||i.config.inline||F()}function N(t){return function(e){var n=i.config["_"+t+"Date"]=i.parseDate(e,i.config.dateFormat),o=i.config["_"+("min"===t?"max":"min")+"Date"];void 0!==n&&(i["min"===t?"minDateHasTime":"maxDateHasTime"]=n.getHours()>0||n.getMinutes()>0||n.getSeconds()>0),i.selectedDates&&(i.selectedDates=i.selectedDates.filter((function(t){return A(t)})),i.selectedDates.length||"min"!==t||l(n),Q()),i.daysContainer&&(q(),void 0!==n?i.currentYearElement[t]=n.getFullYear().toString():i.currentYearElement.removeAttribute(t),i.currentYearElement.disabled=!!o&&void 0!==n&&o.getFullYear()===n.getFullYear())}}function R(){return i.config.wrap?t.querySelector("[data-input]"):t}function B(){"object"!=typeof i.config.locale&&void 0===Ft.l10ns[i.config.locale]&&i.config.errorHandler(new Error("flatpickr: invalid locale "+i.config.locale)),i.l10n=zt(zt({},Ft.l10ns.default),"object"==typeof i.config.locale?i.config.locale:"default"!==i.config.locale?Ft.l10ns[i.config.locale]:void 0),Mt.D="("+i.l10n.weekdays.shorthand.join("|")+")",Mt.l="("+i.l10n.weekdays.longhand.join("|")+")",Mt.M="("+i.l10n.months.shorthand.join("|")+")",Mt.F="("+i.l10n.months.longhand.join("|")+")",Mt.K="("+i.l10n.amPM[0]+"|"+i.l10n.amPM[1]+"|"+i.l10n.amPM[0].toLowerCase()+"|"+i.l10n.amPM[1].toLowerCase()+")",void 0===zt(zt({},e),JSON.parse(JSON.stringify(t.dataset||{}))).time_24hr&&void 0===Ft.defaultConfig.time_24hr&&(i.config.time_24hr=i.l10n.time_24hr),i.formatDate=Dt(i),i.parseDate=At({config:i.config,l10n:i.l10n})}function F(t){if("function"!=typeof i.config.position){if(void 0!==i.calendarContainer){G("onPreCalendarPosition");var e=t||i._positionElement,n=Array.prototype.reduce.call(i.calendarContainer.children,(function(t,e){return t+e.offsetHeight}),0),o=i.calendarContainer.offsetWidth,r=i.config.position.split(" "),s=r[0],a=r.length>1?r[1]:null,l=e.getBoundingClientRect(),c=window.innerHeight-l.bottom,h="above"===s||"below"!==s&&c<n&&l.top>n,d=window.pageYOffset+l.top+(h?-n-2:e.offsetHeight+2);if(bt(i.calendarContainer,"arrowTop",!h),bt(i.calendarContainer,"arrowBottom",h),!i.config.inline){var u=window.pageXOffset+l.left,p=!1,m=!1;"center"===a?(u-=(o-l.width)/2,p=!0):"right"===a&&(u-=o-l.width,m=!0),bt(i.calendarContainer,"arrowLeft",!p&&!m),bt(i.calendarContainer,"arrowCenter",p),bt(i.calendarContainer,"arrowRight",m);var f=window.document.body.offsetWidth-(window.pageXOffset+l.right),g=u+o>window.document.body.offsetWidth,v=f+o>window.document.body.offsetWidth;if(bt(i.calendarContainer,"rightMost",g),!i.config.static)if(i.calendarContainer.style.top=d+"px",g)if(v){var y=function(){for(var t=null,e=0;e<document.styleSheets.length;e++){var i=document.styleSheets[e];if(i.cssRules){try{i.cssRules}catch(t){continue}t=i;break}}return null!=t?t:(n=document.createElement("style"),document.head.appendChild(n),n.sheet);var n}();if(void 0===y)return;var b=window.document.body.offsetWidth,_=Math.max(0,b/2-o/2),x=y.cssRules.length,w="{left:"+l.left+"px;right:auto;}";bt(i.calendarContainer,"rightMost",!1),bt(i.calendarContainer,"centerMost",!0),y.insertRule(".flatpickr-calendar.centerMost:before,.flatpickr-calendar.centerMost:after"+w,x),i.calendarContainer.style.left=_+"px",i.calendarContainer.style.right="auto"}else i.calendarContainer.style.left="auto",i.calendarContainer.style.right=f+"px";else i.calendarContainer.style.left=u+"px",i.calendarContainer.style.right="auto"}}}else i.config.position(i,t)}function q(){i.config.noCalendar||i.isMobile||(w(),J(),x())}function j(){i._input.focus(),-1!==window.navigator.userAgent.indexOf("MSIE")||void 0!==navigator.msMaxTouchPoints?setTimeout(i.close,0):i.close()}function Z(t){t.preventDefault(),t.stopPropagation();var e=wt(Ct(t),(function(t){return t.classList&&t.classList.contains("flatpickr-day")&&!t.classList.contains("flatpickr-disabled")&&!t.classList.contains("notAllowed")}));if(void 0!==e){var n=e,o=i.latestSelectedDateObj=new Date(n.dateObj.getTime()),r=(o.getMonth()<i.currentMonth||o.getMonth()>i.currentMonth+i.config.showMonths-1)&&"range"!==i.config.mode;if(i.selectedDateElem=n,"single"===i.config.mode)i.selectedDates=[o];else if("multiple"===i.config.mode){var s=K(o);s?i.selectedDates.splice(parseInt(s),1):i.selectedDates.push(o)}else"range"===i.config.mode&&(2===i.selectedDates.length&&i.clear(!1,!1),i.latestSelectedDateObj=o,i.selectedDates.push(o),0!==Lt(o,i.selectedDates[0],!0)&&i.selectedDates.sort((function(t,e){return t.getTime()-e.getTime()})));if(a(),r){var l=i.currentYear!==o.getFullYear();i.currentYear=o.getFullYear(),i.currentMonth=o.getMonth(),l&&(G("onYearChange"),w()),G("onMonthChange")}if(J(),x(),Q(),r||"range"===i.config.mode||1!==i.config.showMonths?void 0!==i.selectedDateElem&&void 0===i.hourElement&&i.selectedDateElem&&i.selectedDateElem.focus():v(n),void 0!==i.hourElement&&void 0!==i.hourElement&&i.hourElement.focus(),i.config.closeOnSelect){var c="single"===i.config.mode&&!i.config.enableTime,h="range"===i.config.mode&&2===i.selectedDates.length&&!i.config.enableTime;(c||h)&&j()}u()}}i.parseDate=At({config:i.config,l10n:i.l10n}),i._handlers=[],i.pluginElements=[],i.loadedPlugins=[],i._bind=d,i._setHoursFromDate=l,i._positionCalendar=F,i.changeMonth=T,i.changeYear=D,i.clear=function(t,e){void 0===t&&(t=!0);void 0===e&&(e=!0);i.input.value="",void 0!==i.altInput&&(i.altInput.value="");void 0!==i.mobileInput&&(i.mobileInput.value="");i.selectedDates=[],i.latestSelectedDateObj=void 0,!0===e&&(i.currentYear=i._initialDate.getFullYear(),i.currentMonth=i._initialDate.getMonth());if(!0===i.config.enableTime){var n=It(i.config),o=n.hours,r=n.minutes,s=n.seconds;c(o,r,s)}i.redraw(),t&&G("onChange")},i.close=function(){i.isOpen=!1,i.isMobile||(void 0!==i.calendarContainer&&i.calendarContainer.classList.remove("open"),void 0!==i._input&&i._input.classList.remove("active"));G("onClose")},i.onMouseOver=I,i._createElement=_t,i.createDay=g,i.destroy=function(){void 0!==i.config&&G("onDestroy");for(var t=i._handlers.length;t--;)i._handlers[t].remove();if(i._handlers=[],i.mobileInput)i.mobileInput.parentNode&&i.mobileInput.parentNode.removeChild(i.mobileInput),i.mobileInput=void 0;else if(i.calendarContainer&&i.calendarContainer.parentNode)if(i.config.static&&i.calendarContainer.parentNode){var e=i.calendarContainer.parentNode;if(e.lastChild&&e.removeChild(e.lastChild),e.parentNode){for(;e.firstChild;)e.parentNode.insertBefore(e.firstChild,e);e.parentNode.removeChild(e)}}else i.calendarContainer.parentNode.removeChild(i.calendarContainer);i.altInput&&(i.input.type="text",i.altInput.parentNode&&i.altInput.parentNode.removeChild(i.altInput),delete i.altInput);i.input&&(i.input.type=i.input._type,i.input.classList.remove("flatpickr-input"),i.input.removeAttribute("readonly"));["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach((function(t){try{delete i[t]}catch(t){}}))},i.isEnabled=A,i.jumpToDate=p,i.updateValue=Q,i.open=function(t,e){void 0===e&&(e=i._positionElement);if(!0===i.isMobile){if(t){t.preventDefault();var n=Ct(t);n&&n.blur()}return void 0!==i.mobileInput&&(i.mobileInput.focus(),i.mobileInput.click()),void G("onOpen")}if(i._input.disabled||i.config.inline)return;var o=i.isOpen;i.isOpen=!0,o||(i.calendarContainer.classList.add("open"),i._input.classList.add("active"),G("onOpen"),F(e));!0===i.config.enableTime&&!0===i.config.noCalendar&&(!1!==i.config.allowInput||void 0!==t&&i.timeContainer.contains(t.relatedTarget)||setTimeout((function(){return i.hourElement.select()}),50))},i.redraw=q,i.set=function(t,e){if(null!==t&&"object"==typeof t)for(var n in Object.assign(i.config,t),t)void 0!==H[n]&&H[n].forEach((function(t){return t()}));else i.config[t]=e,void 0!==H[t]?H[t].forEach((function(t){return t()})):ut.indexOf(t)>-1&&(i.config[t]=yt(e));i.redraw(),Q(!0)},i.setDate=function(t,e,n){void 0===e&&(e=!1);void 0===n&&(n=i.config.dateFormat);if(0!==t&&!t||t instanceof Array&&0===t.length)return i.clear(e);U(t,n),i.latestSelectedDateObj=i.selectedDates[i.selectedDates.length-1],i.redraw(),p(void 0,e),l(),0===i.selectedDates.length&&i.clear(!1);Q(e),e&&G("onChange")},i.toggle=function(t){if(!0===i.isOpen)return i.close();i.open(t)};var H={locale:[B,E],showMonths:[C,r,S],minDate:[p],maxDate:[p],positionElement:[W],clickOpens:[function(){!0===i.config.clickOpens?(d(i._input,"focus",i.open),d(i._input,"click",i.open)):(i._input.removeEventListener("focus",i.open),i._input.removeEventListener("click",i.open))}]};function U(t,e){var n=[];if(t instanceof Array)n=t.map((function(t){return i.parseDate(t,e)}));else if(t instanceof Date||"number"==typeof t)n=[i.parseDate(t,e)];else if("string"==typeof t)switch(i.config.mode){case"single":case"time":n=[i.parseDate(t,e)];break;case"multiple":n=t.split(i.config.conjunction).map((function(t){return i.parseDate(t,e)}));break;case"range":n=t.split(i.l10n.rangeSeparator).map((function(t){return i.parseDate(t,e)}))}else i.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(t)));i.selectedDates=i.config.allowInvalidPreload?n:n.filter((function(t){return t instanceof Date&&A(t,!1)})),"range"===i.config.mode&&i.selectedDates.sort((function(t,e){return t.getTime()-e.getTime()}))}function V(t){return t.slice().map((function(t){return"string"==typeof t||"number"==typeof t||t instanceof Date?i.parseDate(t,void 0,!0):t&&"object"==typeof t&&t.from&&t.to?{from:i.parseDate(t.from,void 0),to:i.parseDate(t.to,void 0)}:t})).filter((function(t){return t}))}function W(){i._positionElement=i.config.positionElement||i._input}function G(t,e){if(void 0!==i.config){var n=i.config[t];if(void 0!==n&&n.length>0)for(var o=0;n[o]&&o<n.length;o++)n[o](i.selectedDates,i.input.value,i,e);"onChange"===t&&(i.input.dispatchEvent(Y("change")),i.input.dispatchEvent(Y("input")))}}function Y(t){var e=document.createEvent("Event");return e.initEvent(t,!0,!0),e}function K(t){for(var e=0;e<i.selectedDates.length;e++){var n=i.selectedDates[e];if(n instanceof Date&&0===Lt(n,t))return""+e}return!1}function J(){i.config.noCalendar||i.isMobile||!i.monthNav||(i.yearElements.forEach((function(t,e){var n=new Date(i.currentYear,i.currentMonth,1);n.setMonth(i.currentMonth+e),i.config.showMonths>1||"static"===i.config.monthSelectorType?i.monthElements[e].textContent=Et(n.getMonth(),i.config.shorthandCurrentMonth,i.l10n)+" ":i.monthsDropdownContainer.value=n.getMonth().toString(),t.value=n.getFullYear().toString()})),i._hidePrevMonthArrow=void 0!==i.config.minDate&&(i.currentYear===i.config.minDate.getFullYear()?i.currentMonth<=i.config.minDate.getMonth():i.currentYear<i.config.minDate.getFullYear()),i._hideNextMonthArrow=void 0!==i.config.maxDate&&(i.currentYear===i.config.maxDate.getFullYear()?i.currentMonth+1>i.config.maxDate.getMonth():i.currentYear>i.config.maxDate.getFullYear()))}function X(t){var e=t||(i.config.altInput?i.config.altFormat:i.config.dateFormat);return i.selectedDates.map((function(t){return i.formatDate(t,e)})).filter((function(t,e,n){return"range"!==i.config.mode||i.config.enableTime||n.indexOf(t)===e})).join("range"!==i.config.mode?i.config.conjunction:i.l10n.rangeSeparator)}function Q(t){void 0===t&&(t=!0),void 0!==i.mobileInput&&i.mobileFormatStr&&(i.mobileInput.value=void 0!==i.latestSelectedDateObj?i.formatDate(i.latestSelectedDateObj,i.mobileFormatStr):""),i.input.value=X(i.config.dateFormat),void 0!==i.altInput&&(i.altInput.value=X(i.config.altFormat)),!1!==t&&G("onValueUpdate")}function tt(t){var e=Ct(t),n=i.prevMonthNav.contains(e),o=i.nextMonthNav.contains(e);n||o?T(n?-1:1):i.yearElements.indexOf(e)>=0?e.select():e.classList.contains("arrowUp")?i.changeYear(i.currentYear+1):e.classList.contains("arrowDown")&&i.changeYear(i.currentYear-1)}return function(){i.element=i.input=t,i.isOpen=!1,function(){var n=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],r=zt(zt({},JSON.parse(JSON.stringify(t.dataset||{}))),e),s={};i.config.parseDate=r.parseDate,i.config.formatDate=r.formatDate,Object.defineProperty(i.config,"enable",{get:function(){return i.config._enable},set:function(t){i.config._enable=V(t)}}),Object.defineProperty(i.config,"disable",{get:function(){return i.config._disable},set:function(t){i.config._disable=V(t)}});var a="time"===r.mode;if(!r.dateFormat&&(r.enableTime||a)){var l=Ft.defaultConfig.dateFormat||pt.dateFormat;s.dateFormat=r.noCalendar||a?"H:i"+(r.enableSeconds?":S":""):l+" H:i"+(r.enableSeconds?":S":"")}if(r.altInput&&(r.enableTime||a)&&!r.altFormat){var c=Ft.defaultConfig.altFormat||pt.altFormat;s.altFormat=r.noCalendar||a?"h:i"+(r.enableSeconds?":S K":" K"):c+" h:i"+(r.enableSeconds?":S":"")+" K"}Object.defineProperty(i.config,"minDate",{get:function(){return i.config._minDate},set:N("min")}),Object.defineProperty(i.config,"maxDate",{get:function(){return i.config._maxDate},set:N("max")});var h=function(t){return function(e){i.config["min"===t?"_minTime":"_maxTime"]=i.parseDate(e,"H:i:S")}};Object.defineProperty(i.config,"minTime",{get:function(){return i.config._minTime},set:h("min")}),Object.defineProperty(i.config,"maxTime",{get:function(){return i.config._maxTime},set:h("max")}),"time"===r.mode&&(i.config.noCalendar=!0,i.config.enableTime=!0);Object.assign(i.config,s,r);for(var d=0;d<n.length;d++)i.config[n[d]]=!0===i.config[n[d]]||"true"===i.config[n[d]];ut.filter((function(t){return void 0!==i.config[t]})).forEach((function(t){i.config[t]=yt(i.config[t]||[]).map(o)})),i.isMobile=!i.config.disableMobile&&!i.config.inline&&"single"===i.config.mode&&!i.config.disable.length&&!i.config.enable&&!i.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(d=0;d<i.config.plugins.length;d++){var u=i.config.plugins[d](i)||{};for(var p in u)ut.indexOf(p)>-1?i.config[p]=yt(u[p]).map(o).concat(i.config[p]):void 0===r[p]&&(i.config[p]=u[p])}r.altInputClass||(i.config.altInputClass=R().className+" "+i.config.altInputClass);G("onParseConfig")}(),B(),function(){if(i.input=R(),!i.input)return void i.config.errorHandler(new Error("Invalid input element specified"));i.input._type=i.input.type,i.input.type="text",i.input.classList.add("flatpickr-input"),i._input=i.input,i.config.altInput&&(i.altInput=_t(i.input.nodeName,i.config.altInputClass),i._input=i.altInput,i.altInput.placeholder=i.input.placeholder,i.altInput.disabled=i.input.disabled,i.altInput.required=i.input.required,i.altInput.tabIndex=i.input.tabIndex,i.altInput.type="text",i.input.setAttribute("type","hidden"),!i.config.static&&i.input.parentNode&&i.input.parentNode.insertBefore(i.altInput,i.input.nextSibling));i.config.allowInput||i._input.setAttribute("readonly","readonly");W()}(),function(){i.selectedDates=[],i.now=i.parseDate(i.config.now)||new Date;var t=i.config.defaultDate||("INPUT"!==i.input.nodeName&&"TEXTAREA"!==i.input.nodeName||!i.input.placeholder||i.input.value!==i.input.placeholder?i.input.value:null);t&&U(t,i.config.dateFormat);i._initialDate=i.selectedDates.length>0?i.selectedDates[0]:i.config.minDate&&i.config.minDate.getTime()>i.now.getTime()?i.config.minDate:i.config.maxDate&&i.config.maxDate.getTime()<i.now.getTime()?i.config.maxDate:i.now,i.currentYear=i._initialDate.getFullYear(),i.currentMonth=i._initialDate.getMonth(),i.selectedDates.length>0&&(i.latestSelectedDateObj=i.selectedDates[0]);void 0!==i.config.minTime&&(i.config.minTime=i.parseDate(i.config.minTime,"H:i"));void 0!==i.config.maxTime&&(i.config.maxTime=i.parseDate(i.config.maxTime,"H:i"));i.minDateHasTime=!!i.config.minDate&&(i.config.minDate.getHours()>0||i.config.minDate.getMinutes()>0||i.config.minDate.getSeconds()>0),i.maxDateHasTime=!!i.config.maxDate&&(i.config.maxDate.getHours()>0||i.config.maxDate.getMinutes()>0||i.config.maxDate.getSeconds()>0)}(),i.utils={getDaysInMonth:function(t,e){return void 0===t&&(t=i.currentMonth),void 0===e&&(e=i.currentYear),1===t&&(e%4==0&&e%100!=0||e%400==0)?29:i.l10n.daysInMonth[t]}},i.isMobile||function(){var t=window.document.createDocumentFragment();if(i.calendarContainer=_t("div","flatpickr-calendar"),i.calendarContainer.tabIndex=-1,!i.config.noCalendar){if(t.appendChild((i.monthNav=_t("div","flatpickr-months"),i.yearElements=[],i.monthElements=[],i.prevMonthNav=_t("span","flatpickr-prev-month"),i.prevMonthNav.innerHTML=i.config.prevArrow,i.nextMonthNav=_t("span","flatpickr-next-month"),i.nextMonthNav.innerHTML=i.config.nextArrow,C(),Object.defineProperty(i,"_hidePrevMonthArrow",{get:function(){return i.__hidePrevMonthArrow},set:function(t){i.__hidePrevMonthArrow!==t&&(bt(i.prevMonthNav,"flatpickr-disabled",t),i.__hidePrevMonthArrow=t)}}),Object.defineProperty(i,"_hideNextMonthArrow",{get:function(){return i.__hideNextMonthArrow},set:function(t){i.__hideNextMonthArrow!==t&&(bt(i.nextMonthNav,"flatpickr-disabled",t),i.__hideNextMonthArrow=t)}}),i.currentYearElement=i.yearElements[0],J(),i.monthNav)),i.innerContainer=_t("div","flatpickr-innerContainer"),i.config.weekNumbers){var e=function(){i.calendarContainer.classList.add("hasWeeks");var t=_t("div","flatpickr-weekwrapper");t.appendChild(_t("span","flatpickr-weekday",i.l10n.weekAbbreviation));var e=_t("div","flatpickr-weeks");return t.appendChild(e),{weekWrapper:t,weekNumbers:e}}(),n=e.weekWrapper,o=e.weekNumbers;i.innerContainer.appendChild(n),i.weekNumbers=o,i.weekWrapper=n}i.rContainer=_t("div","flatpickr-rContainer"),i.rContainer.appendChild(S()),i.daysContainer||(i.daysContainer=_t("div","flatpickr-days"),i.daysContainer.tabIndex=-1),x(),i.rContainer.appendChild(i.daysContainer),i.innerContainer.appendChild(i.rContainer),t.appendChild(i.innerContainer)}i.config.enableTime&&t.appendChild(function(){i.calendarContainer.classList.add("hasTime"),i.config.noCalendar&&i.calendarContainer.classList.add("noCalendar");var t=It(i.config);i.timeContainer=_t("div","flatpickr-time"),i.timeContainer.tabIndex=-1;var e=_t("span","flatpickr-time-separator",":"),n=kt("flatpickr-hour",{"aria-label":i.l10n.hourAriaLabel});i.hourElement=n.getElementsByTagName("input")[0];var o=kt("flatpickr-minute",{"aria-label":i.l10n.minuteAriaLabel});i.minuteElement=o.getElementsByTagName("input")[0],i.hourElement.tabIndex=i.minuteElement.tabIndex=-1,i.hourElement.value=ft(i.latestSelectedDateObj?i.latestSelectedDateObj.getHours():i.config.time_24hr?t.hours:function(t){switch(t%24){case 0:case 12:return 12;default:return t%12}}(t.hours)),i.minuteElement.value=ft(i.latestSelectedDateObj?i.latestSelectedDateObj.getMinutes():t.minutes),i.hourElement.setAttribute("step",i.config.hourIncrement.toString()),i.minuteElement.setAttribute("step",i.config.minuteIncrement.toString()),i.hourElement.setAttribute("min",i.config.time_24hr?"0":"1"),i.hourElement.setAttribute("max",i.config.time_24hr?"23":"12"),i.hourElement.setAttribute("maxlength","2"),i.minuteElement.setAttribute("min","0"),i.minuteElement.setAttribute("max","59"),i.minuteElement.setAttribute("maxlength","2"),i.timeContainer.appendChild(n),i.timeContainer.appendChild(e),i.timeContainer.appendChild(o),i.config.time_24hr&&i.timeContainer.classList.add("time24hr");if(i.config.enableSeconds){i.timeContainer.classList.add("hasSeconds");var r=kt("flatpickr-second");i.secondElement=r.getElementsByTagName("input")[0],i.secondElement.value=ft(i.latestSelectedDateObj?i.latestSelectedDateObj.getSeconds():t.seconds),i.secondElement.setAttribute("step",i.minuteElement.getAttribute("step")),i.secondElement.setAttribute("min","0"),i.secondElement.setAttribute("max","59"),i.secondElement.setAttribute("maxlength","2"),i.timeContainer.appendChild(_t("span","flatpickr-time-separator",":")),i.timeContainer.appendChild(r)}i.config.time_24hr||(i.amPM=_t("span","flatpickr-am-pm",i.l10n.amPM[gt((i.latestSelectedDateObj?i.hourElement.value:i.config.defaultHour)>11)]),i.amPM.title=i.l10n.toggleTitle,i.amPM.tabIndex=-1,i.timeContainer.appendChild(i.amPM));return i.timeContainer}());bt(i.calendarContainer,"rangeMode","range"===i.config.mode),bt(i.calendarContainer,"animate",!0===i.config.animate),bt(i.calendarContainer,"multiMonth",i.config.showMonths>1),i.calendarContainer.appendChild(t);var r=void 0!==i.config.appendTo&&void 0!==i.config.appendTo.nodeType;if((i.config.inline||i.config.static)&&(i.calendarContainer.classList.add(i.config.inline?"inline":"static"),i.config.inline&&(!r&&i.element.parentNode?i.element.parentNode.insertBefore(i.calendarContainer,i._input.nextSibling):void 0!==i.config.appendTo&&i.config.appendTo.appendChild(i.calendarContainer)),i.config.static)){var s=_t("div","flatpickr-wrapper");i.element.parentNode&&i.element.parentNode.insertBefore(s,i.element),s.appendChild(i.element),i.altInput&&s.appendChild(i.altInput),s.appendChild(i.calendarContainer)}i.config.static||i.config.inline||(void 0!==i.config.appendTo?i.config.appendTo:window.document.body).appendChild(i.calendarContainer)}(),function(){i.config.wrap&&["open","close","toggle","clear"].forEach((function(t){Array.prototype.forEach.call(i.element.querySelectorAll("[data-"+t+"]"),(function(e){return d(e,"click",i[t])}))}));if(i.isMobile)return void function(){var t=i.config.enableTime?i.config.noCalendar?"time":"datetime-local":"date";i.mobileInput=_t("input",i.input.className+" flatpickr-mobile"),i.mobileInput.tabIndex=1,i.mobileInput.type=t,i.mobileInput.disabled=i.input.disabled,i.mobileInput.required=i.input.required,i.mobileInput.placeholder=i.input.placeholder,i.mobileFormatStr="datetime-local"===t?"Y-m-d\\TH:i:S":"date"===t?"Y-m-d":"H:i:S",i.selectedDates.length>0&&(i.mobileInput.defaultValue=i.mobileInput.value=i.formatDate(i.selectedDates[0],i.mobileFormatStr));i.config.minDate&&(i.mobileInput.min=i.formatDate(i.config.minDate,"Y-m-d"));i.config.maxDate&&(i.mobileInput.max=i.formatDate(i.config.maxDate,"Y-m-d"));i.input.getAttribute("step")&&(i.mobileInput.step=String(i.input.getAttribute("step")));i.input.type="hidden",void 0!==i.altInput&&(i.altInput.type="hidden");try{i.input.parentNode&&i.input.parentNode.insertBefore(i.mobileInput,i.input.nextSibling)}catch(t){}d(i.mobileInput,"change",(function(t){i.setDate(Ct(t).value,!1,i.mobileFormatStr),G("onChange"),G("onClose")}))}();var t=vt(z,50);i._debouncedChange=vt(u,300),i.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&d(i.daysContainer,"mouseover",(function(t){"range"===i.config.mode&&I(Ct(t))}));d(i._input,"keydown",P),void 0!==i.calendarContainer&&d(i.calendarContainer,"keydown",P);i.config.inline||i.config.static||d(window,"resize",t);void 0!==window.ontouchstart?d(window.document,"touchstart",$):d(window.document,"mousedown",$);d(window.document,"focus",$,{capture:!0}),!0===i.config.clickOpens&&(d(i._input,"focus",i.open),d(i._input,"click",i.open));void 0!==i.daysContainer&&(d(i.monthNav,"click",tt),d(i.monthNav,["keyup","increment"],h),d(i.daysContainer,"click",Z));if(void 0!==i.timeContainer&&void 0!==i.minuteElement&&void 0!==i.hourElement){var e=function(t){return Ct(t).select()};d(i.timeContainer,["increment"],s),d(i.timeContainer,"blur",s,{capture:!0}),d(i.timeContainer,"click",m),d([i.hourElement,i.minuteElement],["focus","click"],e),void 0!==i.secondElement&&d(i.secondElement,"focus",(function(){return i.secondElement&&i.secondElement.select()})),void 0!==i.amPM&&d(i.amPM,"click",(function(t){s(t)}))}i.config.allowInput&&d(i._input,"blur",O)}(),(i.selectedDates.length||i.config.noCalendar)&&(i.config.enableTime&&l(i.config.noCalendar?i.latestSelectedDateObj:void 0),Q(!1)),r();var n=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!i.isMobile&&n&&F(),G("onReady")}(),i}function Bt(t,e){for(var i=Array.prototype.slice.call(t).filter((function(t){return t instanceof HTMLElement})),n=[],o=0;o<i.length;o++){var r=i[o];try{if(null!==r.getAttribute("data-fp-omit"))continue;void 0!==r._flatpickr&&(r._flatpickr.destroy(),r._flatpickr=void 0),r._flatpickr=Rt(r,e||{}),n.push(r._flatpickr)}catch(t){console.error(t)}}return 1===n.length?n[0]:n}"undefined"!=typeof HTMLElement&&"undefined"!=typeof HTMLCollection&&"undefined"!=typeof NodeList&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(t){return Bt(this,t)},HTMLElement.prototype.flatpickr=function(t){return Bt([this],t)});var Ft=function(t,e){return"string"==typeof t?Bt(window.document.querySelectorAll(t),e):t instanceof Node?Bt([t],e):Bt(t,e)};Ft.defaultConfig={},Ft.l10ns={en:zt({},mt),default:zt({},mt)},Ft.localize=function(t){Ft.l10ns.default=zt(zt({},Ft.l10ns.default),t)},Ft.setDefaults=function(t){Ft.defaultConfig=zt(zt({},Ft.defaultConfig),t)},Ft.parseDate=At({}),Ft.formatDate=Dt({}),Ft.compareDates=Lt,"undefined"!=typeof jQuery&&void 0!==jQuery.fn&&(jQuery.fn.flatpickr=function(t){return Bt(this,t)}),Date.prototype.fp_incr=function(t){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+("string"==typeof t?parseInt(t,10):t))},"undefined"!=typeof window&&(window.flatpickr=Ft);var qt;!function(t){t.light="light",t.dark="dark",t.materialBlue="material_blue",t.materialGreen="material_green",t.materialOrange="material_orange",t.materialRed="material_red",t.airbnb="airbnb",t.confetti="confetti",t.none="none"}(qt||(qt={}));class jt{constructor(t){this.theme=t,this.theme=t}async initStyles(){const t=`https://npmcdn.com/flatpickr@4.6.9/dist/themes/${this.theme}.css`;this.isThemeLoaded()||(this.appendThemeStyles(t),await this.waitForStyleToLoad((()=>this.isThemeLoaded())))}waitForStyleToLoad(t){return new Promise(((e,i)=>{const n=(i=0)=>{if(t())return e();if(i>10)throw Error("Styles took too long to load, or were not able to be loaded");setTimeout((()=>n(i++)),100)};n()}))}isThemeLoaded(){if(this.theme===qt.none)return!0;return Array.from(document.styleSheets).map((t=>t.href)).some((t=>null!=t&&new RegExp("https://npmcdn.com/flatpickr@4.6.9/dist/themes").test(t)))}appendThemeStyles(t){const e=document.createElement("link");e.rel="stylesheet",e.type="text/css",e.href=t,document.head.append(e)}}let Zt=class extends X{constructor(){super(...arguments),this.placeholder="",this.altFormat="F j, Y",this.altInput=!1,this.altInputClass="",this.allowInput=!1,this.ariaDateFormat="F j, Y",this.clickOpens=!0,this.dateFormat="Y-m-d",this.defaultHour=12,this.defaultMinute=0,this.disable=[],this.disableMobile=!1,this.enable=void 0,this.enableTime=!1,this.enableSeconds=!1,this.hourIncrement=1,this.minuteIncrement=5,this.inline=!1,this.mode="single",this.nextArrow=">",this.prevArrow="<",this.noCalendar=!1,this.position="auto",this.shorthandCurrentMonth=!1,this.showMonths=1,this.static=!1,this.time_24hr=!1,this.weekNumbers=!1,this.wrap=!1,this.theme="light",this.firstDayOfWeek=1,this.defaultToToday=!1,this._hasSlottedElement=!1}static get styles(){return[r`
73
- :host {
74
- width: fit-content;
75
- display: block;
76
- cursor: pointer;
77
- background: #fff;
78
- color: #000;
79
- overflow: hidden;
80
- }
81
-
82
- ::slotted(*) {
83
- cursor: pointer;
84
- }
85
-
86
- input {
87
- width: 100%;
88
- height: 100%;
89
- font-size: inherit;
90
- cursor: pointer;
91
- background: inherit;
92
- box-sizing: border-box;
93
- outline: none;
94
- color: inherit;
95
- border: none;
96
- }
97
- `]}firstUpdated(){this._hasSlottedElement=this.checkForSlottedElement()}updated(){this.init()}getToday(){const t=new Date;return`${t.getFullYear()}-${t.getMonth()+1}-${t.getDate()}`}checkForSlottedElement(){var t;const e=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector("slot"),i=e?e.assignedNodes().filter(this.removeTextNodes):[];return null!=e&&i&&i.length>0}getSlottedElement(){var t;if(!this._hasSlottedElement)return;const e=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector("slot"),i=null==e?void 0:e.assignedNodes().filter(this.removeTextNodes);return!i||i.length<1?void 0:i[0]}removeTextNodes(t){return"#text"!==t.nodeName}async init(){const t=new jt(this.theme);await t.initStyles(),this.locale&&await async function(t){const e="https://npmcdn.com/flatpickr@4.6.9/dist/l10n/"+t+".js";await import(e)}(this.locale),this.initializeComponent()}getOptions(){const t={altFormat:this.altFormat,altInput:this.altInput,altInputClass:this.altInputClass,allowInput:this.allowInput,ariaDateFormat:this.ariaDateFormat,clickOpens:this.clickOpens,dateFormat:this.dateFormat,defaultDate:this.defaultToToday?this.getToday():this.defaultDate,defaultHour:this.defaultHour,defaultMinute:this.defaultMinute,disable:this.disable,disableMobile:this.disableMobile,enable:this.enable,enableTime:this.enableTime,enableSeconds:this.enableSeconds,formatDate:this.formatDateFn,hourIncrement:this.hourIncrement,inline:this.inline,maxDate:this.maxDate,minDate:this.minDate,minuteIncrement:this.minuteIncrement,mode:this.mode,nextArrow:this.nextArrow,prevArrow:this.prevArrow,noCalendar:this.noCalendar,onChange:this.onChange,onClose:this.onClose,onOpen:this.onOpen,onReady:this.onReady,onMonthChange:this.onMonthChange,onYearChange:this.onYearChange,onValueUpdate:this.onValueUpdate,parseDate:this.parseDateFn,position:this.position,shorthandCurrentMonth:this.shorthandCurrentMonth,showMonths:this.showMonths,static:this.static,time_24hr:this.time_24hr,weekNumbers:this.weekNumbers,wrap:this.wrap,locale:this.locale};return Object.keys(t).forEach((e=>{void 0===t[e]&&delete t[e]})),t}initializeComponent(){var t;let e;this._instance&&Object.prototype.hasOwnProperty.call(this,"destroy")&&this._instance.destroy(),e=this._hasSlottedElement?this.findInputField():null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector("input"),e&&(this._inputElement=e,flatpickr.l10ns.default.firstDayOfWeek=this.firstDayOfWeek,this._instance=flatpickr(e,this.getOptions()))}findInputField(){let t=null;if(t=this.querySelector("input"),t)return t;const e=this.getSlottedElement();return void 0!==typeof e&&(t=this.searchWebComponentForInputElement(e)),t||null}searchWebComponentForInputElement(t){let e=this.getInputFieldInElement(t);if(e)return e;const i=this.getWebComponentsInsideElement(t);for(let t=0;t<i.length&&(e=this.searchWebComponentForInputElement(i[t]),!e);t++);return e}getInputFieldInElement(t){let e=null;return e=t.shadowRoot?t.shadowRoot.querySelector("input"):t.querySelector("input"),e}getWebComponentsInsideElement(t){return t.shadowRoot?[...Array.from(t.querySelectorAll("*")),...Array.from(t.shadowRoot.querySelectorAll("*"))].filter((t=>t.shadowRoot)):Array.from(t.querySelectorAll("*")).filter((t=>t.shadowRoot))}changeMonth(t,e=!0){this._instance&&this._instance.changeMonth(t,e)}clear(){this._instance&&this._instance.clear()}close(){this._instance&&this._instance.close()}destroy(){this._instance&&this._instance.destroy()}formatDate(t,e){return this._instance?this._instance.formatDate(t,e):""}jumpToDate(t,e){this._instance&&this._instance.jumpToDate(t,e)}open(){this._instance&&this._instance.open()}parseDate(t,e){if(this._instance)return this._instance.parseDate(t,e)}redraw(){this._instance&&this._instance.redraw()}set(t,e){this._instance&&this._instance.set(t,e)}setDate(t,e,i){this._instance&&this._instance.setDate(t,e,i)}toggle(){this._instance}getSelectedDates(){return this._instance?this._instance.selectedDates:[]}getCurrentYear(){return this._instance?this._instance.currentYear:-1}getCurrentMonth(){return this._instance?this._instance.currentMonth:-1}getConfig(){return this._instance?this._instance.config:{}}getValue(){return this._inputElement?this._inputElement.value:""}render(){return O`
98
- ${this._hasSlottedElement?O``:O`<input class="lit-flatpickr flatpickr flatpickr-input" placeholder=${this.placeholder} />`}
99
- <slot></slot>
100
- `}};t([it({type:String})],Zt.prototype,"placeholder",void 0),t([it({type:String})],Zt.prototype,"altFormat",void 0),t([it({type:Boolean})],Zt.prototype,"altInput",void 0),t([it({type:String})],Zt.prototype,"altInputClass",void 0),t([it({type:Boolean})],Zt.prototype,"allowInput",void 0),t([it({type:String})],Zt.prototype,"ariaDateFormat",void 0),t([it({type:Boolean})],Zt.prototype,"clickOpens",void 0),t([it({type:String})],Zt.prototype,"dateFormat",void 0),t([it({type:Object})],Zt.prototype,"defaultDate",void 0),t([it({type:Number})],Zt.prototype,"defaultHour",void 0),t([it({type:Number})],Zt.prototype,"defaultMinute",void 0),t([it({type:Array})],Zt.prototype,"disable",void 0),t([it({type:Boolean})],Zt.prototype,"disableMobile",void 0),t([it({type:Array})],Zt.prototype,"enable",void 0),t([it({type:Boolean})],Zt.prototype,"enableTime",void 0),t([it({type:Boolean})],Zt.prototype,"enableSeconds",void 0),t([it({type:Function})],Zt.prototype,"formatDateFn",void 0),t([it({type:Number})],Zt.prototype,"hourIncrement",void 0),t([it({type:Number})],Zt.prototype,"minuteIncrement",void 0),t([it({type:Boolean})],Zt.prototype,"inline",void 0),t([it({type:String})],Zt.prototype,"maxDate",void 0),t([it({type:String})],Zt.prototype,"minDate",void 0),t([it({type:String})],Zt.prototype,"mode",void 0),t([it({type:String})],Zt.prototype,"nextArrow",void 0),t([it({type:String})],Zt.prototype,"prevArrow",void 0),t([it({type:Boolean})],Zt.prototype,"noCalendar",void 0),t([it({type:Function})],Zt.prototype,"onChange",void 0),t([it({type:Function})],Zt.prototype,"onClose",void 0),t([it({type:Function})],Zt.prototype,"onOpen",void 0),t([it({type:Function})],Zt.prototype,"onReady",void 0),t([it({type:Function})],Zt.prototype,"onMonthChange",void 0),t([it({type:Function})],Zt.prototype,"onYearChange",void 0),t([it({type:Function})],Zt.prototype,"onValueUpdate",void 0),t([it({type:Function})],Zt.prototype,"parseDateFn",void 0),t([it({type:String})],Zt.prototype,"position",void 0),t([it({type:Boolean})],Zt.prototype,"shorthandCurrentMonth",void 0),t([it({type:Number})],Zt.prototype,"showMonths",void 0),t([it({type:Boolean})],Zt.prototype,"static",void 0),t([it({type:Boolean})],Zt.prototype,"time_24hr",void 0),t([it({type:Boolean})],Zt.prototype,"weekNumbers",void 0),t([it({type:Boolean})],Zt.prototype,"wrap",void 0),t([it({type:String})],Zt.prototype,"theme",void 0),t([it({type:Number})],Zt.prototype,"firstDayOfWeek",void 0),t([it({type:String})],Zt.prototype,"locale",void 0),t([it({type:Boolean,attribute:"default-to-today"})],Zt.prototype,"defaultToToday",void 0),t([it({type:Boolean})],Zt.prototype,"_hasSlottedElement",void 0),Zt=t([(t=>e=>"function"==typeof e?((t,e)=>(window.customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:i,elements:n}=e;return{kind:i,elements:n,finisher(e){window.customElements.define(t,e)}}})(t,e))("lit-flatpickr")],Zt);class Ht extends ot{constructor(){super(),this.placeholder="",this.value="",this.name="",this.loading=!0,this.submitOnEnter=!0,this.disabled=!1,this.autogrow=!1,this.counterElement=null,this.cursorStart=-1,this.cursorEnd=-1}static get styles(){return r`
72
+ `}}t([it({type:String})],st.prototype,"name",void 0),t([it({type:Boolean})],st.prototype,"checked",void 0),t([it({type:Boolean})],st.prototype,"disabled",void 0),t([it({type:Number})],st.prototype,"size",void 0),t([it({type:String})],st.prototype,"animateChange",void 0);const rt=t=>null!=t?t:I,at=1,lt=2,ct=t=>(...e)=>({_$litDirective$:t,values:e});class ht{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}const ut=ct(class extends ht{constructor(t){var e;if(super(t),t.type!==at||"style"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce(((e,i)=>{const n=t[i];return null==n?e:e+`${i=i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${n};`}),"")}update(t,[e]){const{style:i}=t.element;if(void 0===this.vt){this.vt=new Set;for(const t in e)this.vt.add(t);return this.render(e)}this.vt.forEach((t=>{null==e[t]&&(this.vt.delete(t),t.includes("-")?i.removeProperty(t):i[t]="")}));for(const t in e){const n=e[t];null!=n&&(this.vt.add(t),t.includes("-")?i.setProperty(t,n):i[t]=n)}return z}});class dt extends ot{constructor(){super(),this.placeholder="",this.value="",this.loading=!0,this.submitOnEnter=!0,this.autogrow=!1,this.counterElement=null,this.cursorStart=-1,this.cursorEnd=-1}static get styles(){return s`
101
73
  .input-container {
102
74
  border-radius: var(--curvature-widget);
103
75
  cursor: text;
@@ -160,20 +132,6 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
160
132
  width: 100%;
161
133
  }
162
134
 
163
- .textinput.withdate {
164
- cursor: pointer;
165
- }
166
-
167
- .textinput.withdate.loading {
168
- color: #fff;
169
- }
170
-
171
- .datepicker {
172
- padding: 9px;
173
- margin: 0px;
174
- border: 1px red solid;
175
- }
176
-
177
135
  .textinput:focus {
178
136
  outline: none;
179
137
  box-shadow: none;
@@ -211,16 +169,16 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
211
169
  .grow-wrap textarea {
212
170
  margin-left: -100%;
213
171
  }
214
- `}firstUpdated(t){if(super.firstUpdated(t),this.dateElement=this.shadowRoot.querySelector(".datepicker"),this.dateElement&&(this.onDateUpdated=this.onDateUpdated.bind(this),this.onDateReady=this.onDateReady.bind(this),this.onDateClose=this.onDateClose.bind(this)),this.inputElement=this.shadowRoot.querySelector(".textinput"),t.has("counter")){let t=this.getParentModax();t&&(t=t.shadowRoot),t||(t=document),this.counterElement=t.querySelector(this.counter),this.counterElement.text=this.value}}updated(t){if(super.updated(t),t.has("value"))if(this.datepicker||this.datetimepicker)this.onDateReady();else{if(this.setValues([this.value]),this.fireEvent("change"),this.textarea&&this.autogrow){this.shadowRoot.querySelector(".grow-wrap > div").innerText=this.value+String.fromCharCode(10)}this.cursorStart>-1&&this.cursorEnd>-1&&(this.inputElement.setSelectionRange(this.cursorStart,this.cursorEnd),this.cursorStart=-1,this.cursorEnd=-1)}}onDateUpdated(t,e){t.length>0&&(this.isoFormattedDate=e,this.inputElement.value=this.dateElement.formatDate(t[0],this.dateElement.altFormat))}getDisplayValue(){return this.inputElement.value}onDateReady(){window.setTimeout((()=>{this.dateElement&&(this.value&&(this.inputElement.value=this.dateElement.formatDate(this.dateElement.parseDate(this.value),this.dateElement.altFormat),this.dateElement.setDate(this.value)),this.loading=!1)}),0)}onDateClose(){this.isoFormattedDate&&(this.setValue(this.isoFormattedDate),this.fireEvent("blur"))}handleClear(t){t.stopPropagation(),t.preventDefault(),this.setValue(null)}updateValue(t){const e=this.inputElement.selectionStart,i=this.inputElement.selectionEnd,n=this.sanitizeGSM(t);n!==t&&(this.cursorStart=e,this.cursorEnd=i),this.value=n,this.textarea&&(this.inputElement.value=this.value),this.counterElement&&(this.counterElement.text=t)}sanitizeGSM(t){return this.gsm?(t=>t?t.replace(/[\u2018\u2019]/g,"'").replace(/[\u201C\u201D]/g,'"').replace(/[\u2013\u2014]/g,"-").replace(/\u2026/g,"...").replace(/\u2002/g," "):t)(t):t}handleChange(t){this.disabled||(this.updateValue(t.target.value),this.fireEvent("change"))}handleDateClick(){this.disabled||(this.dateElement.open(),this.dateElement.focus())}handleContainerClick(){this.disabled||(this.inputElement?this.inputElement.focus():this.handleDateClick())}handleInput(t){this.disabled||(this.updateValue(t.target.value),this.setValues([this.value]),this.fireEvent("input"))}serializeValue(t){return t}getParentModax(){let t=this;for(;t;){if(t=t.parentElement?t.parentElement:t.getRootNode().host,!t)return null;if("TEMBA-MODAX"==t.tagName)return t}}getParentForm(){let t=this;for(;t;){if(t=t.parentElement?t.parentElement:t.getRootNode().host,!t)return null;if("FORM"===t.tagName)return t}}click(){super.click(),this.handleContainerClick()}render(){const t={height:""+(this.textarea?"100%":"auto")},e=this.clearable&&this.inputElement&&this.inputElement.value?O`<temba-icon
172
+ `}firstUpdated(t){if(super.firstUpdated(t),this.inputElement=this.shadowRoot.querySelector(".textinput"),t.has("counter")){let t=this.getParentModax();t&&(t=t.shadowRoot),t||(t=document),this.counterElement=t.querySelector(this.counter),this.counterElement.text=this.value}}updated(t){if(super.updated(t),t.has("value")){if(this.setValues([this.value]),this.fireEvent("change"),this.textarea&&this.autogrow){this.shadowRoot.querySelector(".grow-wrap > div").innerText=this.value+String.fromCharCode(10)}this.cursorStart>-1&&this.cursorEnd>-1&&(this.inputElement.setSelectionRange(this.cursorStart,this.cursorEnd),this.cursorStart=-1,this.cursorEnd=-1)}}getDisplayValue(){return this.inputElement.value}handleClear(t){t.stopPropagation(),t.preventDefault(),this.setValue(null)}updateValue(t){const e=this.inputElement.selectionStart,i=this.inputElement.selectionEnd,n=this.sanitizeGSM(t);n!==t&&(this.cursorStart=e,this.cursorEnd=i),this.value=n,this.textarea&&(this.inputElement.value=this.value),this.counterElement&&(this.counterElement.text=t)}sanitizeGSM(t){return this.gsm?(t=>t?t.replace(/[\u2018\u2019]/g,"'").replace(/[\u201C\u201D]/g,'"').replace(/[\u2013\u2014]/g,"-").replace(/\u2026/g,"...").replace(/\u2002/g," "):t)(t):t}handleChange(t){this.disabled||(this.updateValue(t.target.value),this.fireEvent("change"))}handleContainerClick(){this.disabled||this.inputElement&&this.inputElement.focus()}handleInput(t){this.disabled||(this.updateValue(t.target.value),this.setValues([this.value]),this.fireEvent("input"))}serializeValue(t){return t}getParentModax(){let t=this;for(;t;){if(t=t.parentElement?t.parentElement:t.getRootNode().host,!t)return null;if("TEMBA-MODAX"==t.tagName)return t}}getParentForm(){let t=this;for(;t;){if(t=t.parentElement?t.parentElement:t.getRootNode().host,!t)return null;if("FORM"===t.tagName)return t}}click(){super.click(),this.handleContainerClick()}render(){const t={height:""+(this.textarea?"100%":"auto")},e=this.clearable&&this.inputElement&&this.inputElement.value?P`<temba-icon
215
173
  name="x"
216
174
  class="clear-icon"
217
175
  @click=${this.handleClear}
218
- />`:null;let i=O`
176
+ />`:null;let i=P`
219
177
  <input
220
178
  class="textinput"
221
179
  name=${this.name}
222
180
  type="${this.password?"password":"text"}"
223
- maxlength="${st(this.maxlength)}"
181
+ maxlength="${rt(this.maxlength)}"
224
182
  @change=${this.handleChange}
225
183
  @input=${this.handleInput}
226
184
  @blur=${this.blur}
@@ -229,7 +187,7 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
229
187
  .value=${this.value}
230
188
  .disabled=${this.disabled}
231
189
  />
232
- `;return this.textarea&&(i=O`
190
+ `;return this.textarea&&(i=P`
233
191
  <textarea
234
192
  class="textinput"
235
193
  name=${this.name}
@@ -240,33 +198,10 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
240
198
  .value=${this.value}
241
199
  .disabled=${this.disabled}
242
200
  ></textarea>
243
- `,this.autogrow&&(i=O` <div class="grow-wrap">
201
+ `,this.autogrow&&(i=P` <div class="grow-wrap">
244
202
  <div></div>
245
203
  ${i}
246
- </div>`)),(this.datepicker||this.datetimepicker)&&(i=O`
247
- <input
248
- class="textinput withdate ${this.loading?"loading":""}"
249
- name=${this.name}
250
- type="text"
251
- @click=${this.handleDateClick}
252
- @focus=${this.handleDateClick}
253
- @keydown=${t=>{t.preventDefault()}}
254
- readonly="true"
255
- placeholder="${this.placeholder}"
256
- .value="${this.value}"
257
- ?disabled=${this.disabled}
258
- />
259
- <lit-flatpickr
260
- class="datepicker hidden"
261
- altInput
262
- altFormat="${this.datepicker?"F j, Y":"F j, Y h:i K"}"
263
- dateFormat="${this.datepicker?"Y-m-d":"Z"}"
264
- .onValueUpdate=${this.onDateUpdated}
265
- .onReady=${this.onDateReady}
266
- .onClose=${this.onDateClose}
267
- ?enableTime=${this.datetimepicker}
268
- ></lit-flatpickr>
269
- `),O`
204
+ </div>`)),P`
270
205
  <temba-field
271
206
  name=${this.name}
272
207
  .label="${this.label}"
@@ -278,7 +213,7 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
278
213
  >
279
214
  <div
280
215
  class="input-container"
281
- style=${dt(t)}
216
+ style=${ut(t)}
282
217
  @click=${this.handleContainerClick}
283
218
  >
284
219
  <slot name="prefix"></slot>
@@ -286,7 +221,7 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
286
221
  <slot></slot>
287
222
  </div>
288
223
  </temba-field>
289
- `}}t([it({type:Boolean})],Ht.prototype,"textarea",void 0),t([it({type:Boolean})],Ht.prototype,"datepicker",void 0),t([it({type:Boolean})],Ht.prototype,"datetimepicker",void 0),t([it({type:String})],Ht.prototype,"placeholder",void 0),t([it({type:String})],Ht.prototype,"value",void 0),t([it({type:String})],Ht.prototype,"name",void 0),t([it({type:Boolean})],Ht.prototype,"password",void 0),t([it({type:Number})],Ht.prototype,"maxlength",void 0),t([it({type:Object})],Ht.prototype,"inputElement",void 0),t([it({type:Object})],Ht.prototype,"dateElement",void 0),t([it({type:Boolean})],Ht.prototype,"clearable",void 0),t([it({type:Boolean})],Ht.prototype,"gsm",void 0),t([it({type:String})],Ht.prototype,"counter",void 0),t([it({type:Boolean})],Ht.prototype,"loading",void 0),t([it({type:Boolean})],Ht.prototype,"submitOnEnter",void 0),t([it()],Ht.prototype,"onBlur",void 0),t([it({type:Boolean})],Ht.prototype,"disabled",void 0),t([it({type:Boolean})],Ht.prototype,"autogrow",void 0);const Ut=/(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))/,Vt=(t={})=>{const e=(t=>{for(const e of document.cookie.split(";")){const i=e.indexOf("=");let n=e.substr(0,i),o=e.substr(i+1);if(n=n.trim(),o=o.trim(),n===t)return o}return null})("csrftoken"),i=e?{"X-CSRFToken":e}:{};return i["X-Requested-With"]="XMLHttpRequest",Object.keys(t).forEach((e=>{i[e]=t[e]})),i},Wt=(t,e=null,i={})=>new Promise(((n,o)=>{const r={method:"GET",headers:Vt(i)};e&&(r.signal=e.signal),fetch(t,r).then((t=>{t.text().then((i=>{let o={};try{o=JSON.parse(i)}catch(t){}n({controller:e,body:i,json:o,headers:t.headers,status:t.status})}))})).catch((t=>{o(t)}))})),Gt=t=>{const e=[];Object.keys(t).forEach((i=>{t[i]&&e.push(i)}));let i=e.join(" ");return i.trim().length>0&&(i=" "+i),i},Yt=(t,e=null)=>new Promise(((i,n)=>{Wt(t,e).then((t=>{i({results:t.json.results,next:t.json.next})})).catch((t=>n(t)))})),Kt=async t=>{if(!t)return new Promise((t=>t([])));let e=[],i=t;for(;i;){const t=await Yt(i);t.results&&(e=e.concat(t.results)),i=t.next}return e},Jt=t=>new Promise(((e,i)=>{Wt(t).then((t=>{e({assets:t.json.results,next:t.json.next})})).catch((t=>i(t)))})),Xt=async t=>{if(!t)return new Promise((t=>t([])));let e=[],i=t;for(;i;){const t=await Jt(i);e=e.concat(t.assets),i=t.next}return e},Qt=(t,e,i={},n=null)=>{const o=Vt(i);n&&(o["Content-Type"]=n);const r={method:"POST",headers:o,body:e};return new Promise(((e,i)=>{fetch(t,r).then((async t=>{t.text().then((i=>{let n={};try{n=JSON.parse(i)}catch(t){}e({body:i,json:n,headers:t.headers,status:t.status})}))})).catch((t=>{i(t)}))}))},te=(t,e)=>Qt(t,JSON.stringify(e),!1,"application/json"),ee=t=>{const e=t.parentNode||t.host;if(e){const t=e instanceof HTMLElement&&window.getComputedStyle(e).overflowY,i=t&&!(t.includes("hidden")||t.includes("visible"));return e?i&&e.scrollHeight>=e.clientHeight?e:ee(e):null}return null};const ie=new class{getCurrentDate(){return new Date}},ne=(t,e={suffix:""})=>{const{compareDate:i,hideRecentText:n,suffix:o}=e,r=i||ie.getCurrentDate(),s=Math.floor((r.getTime()-t.getTime())/1e3);if(s<60)return i?s+"s"+o:!n&&o?o:"just now";if(s<3600)return Math.round(s/60)+"m"+o;if(s<=86400)return Math.round(s/3600)+"h"+o;if(s<=2592e3)return Math.round(s/86400)+"d"+o;if(s<15552e3)return Math.round(s/2592e3)+"mth"+o;return t.getDate()+" "+t.toDateString().match(/ [a-zA-Z]*/)[0].replace(" ","")+(t.getFullYear()==r.getFullYear()?"":" "+t.getFullYear())},oe=(t,e)=>{let i=!0;return function(...n){i&&(i=!1,t.apply(this,n),setTimeout((()=>{i=!0}),e))}},re=(t,e="and")=>1===t.length?t[0]:2===t.length?"html"===t[0].type?O`${t[0]} ${e} ${t[1]}`:t.join(" "+e+" "):"html"===t[0].type?t.map(((i,n)=>n<t.length-1?O`${i}, `:O`${e} ${i}`)):t.join(", ")+e+t[t.length-1],se=(t,e,i="and")=>re(t.map(e),i),ae=t=>"true"===((t=>{let e=null;if(document.cookie&&""!=document.cookie){const i=document.cookie.split(";");for(let n=0;n<i.length;n++){const o=i[n].trim();if(o.substring(0,t.length+1)==t+"="){e=decodeURIComponent(o.substring(t.length+1));break}}}return e})(t)||"");var le;!function(t){t.MENU_COLLAPSED="menu-collapsed",t.TICKET_SHOW_DETAILS="tickets.show-details"}(le||(le={}));var ce,he,de,ue;!function(t){t.DayFirst="day_first",t.MonthFirst="month_first",t.YearFirst="year_first"}(ce||(ce={})),function(t){t.CampaignEvent="campaign_event",t.ScheduledBroadcast="scheduled_broadcast",t.ScheduledTrigger="scheduled_trigger"}(he||(he={})),function(t){t.Open="open",t.Closed="closed"}(de||(de={})),function(t){t.Loaded="temba-loaded",t.Canceled="temba-canceled",t.CursorChanged="temba-cursor-changed",t.Refreshed="temba-refreshed",t.Selection="temba-selection",t.ButtonClicked="temba-button-clicked",t.DialogHidden="temba-dialog-hidden",t.ScrollThreshold="temba-scroll-threshold",t.ContentChanged="temba-content-changed",t.ContextChanged="temba-context-changed",t.FetchComplete="temba-fetch-complete",t.Submitted="temba-submitted",t.Redirected="temba-redirected",t.NoPath="temba-no-path",t.StoreUpdated="temba-store-updated",t.Ready="temba-ready"}(ue||(ue={}));class pe{constructor(t=0,e=0){this.first=null,this.items=Object.create(null),this.last=null,this.max=t,this.size=0,this.ttl=e}has(t){return t in this.items}clear(){return this.first=null,this.items=Object.create(null),this.last=null,this.size=0,this}delete(t){if(this.has(t)){const e=this.items[t];delete this.items[t],this.size--,null!==e.prev&&(e.prev.next=e.next),null!==e.next&&(e.next.prev=e.prev),this.first===e&&(this.first=e.next),this.last===e&&(this.last=e.prev)}return this}evict(t=!1){if(t||this.size>0){const t=this.first;delete this.items[t.key],this.size--,0===this.size?(this.first=null,this.last=null):(this.first=t.next,this.first.prev=null)}return this}get(t){let e;if(this.has(t)){const i=this.items[t];this.ttl>0&&i.expiry<=(new Date).getTime()?this.delete(t):(e=i.value,this.set(t,e,!0))}return e}keys(){return Object.keys(this.items)}set(t,e,i=!1){let n;if(i||this.has(t)){if(n=this.items[t],n.value=e,this.last!==n){const t=this.last,e=n.next,i=n.prev;this.first===n&&(this.first=n.next),n.next=null,n.prev=this.last,t.next=n,null!==i&&(i.next=e),null!==e&&(e.prev=i)}}else this.max>0&&this.size===this.max&&this.evict(!0),n=this.items[t]={expiry:this.ttl>0?(new Date).getTime()+this.ttl:this.ttl,key:t,prev:this.last,next:null,value:e},1==++this.size?this.first=n:this.last.next=n;return this.last=n,this}}function me(t=1e3,e=0){if(isNaN(t)||t<0)throw new TypeError("Invalid max value");if(isNaN(e)||e<0)throw new TypeError("Invalid ttl value");return new pe(t,e)}var fe=function(){function t(){var t=this;this.languages={ar:{y:function(t){return 1===t?"سنة":"سنوات"},mo:function(t){return 1===t?"شهر":"أشهر"},w:function(t){return 1===t?"أسبوع":"أسابيع"},d:function(t){return 1===t?"يوم":"أيام"},h:function(t){return 1===t?"ساعة":"ساعات"},m:function(e){return["دقيقة","دقائق"][t.getArabicForm(e)]},s:function(t){return 1===t?"ثانية":"ثواني"},ms:function(t){return 1===t?"جزء من الثانية":"أجزاء من الثانية"},decimal:","},bg:{y:function(e){return["години","година","години"][t.getSlavicForm(e)]},mo:function(e){return["месеца","месец","месеца"][t.getSlavicForm(e)]},w:function(e){return["седмици","седмица","седмици"][t.getSlavicForm(e)]},d:function(e){return["дни","ден","дни"][t.getSlavicForm(e)]},h:function(e){return["часа","час","часа"][t.getSlavicForm(e)]},m:function(e){return["минути","минута","минути"][t.getSlavicForm(e)]},s:function(e){return["секунди","секунда","секунди"][t.getSlavicForm(e)]},ms:function(e){return["милисекунди","милисекунда","милисекунди"][t.getSlavicForm(e)]},decimal:","},ca:{y:function(t){return"any"+(1===t?"":"s")},mo:function(t){return"mes"+(1===t?"":"os")},w:function(t){return"setman"+(1===t?"a":"es")},d:function(t){return"di"+(1===t?"a":"es")},h:function(t){return"hor"+(1===t?"a":"es")},m:function(t){return"minut"+(1===t?"":"s")},s:function(t){return"segon"+(1===t?"":"s")},ms:function(t){return"milisegon"+(1===t?"":"s")},decimal:","},cs:{y:function(e){return["rok","roku","roky","let"][t.getCzechOrSlovakForm(e)]},mo:function(e){return["měsíc","měsíce","měsíce","měsíců"][t.getCzechOrSlovakForm(e)]},w:function(e){return["týden","týdne","týdny","týdnů"][t.getCzechOrSlovakForm(e)]},d:function(e){return["den","dne","dny","dní"][t.getCzechOrSlovakForm(e)]},h:function(e){return["hodina","hodiny","hodiny","hodin"][t.getCzechOrSlovakForm(e)]},m:function(e){return["minuta","minuty","minuty","minut"][t.getCzechOrSlovakForm(e)]},s:function(e){return["sekunda","sekundy","sekundy","sekund"][t.getCzechOrSlovakForm(e)]},ms:function(e){return["milisekunda","milisekundy","milisekundy","milisekund"][t.getCzechOrSlovakForm(e)]},decimal:","},da:{y:function(){return"år"},mo:function(t){return"måned"+(1===t?"":"er")},w:function(t){return"uge"+(1===t?"":"r")},d:function(t){return"dag"+(1===t?"":"e")},h:function(t){return"time"+(1===t?"":"r")},m:function(t){return"minut"+(1===t?"":"ter")},s:function(t){return"sekund"+(1===t?"":"er")},ms:function(t){return"millisekund"+(1===t?"":"er")},decimal:","},de:{y:function(t){return"Jahr"+(1===t?"":"e")},mo:function(t){return"Monat"+(1===t?"":"e")},w:function(t){return"Woche"+(1===t?"":"n")},d:function(t){return"Tag"+(1===t?"":"e")},h:function(t){return"Stunde"+(1===t?"":"n")},m:function(t){return"Minute"+(1===t?"":"n")},s:function(t){return"Sekunde"+(1===t?"":"n")},ms:function(t){return"Millisekunde"+(1===t?"":"n")},decimal:","},el:{y:function(t){return 1===t?"χρόνος":"χρόνια"},mo:function(t){return 1===t?"μήνας":"μήνες"},w:function(t){return 1===t?"εβδομάδα":"εβδομάδες"},d:function(t){return 1===t?"μέρα":"μέρες"},h:function(t){return 1===t?"ώρα":"ώρες"},m:function(t){return 1===t?"λεπτό":"λεπτά"},s:function(t){return 1===t?"δευτερόλεπτο":"δευτερόλεπτα"},ms:function(t){return 1===t?"χιλιοστό του δευτερολέπτου":"χιλιοστά του δευτερολέπτου"},decimal:","},en:{y:function(t){return"year"+(1===t?"":"s")},mo:function(t){return"month"+(1===t?"":"s")},w:function(t){return"week"+(1===t?"":"s")},d:function(t){return"day"+(1===t?"":"s")},h:function(t){return"hour"+(1===t?"":"s")},m:function(t){return"minute"+(1===t?"":"s")},s:function(t){return"second"+(1===t?"":"s")},ms:function(t){return"millisecond"+(1===t?"":"s")},decimal:"."},es:{y:function(t){return"año"+(1===t?"":"s")},mo:function(t){return"mes"+(1===t?"":"es")},w:function(t){return"semana"+(1===t?"":"s")},d:function(t){return"día"+(1===t?"":"s")},h:function(t){return"hora"+(1===t?"":"s")},m:function(t){return"minuto"+(1===t?"":"s")},s:function(t){return"segundo"+(1===t?"":"s")},ms:function(t){return"milisegundo"+(1===t?"":"s")},decimal:","},et:{y:function(t){return"aasta"+(1===t?"":"t")},mo:function(t){return"kuu"+(1===t?"":"d")},w:function(t){return"nädal"+(1===t?"":"at")},d:function(t){return"päev"+(1===t?"":"a")},h:function(t){return"tund"+(1===t?"":"i")},m:function(t){return"minut"+(1===t?"":"it")},s:function(t){return"sekund"+(1===t?"":"it")},ms:function(t){return"millisekund"+(1===t?"":"it")},decimal:","},fa:{y:function(){return"سال"},mo:function(){return"ماه"},w:function(){return"هفته"},d:function(){return"روز"},h:function(){return"ساعت"},m:function(){return"دقیقه"},s:function(){return"ثانیه"},ms:function(){return"میلی ثانیه"},decimal:"."},fi:{y:function(t){return 1===t?"vuosi":"vuotta"},mo:function(t){return 1===t?"kuukausi":"kuukautta"},w:function(t){return"viikko"+(1===t?"":"a")},d:function(t){return"päivä"+(1===t?"":"ä")},h:function(t){return"tunti"+(1===t?"":"a")},m:function(t){return"minuutti"+(1===t?"":"a")},s:function(t){return"sekunti"+(1===t?"":"a")},ms:function(t){return"millisekunti"+(1===t?"":"a")},decimal:","},fo:{y:function(){return"ár"},mo:function(t){return 1===t?"mánaður":"mánaðir"},w:function(t){return 1===t?"vika":"vikur"},d:function(t){return 1===t?"dagur":"dagar"},h:function(t){return 1===t?"tími":"tímar"},m:function(t){return 1===t?"minuttur":"minuttir"},s:function(){return"sekund"},ms:function(){return"millisekund"},decimal:","},fr:{y:function(t){return"an"+(t>=2?"s":"")},mo:function(){return"mois"},w:function(t){return"semaine"+(t>=2?"s":"")},d:function(t){return"jour"+(t>=2?"s":"")},h:function(t){return"heure"+(t>=2?"s":"")},m:function(t){return"minute"+(t>=2?"s":"")},s:function(t){return"seconde"+(t>=2?"s":"")},ms:function(t){return"milliseconde"+(t>=2?"s":"")},decimal:","},hr:{y:function(t){return t%10==2||t%10==3||t%10==4?"godine":"godina"},mo:function(t){return 1===t?"mjesec":2===t||3===t||4===t?"mjeseca":"mjeseci"},w:function(t){return t%10==1&&11!==t?"tjedan":"tjedna"},d:function(t){return 1===t?"dan":"dana"},h:function(t){return 1===t?"sat":2===t||3===t||4===t?"sata":"sati"},m:function(t){var e=t%10;return 2!==e&&3!==e&&4!==e||!(t<10||t>14)?"minuta":"minute"},s:function(t){return 10===t||11===t||12===t||13===t||14===t||16===t||17===t||18===t||19===t||t%10==5?"sekundi":t%10==1?"sekunda":t%10==2||t%10==3||t%10==4?"sekunde":"sekundi"},ms:function(t){return 1===t?"milisekunda":t%10==2||t%10==3||t%10==4?"milisekunde":"milisekundi"},decimal:","},hu:{y:function(){return"év"},mo:function(){return"hónap"},w:function(){return"hét"},d:function(){return"nap"},h:function(){return"óra"},m:function(){return"perc"},s:function(){return"másodperc"},ms:function(){return"ezredmásodperc"},decimal:","},id:{y:function(){return"tahun"},mo:function(){return"bulan"},w:function(){return"minggu"},d:function(){return"hari"},h:function(){return"jam"},m:function(){return"menit"},s:function(){return"detik"},ms:function(){return"milidetik"},decimal:"."},is:{y:function(){return"ár"},mo:function(t){return"mánuð"+(1===t?"ur":"ir")},w:function(t){return"vik"+(1===t?"a":"ur")},d:function(t){return"dag"+(1===t?"ur":"ar")},h:function(t){return"klukkutím"+(1===t?"i":"ar")},m:function(t){return"mínút"+(1===t?"a":"ur")},s:function(t){return"sekúnd"+(1===t?"a":"ur")},ms:function(t){return"millisekúnd"+(1===t?"a":"ur")},decimal:"."},it:{y:function(t){return"ann"+(1===t?"o":"i")},mo:function(t){return"mes"+(1===t?"e":"i")},w:function(t){return"settiman"+(1===t?"a":"e")},d:function(t){return"giorn"+(1===t?"o":"i")},h:function(t){return"or"+(1===t?"a":"e")},m:function(t){return"minut"+(1===t?"o":"i")},s:function(t){return"second"+(1===t?"o":"i")},ms:function(t){return"millisecond"+(1===t?"o":"i")},decimal:","},ja:{y:function(){return"年"},mo:function(){return"月"},w:function(){return"週"},d:function(){return"日"},h:function(){return"時間"},m:function(){return"分"},s:function(){return"秒"},ms:function(){return"ミリ秒"},decimal:"."},ko:{y:function(){return"년"},mo:function(){return"개월"},w:function(){return"주일"},d:function(){return"일"},h:function(){return"시간"},m:function(){return"분"},s:function(){return"초"},ms:function(){return"밀리 초"},decimal:"."},lo:{y:function(){return"ປີ"},mo:function(){return"ເດືອນ"},w:function(){return"ອາທິດ"},d:function(){return"ມື້"},h:function(){return"ຊົ່ວໂມງ"},m:function(){return"ນາທີ"},s:function(){return"ວິນາທີ"},ms:function(){return"ມິນລິວິນາທີ"},decimal:","},lt:{y:function(t){return t%10==0||t%100>=10&&t%100<=20?"metų":"metai"},mo:function(e){return["mėnuo","mėnesiai","mėnesių"][t.getLithuanianForm(e)]},w:function(e){return["savaitė","savaitės","savaičių"][t.getLithuanianForm(e)]},d:function(e){return["diena","dienos","dienų"][t.getLithuanianForm(e)]},h:function(e){return["valanda","valandos","valandų"][t.getLithuanianForm(e)]},m:function(e){return["minutė","minutės","minučių"][t.getLithuanianForm(e)]},s:function(e){return["sekundė","sekundės","sekundžių"][t.getLithuanianForm(e)]},ms:function(e){return["milisekundė","milisekundės","milisekundžių"][t.getLithuanianForm(e)]},decimal:","},lv:{y:function(e){return["gads","gadi"][t.getLatvianForm(e)]},mo:function(e){return["mēnesis","mēneši"][t.getLatvianForm(e)]},w:function(e){return["nedēļa","nedēļas"][t.getLatvianForm(e)]},d:function(e){return["diena","dienas"][t.getLatvianForm(e)]},h:function(e){return["stunda","stundas"][t.getLatvianForm(e)]},m:function(e){return["minūte","minūtes"][t.getLatvianForm(e)]},s:function(e){return["sekunde","sekundes"][t.getLatvianForm(e)]},ms:function(e){return["milisekunde","milisekundes"][t.getLatvianForm(e)]},decimal:","},ms:{y:function(){return"tahun"},mo:function(){return"bulan"},w:function(){return"minggu"},d:function(){return"hari"},h:function(){return"jam"},m:function(){return"minit"},s:function(){return"saat"},ms:function(){return"milisaat"},decimal:"."},nl:{y:function(){return"jaar"},mo:function(t){return 1===t?"maand":"maanden"},w:function(t){return 1===t?"week":"weken"},d:function(t){return 1===t?"dag":"dagen"},h:function(){return"uur"},m:function(t){return 1===t?"minuut":"minuten"},s:function(t){return 1===t?"seconde":"seconden"},ms:function(t){return 1===t?"milliseconde":"milliseconden"},decimal:","},no:{y:function(){return"år"},mo:function(t){return"måned"+(1===t?"":"er")},w:function(t){return"uke"+(1===t?"":"r")},d:function(t){return"dag"+(1===t?"":"er")},h:function(t){return"time"+(1===t?"":"r")},m:function(t){return"minutt"+(1===t?"":"er")},s:function(t){return"sekund"+(1===t?"":"er")},ms:function(t){return"millisekund"+(1===t?"":"er")},decimal:","},pl:{y:function(e){return["rok","roku","lata","lat"][t.getPolishForm(e)]},mo:function(e){return["miesiąc","miesiąca","miesiące","miesięcy"][t.getPolishForm(e)]},w:function(e){return["tydzień","tygodnia","tygodnie","tygodni"][t.getPolishForm(e)]},d:function(e){return["dzień","dnia","dni","dni"][t.getPolishForm(e)]},h:function(e){return["godzina","godziny","godziny","godzin"][t.getPolishForm(e)]},m:function(e){return["minuta","minuty","minuty","minut"][t.getPolishForm(e)]},s:function(e){return["sekunda","sekundy","sekundy","sekund"][t.getPolishForm(e)]},ms:function(e){return["milisekunda","milisekundy","milisekundy","milisekund"][t.getPolishForm(e)]},decimal:","},pt:{y:function(t){return"ano"+(1===t?"":"s")},mo:function(t){return 1===t?"mês":"meses"},w:function(t){return"semana"+(1===t?"":"s")},d:function(t){return"dia"+(1===t?"":"s")},h:function(t){return"hora"+(1===t?"":"s")},m:function(t){return"minuto"+(1===t?"":"s")},s:function(t){return"segundo"+(1===t?"":"s")},ms:function(t){return"milissegundo"+(1===t?"":"s")},decimal:","},ro:{y:function(t){return 1===t?"an":"ani"},mo:function(t){return 1===t?"lună":"luni"},w:function(t){return 1===t?"săptămână":"săptămâni"},d:function(t){return 1===t?"zi":"zile"},h:function(t){return 1===t?"oră":"ore"},m:function(t){return 1===t?"minut":"minute"},s:function(t){return 1===t?"secundă":"secunde"},ms:function(t){return 1===t?"milisecundă":"milisecunde"},decimal:","},ru:{y:function(e){return["лет","год","года"][t.getSlavicForm(e)]},mo:function(e){return["месяцев","месяц","месяца"][t.getSlavicForm(e)]},w:function(e){return["недель","неделя","недели"][t.getSlavicForm(e)]},d:function(e){return["дней","день","дня"][t.getSlavicForm(e)]},h:function(e){return["часов","час","часа"][t.getSlavicForm(e)]},m:function(e){return["минут","минута","минуты"][t.getSlavicForm(e)]},s:function(e){return["секунд","секунда","секунды"][t.getSlavicForm(e)]},ms:function(e){return["миллисекунд","миллисекунда","миллисекунды"][t.getSlavicForm(e)]},decimal:","},uk:{y:function(e){return["років","рік","роки"][t.getSlavicForm(e)]},mo:function(e){return["місяців","місяць","місяці"][t.getSlavicForm(e)]},w:function(e){return["тижнів","тиждень","тижні"][t.getSlavicForm(e)]},d:function(e){return["днів","день","дні"][t.getSlavicForm(e)]},h:function(e){return["годин","година","години"][t.getSlavicForm(e)]},m:function(e){return["хвилин","хвилина","хвилини"][t.getSlavicForm(e)]},s:function(e){return["секунд","секунда","секунди"][t.getSlavicForm(e)]},ms:function(e){return["мілісекунд","мілісекунда","мілісекунди"][t.getSlavicForm(e)]},decimal:","},ur:{y:function(){return"سال"},mo:function(t){return 1===t?"مہینہ":"مہینے"},w:function(t){return 1===t?"ہفتہ":"ہفتے"},d:function(){return"دن"},h:function(t){return 1===t?"گھنٹہ":"گھنٹے"},m:function(){return"منٹ"},s:function(){return"سیکنڈ"},ms:function(){return"ملی سیکنڈ"},decimal:"."},sk:{y:function(e){return["rok","roky","roky","rokov"][t.getCzechOrSlovakForm(e)]},mo:function(e){return["mesiac","mesiace","mesiace","mesiacov"][t.getCzechOrSlovakForm(e)]},w:function(e){return["týždeň","týždne","týždne","týždňov"][t.getCzechOrSlovakForm(e)]},d:function(e){return["deň","dni","dni","dní"][t.getCzechOrSlovakForm(e)]},h:function(e){return["hodina","hodiny","hodiny","hodín"][t.getCzechOrSlovakForm(e)]},m:function(e){return["minúta","minúty","minúty","minút"][t.getCzechOrSlovakForm(e)]},s:function(e){return["sekunda","sekundy","sekundy","sekúnd"][t.getCzechOrSlovakForm(e)]},ms:function(e){return["milisekunda","milisekundy","milisekundy","milisekúnd"][t.getCzechOrSlovakForm(e)]},decimal:","},sv:{y:function(){return"år"},mo:function(t){return"månad"+(1===t?"":"er")},w:function(t){return"veck"+(1===t?"a":"or")},d:function(t){return"dag"+(1===t?"":"ar")},h:function(t){return"timm"+(1===t?"e":"ar")},m:function(t){return"minut"+(1===t?"":"er")},s:function(t){return"sekund"+(1===t?"":"er")},ms:function(t){return"millisekund"+(1===t?"":"er")},decimal:","},tr:{y:function(){return"yıl"},mo:function(){return"ay"},w:function(){return"hafta"},d:function(){return"gün"},h:function(){return"saat"},m:function(){return"dakika"},s:function(){return"saniye"},ms:function(){return"milisaniye"},decimal:","},th:{y:function(){return"ปี"},mo:function(){return"เดือน"},w:function(){return"อาทิตย์"},d:function(){return"วัน"},h:function(){return"ชั่วโมง"},m:function(){return"นาที"},s:function(){return"วินาที"},ms:function(){return"มิลลิวินาที"},decimal:"."},vi:{y:function(){return"năm"},mo:function(){return"tháng"},w:function(){return"tuần"},d:function(){return"ngày"},h:function(){return"giờ"},m:function(){return"phút"},s:function(){return"giây"},ms:function(){return"mili giây"},decimal:","},zh_CN:{y:function(){return"年"},mo:function(){return"个月"},w:function(){return"周"},d:function(){return"天"},h:function(){return"小时"},m:function(){return"分钟"},s:function(){return"秒"},ms:function(){return"毫秒"},decimal:"."},zh_TW:{y:function(){return"年"},mo:function(){return"個月"},w:function(){return"周"},d:function(){return"天"},h:function(){return"小時"},m:function(){return"分鐘"},s:function(){return"秒"},ms:function(){return"毫秒"},decimal:"."}}}return t.prototype.addLanguage=function(t,e){this.languages[t]=e},t.prototype.getCzechForm=function(t){return 1===t?0:Math.floor(t)!==t?1:t%10>=2&&t%10<=4&&t%100<10?2:3},t.prototype.getPolishForm=function(t){return 1===t?0:Math.floor(t)!==t?1:t%10>=2&&t%10<=4&&!(t%100>10&&t%100<20)?2:3},t.prototype.getSlavicForm=function(t){return Math.floor(t)!==t?2:t>=5&&t<=20||t%10>=5&&t%10<=9||t%10==0?0:t%10==1?1:t>1?2:0},t.prototype.getLithuanianForm=function(t){return 1===t||t%10==1&&t%100>20?0:Math.floor(t)!==t||t%10>=2&&t%100>20||t%10>=2&&t%100<10?1:2},t.prototype.getArabicForm=function(t){return t<=2?0:t>2&&t<11?1:0},t.prototype.getCzechOrSlovakForm=function(t){return 1===t?0:Math.floor(t)!==t?1:t%10>=2&&t%10<=4&&t%100<10?2:3},t.prototype.getLatvianForm=function(t){return 1===t||t%10==1&&t%100!=11?0:1},t}(),ge=function(){function t(t){this.languageUtil=t,this.defaultOptions={language:"en",delimiter:", ",spacer:" ",conjunction:"",serialComma:!0,units:["y","mo","w","d","h","m","s"],languages:{},largest:10,decimal:".",round:!1,unitMeasures:{y:315576e5,mo:26298e5,w:6048e5,d:864e5,h:36e5,m:6e4,s:1e3,ms:1}},this.options=void 0,this.options=this.defaultOptions}return t.prototype.humanize=function(t,e){var i=void 0!==e?this.extend(this.options,e):this.defaultOptions;return this.doHumanization(t,i)},t.prototype.setOptions=function(t){this.options=void 0!==t?this.extend(this.defaultOptions,t):this.defaultOptions},t.prototype.getSupportedLanguages=function(){var t=[];for(var e in this.languageUtil.languages)this.languageUtil.languages.hasOwnProperty(e)&&t.push(e);return t},t.prototype.addLanguage=function(t,e){this.languageUtil.addLanguage(t,e)},t.prototype.doHumanization=function(t,e){var i,n,o;t=Math.abs(t);var r=e.languages[e.language]||this.languageUtil.languages[e.language];if(!r)throw new Error("No language "+r+".");var s,a,l,c=[];for(i=0,n=e.units.length;i<n;i++)s=e.units[i],a=e.unitMeasures[s],l=i+1===n?t/a:Math.floor(t/a),c.push({unitCount:l,unitName:s}),t-=l*a;var h=0;for(i=0;i<c.length;i++)if(c[i].unitCount){h=i;break}if(e.round){var d=void 0,u=void 0;for(i=c.length-1;i>=0&&((o=c[i]).unitCount=Math.round(o.unitCount),0!==i);i--)u=c[i-1],d=e.unitMeasures[u.unitName]/e.unitMeasures[o.unitName],(o.unitCount%d==0||e.largest&&e.largest-1<i-h)&&(u.unitCount+=o.unitCount/d,o.unitCount=0)}var p=[];for(i=0,c.length;i<n&&((o=c[i]).unitCount&&p.push(this.render(o.unitCount,o.unitName,r,e)),p.length!==e.largest);i++);return p.length?e.conjunction&&1!==p.length?2===p.length?p.join(e.conjunction):p.length>2?p.slice(0,-1).join(e.delimiter)+(e.serialComma?",":"")+e.conjunction+p.slice(-1):void 0:p.join(e.delimiter):this.render(0,e.units[e.units.length-1],r,e)},t.prototype.render=function(t,e,i,n){var o;o=void 0===n.decimal?i.decimal:n.decimal;var r=t.toString().replace(".",o.toString()),s=i[e](t);return r+n.spacer+s},t.prototype.extend=function(t,e){for(var i in e)t.hasOwnProperty(i)&&(t[i]=e[i]);return t},t}();class ve extends Error{}class ye extends ve{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class be extends ve{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class _e extends ve{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class xe extends ve{}class we extends ve{constructor(t){super(`Invalid unit ${t}`)}}class ke extends ve{}class Ce extends ve{constructor(){super("Zone is an abstract class")}}const Se="numeric",Ee="short",Te="long",Me={year:Se,month:Se,day:Se},$e={year:Se,month:Ee,day:Se},De={year:Se,month:Ee,day:Se,weekday:Ee},Ae={year:Se,month:Te,day:Se},Le={year:Se,month:Te,day:Se,weekday:Te},Oe={hour:Se,minute:Se},Pe={hour:Se,minute:Se,second:Se},Ie={hour:Se,minute:Se,second:Se,timeZoneName:Ee},ze={hour:Se,minute:Se,second:Se,timeZoneName:Te},Ne={hour:Se,minute:Se,hourCycle:"h23"},Re={hour:Se,minute:Se,second:Se,hourCycle:"h23"},Be={hour:Se,minute:Se,second:Se,hourCycle:"h23",timeZoneName:Ee},Fe={hour:Se,minute:Se,second:Se,hourCycle:"h23",timeZoneName:Te},qe={year:Se,month:Se,day:Se,hour:Se,minute:Se},je={year:Se,month:Se,day:Se,hour:Se,minute:Se,second:Se},Ze={year:Se,month:Ee,day:Se,hour:Se,minute:Se},He={year:Se,month:Ee,day:Se,hour:Se,minute:Se,second:Se},Ue={year:Se,month:Ee,day:Se,weekday:Ee,hour:Se,minute:Se},Ve={year:Se,month:Te,day:Se,hour:Se,minute:Se,timeZoneName:Ee},We={year:Se,month:Te,day:Se,hour:Se,minute:Se,second:Se,timeZoneName:Ee},Ge={year:Se,month:Te,day:Se,weekday:Te,hour:Se,minute:Se,timeZoneName:Te},Ye={year:Se,month:Te,day:Se,weekday:Te,hour:Se,minute:Se,second:Se,timeZoneName:Te};function Ke(t){return void 0===t}function Je(t){return"number"==typeof t}function Xe(t){return"number"==typeof t&&t%1==0}function Qe(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(t){return!1}}function ti(t,e,i){if(0!==t.length)return t.reduce(((t,n)=>{const o=[e(n),n];return t&&i(t[0],o[0])===t[0]?t:o}),null)[1]}function ei(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function ii(t,e,i){return Xe(t)&&t>=e&&t<=i}function ni(t,e=2){let i;return i=t<0?"-"+(""+-t).padStart(e,"0"):(""+t).padStart(e,"0"),i}function oi(t){return Ke(t)||null===t||""===t?void 0:parseInt(t,10)}function ri(t){return Ke(t)||null===t||""===t?void 0:parseFloat(t)}function si(t){if(!Ke(t)&&null!==t&&""!==t){const e=1e3*parseFloat("0."+t);return Math.floor(e)}}function ai(t,e,i=!1){const n=10**e;return(i?Math.trunc:Math.round)(t*n)/n}function li(t){return t%4==0&&(t%100!=0||t%400==0)}function ci(t){return li(t)?366:365}function hi(t,e){const i=function(t,e){return t-e*Math.floor(t/e)}(e-1,12)+1;return 2===i?li(t+(e-i)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][i-1]}function di(t){let e=Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second,t.millisecond);return t.year<100&&t.year>=0&&(e=new Date(e),e.setUTCFullYear(e.getUTCFullYear()-1900)),+e}function ui(t){const e=(t+Math.floor(t/4)-Math.floor(t/100)+Math.floor(t/400))%7,i=t-1,n=(i+Math.floor(i/4)-Math.floor(i/100)+Math.floor(i/400))%7;return 4===e||3===n?53:52}function pi(t){return t>99?t:t>60?1900+t:2e3+t}function mi(t,e,i,n=null){const o=new Date(t),r={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};n&&(r.timeZone=n);const s={timeZoneName:e,...r},a=new Intl.DateTimeFormat(i,s).formatToParts(o).find((t=>"timezonename"===t.type.toLowerCase()));return a?a.value:null}function fi(t,e){let i=parseInt(t,10);Number.isNaN(i)&&(i=0);const n=parseInt(e,10)||0;return 60*i+(i<0||Object.is(i,-0)?-n:n)}function gi(t){const e=Number(t);if("boolean"==typeof t||""===t||Number.isNaN(e))throw new ke(`Invalid unit value ${t}`);return e}function vi(t,e){const i={};for(const n in t)if(ei(t,n)){const o=t[n];if(null==o)continue;i[e(n)]=gi(o)}return i}function yi(t,e){const i=Math.trunc(Math.abs(t/60)),n=Math.trunc(Math.abs(t%60)),o=t>=0?"+":"-";switch(e){case"short":return`${o}${ni(i,2)}:${ni(n,2)}`;case"narrow":return`${o}${i}${n>0?`:${n}`:""}`;case"techie":return`${o}${ni(i,2)}${ni(n,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function bi(t){return function(t,e){return e.reduce(((e,i)=>(e[i]=t[i],e)),{})}(t,["hour","minute","second","millisecond"])}const _i=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/,xi=["January","February","March","April","May","June","July","August","September","October","November","December"],wi=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ki=["J","F","M","A","M","J","J","A","S","O","N","D"];function Ci(t){switch(t){case"narrow":return[...ki];case"short":return[...wi];case"long":return[...xi];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const Si=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Ei=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Ti=["M","T","W","T","F","S","S"];function Mi(t){switch(t){case"narrow":return[...Ti];case"short":return[...Ei];case"long":return[...Si];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const $i=["AM","PM"],Di=["Before Christ","Anno Domini"],Ai=["BC","AD"],Li=["B","A"];function Oi(t){switch(t){case"narrow":return[...Li];case"short":return[...Ai];case"long":return[...Di];default:return null}}function Pi(t,e){let i="";for(const n of t)n.literal?i+=n.val:i+=e(n.val);return i}const Ii={D:Me,DD:$e,DDD:Ae,DDDD:Le,t:Oe,tt:Pe,ttt:Ie,tttt:ze,T:Ne,TT:Re,TTT:Be,TTTT:Fe,f:qe,ff:Ze,fff:Ve,ffff:Ge,F:je,FF:He,FFF:We,FFFF:Ye};class zi{static create(t,e={}){return new zi(t,e)}static parseFormat(t){let e=null,i="",n=!1;const o=[];for(let r=0;r<t.length;r++){const s=t.charAt(r);"'"===s?(i.length>0&&o.push({literal:n,val:i}),e=null,i="",n=!n):n||s===e?i+=s:(i.length>0&&o.push({literal:!1,val:i}),i=s,e=s)}return i.length>0&&o.push({literal:n,val:i}),o}static macroTokenToFormatOpts(t){return Ii[t]}constructor(t,e){this.opts=e,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,e){null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem());return this.systemLoc.dtFormatter(t,{...this.opts,...e}).format()}formatDateTime(t,e={}){return this.loc.dtFormatter(t,{...this.opts,...e}).format()}formatDateTimeParts(t,e={}){return this.loc.dtFormatter(t,{...this.opts,...e}).formatToParts()}resolvedOptions(t,e={}){return this.loc.dtFormatter(t,{...this.opts,...e}).resolvedOptions()}num(t,e=0){if(this.opts.forceSimple)return ni(t,e);const i={...this.opts};return e>0&&(i.padTo=e),this.loc.numberFormatter(i).format(t)}formatDateTimeFromString(t,e){const i="en"===this.loc.listingMode(),n=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar,o=(e,i)=>this.loc.extract(t,e,i),r=e=>t.isOffsetFixed&&0===t.offset&&e.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,e.format):"",s=()=>i?function(t){return $i[t.hour<12?0:1]}(t):o({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(e,n)=>i?function(t,e){return Ci(e)[t.month-1]}(t,e):o(n?{month:e}:{month:e,day:"numeric"},"month"),l=(e,n)=>i?function(t,e){return Mi(e)[t.weekday-1]}(t,e):o(n?{weekday:e}:{weekday:e,month:"long",day:"numeric"},"weekday"),c=e=>{const i=zi.macroTokenToFormatOpts(e);return i?this.formatWithSystemDefault(t,i):e},h=e=>i?function(t,e){return Oi(e)[t.year<0?0:1]}(t,e):o({era:e},"era");return Pi(zi.parseFormat(e),(e=>{switch(e){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12==0?12:t.hour%12);case"hh":return this.num(t.hour%12==0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return r({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return r({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return r({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return s();case"d":return n?o({day:"numeric"},"day"):this.num(t.day);case"dd":return n?o({day:"2-digit"},"day"):this.num(t.day,2);case"c":case"E":return this.num(t.weekday);case"ccc":return l("short",!0);case"cccc":return l("long",!0);case"ccccc":return l("narrow",!0);case"EEE":return l("short",!1);case"EEEE":return l("long",!1);case"EEEEE":return l("narrow",!1);case"L":return n?o({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return n?o({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return n?o({month:"numeric"},"month"):this.num(t.month);case"MM":return n?o({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return n?o({year:"numeric"},"year"):this.num(t.year);case"yy":return n?o({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return n?o({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return n?o({year:"numeric"},"year"):this.num(t.year,6);case"G":return h("short");case"GG":return h("long");case"GGGGG":return h("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return c(e)}}))}formatDurationFromString(t,e){const i=t=>{switch(t[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},n=zi.parseFormat(e),o=n.reduce(((t,{literal:e,val:i})=>e?t:t.concat(i)),[]),r=t.shiftTo(...o.map(i).filter((t=>t)));return Pi(n,(t=>e=>{const n=i(e);return n?this.num(t.get(n),e.length):e})(r))}}class Ni{constructor(t,e){this.reason=t,this.explanation=e}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class Ri{get type(){throw new Ce}get name(){throw new Ce}get ianaName(){return this.name}get isUniversal(){throw new Ce}offsetName(t,e){throw new Ce}formatOffset(t,e){throw new Ce}offset(t){throw new Ce}equals(t){throw new Ce}get isValid(){throw new Ce}}let Bi=null;class Fi extends Ri{static get instance(){return null===Bi&&(Bi=new Fi),Bi}get type(){return"system"}get name(){return(new Intl.DateTimeFormat).resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:e,locale:i}){return mi(t,e,i)}formatOffset(t,e){return yi(this.offset(t),e)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return"system"===t.type}get isValid(){return!0}}let qi={};const ji={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};let Zi={};class Hi extends Ri{static create(t){return Zi[t]||(Zi[t]=new Hi(t)),Zi[t]}static resetCache(){Zi={},qi={}}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch(t){return!1}}constructor(t){super(),this.zoneName=t,this.valid=Hi.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:e,locale:i}){return mi(t,e,i,this.name)}formatOffset(t,e){return yi(this.offset(t),e)}offset(t){const e=new Date(t);if(isNaN(e))return NaN;const i=(n=this.name,qi[n]||(qi[n]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),qi[n]);var n;let[o,r,s,a,l,c,h]=i.formatToParts?function(t,e){const i=t.formatToParts(e),n=[];for(let t=0;t<i.length;t++){const{type:e,value:o}=i[t],r=ji[e];"era"===e?n[r]=o:Ke(r)||(n[r]=parseInt(o,10))}return n}(i,e):function(t,e){const i=t.format(e).replace(/\u200E/g,""),n=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(i),[,o,r,s,a,l,c,h]=n;return[s,o,r,a,l,c,h]}(i,e);"BC"===a&&(o=1-Math.abs(o));let d=+e;const u=d%1e3;return d-=u>=0?u:1e3+u,(di({year:o,month:r,day:s,hour:24===l?0:l,minute:c,second:h,millisecond:0})-d)/6e4}equals(t){return"iana"===t.type&&t.name===this.name}get isValid(){return this.valid}}let Ui=null;class Vi extends Ri{static get utcInstance(){return null===Ui&&(Ui=new Vi(0)),Ui}static instance(t){return 0===t?Vi.utcInstance:new Vi(t)}static parseSpecifier(t){if(t){const e=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(e)return new Vi(fi(e[1],e[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return 0===this.fixed?"UTC":`UTC${yi(this.fixed,"narrow")}`}get ianaName(){return 0===this.fixed?"Etc/UTC":`Etc/GMT${yi(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,e){return yi(this.fixed,e)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return"fixed"===t.type&&t.fixed===this.fixed}get isValid(){return!0}}class Wi extends Ri{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Gi(t,e){if(Ke(t)||null===t)return e;if(t instanceof Ri)return t;if(function(t){return"string"==typeof t}(t)){const i=t.toLowerCase();return"local"===i||"system"===i?e:"utc"===i||"gmt"===i?Vi.utcInstance:Vi.parseSpecifier(i)||Hi.create(t)}return Je(t)?Vi.instance(t):"object"==typeof t&&t.offset&&"number"==typeof t.offset?t:new Wi(t)}let Yi,Ki=()=>Date.now(),Ji="system",Xi=null,Qi=null,tn=null;class en{static get now(){return Ki}static set now(t){Ki=t}static set defaultZone(t){Ji=t}static get defaultZone(){return Gi(Ji,Fi.instance)}static get defaultLocale(){return Xi}static set defaultLocale(t){Xi=t}static get defaultNumberingSystem(){return Qi}static set defaultNumberingSystem(t){Qi=t}static get defaultOutputCalendar(){return tn}static set defaultOutputCalendar(t){tn=t}static get throwOnInvalid(){return Yi}static set throwOnInvalid(t){Yi=t}static resetCaches(){pn.resetCache(),Hi.resetCache()}}let nn={};let on={};function rn(t,e={}){const i=JSON.stringify([t,e]);let n=on[i];return n||(n=new Intl.DateTimeFormat(t,e),on[i]=n),n}let sn={};let an={};let ln=null;function cn(t,e,i,n,o){const r=t.listingMode(i);return"error"===r?null:"en"===r?n(e):o(e)}class hn{constructor(t,e,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;const{padTo:n,floor:o,...r}=i;if(!e||Object.keys(r).length>0){const e={useGrouping:!1,...i};i.padTo>0&&(e.minimumIntegerDigits=i.padTo),this.inf=function(t,e={}){const i=JSON.stringify([t,e]);let n=sn[i];return n||(n=new Intl.NumberFormat(t,e),sn[i]=n),n}(t,e)}}format(t){if(this.inf){const e=this.floor?Math.floor(t):t;return this.inf.format(e)}return ni(this.floor?Math.floor(t):ai(t,3),this.padTo)}}class dn{constructor(t,e,i){let n;if(this.opts=i,t.zone.isUniversal){const e=t.offset/60*-1,o=e>=0?`Etc/GMT+${e}`:`Etc/GMT${e}`;0!==t.offset&&Hi.create(o).valid?(n=o,this.dt=t):(n="UTC",i.timeZoneName?this.dt=t:this.dt=0===t.offset?t:hr.fromMillis(t.ts+60*t.offset*1e3))}else"system"===t.zone.type?this.dt=t:(this.dt=t,n=t.zone.name);const o={...this.opts};n&&(o.timeZone=n),this.dtf=rn(e,o)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class un{constructor(t,e,i){this.opts={style:"long",...i},!e&&Qe()&&(this.rtf=function(t,e={}){const{base:i,...n}=e,o=JSON.stringify([t,n]);let r=an[o];return r||(r=new Intl.RelativeTimeFormat(t,e),an[o]=r),r}(t,i))}format(t,e){return this.rtf?this.rtf.format(t,e):function(t,e,i="always",n=!1){const o={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},r=-1===["hours","minutes","seconds"].indexOf(t);if("auto"===i&&r){const i="days"===t;switch(e){case 1:return i?"tomorrow":`next ${o[t][0]}`;case-1:return i?"yesterday":`last ${o[t][0]}`;case 0:return i?"today":`this ${o[t][0]}`}}const s=Object.is(e,-0)||e<0,a=Math.abs(e),l=1===a,c=o[t],h=n?l?c[1]:c[2]||c[1]:l?o[t][0]:t;return s?`${a} ${h} ago`:`in ${a} ${h}`}(e,t,this.opts.numeric,"long"!==this.opts.style)}formatToParts(t,e){return this.rtf?this.rtf.formatToParts(t,e):[]}}class pn{static fromOpts(t){return pn.create(t.locale,t.numberingSystem,t.outputCalendar,t.defaultToEN)}static create(t,e,i,n=!1){const o=t||en.defaultLocale,r=o||(n?"en-US":ln||(ln=(new Intl.DateTimeFormat).resolvedOptions().locale,ln)),s=e||en.defaultNumberingSystem,a=i||en.defaultOutputCalendar;return new pn(r,s,a,o)}static resetCache(){ln=null,on={},sn={},an={}}static fromObject({locale:t,numberingSystem:e,outputCalendar:i}={}){return pn.create(t,e,i)}constructor(t,e,i,n){const[o,r,s]=function(t){const e=t.indexOf("-u-");if(-1===e)return[t];{let i;const n=t.substring(0,e);try{i=rn(t).resolvedOptions()}catch(t){i=rn(n).resolvedOptions()}const{numberingSystem:o,calendar:r}=i;return[n,o,r]}}(t);this.locale=o,this.numberingSystem=e||r||null,this.outputCalendar=i||s||null,this.intl=function(t,e,i){return i||e?(t+="-u",i&&(t+=`-ca-${i}`),e&&(t+=`-nu-${e}`),t):t}(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=n,this.fastNumbersCached=null}get fastNumbers(){var t;return null==this.fastNumbersCached&&(this.fastNumbersCached=(!(t=this).numberingSystem||"latn"===t.numberingSystem)&&("latn"===t.numberingSystem||!t.locale||t.locale.startsWith("en")||"latn"===new Intl.DateTimeFormat(t.intl).resolvedOptions().numberingSystem)),this.fastNumbersCached}listingMode(){const t=this.isEnglish(),e=!(null!==this.numberingSystem&&"latn"!==this.numberingSystem||null!==this.outputCalendar&&"gregory"!==this.outputCalendar);return t&&e?"en":"intl"}clone(t){return t&&0!==Object.getOwnPropertyNames(t).length?pn.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,t.defaultToEN||!1):this}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,e=!1,i=!0){return cn(this,t,i,Ci,(()=>{const i=e?{month:t,day:"numeric"}:{month:t},n=e?"format":"standalone";return this.monthsCache[n][t]||(this.monthsCache[n][t]=function(t){const e=[];for(let i=1;i<=12;i++){const n=hr.utc(2016,i,1);e.push(t(n))}return e}((t=>this.extract(t,i,"month")))),this.monthsCache[n][t]}))}weekdays(t,e=!1,i=!0){return cn(this,t,i,Mi,(()=>{const i=e?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},n=e?"format":"standalone";return this.weekdaysCache[n][t]||(this.weekdaysCache[n][t]=function(t){const e=[];for(let i=1;i<=7;i++){const n=hr.utc(2016,11,13+i);e.push(t(n))}return e}((t=>this.extract(t,i,"weekday")))),this.weekdaysCache[n][t]}))}meridiems(t=!0){return cn(this,void 0,t,(()=>$i),(()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[hr.utc(2016,11,13,9),hr.utc(2016,11,13,19)].map((e=>this.extract(e,t,"dayperiod")))}return this.meridiemCache}))}eras(t,e=!0){return cn(this,t,e,Oi,(()=>{const e={era:t};return this.eraCache[t]||(this.eraCache[t]=[hr.utc(-40,1,1),hr.utc(2017,1,1)].map((t=>this.extract(t,e,"era")))),this.eraCache[t]}))}extract(t,e,i){const n=this.dtFormatter(t,e).formatToParts().find((t=>t.type.toLowerCase()===i));return n?n.value:null}numberFormatter(t={}){return new hn(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,e={}){return new dn(t,this.intl,e)}relFormatter(t={}){return new un(this.intl,this.isEnglish(),t)}listFormatter(t={}){return function(t,e={}){const i=JSON.stringify([t,e]);let n=nn[i];return n||(n=new Intl.ListFormat(t,e),nn[i]=n),n}(this.intl,t)}isEnglish(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}}function mn(...t){const e=t.reduce(((t,e)=>t+e.source),"");return RegExp(`^${e}$`)}function fn(...t){return e=>t.reduce((([t,i,n],o)=>{const[r,s,a]=o(e,n);return[{...t,...r},s||i,a]}),[{},null,1]).slice(0,2)}function gn(t,...e){if(null==t)return[null,null];for(const[i,n]of e){const e=i.exec(t);if(e)return n(e)}return[null,null]}function vn(...t){return(e,i)=>{const n={};let o;for(o=0;o<t.length;o++)n[t[o]]=oi(e[i+o]);return[n,null,i+o]}}const yn=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,bn=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,_n=RegExp(`${bn.source}${`(?:${yn.source}?(?:\\[(${_i.source})\\])?)?`}`),xn=RegExp(`(?:T${_n.source})?`),wn=vn("weekYear","weekNumber","weekDay"),kn=vn("year","ordinal"),Cn=RegExp(`${bn.source} ?(?:${yn.source}|(${_i.source}))?`),Sn=RegExp(`(?: ${Cn.source})?`);function En(t,e,i){const n=t[e];return Ke(n)?i:oi(n)}function Tn(t,e){return[{hours:En(t,e,0),minutes:En(t,e+1,0),seconds:En(t,e+2,0),milliseconds:si(t[e+3])},null,e+4]}function Mn(t,e){const i=!t[e]&&!t[e+1],n=fi(t[e+1],t[e+2]);return[{},i?null:Vi.instance(n),e+3]}function $n(t,e){return[{},t[e]?Hi.create(t[e]):null,e+1]}const Dn=RegExp(`^T?${bn.source}$`),An=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function Ln(t){const[e,i,n,o,r,s,a,l,c]=t,h="-"===e[0],d=l&&"-"===l[0],u=(t,e=!1)=>void 0!==t&&(e||t&&h)?-t:t;return[{years:u(ri(i)),months:u(ri(n)),weeks:u(ri(o)),days:u(ri(r)),hours:u(ri(s)),minutes:u(ri(a)),seconds:u(ri(l),"-0"===l),milliseconds:u(si(c),d)}]}const On={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Pn(t,e,i,n,o,r,s){const a={year:2===e.length?pi(oi(e)):oi(e),month:wi.indexOf(i)+1,day:oi(n),hour:oi(o),minute:oi(r)};return s&&(a.second=oi(s)),t&&(a.weekday=t.length>3?Si.indexOf(t)+1:Ei.indexOf(t)+1),a}const In=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function zn(t){const[,e,i,n,o,r,s,a,l,c,h,d]=t,u=Pn(e,o,n,i,r,s,a);let p;return p=l?On[l]:c?0:fi(h,d),[u,new Vi(p)]}const Nn=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Rn=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,Bn=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Fn(t){const[,e,i,n,o,r,s,a]=t;return[Pn(e,o,n,i,r,s,a),Vi.utcInstance]}function qn(t){const[,e,i,n,o,r,s,a]=t;return[Pn(e,a,i,n,o,r,s),Vi.utcInstance]}const jn=mn(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,xn),Zn=mn(/(\d{4})-?W(\d\d)(?:-?(\d))?/,xn),Hn=mn(/(\d{4})-?(\d{3})/,xn),Un=mn(_n),Vn=fn((function(t,e){return[{year:En(t,e),month:En(t,e+1,1),day:En(t,e+2,1)},null,e+3]}),Tn,Mn,$n),Wn=fn(wn,Tn,Mn,$n),Gn=fn(kn,Tn,Mn,$n),Yn=fn(Tn,Mn,$n);const Kn=fn(Tn);const Jn=mn(/(\d{4})-(\d\d)-(\d\d)/,Sn),Xn=mn(Cn),Qn=fn(Tn,Mn,$n);const to={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},eo={years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6},...to},io={years:{quarters:4,months:12,weeks:52.1775,days:365.2425,hours:8765.82,minutes:525949.2,seconds:525949.2*60,milliseconds:525949.2*60*1e3},quarters:{months:3,weeks:13.044375,days:91.310625,hours:2191.455,minutes:131487.3,seconds:525949.2*60/4,milliseconds:7889237999.999999},months:{weeks:30.436875/7,days:30.436875,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3},...to},no=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],oo=no.slice(0).reverse();function ro(t,e,i=!1){const n={values:i?e.values:{...t.values,...e.values||{}},loc:t.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||t.conversionAccuracy};return new ao(n)}function so(t,e,i,n,o){const r=t[o][i],s=e[i]/r,a=!(Math.sign(s)===Math.sign(n[o]))&&0!==n[o]&&Math.abs(s)<=1?function(t){return t<0?Math.floor(t):Math.ceil(t)}(s):Math.trunc(s);n[o]+=a,e[i]-=a*r}class ao{constructor(t){const e="longterm"===t.conversionAccuracy||!1;this.values=t.values,this.loc=t.loc||pn.create(),this.conversionAccuracy=e?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=e?io:eo,this.isLuxonDuration=!0}static fromMillis(t,e){return ao.fromObject({milliseconds:t},e)}static fromObject(t,e={}){if(null==t||"object"!=typeof t)throw new ke("Duration.fromObject: argument expected to be an object, got "+(null===t?"null":typeof t));return new ao({values:vi(t,ao.normalizeUnit),loc:pn.fromObject(e),conversionAccuracy:e.conversionAccuracy})}static fromDurationLike(t){if(Je(t))return ao.fromMillis(t);if(ao.isDuration(t))return t;if("object"==typeof t)return ao.fromObject(t);throw new ke(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,e){const[i]=function(t){return gn(t,[An,Ln])}(t);return i?ao.fromObject(i,e):ao.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,e){const[i]=function(t){return gn(t,[Dn,Kn])}(t);return i?ao.fromObject(i,e):ao.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,e=null){if(!t)throw new ke("need to specify a reason the Duration is invalid");const i=t instanceof Ni?t:new Ni(t,e);if(en.throwOnInvalid)throw new _e(i);return new ao({invalid:i})}static normalizeUnit(t){const e={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t?t.toLowerCase():t];if(!e)throw new we(t);return e}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,e={}){const i={...e,floor:!1!==e.round&&!1!==e.floor};return this.isValid?zi.create(this.loc,i).formatDurationFromString(this,t):"Invalid Duration"}toHuman(t={}){const e=no.map((e=>{const i=this.values[e];return Ke(i)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:e.slice(0,-1)}).format(i)})).filter((t=>t));return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(e)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return 0!==this.years&&(t+=this.years+"Y"),0===this.months&&0===this.quarters||(t+=this.months+3*this.quarters+"M"),0!==this.weeks&&(t+=this.weeks+"W"),0!==this.days&&(t+=this.days+"D"),0===this.hours&&0===this.minutes&&0===this.seconds&&0===this.milliseconds||(t+="T"),0!==this.hours&&(t+=this.hours+"H"),0!==this.minutes&&(t+=this.minutes+"M"),0===this.seconds&&0===this.milliseconds||(t+=ai(this.seconds+this.milliseconds/1e3,3)+"S"),"P"===t&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;const e=this.toMillis();if(e<0||e>=864e5)return null;t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t};const i=this.shiftTo("hours","minutes","seconds","milliseconds");let n="basic"===t.format?"hhmm":"hh:mm";t.suppressSeconds&&0===i.seconds&&0===i.milliseconds||(n+="basic"===t.format?"ss":":ss",t.suppressMilliseconds&&0===i.milliseconds||(n+=".SSS"));let o=i.toFormat(n);return t.includePrefix&&(o="T"+o),o}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.as("milliseconds")}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const e=ao.fromDurationLike(t),i={};for(const t of no)(ei(e.values,t)||ei(this.values,t))&&(i[t]=e.get(t)+this.get(t));return ro(this,{values:i},!0)}minus(t){if(!this.isValid)return this;const e=ao.fromDurationLike(t);return this.plus(e.negate())}mapUnits(t){if(!this.isValid)return this;const e={};for(const i of Object.keys(this.values))e[i]=gi(t(this.values[i],i));return ro(this,{values:e},!0)}get(t){return this[ao.normalizeUnit(t)]}set(t){if(!this.isValid)return this;return ro(this,{values:{...this.values,...vi(t,ao.normalizeUnit)}})}reconfigure({locale:t,numberingSystem:e,conversionAccuracy:i}={}){const n={loc:this.loc.clone({locale:t,numberingSystem:e})};return i&&(n.conversionAccuracy=i),ro(this,n)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return function(t,e){oo.reduce(((i,n)=>Ke(e[n])?i:(i&&so(t,e,i,e,n),n)),null)}(this.matrix,t),ro(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(0===t.length)return this;t=t.map((t=>ao.normalizeUnit(t)));const e={},i={},n=this.toObject();let o;for(const r of no)if(t.indexOf(r)>=0){o=r;let t=0;for(const e in i)t+=this.matrix[e][r]*i[e],i[e]=0;Je(n[r])&&(t+=n[r]);const s=Math.trunc(t);e[r]=s,i[r]=(1e3*t-1e3*s)/1e3;for(const t in n)no.indexOf(t)>no.indexOf(r)&&so(this.matrix,n,t,e,r)}else Je(n[r])&&(i[r]=n[r]);for(const t in i)0!==i[t]&&(e[o]+=t===o?i[t]:i[t]/this.matrix[o][t]);return ro(this,{values:e},!0).normalize()}negate(){if(!this.isValid)return this;const t={};for(const e of Object.keys(this.values))t[e]=0===this.values[e]?0:-this.values[e];return ro(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid)return!1;if(!this.loc.equals(t.loc))return!1;for(const n of no)if(e=this.values[n],i=t.values[n],!(void 0===e||0===e?void 0===i||0===i:e===i))return!1;var e,i;return!0}}const lo="Invalid Interval";class co{constructor(t){this.s=t.start,this.e=t.end,this.invalid=t.invalid||null,this.isLuxonInterval=!0}static invalid(t,e=null){if(!t)throw new ke("need to specify a reason the Interval is invalid");const i=t instanceof Ni?t:new Ni(t,e);if(en.throwOnInvalid)throw new be(i);return new co({invalid:i})}static fromDateTimes(t,e){const i=dr(t),n=dr(e),o=function(t,e){return t&&t.isValid?e&&e.isValid?e<t?co.invalid("end before start",`The end of an interval must be after its start, but you had start=${t.toISO()} and end=${e.toISO()}`):null:co.invalid("missing or invalid end"):co.invalid("missing or invalid start")}(i,n);return null==o?new co({start:i,end:n}):o}static after(t,e){const i=ao.fromDurationLike(e),n=dr(t);return co.fromDateTimes(n,n.plus(i))}static before(t,e){const i=ao.fromDurationLike(e),n=dr(t);return co.fromDateTimes(n.minus(i),n)}static fromISO(t,e){const[i,n]=(t||"").split("/",2);if(i&&n){let t,o,r,s;try{t=hr.fromISO(i,e),o=t.isValid}catch(n){o=!1}try{r=hr.fromISO(n,e),s=r.isValid}catch(n){s=!1}if(o&&s)return co.fromDateTimes(t,r);if(o){const i=ao.fromISO(n,e);if(i.isValid)return co.after(t,i)}else if(s){const t=ao.fromISO(i,e);if(t.isValid)return co.before(r,t)}}return co.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(t){return t&&t.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return null===this.invalidReason}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(t="milliseconds"){return this.isValid?this.toDuration(t).get(t):NaN}count(t="milliseconds"){if(!this.isValid)return NaN;const e=this.start.startOf(t),i=this.end.startOf(t);return Math.floor(i.diff(e,t).get(t))+1}hasSame(t){return!!this.isValid&&(this.isEmpty()||this.e.minus(1).hasSame(this.s,t))}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(t){return!!this.isValid&&this.s>t}isBefore(t){return!!this.isValid&&this.e<=t}contains(t){return!!this.isValid&&(this.s<=t&&this.e>t)}set({start:t,end:e}={}){return this.isValid?co.fromDateTimes(t||this.s,e||this.e):this}splitAt(...t){if(!this.isValid)return[];const e=t.map(dr).filter((t=>this.contains(t))).sort(),i=[];let{s:n}=this,o=0;for(;n<this.e;){const t=e[o]||this.e,r=+t>+this.e?this.e:t;i.push(co.fromDateTimes(n,r)),n=r,o+=1}return i}splitBy(t){const e=ao.fromDurationLike(t);if(!this.isValid||!e.isValid||0===e.as("milliseconds"))return[];let i,{s:n}=this,o=1;const r=[];for(;n<this.e;){const t=this.start.plus(e.mapUnits((t=>t*o)));i=+t>+this.e?this.e:t,r.push(co.fromDateTimes(n,i)),n=i,o+=1}return r}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s<t.e}abutsStart(t){return!!this.isValid&&+this.e==+t.s}abutsEnd(t){return!!this.isValid&&+t.e==+this.s}engulfs(t){return!!this.isValid&&(this.s<=t.s&&this.e>=t.e)}equals(t){return!(!this.isValid||!t.isValid)&&(this.s.equals(t.s)&&this.e.equals(t.e))}intersection(t){if(!this.isValid)return this;const e=this.s>t.s?this.s:t.s,i=this.e<t.e?this.e:t.e;return e>=i?null:co.fromDateTimes(e,i)}union(t){if(!this.isValid)return this;const e=this.s<t.s?this.s:t.s,i=this.e>t.e?this.e:t.e;return co.fromDateTimes(e,i)}static merge(t){const[e,i]=t.sort(((t,e)=>t.s-e.s)).reduce((([t,e],i)=>e?e.overlaps(i)||e.abutsStart(i)?[t,e.union(i)]:[t.concat([e]),i]:[t,i]),[[],null]);return i&&e.push(i),e}static xor(t){let e=null,i=0;const n=[],o=t.map((t=>[{time:t.s,type:"s"},{time:t.e,type:"e"}])),r=Array.prototype.concat(...o).sort(((t,e)=>t.time-e.time));for(const t of r)i+="s"===t.type?1:-1,1===i?e=t.time:(e&&+e!=+t.time&&n.push(co.fromDateTimes(e,t.time)),e=null);return co.merge(n)}difference(...t){return co.xor([this].concat(t)).map((t=>this.intersection(t))).filter((t=>t&&!t.isEmpty()))}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:lo}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:lo}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:lo}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:lo}toFormat(t,{separator:e=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${e}${this.e.toFormat(t)}`:lo}toDuration(t,e){return this.isValid?this.e.diff(this.s,t,e):ao.invalid(this.invalidReason)}mapEndpoints(t){return co.fromDateTimes(t(this.s),t(this.e))}}class ho{static hasDST(t=en.defaultZone){const e=hr.now().setZone(t).set({month:12});return!t.isUniversal&&e.offset!==e.set({month:6}).offset}static isValidIANAZone(t){return Hi.isValidZone(t)}static normalizeZone(t){return Gi(t,en.defaultZone)}static months(t="long",{locale:e=null,numberingSystem:i=null,locObj:n=null,outputCalendar:o="gregory"}={}){return(n||pn.create(e,i,o)).months(t)}static monthsFormat(t="long",{locale:e=null,numberingSystem:i=null,locObj:n=null,outputCalendar:o="gregory"}={}){return(n||pn.create(e,i,o)).months(t,!0)}static weekdays(t="long",{locale:e=null,numberingSystem:i=null,locObj:n=null}={}){return(n||pn.create(e,i,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:e=null,numberingSystem:i=null,locObj:n=null}={}){return(n||pn.create(e,i,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return pn.create(t).meridiems()}static eras(t="short",{locale:e=null}={}){return pn.create(e,null,"gregory").eras(t)}static features(){return{relative:Qe()}}}function uo(t,e){const i=t=>t.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),n=i(e)-i(t);return Math.floor(ao.fromMillis(n).as("days"))}function po(t,e,i,n){let[o,r,s,a]=function(t,e,i){const n=[["years",(t,e)=>e.year-t.year],["quarters",(t,e)=>e.quarter-t.quarter],["months",(t,e)=>e.month-t.month+12*(e.year-t.year)],["weeks",(t,e)=>{const i=uo(t,e);return(i-i%7)/7}],["days",uo]],o={};let r,s;for(const[a,l]of n)if(i.indexOf(a)>=0){r=a;let i=l(t,e);s=t.plus({[a]:i}),s>e?(t=t.plus({[a]:i-1}),i-=1):t=s,o[a]=i}return[t,o,s,r]}(t,e,i);const l=e-o,c=i.filter((t=>["hours","minutes","seconds","milliseconds"].indexOf(t)>=0));0===c.length&&(s<e&&(s=o.plus({[a]:1})),s!==o&&(r[a]=(r[a]||0)+l/(s-o)));const h=ao.fromObject(r,n);return c.length>0?ao.fromMillis(l,n).shiftTo(...c).plus(h):h}const mo={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},fo={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},go=mo.hanidec.replace(/[\[|\]]/g,"").split("");function vo({numberingSystem:t},e=""){return new RegExp(`${mo[t||"latn"]}${e}`)}function yo(t,e=(t=>t)){return{regex:t,deser:([t])=>e(function(t){let e=parseInt(t,10);if(isNaN(e)){e="";for(let i=0;i<t.length;i++){const n=t.charCodeAt(i);if(-1!==t[i].search(mo.hanidec))e+=go.indexOf(t[i]);else for(const t in fo){const[i,o]=fo[t];n>=i&&n<=o&&(e+=n-i)}}return parseInt(e,10)}return e}(t))}}const bo=`[ ${String.fromCharCode(160)}]`,_o=new RegExp(bo,"g");function xo(t){return t.replace(/\./g,"\\.?").replace(_o,bo)}function wo(t){return t.replace(/\./g,"").replace(_o," ").toLowerCase()}function ko(t,e){return null===t?null:{regex:RegExp(t.map(xo).join("|")),deser:([i])=>t.findIndex((t=>wo(i)===wo(t)))+e}}function Co(t,e){return{regex:t,deser:([,t,e])=>fi(t,e),groups:e}}function So(t){return{regex:t,deser:([t])=>t}}const Eo={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"}};let To=null;function Mo(t,e){if(t.literal)return t;const i=zi.macroTokenToFormatOpts(t.val);if(!i)return t;const n=zi.create(e,i).formatDateTimeParts((To||(To=hr.fromMillis(1555555555555)),To)).map((t=>function(t,e,i){const{type:n,value:o}=t;if("literal"===n)return{literal:!0,val:o};const r=i[n];let s=Eo[n];return"object"==typeof s&&(s=s[r]),s?{literal:!1,val:s}:void 0}(t,0,i)));return n.includes(void 0)?t:n}function $o(t,e,i){const n=function(t,e){return Array.prototype.concat(...t.map((t=>Mo(t,e))))}(zi.parseFormat(i),t),o=n.map((e=>function(t,e){const i=vo(e),n=vo(e,"{2}"),o=vo(e,"{3}"),r=vo(e,"{4}"),s=vo(e,"{6}"),a=vo(e,"{1,2}"),l=vo(e,"{1,3}"),c=vo(e,"{1,6}"),h=vo(e,"{1,9}"),d=vo(e,"{2,4}"),u=vo(e,"{4,6}"),p=t=>{return{regex:RegExp((e=t.val,e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"))),deser:([t])=>t,literal:!0};var e},m=(m=>{if(t.literal)return p(m);switch(m.val){case"G":return ko(e.eras("short",!1),0);case"GG":return ko(e.eras("long",!1),0);case"y":return yo(c);case"yy":case"kk":return yo(d,pi);case"yyyy":case"kkkk":return yo(r);case"yyyyy":return yo(u);case"yyyyyy":return yo(s);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return yo(a);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return yo(n);case"MMM":return ko(e.months("short",!0,!1),1);case"MMMM":return ko(e.months("long",!0,!1),1);case"LLL":return ko(e.months("short",!1,!1),1);case"LLLL":return ko(e.months("long",!1,!1),1);case"o":case"S":return yo(l);case"ooo":case"SSS":return yo(o);case"u":return So(h);case"uu":return So(a);case"uuu":case"E":case"c":return yo(i);case"a":return ko(e.meridiems(),0);case"EEE":return ko(e.weekdays("short",!1,!1),1);case"EEEE":return ko(e.weekdays("long",!1,!1),1);case"ccc":return ko(e.weekdays("short",!0,!1),1);case"cccc":return ko(e.weekdays("long",!0,!1),1);case"Z":case"ZZ":return Co(new RegExp(`([+-]${a.source})(?::(${n.source}))?`),2);case"ZZZ":return Co(new RegExp(`([+-]${a.source})(${n.source})?`),2);case"z":return So(/[a-z_+-/]{1,256}?/i);default:return p(m)}})(t)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"};return m.token=t,m}(e,t))),r=o.find((t=>t.invalidReason));if(r)return{input:e,tokens:n,invalidReason:r.invalidReason};{const[t,i]=function(t){const e=t.map((t=>t.regex)).reduce(((t,e)=>`${t}(${e.source})`),"");return[`^${e}$`,t]}(o),r=RegExp(t,"i"),[s,a]=function(t,e,i){const n=t.match(e);if(n){const t={};let e=1;for(const o in i)if(ei(i,o)){const r=i[o],s=r.groups?r.groups+1:1;!r.literal&&r.token&&(t[r.token.val[0]]=r.deser(n.slice(e,e+s))),e+=s}return[n,t]}return[n,{}]}(e,r,i),[l,c,h]=a?function(t){let e,i=null;Ke(t.z)||(i=Hi.create(t.z)),Ke(t.Z)||(i||(i=new Vi(t.Z)),e=t.Z),Ke(t.q)||(t.M=3*(t.q-1)+1),Ke(t.h)||(t.h<12&&1===t.a?t.h+=12:12===t.h&&0===t.a&&(t.h=0)),0===t.G&&t.y&&(t.y=-t.y),Ke(t.u)||(t.S=si(t.u));const n=Object.keys(t).reduce(((e,i)=>{const n=(t=>{switch(t){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}})(i);return n&&(e[n]=t[i]),e}),{});return[n,i,e]}(a):[null,null,void 0];if(ei(a,"a")&&ei(a,"H"))throw new xe("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:n,regex:r,rawMatches:s,matches:a,result:l,zone:c,specificOffset:h}}}const Do=[0,31,59,90,120,151,181,212,243,273,304,334],Ao=[0,31,60,91,121,152,182,213,244,274,305,335];function Lo(t,e){return new Ni("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${t}, which is invalid`)}function Oo(t,e,i){const n=new Date(Date.UTC(t,e-1,i));t<100&&t>=0&&n.setUTCFullYear(n.getUTCFullYear()-1900);const o=n.getUTCDay();return 0===o?7:o}function Po(t,e,i){return i+(li(t)?Ao:Do)[e-1]}function Io(t,e){const i=li(t)?Ao:Do,n=i.findIndex((t=>t<e));return{month:n+1,day:e-i[n]}}function zo(t){const{year:e,month:i,day:n}=t,o=Po(e,i,n),r=Oo(e,i,n);let s,a=Math.floor((o-r+10)/7);return a<1?(s=e-1,a=ui(s)):a>ui(e)?(s=e+1,a=1):s=e,{weekYear:s,weekNumber:a,weekday:r,...bi(t)}}function No(t){const{weekYear:e,weekNumber:i,weekday:n}=t,o=Oo(e,1,4),r=ci(e);let s,a=7*i+n-o-3;a<1?(s=e-1,a+=ci(s)):a>r?(s=e+1,a-=ci(e)):s=e;const{month:l,day:c}=Io(s,a);return{year:s,month:l,day:c,...bi(t)}}function Ro(t){const{year:e,month:i,day:n}=t;return{year:e,ordinal:Po(e,i,n),...bi(t)}}function Bo(t){const{year:e,ordinal:i}=t,{month:n,day:o}=Io(e,i);return{year:e,month:n,day:o,...bi(t)}}function Fo(t){const e=Xe(t.year),i=ii(t.month,1,12),n=ii(t.day,1,hi(t.year,t.month));return e?i?!n&&Lo("day",t.day):Lo("month",t.month):Lo("year",t.year)}function qo(t){const{hour:e,minute:i,second:n,millisecond:o}=t,r=ii(e,0,23)||24===e&&0===i&&0===n&&0===o,s=ii(i,0,59),a=ii(n,0,59),l=ii(o,0,999);return r?s?a?!l&&Lo("millisecond",o):Lo("second",n):Lo("minute",i):Lo("hour",e)}const jo="Invalid DateTime";function Zo(t){return new Ni("unsupported zone",`the zone "${t.name}" is not supported`)}function Ho(t){return null===t.weekData&&(t.weekData=zo(t.c)),t.weekData}function Uo(t,e){const i={ts:t.ts,zone:t.zone,c:t.c,o:t.o,loc:t.loc,invalid:t.invalid};return new hr({...i,...e,old:i})}function Vo(t,e,i){let n=t-60*e*1e3;const o=i.offset(n);if(e===o)return[n,e];n-=60*(o-e)*1e3;const r=i.offset(n);return o===r?[n,o]:[t-60*Math.min(o,r)*1e3,Math.max(o,r)]}function Wo(t,e){const i=new Date(t+=60*e*1e3);return{year:i.getUTCFullYear(),month:i.getUTCMonth()+1,day:i.getUTCDate(),hour:i.getUTCHours(),minute:i.getUTCMinutes(),second:i.getUTCSeconds(),millisecond:i.getUTCMilliseconds()}}function Go(t,e,i){return Vo(di(t),e,i)}function Yo(t,e){const i=t.o,n=t.c.year+Math.trunc(e.years),o=t.c.month+Math.trunc(e.months)+3*Math.trunc(e.quarters),r={...t.c,year:n,month:o,day:Math.min(t.c.day,hi(n,o))+Math.trunc(e.days)+7*Math.trunc(e.weeks)},s=ao.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),a=di(r);let[l,c]=Vo(a,i,t.zone);return 0!==s&&(l+=s,c=t.zone.offset(l)),{ts:l,o:c}}function Ko(t,e,i,n,o,r){const{setZone:s,zone:a}=i;if(t&&0!==Object.keys(t).length){const n=e||a,o=hr.fromObject(t,{...i,zone:n,specificOffset:r});return s?o:o.setZone(a)}return hr.invalid(new Ni("unparsable",`the input "${o}" can't be parsed as ${n}`))}function Jo(t,e,i=!0){return t.isValid?zi.create(pn.create("en-US"),{allowZ:i,forceSimple:!0}).formatDateTimeFromString(t,e):null}function Xo(t,e){const i=t.c.year>9999||t.c.year<0;let n="";return i&&t.c.year>=0&&(n+="+"),n+=ni(t.c.year,i?6:4),e?(n+="-",n+=ni(t.c.month),n+="-",n+=ni(t.c.day)):(n+=ni(t.c.month),n+=ni(t.c.day)),n}function Qo(t,e,i,n,o,r){let s=ni(t.c.hour);return e?(s+=":",s+=ni(t.c.minute),0===t.c.second&&i||(s+=":")):s+=ni(t.c.minute),0===t.c.second&&i||(s+=ni(t.c.second),0===t.c.millisecond&&n||(s+=".",s+=ni(t.c.millisecond,3))),o&&(t.isOffsetFixed&&0===t.offset&&!r?s+="Z":t.o<0?(s+="-",s+=ni(Math.trunc(-t.o/60)),s+=":",s+=ni(Math.trunc(-t.o%60))):(s+="+",s+=ni(Math.trunc(t.o/60)),s+=":",s+=ni(Math.trunc(t.o%60)))),r&&(s+="["+t.zone.ianaName+"]"),s}const tr={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},er={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},ir={ordinal:1,hour:0,minute:0,second:0,millisecond:0},nr=["year","month","day","hour","minute","second","millisecond"],or=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],rr=["year","ordinal","hour","minute","second","millisecond"];function sr(t){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[t.toLowerCase()];if(!e)throw new we(t);return e}function ar(t,e){const i=Gi(e.zone,en.defaultZone),n=pn.fromObject(e),o=en.now();let r,s;if(Ke(t.year))r=o;else{for(const e of nr)Ke(t[e])&&(t[e]=tr[e]);const e=Fo(t)||qo(t);if(e)return hr.invalid(e);const n=i.offset(o);[r,s]=Go(t,n,i)}return new hr({ts:r,zone:i,loc:n,o:s})}function lr(t,e,i){const n=!!Ke(i.round)||i.round,o=(t,o)=>{t=ai(t,n||i.calendary?0:2,!0);return e.loc.clone(i).relFormatter(i).format(t,o)},r=n=>i.calendary?e.hasSame(t,n)?0:e.startOf(n).diff(t.startOf(n),n).get(n):e.diff(t,n).get(n);if(i.unit)return o(r(i.unit),i.unit);for(const t of i.units){const e=r(t);if(Math.abs(e)>=1)return o(e,t)}return o(t>e?-0:0,i.units[i.units.length-1])}function cr(t){let e,i={};return t.length>0&&"object"==typeof t[t.length-1]?(i=t[t.length-1],e=Array.from(t).slice(0,t.length-1)):e=Array.from(t),[i,e]}class hr{constructor(t){const e=t.zone||en.defaultZone;let i=t.invalid||(Number.isNaN(t.ts)?new Ni("invalid input"):null)||(e.isValid?null:Zo(e));this.ts=Ke(t.ts)?en.now():t.ts;let n=null,o=null;if(!i){if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(e))[n,o]=[t.old.c,t.old.o];else{const t=e.offset(this.ts);n=Wo(this.ts,t),i=Number.isNaN(n.year)?new Ni("invalid input"):null,n=i?null:n,o=i?null:t}}this._zone=e,this.loc=t.loc||pn.create(),this.invalid=i,this.weekData=null,this.c=n,this.o=o,this.isLuxonDateTime=!0}static now(){return new hr({})}static local(){const[t,e]=cr(arguments),[i,n,o,r,s,a,l]=e;return ar({year:i,month:n,day:o,hour:r,minute:s,second:a,millisecond:l},t)}static utc(){const[t,e]=cr(arguments),[i,n,o,r,s,a,l]=e;return t.zone=Vi.utcInstance,ar({year:i,month:n,day:o,hour:r,minute:s,second:a,millisecond:l},t)}static fromJSDate(t,e={}){const i=function(t){return"[object Date]"===Object.prototype.toString.call(t)}(t)?t.valueOf():NaN;if(Number.isNaN(i))return hr.invalid("invalid input");const n=Gi(e.zone,en.defaultZone);return n.isValid?new hr({ts:i,zone:n,loc:pn.fromObject(e)}):hr.invalid(Zo(n))}static fromMillis(t,e={}){if(Je(t))return t<-864e13||t>864e13?hr.invalid("Timestamp out of range"):new hr({ts:t,zone:Gi(e.zone,en.defaultZone),loc:pn.fromObject(e)});throw new ke(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,e={}){if(Je(t))return new hr({ts:1e3*t,zone:Gi(e.zone,en.defaultZone),loc:pn.fromObject(e)});throw new ke("fromSeconds requires a numerical input")}static fromObject(t,e={}){t=t||{};const i=Gi(e.zone,en.defaultZone);if(!i.isValid)return hr.invalid(Zo(i));const n=en.now(),o=Ke(e.specificOffset)?i.offset(n):e.specificOffset,r=vi(t,sr),s=!Ke(r.ordinal),a=!Ke(r.year),l=!Ke(r.month)||!Ke(r.day),c=a||l,h=r.weekYear||r.weekNumber,d=pn.fromObject(e);if((c||s)&&h)throw new xe("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&s)throw new xe("Can't mix ordinal dates with month/day");const u=h||r.weekday&&!c;let p,m,f=Wo(n,o);u?(p=or,m=er,f=zo(f)):s?(p=rr,m=ir,f=Ro(f)):(p=nr,m=tr);let g=!1;for(const t of p){Ke(r[t])?r[t]=g?m[t]:f[t]:g=!0}const v=u?function(t){const e=Xe(t.weekYear),i=ii(t.weekNumber,1,ui(t.weekYear)),n=ii(t.weekday,1,7);return e?i?!n&&Lo("weekday",t.weekday):Lo("week",t.week):Lo("weekYear",t.weekYear)}(r):s?function(t){const e=Xe(t.year),i=ii(t.ordinal,1,ci(t.year));return e?!i&&Lo("ordinal",t.ordinal):Lo("year",t.year)}(r):Fo(r),y=v||qo(r);if(y)return hr.invalid(y);const b=u?No(r):s?Bo(r):r,[_,x]=Go(b,o,i),w=new hr({ts:_,zone:i,o:x,loc:d});return r.weekday&&c&&t.weekday!==w.weekday?hr.invalid("mismatched weekday",`you can't specify both a weekday of ${r.weekday} and a date of ${w.toISO()}`):w}static fromISO(t,e={}){const[i,n]=function(t){return gn(t,[jn,Vn],[Zn,Wn],[Hn,Gn],[Un,Yn])}(t);return Ko(i,n,e,"ISO 8601",t)}static fromRFC2822(t,e={}){const[i,n]=function(t){return gn(function(t){return t.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(t),[In,zn])}(t);return Ko(i,n,e,"RFC 2822",t)}static fromHTTP(t,e={}){const[i,n]=function(t){return gn(t,[Nn,Fn],[Rn,Fn],[Bn,qn])}(t);return Ko(i,n,e,"HTTP",e)}static fromFormat(t,e,i={}){if(Ke(t)||Ke(e))throw new ke("fromFormat requires an input string and a format");const{locale:n=null,numberingSystem:o=null}=i,r=pn.fromOpts({locale:n,numberingSystem:o,defaultToEN:!0}),[s,a,l,c]=function(t,e,i){const{result:n,zone:o,specificOffset:r,invalidReason:s}=$o(t,e,i);return[n,o,r,s]}(r,t,e);return c?hr.invalid(c):Ko(s,a,i,`format ${e}`,t,l)}static fromString(t,e,i={}){return hr.fromFormat(t,e,i)}static fromSQL(t,e={}){const[i,n]=function(t){return gn(t,[Jn,Vn],[Xn,Qn])}(t);return Ko(i,n,e,"SQL",t)}static invalid(t,e=null){if(!t)throw new ke("need to specify a reason the DateTime is invalid");const i=t instanceof Ni?t:new Ni(t,e);if(en.throwOnInvalid)throw new ye(i);return new hr({invalid:i})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}get(t){return this[t]}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?Ho(this).weekYear:NaN}get weekNumber(){return this.isValid?Ho(this).weekNumber:NaN}get weekday(){return this.isValid?Ho(this).weekday:NaN}get ordinal(){return this.isValid?Ro(this.c).ordinal:NaN}get monthShort(){return this.isValid?ho.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?ho.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?ho.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?ho.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return!this.isOffsetFixed&&(this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset)}get isInLeapYear(){return li(this.year)}get daysInMonth(){return hi(this.year,this.month)}get daysInYear(){return this.isValid?ci(this.year):NaN}get weeksInWeekYear(){return this.isValid?ui(this.weekYear):NaN}resolvedLocaleOptions(t={}){const{locale:e,numberingSystem:i,calendar:n}=zi.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:e,numberingSystem:i,outputCalendar:n}}toUTC(t=0,e={}){return this.setZone(Vi.instance(t),e)}toLocal(){return this.setZone(en.defaultZone)}setZone(t,{keepLocalTime:e=!1,keepCalendarTime:i=!1}={}){if((t=Gi(t,en.defaultZone)).equals(this.zone))return this;if(t.isValid){let n=this.ts;if(e||i){const e=t.offset(this.ts),i=this.toObject();[n]=Go(i,e,t)}return Uo(this,{ts:n,zone:t})}return hr.invalid(Zo(t))}reconfigure({locale:t,numberingSystem:e,outputCalendar:i}={}){return Uo(this,{loc:this.loc.clone({locale:t,numberingSystem:e,outputCalendar:i})})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const e=vi(t,sr),i=!Ke(e.weekYear)||!Ke(e.weekNumber)||!Ke(e.weekday),n=!Ke(e.ordinal),o=!Ke(e.year),r=!Ke(e.month)||!Ke(e.day),s=o||r,a=e.weekYear||e.weekNumber;if((s||n)&&a)throw new xe("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(r&&n)throw new xe("Can't mix ordinal dates with month/day");let l;i?l=No({...zo(this.c),...e}):Ke(e.ordinal)?(l={...this.toObject(),...e},Ke(e.day)&&(l.day=Math.min(hi(l.year,l.month),l.day))):l=Bo({...Ro(this.c),...e});const[c,h]=Go(l,this.o,this.zone);return Uo(this,{ts:c,o:h})}plus(t){if(!this.isValid)return this;return Uo(this,Yo(this,ao.fromDurationLike(t)))}minus(t){if(!this.isValid)return this;return Uo(this,Yo(this,ao.fromDurationLike(t).negate()))}startOf(t){if(!this.isValid)return this;const e={},i=ao.normalizeUnit(t);switch(i){case"years":e.month=1;case"quarters":case"months":e.day=1;case"weeks":case"days":e.hour=0;case"hours":e.minute=0;case"minutes":e.second=0;case"seconds":e.millisecond=0}if("weeks"===i&&(e.weekday=1),"quarters"===i){const t=Math.ceil(this.month/3);e.month=3*(t-1)+1}return this.set(e)}endOf(t){return this.isValid?this.plus({[t]:1}).startOf(t).minus(1):this}toFormat(t,e={}){return this.isValid?zi.create(this.loc.redefaultToEN(e)).formatDateTimeFromString(this,t):jo}toLocaleString(t=Me,e={}){return this.isValid?zi.create(this.loc.clone(e),t).formatDateTime(this):jo}toLocaleParts(t={}){return this.isValid?zi.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:e=!1,suppressMilliseconds:i=!1,includeOffset:n=!0,extendedZone:o=!1}={}){if(!this.isValid)return null;const r="extended"===t;let s=Xo(this,r);return s+="T",s+=Qo(this,r,e,i,n,o),s}toISODate({format:t="extended"}={}){return this.isValid?Xo(this,"extended"===t):null}toISOWeekDate(){return Jo(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:e=!1,includeOffset:i=!0,includePrefix:n=!1,extendedZone:o=!1,format:r="extended"}={}){if(!this.isValid)return null;return(n?"T":"")+Qo(this,"extended"===r,e,t,i,o)}toRFC2822(){return Jo(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Jo(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?Xo(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:e=!1,includeOffsetSpace:i=!0}={}){let n="HH:mm:ss.SSS";return(e||t)&&(i&&(n+=" "),e?n+="z":t&&(n+="ZZ")),Jo(this,n,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():jo}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(t={}){if(!this.isValid)return{};const e={...this.c};return t.includeConfig&&(e.outputCalendar=this.outputCalendar,e.numberingSystem=this.loc.numberingSystem,e.locale=this.loc.locale),e}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(t,e="milliseconds",i={}){if(!this.isValid||!t.isValid)return ao.invalid("created by diffing an invalid DateTime");const n={locale:this.locale,numberingSystem:this.numberingSystem,...i},o=(a=e,Array.isArray(a)?a:[a]).map(ao.normalizeUnit),r=t.valueOf()>this.valueOf(),s=po(r?this:t,r?t:this,o,n);var a;return r?s.negate():s}diffNow(t="milliseconds",e={}){return this.diff(hr.now(),t,e)}until(t){return this.isValid?co.fromDateTimes(this,t):this}hasSame(t,e){if(!this.isValid)return!1;const i=t.valueOf(),n=this.setZone(t.zone,{keepLocalTime:!0});return n.startOf(e)<=i&&i<=n.endOf(e)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;const e=t.base||hr.fromObject({},{zone:this.zone}),i=t.padding?this<e?-t.padding:t.padding:0;let n=["years","months","days","hours","minutes","seconds"],o=t.unit;return Array.isArray(t.unit)&&(n=t.unit,o=void 0),lr(e,this.plus(i),{...t,numeric:"always",units:n,unit:o})}toRelativeCalendar(t={}){return this.isValid?lr(t.base||hr.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(hr.isDateTime))throw new ke("min requires all arguments be DateTimes");return ti(t,(t=>t.valueOf()),Math.min)}static max(...t){if(!t.every(hr.isDateTime))throw new ke("max requires all arguments be DateTimes");return ti(t,(t=>t.valueOf()),Math.max)}static fromFormatExplain(t,e,i={}){const{locale:n=null,numberingSystem:o=null}=i;return $o(pn.fromOpts({locale:n,numberingSystem:o,defaultToEN:!0}),t,e)}static fromStringExplain(t,e,i={}){return hr.fromFormatExplain(t,e,i)}static get DATE_SHORT(){return Me}static get DATE_MED(){return $e}static get DATE_MED_WITH_WEEKDAY(){return De}static get DATE_FULL(){return Ae}static get DATE_HUGE(){return Le}static get TIME_SIMPLE(){return Oe}static get TIME_WITH_SECONDS(){return Pe}static get TIME_WITH_SHORT_OFFSET(){return Ie}static get TIME_WITH_LONG_OFFSET(){return ze}static get TIME_24_SIMPLE(){return Ne}static get TIME_24_WITH_SECONDS(){return Re}static get TIME_24_WITH_SHORT_OFFSET(){return Be}static get TIME_24_WITH_LONG_OFFSET(){return Fe}static get DATETIME_SHORT(){return qe}static get DATETIME_SHORT_WITH_SECONDS(){return je}static get DATETIME_MED(){return Ze}static get DATETIME_MED_WITH_SECONDS(){return He}static get DATETIME_MED_WITH_WEEKDAY(){return Ue}static get DATETIME_FULL(){return Ve}static get DATETIME_FULL_WITH_SECONDS(){return We}static get DATETIME_HUGE(){return Ge}static get DATETIME_HUGE_WITH_SECONDS(){return Ye}}function dr(t){if(hr.isDateTime(t))return t;if(t&&t.valueOf&&Je(t.valueOf()))return hr.fromJSDate(t);if(t&&"object"==typeof t)return hr.fromObject(t);throw new ke(`Unknown datetime argument: ${t}, of type ${typeof t}`)}class ur extends tt{constructor(){super(...arguments),this.ttl=6e4,this.max=20,this.keyedAssets={},this.locale=[...navigator.languages],this.fields={},this.groups={},this.languages={},this.pinnedFields=[],this.langService=new fe,this.humanizer=new ge(this.langService),this.pendingResolves={},this.fetching={}}reset(){this.cache=me(this.max,this.ttl);const t=[];this.completionEndpoint&&t.push(Wt(this.completionEndpoint).then((t=>{this.schema=t.json.context,this.fnOptions=t.json.functions}))),this.fieldsEndpoint&&t.push(Xt(this.fieldsEndpoint).then((t=>{this.keyedAssets.fields=[],this.pinnedFields=[],t.forEach((t=>{this.keyedAssets.fields.push(t.key),this.fields[t.key]=t,t.pinned&&this.pinnedFields.push(t)})),this.pinnedFields.sort(((t,e)=>e.priority-t.priority))}))),this.globalsEndpoint&&t.push(Xt(this.globalsEndpoint).then((t=>{this.keyedAssets.globals=t.map((t=>t.key))}))),this.languagesEndpoint&&t.push(Xt(this.languagesEndpoint).then((t=>{this.languages=t.reduce((function(t,e){return t[e.value]=e.name,t}),{})}))),this.groupsEndpoint&&t.push(Xt(this.groupsEndpoint).then((t=>{t.forEach((t=>{this.groups[t.uuid]=t}))}))),this.workspaceEndpoint&&t.push(Wt(this.workspaceEndpoint).then((t=>{this.workspace=t.json;const e=t.headers.get("content-language");e&&(this.locale=[e,...this.locale])}))),this.httpComplete=Promise.all(t)}firstUpdated(){this.reset()}getLanguageCode(){return this.locale.length>0?this.locale[0].split("-")[0]:"en"}getShortDuration(t,e=null,i=!1){const n=hr.fromISO(t),o=e?hr.fromISO(e):hr.now(),r=n.diff(o).valueOf();return i?this.humanizer.humanize(r,{language:this.getLanguageCode(),largest:1,round:!0}):Math.abs(r)<6e4?"just now":this.humanizer.humanize(r,{language:this.getLanguageCode(),largest:1,round:!1})}setKeyedAssets(t,e){this.keyedAssets[t]=e}updated(t){super.updated(t)}getCompletionSchema(){return this.schema}getFunctions(){return this.fnOptions}getKeyedAssets(){return this.keyedAssets}getContactField(t){return this.fields[t]}getPinnedFields(){return this.pinnedFields}getLanguageName(t){return this.languages[t]}isDynamicGroup(t){const e=this.groups[t];return!(!e||!e.query)}getWorkspace(){return this.workspace}formatDate(t){return new Date(t).toLocaleString(this.locale,{year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric"})}postUrl(t,e="",i={},n=null){return Qt(t,e,i,n)}getUrl(t,e){return!(e=e||{}).force&&this.cache.has(t)?new Promise((e=>{e(this.cache.get(t))})):Wt(t,e.controller,e.headers||{}).then((e=>new Promise(((i,n)=>{e.status>=200&&e.status<=300?(this.cache.set(t,e),i(e)):n("Status: "+e.status)}))))}getResults(t,e){e=e||{};const i="results_"+t,n=this.cache.get(i);return!e.force&&n?new Promise((t=>{t(n)})):new Promise((e=>{const n=this.pendingResolves[t]||[];n.push(e),this.pendingResolves[t]=n,n.length<=1&&Kt(t).then((e=>{this.cache.set(i,e);const n=this.pendingResolves[t]||[];for(;n.length>0;){n.pop()(e)}}))}))}updateCache(t,e){this.cache.set(t,e),this.fireCustomEvent(ue.StoreUpdated,{url:t,data:e})}makeRequest(t,e){const i=this.fetching[t],n=(new Date).getTime();if(i&&n-i<500)return;this.fetching[t]=n,e=e||{};const o=this.cache.get(t);o&&!e.force?this.fireCustomEvent(ue.StoreUpdated,{url:t,data:o}):Kt(t).then((i=>{i=e.prepareData?e.prepareData(i):i,this.cache.set(t,i),this.fireCustomEvent(ue.StoreUpdated,{url:t,data:i}),delete this.fetching[t]}))}}t([it({type:Number})],ur.prototype,"ttl",void 0),t([it({type:Number})],ur.prototype,"max",void 0),t([it({type:String,attribute:"completion"})],ur.prototype,"completionEndpoint",void 0),t([it({type:String,attribute:"fields"})],ur.prototype,"fieldsEndpoint",void 0),t([it({type:String,attribute:"groups"})],ur.prototype,"groupsEndpoint",void 0),t([it({type:String,attribute:"globals"})],ur.prototype,"globalsEndpoint",void 0),t([it({type:String,attribute:"languages"})],ur.prototype,"languagesEndpoint",void 0),t([it({type:String,attribute:"workspace"})],ur.prototype,"workspaceEndpoint",void 0),t([it({type:Object,attribute:!1})],ur.prototype,"schema",void 0),t([it({type:Object,attribute:!1})],ur.prototype,"fnOptions",void 0),t([it({type:Object,attribute:!1})],ur.prototype,"keyedAssets",void 0);class pr extends tt{constructor(){super(...arguments),this.marginHorizontal=0,this.marginVertical=7,this.scrollPct=75,this.cursorIndex=-1,this.nameKey="name",this.loading=!1,this.hideShadow=!1,this.getName=function(t){return t[this.nameKey||"name"]},this.renderInputOption=function(){return null},this.scrollHeight=0,this.triggerScroll=!1,this.scrollParent=null,this.setCursor=oe((function(t){t!==this.cursorIndex&&(this.cursorIndex=t)}),50)}static get styles(){return r`
224
+ `}}t([it({type:Boolean})],dt.prototype,"textarea",void 0),t([it({type:String})],dt.prototype,"placeholder",void 0),t([it({type:String})],dt.prototype,"value",void 0),t([it({type:Boolean})],dt.prototype,"password",void 0),t([it({type:Number})],dt.prototype,"maxlength",void 0),t([it({type:Object})],dt.prototype,"inputElement",void 0),t([it({type:Boolean})],dt.prototype,"clearable",void 0),t([it({type:Boolean})],dt.prototype,"gsm",void 0),t([it({type:String})],dt.prototype,"counter",void 0),t([it({type:Boolean})],dt.prototype,"loading",void 0),t([it({type:Boolean})],dt.prototype,"submitOnEnter",void 0),t([it()],dt.prototype,"onBlur",void 0),t([it({type:Boolean})],dt.prototype,"autogrow",void 0);const pt=/(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))/,mt=(t={})=>{const e=(t=>{for(const e of document.cookie.split(";")){const i=e.indexOf("=");let n=e.substr(0,i),o=e.substr(i+1);if(n=n.trim(),o=o.trim(),n===t)return o}return null})("csrftoken"),i=e?{"X-CSRFToken":e}:{};return i["X-Requested-With"]="XMLHttpRequest",Object.keys(t).forEach((e=>{i[e]=t[e]})),i},ft=(t,e=null,i={})=>new Promise(((n,o)=>{const s={method:"GET",headers:mt(i)};e&&(s.signal=e.signal),fetch(t,s).then((t=>{t.text().then((i=>{let o={};try{o=JSON.parse(i)}catch(t){}n({controller:e,body:i,json:o,headers:t.headers,status:t.status})}))})).catch((t=>{o(t)}))})),gt=t=>{const e=[];Object.keys(t).forEach((i=>{t[i]&&e.push(i)}));let i=e.join(" ");return i.trim().length>0&&(i=" "+i),i},vt=(t,e=null)=>new Promise(((i,n)=>{ft(t,e).then((t=>{i({results:t.json.results,next:t.json.next})})).catch((t=>n(t)))})),yt=async t=>{if(!t)return new Promise((t=>t([])));let e=[],i=t;for(;i;){const t=await vt(i);t.results&&(e=e.concat(t.results)),i=t.next}return e},bt=t=>new Promise(((e,i)=>{ft(t).then((t=>{e({assets:t.json.results,next:t.json.next})})).catch((t=>i(t)))})),_t=async t=>{if(!t)return new Promise((t=>t([])));let e=[],i=t;for(;i;){const t=await bt(i);e=e.concat(t.assets),i=t.next}return e},xt=(t,e,i={},n=null)=>{const o=mt(i);n&&(o["Content-Type"]=n);const s={method:"POST",headers:o,body:e};return new Promise(((e,i)=>{fetch(t,s).then((async t=>{t.text().then((i=>{let n={};try{n=JSON.parse(i)}catch(t){}e({body:i,json:n,headers:t.headers,status:t.status})}))})).catch((t=>{i(t)}))}))},wt=(t,e)=>xt(t,JSON.stringify(e),!1,"application/json"),kt=t=>{const e=t.parentNode||t.host;if(e){const t=e instanceof HTMLElement&&window.getComputedStyle(e).overflowY,i=t&&!(t.includes("hidden")||t.includes("visible"));return e?i&&e.scrollHeight>=e.clientHeight?e:kt(e):null}return null};const St=new class{getCurrentDate(){return new Date}},Ct=(t,e={suffix:""})=>{const{compareDate:i,hideRecentText:n,suffix:o}=e,s=i||St.getCurrentDate(),r=Math.floor((s.getTime()-t.getTime())/1e3);if(r<60)return i?r+"s"+o:!n&&o?o:"just now";if(r<3600)return Math.round(r/60)+"m"+o;if(r<=86400)return Math.round(r/3600)+"h"+o;if(r<=2592e3)return Math.round(r/86400)+"d"+o;if(r<15552e3)return Math.round(r/2592e3)+"mth"+o;return t.getDate()+" "+t.toDateString().match(/ [a-zA-Z]*/)[0].replace(" ","")+(t.getFullYear()==s.getFullYear()?"":" "+t.getFullYear())},Tt=(t,e)=>{let i=!0;return function(...n){i&&(i=!1,t.apply(this,n),setTimeout((()=>{i=!0}),e))}},Et=(t,e="and")=>1===t.length?t[0]:2===t.length?"html"===t[0].type?P`${t[0]} ${e} ${t[1]}`:t.join(" "+e+" "):"html"===t[0].type?t.map(((i,n)=>n<t.length-1?P`${i}, `:P`${e} ${i}`)):t.join(", ")+e+t[t.length-1],$t=(t,e,i="and")=>Et(t.map(e),i),Lt=t=>"true"===((t=>{let e=null;if(document.cookie&&""!=document.cookie){const i=document.cookie.split(";");for(let n=0;n<i.length;n++){const o=i[n].trim();if(o.substring(0,t.length+1)==t+"="){e=decodeURIComponent(o.substring(t.length+1));break}}}return e})(t)||"");var At;!function(t){t.MENU_COLLAPSED="menu-collapsed",t.TICKET_SHOW_DETAILS="tickets.show-details"}(At||(At={}));var Ot,Mt,Pt,zt;!function(t){t.DayFirst="day_first",t.MonthFirst="month_first",t.YearFirst="year_first"}(Ot||(Ot={})),function(t){t.CampaignEvent="campaign_event",t.ScheduledBroadcast="scheduled_broadcast",t.ScheduledTrigger="scheduled_trigger"}(Mt||(Mt={})),function(t){t.Open="open",t.Closed="closed"}(Pt||(Pt={})),function(t){t.Loaded="temba-loaded",t.Canceled="temba-canceled",t.CursorChanged="temba-cursor-changed",t.Refreshed="temba-refreshed",t.Selection="temba-selection",t.ButtonClicked="temba-button-clicked",t.DialogHidden="temba-dialog-hidden",t.ScrollThreshold="temba-scroll-threshold",t.ContentChanged="temba-content-changed",t.ContextChanged="temba-context-changed",t.FetchComplete="temba-fetch-complete",t.Submitted="temba-submitted",t.Redirected="temba-redirected",t.NoPath="temba-no-path",t.StoreUpdated="temba-store-updated",t.Ready="temba-ready"}(zt||(zt={}));class It{constructor(t=0,e=0){this.first=null,this.items=Object.create(null),this.last=null,this.max=t,this.size=0,this.ttl=e}has(t){return t in this.items}clear(){return this.first=null,this.items=Object.create(null),this.last=null,this.size=0,this}delete(t){if(this.has(t)){const e=this.items[t];delete this.items[t],this.size--,null!==e.prev&&(e.prev.next=e.next),null!==e.next&&(e.next.prev=e.prev),this.first===e&&(this.first=e.next),this.last===e&&(this.last=e.prev)}return this}evict(t=!1){if(t||this.size>0){const t=this.first;delete this.items[t.key],this.size--,0===this.size?(this.first=null,this.last=null):(this.first=t.next,this.first.prev=null)}return this}get(t){let e;if(this.has(t)){const i=this.items[t];this.ttl>0&&i.expiry<=(new Date).getTime()?this.delete(t):(e=i.value,this.set(t,e,!0))}return e}keys(){return Object.keys(this.items)}set(t,e,i=!1){let n;if(i||this.has(t)){if(n=this.items[t],n.value=e,this.last!==n){const t=this.last,e=n.next,i=n.prev;this.first===n&&(this.first=n.next),n.next=null,n.prev=this.last,t.next=n,null!==i&&(i.next=e),null!==e&&(e.prev=i)}}else this.max>0&&this.size===this.max&&this.evict(!0),n=this.items[t]={expiry:this.ttl>0?(new Date).getTime()+this.ttl:this.ttl,key:t,prev:this.last,next:null,value:e},1==++this.size?this.first=n:this.last.next=n;return this.last=n,this}}function Dt(t=1e3,e=0){if(isNaN(t)||t<0)throw new TypeError("Invalid max value");if(isNaN(e)||e<0)throw new TypeError("Invalid ttl value");return new It(t,e)}var Nt=function(){function t(){var t=this;this.languages={ar:{y:function(t){return 1===t?"سنة":"سنوات"},mo:function(t){return 1===t?"شهر":"أشهر"},w:function(t){return 1===t?"أسبوع":"أسابيع"},d:function(t){return 1===t?"يوم":"أيام"},h:function(t){return 1===t?"ساعة":"ساعات"},m:function(e){return["دقيقة","دقائق"][t.getArabicForm(e)]},s:function(t){return 1===t?"ثانية":"ثواني"},ms:function(t){return 1===t?"جزء من الثانية":"أجزاء من الثانية"},decimal:","},bg:{y:function(e){return["години","година","години"][t.getSlavicForm(e)]},mo:function(e){return["месеца","месец","месеца"][t.getSlavicForm(e)]},w:function(e){return["седмици","седмица","седмици"][t.getSlavicForm(e)]},d:function(e){return["дни","ден","дни"][t.getSlavicForm(e)]},h:function(e){return["часа","час","часа"][t.getSlavicForm(e)]},m:function(e){return["минути","минута","минути"][t.getSlavicForm(e)]},s:function(e){return["секунди","секунда","секунди"][t.getSlavicForm(e)]},ms:function(e){return["милисекунди","милисекунда","милисекунди"][t.getSlavicForm(e)]},decimal:","},ca:{y:function(t){return"any"+(1===t?"":"s")},mo:function(t){return"mes"+(1===t?"":"os")},w:function(t){return"setman"+(1===t?"a":"es")},d:function(t){return"di"+(1===t?"a":"es")},h:function(t){return"hor"+(1===t?"a":"es")},m:function(t){return"minut"+(1===t?"":"s")},s:function(t){return"segon"+(1===t?"":"s")},ms:function(t){return"milisegon"+(1===t?"":"s")},decimal:","},cs:{y:function(e){return["rok","roku","roky","let"][t.getCzechOrSlovakForm(e)]},mo:function(e){return["měsíc","měsíce","měsíce","měsíců"][t.getCzechOrSlovakForm(e)]},w:function(e){return["týden","týdne","týdny","týdnů"][t.getCzechOrSlovakForm(e)]},d:function(e){return["den","dne","dny","dní"][t.getCzechOrSlovakForm(e)]},h:function(e){return["hodina","hodiny","hodiny","hodin"][t.getCzechOrSlovakForm(e)]},m:function(e){return["minuta","minuty","minuty","minut"][t.getCzechOrSlovakForm(e)]},s:function(e){return["sekunda","sekundy","sekundy","sekund"][t.getCzechOrSlovakForm(e)]},ms:function(e){return["milisekunda","milisekundy","milisekundy","milisekund"][t.getCzechOrSlovakForm(e)]},decimal:","},da:{y:function(){return"år"},mo:function(t){return"måned"+(1===t?"":"er")},w:function(t){return"uge"+(1===t?"":"r")},d:function(t){return"dag"+(1===t?"":"e")},h:function(t){return"time"+(1===t?"":"r")},m:function(t){return"minut"+(1===t?"":"ter")},s:function(t){return"sekund"+(1===t?"":"er")},ms:function(t){return"millisekund"+(1===t?"":"er")},decimal:","},de:{y:function(t){return"Jahr"+(1===t?"":"e")},mo:function(t){return"Monat"+(1===t?"":"e")},w:function(t){return"Woche"+(1===t?"":"n")},d:function(t){return"Tag"+(1===t?"":"e")},h:function(t){return"Stunde"+(1===t?"":"n")},m:function(t){return"Minute"+(1===t?"":"n")},s:function(t){return"Sekunde"+(1===t?"":"n")},ms:function(t){return"Millisekunde"+(1===t?"":"n")},decimal:","},el:{y:function(t){return 1===t?"χρόνος":"χρόνια"},mo:function(t){return 1===t?"μήνας":"μήνες"},w:function(t){return 1===t?"εβδομάδα":"εβδομάδες"},d:function(t){return 1===t?"μέρα":"μέρες"},h:function(t){return 1===t?"ώρα":"ώρες"},m:function(t){return 1===t?"λεπτό":"λεπτά"},s:function(t){return 1===t?"δευτερόλεπτο":"δευτερόλεπτα"},ms:function(t){return 1===t?"χιλιοστό του δευτερολέπτου":"χιλιοστά του δευτερολέπτου"},decimal:","},en:{y:function(t){return"year"+(1===t?"":"s")},mo:function(t){return"month"+(1===t?"":"s")},w:function(t){return"week"+(1===t?"":"s")},d:function(t){return"day"+(1===t?"":"s")},h:function(t){return"hour"+(1===t?"":"s")},m:function(t){return"minute"+(1===t?"":"s")},s:function(t){return"second"+(1===t?"":"s")},ms:function(t){return"millisecond"+(1===t?"":"s")},decimal:"."},es:{y:function(t){return"año"+(1===t?"":"s")},mo:function(t){return"mes"+(1===t?"":"es")},w:function(t){return"semana"+(1===t?"":"s")},d:function(t){return"día"+(1===t?"":"s")},h:function(t){return"hora"+(1===t?"":"s")},m:function(t){return"minuto"+(1===t?"":"s")},s:function(t){return"segundo"+(1===t?"":"s")},ms:function(t){return"milisegundo"+(1===t?"":"s")},decimal:","},et:{y:function(t){return"aasta"+(1===t?"":"t")},mo:function(t){return"kuu"+(1===t?"":"d")},w:function(t){return"nädal"+(1===t?"":"at")},d:function(t){return"päev"+(1===t?"":"a")},h:function(t){return"tund"+(1===t?"":"i")},m:function(t){return"minut"+(1===t?"":"it")},s:function(t){return"sekund"+(1===t?"":"it")},ms:function(t){return"millisekund"+(1===t?"":"it")},decimal:","},fa:{y:function(){return"سال"},mo:function(){return"ماه"},w:function(){return"هفته"},d:function(){return"روز"},h:function(){return"ساعت"},m:function(){return"دقیقه"},s:function(){return"ثانیه"},ms:function(){return"میلی ثانیه"},decimal:"."},fi:{y:function(t){return 1===t?"vuosi":"vuotta"},mo:function(t){return 1===t?"kuukausi":"kuukautta"},w:function(t){return"viikko"+(1===t?"":"a")},d:function(t){return"päivä"+(1===t?"":"ä")},h:function(t){return"tunti"+(1===t?"":"a")},m:function(t){return"minuutti"+(1===t?"":"a")},s:function(t){return"sekunti"+(1===t?"":"a")},ms:function(t){return"millisekunti"+(1===t?"":"a")},decimal:","},fo:{y:function(){return"ár"},mo:function(t){return 1===t?"mánaður":"mánaðir"},w:function(t){return 1===t?"vika":"vikur"},d:function(t){return 1===t?"dagur":"dagar"},h:function(t){return 1===t?"tími":"tímar"},m:function(t){return 1===t?"minuttur":"minuttir"},s:function(){return"sekund"},ms:function(){return"millisekund"},decimal:","},fr:{y:function(t){return"an"+(t>=2?"s":"")},mo:function(){return"mois"},w:function(t){return"semaine"+(t>=2?"s":"")},d:function(t){return"jour"+(t>=2?"s":"")},h:function(t){return"heure"+(t>=2?"s":"")},m:function(t){return"minute"+(t>=2?"s":"")},s:function(t){return"seconde"+(t>=2?"s":"")},ms:function(t){return"milliseconde"+(t>=2?"s":"")},decimal:","},hr:{y:function(t){return t%10==2||t%10==3||t%10==4?"godine":"godina"},mo:function(t){return 1===t?"mjesec":2===t||3===t||4===t?"mjeseca":"mjeseci"},w:function(t){return t%10==1&&11!==t?"tjedan":"tjedna"},d:function(t){return 1===t?"dan":"dana"},h:function(t){return 1===t?"sat":2===t||3===t||4===t?"sata":"sati"},m:function(t){var e=t%10;return 2!==e&&3!==e&&4!==e||!(t<10||t>14)?"minuta":"minute"},s:function(t){return 10===t||11===t||12===t||13===t||14===t||16===t||17===t||18===t||19===t||t%10==5?"sekundi":t%10==1?"sekunda":t%10==2||t%10==3||t%10==4?"sekunde":"sekundi"},ms:function(t){return 1===t?"milisekunda":t%10==2||t%10==3||t%10==4?"milisekunde":"milisekundi"},decimal:","},hu:{y:function(){return"év"},mo:function(){return"hónap"},w:function(){return"hét"},d:function(){return"nap"},h:function(){return"óra"},m:function(){return"perc"},s:function(){return"másodperc"},ms:function(){return"ezredmásodperc"},decimal:","},id:{y:function(){return"tahun"},mo:function(){return"bulan"},w:function(){return"minggu"},d:function(){return"hari"},h:function(){return"jam"},m:function(){return"menit"},s:function(){return"detik"},ms:function(){return"milidetik"},decimal:"."},is:{y:function(){return"ár"},mo:function(t){return"mánuð"+(1===t?"ur":"ir")},w:function(t){return"vik"+(1===t?"a":"ur")},d:function(t){return"dag"+(1===t?"ur":"ar")},h:function(t){return"klukkutím"+(1===t?"i":"ar")},m:function(t){return"mínút"+(1===t?"a":"ur")},s:function(t){return"sekúnd"+(1===t?"a":"ur")},ms:function(t){return"millisekúnd"+(1===t?"a":"ur")},decimal:"."},it:{y:function(t){return"ann"+(1===t?"o":"i")},mo:function(t){return"mes"+(1===t?"e":"i")},w:function(t){return"settiman"+(1===t?"a":"e")},d:function(t){return"giorn"+(1===t?"o":"i")},h:function(t){return"or"+(1===t?"a":"e")},m:function(t){return"minut"+(1===t?"o":"i")},s:function(t){return"second"+(1===t?"o":"i")},ms:function(t){return"millisecond"+(1===t?"o":"i")},decimal:","},ja:{y:function(){return"年"},mo:function(){return"月"},w:function(){return"週"},d:function(){return"日"},h:function(){return"時間"},m:function(){return"分"},s:function(){return"秒"},ms:function(){return"ミリ秒"},decimal:"."},ko:{y:function(){return"년"},mo:function(){return"개월"},w:function(){return"주일"},d:function(){return"일"},h:function(){return"시간"},m:function(){return"분"},s:function(){return"초"},ms:function(){return"밀리 초"},decimal:"."},lo:{y:function(){return"ປີ"},mo:function(){return"ເດືອນ"},w:function(){return"ອາທິດ"},d:function(){return"ມື້"},h:function(){return"ຊົ່ວໂມງ"},m:function(){return"ນາທີ"},s:function(){return"ວິນາທີ"},ms:function(){return"ມິນລິວິນາທີ"},decimal:","},lt:{y:function(t){return t%10==0||t%100>=10&&t%100<=20?"metų":"metai"},mo:function(e){return["mėnuo","mėnesiai","mėnesių"][t.getLithuanianForm(e)]},w:function(e){return["savaitė","savaitės","savaičių"][t.getLithuanianForm(e)]},d:function(e){return["diena","dienos","dienų"][t.getLithuanianForm(e)]},h:function(e){return["valanda","valandos","valandų"][t.getLithuanianForm(e)]},m:function(e){return["minutė","minutės","minučių"][t.getLithuanianForm(e)]},s:function(e){return["sekundė","sekundės","sekundžių"][t.getLithuanianForm(e)]},ms:function(e){return["milisekundė","milisekundės","milisekundžių"][t.getLithuanianForm(e)]},decimal:","},lv:{y:function(e){return["gads","gadi"][t.getLatvianForm(e)]},mo:function(e){return["mēnesis","mēneši"][t.getLatvianForm(e)]},w:function(e){return["nedēļa","nedēļas"][t.getLatvianForm(e)]},d:function(e){return["diena","dienas"][t.getLatvianForm(e)]},h:function(e){return["stunda","stundas"][t.getLatvianForm(e)]},m:function(e){return["minūte","minūtes"][t.getLatvianForm(e)]},s:function(e){return["sekunde","sekundes"][t.getLatvianForm(e)]},ms:function(e){return["milisekunde","milisekundes"][t.getLatvianForm(e)]},decimal:","},ms:{y:function(){return"tahun"},mo:function(){return"bulan"},w:function(){return"minggu"},d:function(){return"hari"},h:function(){return"jam"},m:function(){return"minit"},s:function(){return"saat"},ms:function(){return"milisaat"},decimal:"."},nl:{y:function(){return"jaar"},mo:function(t){return 1===t?"maand":"maanden"},w:function(t){return 1===t?"week":"weken"},d:function(t){return 1===t?"dag":"dagen"},h:function(){return"uur"},m:function(t){return 1===t?"minuut":"minuten"},s:function(t){return 1===t?"seconde":"seconden"},ms:function(t){return 1===t?"milliseconde":"milliseconden"},decimal:","},no:{y:function(){return"år"},mo:function(t){return"måned"+(1===t?"":"er")},w:function(t){return"uke"+(1===t?"":"r")},d:function(t){return"dag"+(1===t?"":"er")},h:function(t){return"time"+(1===t?"":"r")},m:function(t){return"minutt"+(1===t?"":"er")},s:function(t){return"sekund"+(1===t?"":"er")},ms:function(t){return"millisekund"+(1===t?"":"er")},decimal:","},pl:{y:function(e){return["rok","roku","lata","lat"][t.getPolishForm(e)]},mo:function(e){return["miesiąc","miesiąca","miesiące","miesięcy"][t.getPolishForm(e)]},w:function(e){return["tydzień","tygodnia","tygodnie","tygodni"][t.getPolishForm(e)]},d:function(e){return["dzień","dnia","dni","dni"][t.getPolishForm(e)]},h:function(e){return["godzina","godziny","godziny","godzin"][t.getPolishForm(e)]},m:function(e){return["minuta","minuty","minuty","minut"][t.getPolishForm(e)]},s:function(e){return["sekunda","sekundy","sekundy","sekund"][t.getPolishForm(e)]},ms:function(e){return["milisekunda","milisekundy","milisekundy","milisekund"][t.getPolishForm(e)]},decimal:","},pt:{y:function(t){return"ano"+(1===t?"":"s")},mo:function(t){return 1===t?"mês":"meses"},w:function(t){return"semana"+(1===t?"":"s")},d:function(t){return"dia"+(1===t?"":"s")},h:function(t){return"hora"+(1===t?"":"s")},m:function(t){return"minuto"+(1===t?"":"s")},s:function(t){return"segundo"+(1===t?"":"s")},ms:function(t){return"milissegundo"+(1===t?"":"s")},decimal:","},ro:{y:function(t){return 1===t?"an":"ani"},mo:function(t){return 1===t?"lună":"luni"},w:function(t){return 1===t?"săptămână":"săptămâni"},d:function(t){return 1===t?"zi":"zile"},h:function(t){return 1===t?"oră":"ore"},m:function(t){return 1===t?"minut":"minute"},s:function(t){return 1===t?"secundă":"secunde"},ms:function(t){return 1===t?"milisecundă":"milisecunde"},decimal:","},ru:{y:function(e){return["лет","год","года"][t.getSlavicForm(e)]},mo:function(e){return["месяцев","месяц","месяца"][t.getSlavicForm(e)]},w:function(e){return["недель","неделя","недели"][t.getSlavicForm(e)]},d:function(e){return["дней","день","дня"][t.getSlavicForm(e)]},h:function(e){return["часов","час","часа"][t.getSlavicForm(e)]},m:function(e){return["минут","минута","минуты"][t.getSlavicForm(e)]},s:function(e){return["секунд","секунда","секунды"][t.getSlavicForm(e)]},ms:function(e){return["миллисекунд","миллисекунда","миллисекунды"][t.getSlavicForm(e)]},decimal:","},uk:{y:function(e){return["років","рік","роки"][t.getSlavicForm(e)]},mo:function(e){return["місяців","місяць","місяці"][t.getSlavicForm(e)]},w:function(e){return["тижнів","тиждень","тижні"][t.getSlavicForm(e)]},d:function(e){return["днів","день","дні"][t.getSlavicForm(e)]},h:function(e){return["годин","година","години"][t.getSlavicForm(e)]},m:function(e){return["хвилин","хвилина","хвилини"][t.getSlavicForm(e)]},s:function(e){return["секунд","секунда","секунди"][t.getSlavicForm(e)]},ms:function(e){return["мілісекунд","мілісекунда","мілісекунди"][t.getSlavicForm(e)]},decimal:","},ur:{y:function(){return"سال"},mo:function(t){return 1===t?"مہینہ":"مہینے"},w:function(t){return 1===t?"ہفتہ":"ہفتے"},d:function(){return"دن"},h:function(t){return 1===t?"گھنٹہ":"گھنٹے"},m:function(){return"منٹ"},s:function(){return"سیکنڈ"},ms:function(){return"ملی سیکنڈ"},decimal:"."},sk:{y:function(e){return["rok","roky","roky","rokov"][t.getCzechOrSlovakForm(e)]},mo:function(e){return["mesiac","mesiace","mesiace","mesiacov"][t.getCzechOrSlovakForm(e)]},w:function(e){return["týždeň","týždne","týždne","týždňov"][t.getCzechOrSlovakForm(e)]},d:function(e){return["deň","dni","dni","dní"][t.getCzechOrSlovakForm(e)]},h:function(e){return["hodina","hodiny","hodiny","hodín"][t.getCzechOrSlovakForm(e)]},m:function(e){return["minúta","minúty","minúty","minút"][t.getCzechOrSlovakForm(e)]},s:function(e){return["sekunda","sekundy","sekundy","sekúnd"][t.getCzechOrSlovakForm(e)]},ms:function(e){return["milisekunda","milisekundy","milisekundy","milisekúnd"][t.getCzechOrSlovakForm(e)]},decimal:","},sv:{y:function(){return"år"},mo:function(t){return"månad"+(1===t?"":"er")},w:function(t){return"veck"+(1===t?"a":"or")},d:function(t){return"dag"+(1===t?"":"ar")},h:function(t){return"timm"+(1===t?"e":"ar")},m:function(t){return"minut"+(1===t?"":"er")},s:function(t){return"sekund"+(1===t?"":"er")},ms:function(t){return"millisekund"+(1===t?"":"er")},decimal:","},tr:{y:function(){return"yıl"},mo:function(){return"ay"},w:function(){return"hafta"},d:function(){return"gün"},h:function(){return"saat"},m:function(){return"dakika"},s:function(){return"saniye"},ms:function(){return"milisaniye"},decimal:","},th:{y:function(){return"ปี"},mo:function(){return"เดือน"},w:function(){return"อาทิตย์"},d:function(){return"วัน"},h:function(){return"ชั่วโมง"},m:function(){return"นาที"},s:function(){return"วินาที"},ms:function(){return"มิลลิวินาที"},decimal:"."},vi:{y:function(){return"năm"},mo:function(){return"tháng"},w:function(){return"tuần"},d:function(){return"ngày"},h:function(){return"giờ"},m:function(){return"phút"},s:function(){return"giây"},ms:function(){return"mili giây"},decimal:","},zh_CN:{y:function(){return"年"},mo:function(){return"个月"},w:function(){return"周"},d:function(){return"天"},h:function(){return"小时"},m:function(){return"分钟"},s:function(){return"秒"},ms:function(){return"毫秒"},decimal:"."},zh_TW:{y:function(){return"年"},mo:function(){return"個月"},w:function(){return"周"},d:function(){return"天"},h:function(){return"小時"},m:function(){return"分鐘"},s:function(){return"秒"},ms:function(){return"毫秒"},decimal:"."}}}return t.prototype.addLanguage=function(t,e){this.languages[t]=e},t.prototype.getCzechForm=function(t){return 1===t?0:Math.floor(t)!==t?1:t%10>=2&&t%10<=4&&t%100<10?2:3},t.prototype.getPolishForm=function(t){return 1===t?0:Math.floor(t)!==t?1:t%10>=2&&t%10<=4&&!(t%100>10&&t%100<20)?2:3},t.prototype.getSlavicForm=function(t){return Math.floor(t)!==t?2:t>=5&&t<=20||t%10>=5&&t%10<=9||t%10==0?0:t%10==1?1:t>1?2:0},t.prototype.getLithuanianForm=function(t){return 1===t||t%10==1&&t%100>20?0:Math.floor(t)!==t||t%10>=2&&t%100>20||t%10>=2&&t%100<10?1:2},t.prototype.getArabicForm=function(t){return t<=2?0:t>2&&t<11?1:0},t.prototype.getCzechOrSlovakForm=function(t){return 1===t?0:Math.floor(t)!==t?1:t%10>=2&&t%10<=4&&t%100<10?2:3},t.prototype.getLatvianForm=function(t){return 1===t||t%10==1&&t%100!=11?0:1},t}(),Rt=function(){function t(t){this.languageUtil=t,this.defaultOptions={language:"en",delimiter:", ",spacer:" ",conjunction:"",serialComma:!0,units:["y","mo","w","d","h","m","s"],languages:{},largest:10,decimal:".",round:!1,unitMeasures:{y:315576e5,mo:26298e5,w:6048e5,d:864e5,h:36e5,m:6e4,s:1e3,ms:1}},this.options=void 0,this.options=this.defaultOptions}return t.prototype.humanize=function(t,e){var i=void 0!==e?this.extend(this.options,e):this.defaultOptions;return this.doHumanization(t,i)},t.prototype.setOptions=function(t){this.options=void 0!==t?this.extend(this.defaultOptions,t):this.defaultOptions},t.prototype.getSupportedLanguages=function(){var t=[];for(var e in this.languageUtil.languages)this.languageUtil.languages.hasOwnProperty(e)&&t.push(e);return t},t.prototype.addLanguage=function(t,e){this.languageUtil.addLanguage(t,e)},t.prototype.doHumanization=function(t,e){var i,n,o;t=Math.abs(t);var s=e.languages[e.language]||this.languageUtil.languages[e.language];if(!s)throw new Error("No language "+s+".");var r,a,l,c=[];for(i=0,n=e.units.length;i<n;i++)r=e.units[i],a=e.unitMeasures[r],l=i+1===n?t/a:Math.floor(t/a),c.push({unitCount:l,unitName:r}),t-=l*a;var h=0;for(i=0;i<c.length;i++)if(c[i].unitCount){h=i;break}if(e.round){var u=void 0,d=void 0;for(i=c.length-1;i>=0&&((o=c[i]).unitCount=Math.round(o.unitCount),0!==i);i--)d=c[i-1],u=e.unitMeasures[d.unitName]/e.unitMeasures[o.unitName],(o.unitCount%u==0||e.largest&&e.largest-1<i-h)&&(d.unitCount+=o.unitCount/u,o.unitCount=0)}var p=[];for(i=0,c.length;i<n&&((o=c[i]).unitCount&&p.push(this.render(o.unitCount,o.unitName,s,e)),p.length!==e.largest);i++);return p.length?e.conjunction&&1!==p.length?2===p.length?p.join(e.conjunction):p.length>2?p.slice(0,-1).join(e.delimiter)+(e.serialComma?",":"")+e.conjunction+p.slice(-1):void 0:p.join(e.delimiter):this.render(0,e.units[e.units.length-1],s,e)},t.prototype.render=function(t,e,i,n){var o;o=void 0===n.decimal?i.decimal:n.decimal;var s=t.toString().replace(".",o.toString()),r=i[e](t);return s+n.spacer+r},t.prototype.extend=function(t,e){for(var i in e)t.hasOwnProperty(i)&&(t[i]=e[i]);return t},t}();class Bt extends Error{}class qt extends Bt{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class Zt extends Bt{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class Ft extends Bt{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class Vt extends Bt{}class jt extends Bt{constructor(t){super(`Invalid unit ${t}`)}}class Ut extends Bt{}class Ht extends Bt{constructor(){super("Zone is an abstract class")}}const Gt="numeric",Wt="short",Kt="long",Yt={year:Gt,month:Gt,day:Gt},Jt={year:Gt,month:Wt,day:Gt},Xt={year:Gt,month:Wt,day:Gt,weekday:Wt},Qt={year:Gt,month:Kt,day:Gt},te={year:Gt,month:Kt,day:Gt,weekday:Kt},ee={hour:Gt,minute:Gt},ie={hour:Gt,minute:Gt,second:Gt},ne={hour:Gt,minute:Gt,second:Gt,timeZoneName:Wt},oe={hour:Gt,minute:Gt,second:Gt,timeZoneName:Kt},se={hour:Gt,minute:Gt,hourCycle:"h23"},re={hour:Gt,minute:Gt,second:Gt,hourCycle:"h23"},ae={hour:Gt,minute:Gt,second:Gt,hourCycle:"h23",timeZoneName:Wt},le={hour:Gt,minute:Gt,second:Gt,hourCycle:"h23",timeZoneName:Kt},ce={year:Gt,month:Gt,day:Gt,hour:Gt,minute:Gt},he={year:Gt,month:Gt,day:Gt,hour:Gt,minute:Gt,second:Gt},ue={year:Gt,month:Wt,day:Gt,hour:Gt,minute:Gt},de={year:Gt,month:Wt,day:Gt,hour:Gt,minute:Gt,second:Gt},pe={year:Gt,month:Wt,day:Gt,weekday:Wt,hour:Gt,minute:Gt},me={year:Gt,month:Kt,day:Gt,hour:Gt,minute:Gt,timeZoneName:Wt},fe={year:Gt,month:Kt,day:Gt,hour:Gt,minute:Gt,second:Gt,timeZoneName:Wt},ge={year:Gt,month:Kt,day:Gt,weekday:Kt,hour:Gt,minute:Gt,timeZoneName:Kt},ve={year:Gt,month:Kt,day:Gt,weekday:Kt,hour:Gt,minute:Gt,second:Gt,timeZoneName:Kt};function ye(t){return void 0===t}function be(t){return"number"==typeof t}function _e(t){return"number"==typeof t&&t%1==0}function xe(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(t){return!1}}function we(t,e,i){if(0!==t.length)return t.reduce(((t,n)=>{const o=[e(n),n];return t&&i(t[0],o[0])===t[0]?t:o}),null)[1]}function ke(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Se(t,e,i){return _e(t)&&t>=e&&t<=i}function Ce(t,e=2){let i;return i=t<0?"-"+(""+-t).padStart(e,"0"):(""+t).padStart(e,"0"),i}function Te(t){return ye(t)||null===t||""===t?void 0:parseInt(t,10)}function Ee(t){return ye(t)||null===t||""===t?void 0:parseFloat(t)}function $e(t){if(!ye(t)&&null!==t&&""!==t){const e=1e3*parseFloat("0."+t);return Math.floor(e)}}function Le(t,e,i=!1){const n=10**e;return(i?Math.trunc:Math.round)(t*n)/n}function Ae(t){return t%4==0&&(t%100!=0||t%400==0)}function Oe(t){return Ae(t)?366:365}function Me(t,e){const i=function(t,e){return t-e*Math.floor(t/e)}(e-1,12)+1;return 2===i?Ae(t+(e-i)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][i-1]}function Pe(t){let e=Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second,t.millisecond);return t.year<100&&t.year>=0&&(e=new Date(e),e.setUTCFullYear(e.getUTCFullYear()-1900)),+e}function ze(t){const e=(t+Math.floor(t/4)-Math.floor(t/100)+Math.floor(t/400))%7,i=t-1,n=(i+Math.floor(i/4)-Math.floor(i/100)+Math.floor(i/400))%7;return 4===e||3===n?53:52}function Ie(t){return t>99?t:t>60?1900+t:2e3+t}function De(t,e,i,n=null){const o=new Date(t),s={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};n&&(s.timeZone=n);const r={timeZoneName:e,...s},a=new Intl.DateTimeFormat(i,r).formatToParts(o).find((t=>"timezonename"===t.type.toLowerCase()));return a?a.value:null}function Ne(t,e){let i=parseInt(t,10);Number.isNaN(i)&&(i=0);const n=parseInt(e,10)||0;return 60*i+(i<0||Object.is(i,-0)?-n:n)}function Re(t){const e=Number(t);if("boolean"==typeof t||""===t||Number.isNaN(e))throw new Ut(`Invalid unit value ${t}`);return e}function Be(t,e){const i={};for(const n in t)if(ke(t,n)){const o=t[n];if(null==o)continue;i[e(n)]=Re(o)}return i}function qe(t,e){const i=Math.trunc(Math.abs(t/60)),n=Math.trunc(Math.abs(t%60)),o=t>=0?"+":"-";switch(e){case"short":return`${o}${Ce(i,2)}:${Ce(n,2)}`;case"narrow":return`${o}${i}${n>0?`:${n}`:""}`;case"techie":return`${o}${Ce(i,2)}${Ce(n,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Ze(t){return function(t,e){return e.reduce(((e,i)=>(e[i]=t[i],e)),{})}(t,["hour","minute","second","millisecond"])}const Fe=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/,Ve=["January","February","March","April","May","June","July","August","September","October","November","December"],je=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Ue=["J","F","M","A","M","J","J","A","S","O","N","D"];function He(t){switch(t){case"narrow":return[...Ue];case"short":return[...je];case"long":return[...Ve];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const Ge=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],We=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Ke=["M","T","W","T","F","S","S"];function Ye(t){switch(t){case"narrow":return[...Ke];case"short":return[...We];case"long":return[...Ge];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Je=["AM","PM"],Xe=["Before Christ","Anno Domini"],Qe=["BC","AD"],ti=["B","A"];function ei(t){switch(t){case"narrow":return[...ti];case"short":return[...Qe];case"long":return[...Xe];default:return null}}function ii(t,e){let i="";for(const n of t)n.literal?i+=n.val:i+=e(n.val);return i}const ni={D:Yt,DD:Jt,DDD:Qt,DDDD:te,t:ee,tt:ie,ttt:ne,tttt:oe,T:se,TT:re,TTT:ae,TTTT:le,f:ce,ff:ue,fff:me,ffff:ge,F:he,FF:de,FFF:fe,FFFF:ve};class oi{static create(t,e={}){return new oi(t,e)}static parseFormat(t){let e=null,i="",n=!1;const o=[];for(let s=0;s<t.length;s++){const r=t.charAt(s);"'"===r?(i.length>0&&o.push({literal:n,val:i}),e=null,i="",n=!n):n||r===e?i+=r:(i.length>0&&o.push({literal:!1,val:i}),i=r,e=r)}return i.length>0&&o.push({literal:n,val:i}),o}static macroTokenToFormatOpts(t){return ni[t]}constructor(t,e){this.opts=e,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,e){null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem());return this.systemLoc.dtFormatter(t,{...this.opts,...e}).format()}formatDateTime(t,e={}){return this.loc.dtFormatter(t,{...this.opts,...e}).format()}formatDateTimeParts(t,e={}){return this.loc.dtFormatter(t,{...this.opts,...e}).formatToParts()}resolvedOptions(t,e={}){return this.loc.dtFormatter(t,{...this.opts,...e}).resolvedOptions()}num(t,e=0){if(this.opts.forceSimple)return Ce(t,e);const i={...this.opts};return e>0&&(i.padTo=e),this.loc.numberFormatter(i).format(t)}formatDateTimeFromString(t,e){const i="en"===this.loc.listingMode(),n=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar,o=(e,i)=>this.loc.extract(t,e,i),s=e=>t.isOffsetFixed&&0===t.offset&&e.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,e.format):"",r=()=>i?function(t){return Je[t.hour<12?0:1]}(t):o({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(e,n)=>i?function(t,e){return He(e)[t.month-1]}(t,e):o(n?{month:e}:{month:e,day:"numeric"},"month"),l=(e,n)=>i?function(t,e){return Ye(e)[t.weekday-1]}(t,e):o(n?{weekday:e}:{weekday:e,month:"long",day:"numeric"},"weekday"),c=e=>{const i=oi.macroTokenToFormatOpts(e);return i?this.formatWithSystemDefault(t,i):e},h=e=>i?function(t,e){return ei(e)[t.year<0?0:1]}(t,e):o({era:e},"era");return ii(oi.parseFormat(e),(e=>{switch(e){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12==0?12:t.hour%12);case"hh":return this.num(t.hour%12==0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return s({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return s({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return s({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return r();case"d":return n?o({day:"numeric"},"day"):this.num(t.day);case"dd":return n?o({day:"2-digit"},"day"):this.num(t.day,2);case"c":case"E":return this.num(t.weekday);case"ccc":return l("short",!0);case"cccc":return l("long",!0);case"ccccc":return l("narrow",!0);case"EEE":return l("short",!1);case"EEEE":return l("long",!1);case"EEEEE":return l("narrow",!1);case"L":return n?o({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return n?o({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return n?o({month:"numeric"},"month"):this.num(t.month);case"MM":return n?o({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return n?o({year:"numeric"},"year"):this.num(t.year);case"yy":return n?o({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return n?o({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return n?o({year:"numeric"},"year"):this.num(t.year,6);case"G":return h("short");case"GG":return h("long");case"GGGGG":return h("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return c(e)}}))}formatDurationFromString(t,e){const i=t=>{switch(t[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},n=oi.parseFormat(e),o=n.reduce(((t,{literal:e,val:i})=>e?t:t.concat(i)),[]),s=t.shiftTo(...o.map(i).filter((t=>t)));return ii(n,(t=>e=>{const n=i(e);return n?this.num(t.get(n),e.length):e})(s))}}class si{constructor(t,e){this.reason=t,this.explanation=e}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class ri{get type(){throw new Ht}get name(){throw new Ht}get ianaName(){return this.name}get isUniversal(){throw new Ht}offsetName(t,e){throw new Ht}formatOffset(t,e){throw new Ht}offset(t){throw new Ht}equals(t){throw new Ht}get isValid(){throw new Ht}}let ai=null;class li extends ri{static get instance(){return null===ai&&(ai=new li),ai}get type(){return"system"}get name(){return(new Intl.DateTimeFormat).resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:e,locale:i}){return De(t,e,i)}formatOffset(t,e){return qe(this.offset(t),e)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return"system"===t.type}get isValid(){return!0}}let ci={};const hi={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};let ui={};class di extends ri{static create(t){return ui[t]||(ui[t]=new di(t)),ui[t]}static resetCache(){ui={},ci={}}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch(t){return!1}}constructor(t){super(),this.zoneName=t,this.valid=di.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:e,locale:i}){return De(t,e,i,this.name)}formatOffset(t,e){return qe(this.offset(t),e)}offset(t){const e=new Date(t);if(isNaN(e))return NaN;const i=(n=this.name,ci[n]||(ci[n]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),ci[n]);var n;let[o,s,r,a,l,c,h]=i.formatToParts?function(t,e){const i=t.formatToParts(e),n=[];for(let t=0;t<i.length;t++){const{type:e,value:o}=i[t],s=hi[e];"era"===e?n[s]=o:ye(s)||(n[s]=parseInt(o,10))}return n}(i,e):function(t,e){const i=t.format(e).replace(/\u200E/g,""),n=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(i),[,o,s,r,a,l,c,h]=n;return[r,o,s,a,l,c,h]}(i,e);"BC"===a&&(o=1-Math.abs(o));let u=+e;const d=u%1e3;return u-=d>=0?d:1e3+d,(Pe({year:o,month:s,day:r,hour:24===l?0:l,minute:c,second:h,millisecond:0})-u)/6e4}equals(t){return"iana"===t.type&&t.name===this.name}get isValid(){return this.valid}}let pi=null;class mi extends ri{static get utcInstance(){return null===pi&&(pi=new mi(0)),pi}static instance(t){return 0===t?mi.utcInstance:new mi(t)}static parseSpecifier(t){if(t){const e=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(e)return new mi(Ne(e[1],e[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return 0===this.fixed?"UTC":`UTC${qe(this.fixed,"narrow")}`}get ianaName(){return 0===this.fixed?"Etc/UTC":`Etc/GMT${qe(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,e){return qe(this.fixed,e)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return"fixed"===t.type&&t.fixed===this.fixed}get isValid(){return!0}}class fi extends ri{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function gi(t,e){if(ye(t)||null===t)return e;if(t instanceof ri)return t;if(function(t){return"string"==typeof t}(t)){const i=t.toLowerCase();return"local"===i||"system"===i?e:"utc"===i||"gmt"===i?mi.utcInstance:mi.parseSpecifier(i)||di.create(t)}return be(t)?mi.instance(t):"object"==typeof t&&t.offset&&"number"==typeof t.offset?t:new fi(t)}let vi,yi=()=>Date.now(),bi="system",_i=null,xi=null,wi=null;class ki{static get now(){return yi}static set now(t){yi=t}static set defaultZone(t){bi=t}static get defaultZone(){return gi(bi,li.instance)}static get defaultLocale(){return _i}static set defaultLocale(t){_i=t}static get defaultNumberingSystem(){return xi}static set defaultNumberingSystem(t){xi=t}static get defaultOutputCalendar(){return wi}static set defaultOutputCalendar(t){wi=t}static get throwOnInvalid(){return vi}static set throwOnInvalid(t){vi=t}static resetCaches(){zi.resetCache(),di.resetCache()}}let Si={};let Ci={};function Ti(t,e={}){const i=JSON.stringify([t,e]);let n=Ci[i];return n||(n=new Intl.DateTimeFormat(t,e),Ci[i]=n),n}let Ei={};let $i={};let Li=null;function Ai(t,e,i,n,o){const s=t.listingMode(i);return"error"===s?null:"en"===s?n(e):o(e)}class Oi{constructor(t,e,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;const{padTo:n,floor:o,...s}=i;if(!e||Object.keys(s).length>0){const e={useGrouping:!1,...i};i.padTo>0&&(e.minimumIntegerDigits=i.padTo),this.inf=function(t,e={}){const i=JSON.stringify([t,e]);let n=Ei[i];return n||(n=new Intl.NumberFormat(t,e),Ei[i]=n),n}(t,e)}}format(t){if(this.inf){const e=this.floor?Math.floor(t):t;return this.inf.format(e)}return Ce(this.floor?Math.floor(t):Le(t,3),this.padTo)}}class Mi{constructor(t,e,i){let n;if(this.opts=i,t.zone.isUniversal){const e=t.offset/60*-1,o=e>=0?`Etc/GMT+${e}`:`Etc/GMT${e}`;0!==t.offset&&di.create(o).valid?(n=o,this.dt=t):(n="UTC",i.timeZoneName?this.dt=t:this.dt=0===t.offset?t:Mo.fromMillis(t.ts+60*t.offset*1e3))}else"system"===t.zone.type?this.dt=t:(this.dt=t,n=t.zone.name);const o={...this.opts};n&&(o.timeZone=n),this.dtf=Ti(e,o)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class Pi{constructor(t,e,i){this.opts={style:"long",...i},!e&&xe()&&(this.rtf=function(t,e={}){const{base:i,...n}=e,o=JSON.stringify([t,n]);let s=$i[o];return s||(s=new Intl.RelativeTimeFormat(t,e),$i[o]=s),s}(t,i))}format(t,e){return this.rtf?this.rtf.format(t,e):function(t,e,i="always",n=!1){const o={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},s=-1===["hours","minutes","seconds"].indexOf(t);if("auto"===i&&s){const i="days"===t;switch(e){case 1:return i?"tomorrow":`next ${o[t][0]}`;case-1:return i?"yesterday":`last ${o[t][0]}`;case 0:return i?"today":`this ${o[t][0]}`}}const r=Object.is(e,-0)||e<0,a=Math.abs(e),l=1===a,c=o[t],h=n?l?c[1]:c[2]||c[1]:l?o[t][0]:t;return r?`${a} ${h} ago`:`in ${a} ${h}`}(e,t,this.opts.numeric,"long"!==this.opts.style)}formatToParts(t,e){return this.rtf?this.rtf.formatToParts(t,e):[]}}class zi{static fromOpts(t){return zi.create(t.locale,t.numberingSystem,t.outputCalendar,t.defaultToEN)}static create(t,e,i,n=!1){const o=t||ki.defaultLocale,s=o||(n?"en-US":Li||(Li=(new Intl.DateTimeFormat).resolvedOptions().locale,Li)),r=e||ki.defaultNumberingSystem,a=i||ki.defaultOutputCalendar;return new zi(s,r,a,o)}static resetCache(){Li=null,Ci={},Ei={},$i={}}static fromObject({locale:t,numberingSystem:e,outputCalendar:i}={}){return zi.create(t,e,i)}constructor(t,e,i,n){const[o,s,r]=function(t){const e=t.indexOf("-u-");if(-1===e)return[t];{let i;const n=t.substring(0,e);try{i=Ti(t).resolvedOptions()}catch(t){i=Ti(n).resolvedOptions()}const{numberingSystem:o,calendar:s}=i;return[n,o,s]}}(t);this.locale=o,this.numberingSystem=e||s||null,this.outputCalendar=i||r||null,this.intl=function(t,e,i){return i||e?(t+="-u",i&&(t+=`-ca-${i}`),e&&(t+=`-nu-${e}`),t):t}(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=n,this.fastNumbersCached=null}get fastNumbers(){var t;return null==this.fastNumbersCached&&(this.fastNumbersCached=(!(t=this).numberingSystem||"latn"===t.numberingSystem)&&("latn"===t.numberingSystem||!t.locale||t.locale.startsWith("en")||"latn"===new Intl.DateTimeFormat(t.intl).resolvedOptions().numberingSystem)),this.fastNumbersCached}listingMode(){const t=this.isEnglish(),e=!(null!==this.numberingSystem&&"latn"!==this.numberingSystem||null!==this.outputCalendar&&"gregory"!==this.outputCalendar);return t&&e?"en":"intl"}clone(t){return t&&0!==Object.getOwnPropertyNames(t).length?zi.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,t.defaultToEN||!1):this}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,e=!1,i=!0){return Ai(this,t,i,He,(()=>{const i=e?{month:t,day:"numeric"}:{month:t},n=e?"format":"standalone";return this.monthsCache[n][t]||(this.monthsCache[n][t]=function(t){const e=[];for(let i=1;i<=12;i++){const n=Mo.utc(2016,i,1);e.push(t(n))}return e}((t=>this.extract(t,i,"month")))),this.monthsCache[n][t]}))}weekdays(t,e=!1,i=!0){return Ai(this,t,i,Ye,(()=>{const i=e?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},n=e?"format":"standalone";return this.weekdaysCache[n][t]||(this.weekdaysCache[n][t]=function(t){const e=[];for(let i=1;i<=7;i++){const n=Mo.utc(2016,11,13+i);e.push(t(n))}return e}((t=>this.extract(t,i,"weekday")))),this.weekdaysCache[n][t]}))}meridiems(t=!0){return Ai(this,void 0,t,(()=>Je),(()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Mo.utc(2016,11,13,9),Mo.utc(2016,11,13,19)].map((e=>this.extract(e,t,"dayperiod")))}return this.meridiemCache}))}eras(t,e=!0){return Ai(this,t,e,ei,(()=>{const e={era:t};return this.eraCache[t]||(this.eraCache[t]=[Mo.utc(-40,1,1),Mo.utc(2017,1,1)].map((t=>this.extract(t,e,"era")))),this.eraCache[t]}))}extract(t,e,i){const n=this.dtFormatter(t,e).formatToParts().find((t=>t.type.toLowerCase()===i));return n?n.value:null}numberFormatter(t={}){return new Oi(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,e={}){return new Mi(t,this.intl,e)}relFormatter(t={}){return new Pi(this.intl,this.isEnglish(),t)}listFormatter(t={}){return function(t,e={}){const i=JSON.stringify([t,e]);let n=Si[i];return n||(n=new Intl.ListFormat(t,e),Si[i]=n),n}(this.intl,t)}isEnglish(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}}function Ii(...t){const e=t.reduce(((t,e)=>t+e.source),"");return RegExp(`^${e}$`)}function Di(...t){return e=>t.reduce((([t,i,n],o)=>{const[s,r,a]=o(e,n);return[{...t,...s},r||i,a]}),[{},null,1]).slice(0,2)}function Ni(t,...e){if(null==t)return[null,null];for(const[i,n]of e){const e=i.exec(t);if(e)return n(e)}return[null,null]}function Ri(...t){return(e,i)=>{const n={};let o;for(o=0;o<t.length;o++)n[t[o]]=Te(e[i+o]);return[n,null,i+o]}}const Bi=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,qi=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Zi=RegExp(`${qi.source}${`(?:${Bi.source}?(?:\\[(${Fe.source})\\])?)?`}`),Fi=RegExp(`(?:T${Zi.source})?`),Vi=Ri("weekYear","weekNumber","weekDay"),ji=Ri("year","ordinal"),Ui=RegExp(`${qi.source} ?(?:${Bi.source}|(${Fe.source}))?`),Hi=RegExp(`(?: ${Ui.source})?`);function Gi(t,e,i){const n=t[e];return ye(n)?i:Te(n)}function Wi(t,e){return[{hours:Gi(t,e,0),minutes:Gi(t,e+1,0),seconds:Gi(t,e+2,0),milliseconds:$e(t[e+3])},null,e+4]}function Ki(t,e){const i=!t[e]&&!t[e+1],n=Ne(t[e+1],t[e+2]);return[{},i?null:mi.instance(n),e+3]}function Yi(t,e){return[{},t[e]?di.create(t[e]):null,e+1]}const Ji=RegExp(`^T?${qi.source}$`),Xi=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function Qi(t){const[e,i,n,o,s,r,a,l,c]=t,h="-"===e[0],u=l&&"-"===l[0],d=(t,e=!1)=>void 0!==t&&(e||t&&h)?-t:t;return[{years:d(Ee(i)),months:d(Ee(n)),weeks:d(Ee(o)),days:d(Ee(s)),hours:d(Ee(r)),minutes:d(Ee(a)),seconds:d(Ee(l),"-0"===l),milliseconds:d($e(c),u)}]}const tn={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function en(t,e,i,n,o,s,r){const a={year:2===e.length?Ie(Te(e)):Te(e),month:je.indexOf(i)+1,day:Te(n),hour:Te(o),minute:Te(s)};return r&&(a.second=Te(r)),t&&(a.weekday=t.length>3?Ge.indexOf(t)+1:We.indexOf(t)+1),a}const nn=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function on(t){const[,e,i,n,o,s,r,a,l,c,h,u]=t,d=en(e,o,n,i,s,r,a);let p;return p=l?tn[l]:c?0:Ne(h,u),[d,new mi(p)]}const sn=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,rn=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,an=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function ln(t){const[,e,i,n,o,s,r,a]=t;return[en(e,o,n,i,s,r,a),mi.utcInstance]}function cn(t){const[,e,i,n,o,s,r,a]=t;return[en(e,a,i,n,o,s,r),mi.utcInstance]}const hn=Ii(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Fi),un=Ii(/(\d{4})-?W(\d\d)(?:-?(\d))?/,Fi),dn=Ii(/(\d{4})-?(\d{3})/,Fi),pn=Ii(Zi),mn=Di((function(t,e){return[{year:Gi(t,e),month:Gi(t,e+1,1),day:Gi(t,e+2,1)},null,e+3]}),Wi,Ki,Yi),fn=Di(Vi,Wi,Ki,Yi),gn=Di(ji,Wi,Ki,Yi),vn=Di(Wi,Ki,Yi);const yn=Di(Wi);const bn=Ii(/(\d{4})-(\d\d)-(\d\d)/,Hi),_n=Ii(Ui),xn=Di(Wi,Ki,Yi);const wn={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},kn={years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6},...wn},Sn={years:{quarters:4,months:12,weeks:52.1775,days:365.2425,hours:8765.82,minutes:525949.2,seconds:525949.2*60,milliseconds:525949.2*60*1e3},quarters:{months:3,weeks:13.044375,days:91.310625,hours:2191.455,minutes:131487.3,seconds:525949.2*60/4,milliseconds:7889237999.999999},months:{weeks:30.436875/7,days:30.436875,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3},...wn},Cn=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Tn=Cn.slice(0).reverse();function En(t,e,i=!1){const n={values:i?e.values:{...t.values,...e.values||{}},loc:t.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||t.conversionAccuracy};return new Ln(n)}function $n(t,e,i,n,o){const s=t[o][i],r=e[i]/s,a=!(Math.sign(r)===Math.sign(n[o]))&&0!==n[o]&&Math.abs(r)<=1?function(t){return t<0?Math.floor(t):Math.ceil(t)}(r):Math.trunc(r);n[o]+=a,e[i]-=a*s}class Ln{constructor(t){const e="longterm"===t.conversionAccuracy||!1;this.values=t.values,this.loc=t.loc||zi.create(),this.conversionAccuracy=e?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=e?Sn:kn,this.isLuxonDuration=!0}static fromMillis(t,e){return Ln.fromObject({milliseconds:t},e)}static fromObject(t,e={}){if(null==t||"object"!=typeof t)throw new Ut("Duration.fromObject: argument expected to be an object, got "+(null===t?"null":typeof t));return new Ln({values:Be(t,Ln.normalizeUnit),loc:zi.fromObject(e),conversionAccuracy:e.conversionAccuracy})}static fromDurationLike(t){if(be(t))return Ln.fromMillis(t);if(Ln.isDuration(t))return t;if("object"==typeof t)return Ln.fromObject(t);throw new Ut(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,e){const[i]=function(t){return Ni(t,[Xi,Qi])}(t);return i?Ln.fromObject(i,e):Ln.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,e){const[i]=function(t){return Ni(t,[Ji,yn])}(t);return i?Ln.fromObject(i,e):Ln.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,e=null){if(!t)throw new Ut("need to specify a reason the Duration is invalid");const i=t instanceof si?t:new si(t,e);if(ki.throwOnInvalid)throw new Ft(i);return new Ln({invalid:i})}static normalizeUnit(t){const e={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t?t.toLowerCase():t];if(!e)throw new jt(t);return e}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,e={}){const i={...e,floor:!1!==e.round&&!1!==e.floor};return this.isValid?oi.create(this.loc,i).formatDurationFromString(this,t):"Invalid Duration"}toHuman(t={}){const e=Cn.map((e=>{const i=this.values[e];return ye(i)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:e.slice(0,-1)}).format(i)})).filter((t=>t));return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(e)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return 0!==this.years&&(t+=this.years+"Y"),0===this.months&&0===this.quarters||(t+=this.months+3*this.quarters+"M"),0!==this.weeks&&(t+=this.weeks+"W"),0!==this.days&&(t+=this.days+"D"),0===this.hours&&0===this.minutes&&0===this.seconds&&0===this.milliseconds||(t+="T"),0!==this.hours&&(t+=this.hours+"H"),0!==this.minutes&&(t+=this.minutes+"M"),0===this.seconds&&0===this.milliseconds||(t+=Le(this.seconds+this.milliseconds/1e3,3)+"S"),"P"===t&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;const e=this.toMillis();if(e<0||e>=864e5)return null;t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t};const i=this.shiftTo("hours","minutes","seconds","milliseconds");let n="basic"===t.format?"hhmm":"hh:mm";t.suppressSeconds&&0===i.seconds&&0===i.milliseconds||(n+="basic"===t.format?"ss":":ss",t.suppressMilliseconds&&0===i.milliseconds||(n+=".SSS"));let o=i.toFormat(n);return t.includePrefix&&(o="T"+o),o}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.as("milliseconds")}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const e=Ln.fromDurationLike(t),i={};for(const t of Cn)(ke(e.values,t)||ke(this.values,t))&&(i[t]=e.get(t)+this.get(t));return En(this,{values:i},!0)}minus(t){if(!this.isValid)return this;const e=Ln.fromDurationLike(t);return this.plus(e.negate())}mapUnits(t){if(!this.isValid)return this;const e={};for(const i of Object.keys(this.values))e[i]=Re(t(this.values[i],i));return En(this,{values:e},!0)}get(t){return this[Ln.normalizeUnit(t)]}set(t){if(!this.isValid)return this;return En(this,{values:{...this.values,...Be(t,Ln.normalizeUnit)}})}reconfigure({locale:t,numberingSystem:e,conversionAccuracy:i}={}){const n={loc:this.loc.clone({locale:t,numberingSystem:e})};return i&&(n.conversionAccuracy=i),En(this,n)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return function(t,e){Tn.reduce(((i,n)=>ye(e[n])?i:(i&&$n(t,e,i,e,n),n)),null)}(this.matrix,t),En(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(0===t.length)return this;t=t.map((t=>Ln.normalizeUnit(t)));const e={},i={},n=this.toObject();let o;for(const s of Cn)if(t.indexOf(s)>=0){o=s;let t=0;for(const e in i)t+=this.matrix[e][s]*i[e],i[e]=0;be(n[s])&&(t+=n[s]);const r=Math.trunc(t);e[s]=r,i[s]=(1e3*t-1e3*r)/1e3;for(const t in n)Cn.indexOf(t)>Cn.indexOf(s)&&$n(this.matrix,n,t,e,s)}else be(n[s])&&(i[s]=n[s]);for(const t in i)0!==i[t]&&(e[o]+=t===o?i[t]:i[t]/this.matrix[o][t]);return En(this,{values:e},!0).normalize()}negate(){if(!this.isValid)return this;const t={};for(const e of Object.keys(this.values))t[e]=0===this.values[e]?0:-this.values[e];return En(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid)return!1;if(!this.loc.equals(t.loc))return!1;for(const n of Cn)if(e=this.values[n],i=t.values[n],!(void 0===e||0===e?void 0===i||0===i:e===i))return!1;var e,i;return!0}}const An="Invalid Interval";class On{constructor(t){this.s=t.start,this.e=t.end,this.invalid=t.invalid||null,this.isLuxonInterval=!0}static invalid(t,e=null){if(!t)throw new Ut("need to specify a reason the Interval is invalid");const i=t instanceof si?t:new si(t,e);if(ki.throwOnInvalid)throw new Zt(i);return new On({invalid:i})}static fromDateTimes(t,e){const i=Po(t),n=Po(e),o=function(t,e){return t&&t.isValid?e&&e.isValid?e<t?On.invalid("end before start",`The end of an interval must be after its start, but you had start=${t.toISO()} and end=${e.toISO()}`):null:On.invalid("missing or invalid end"):On.invalid("missing or invalid start")}(i,n);return null==o?new On({start:i,end:n}):o}static after(t,e){const i=Ln.fromDurationLike(e),n=Po(t);return On.fromDateTimes(n,n.plus(i))}static before(t,e){const i=Ln.fromDurationLike(e),n=Po(t);return On.fromDateTimes(n.minus(i),n)}static fromISO(t,e){const[i,n]=(t||"").split("/",2);if(i&&n){let t,o,s,r;try{t=Mo.fromISO(i,e),o=t.isValid}catch(n){o=!1}try{s=Mo.fromISO(n,e),r=s.isValid}catch(n){r=!1}if(o&&r)return On.fromDateTimes(t,s);if(o){const i=Ln.fromISO(n,e);if(i.isValid)return On.after(t,i)}else if(r){const t=Ln.fromISO(i,e);if(t.isValid)return On.before(s,t)}}return On.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(t){return t&&t.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return null===this.invalidReason}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(t="milliseconds"){return this.isValid?this.toDuration(t).get(t):NaN}count(t="milliseconds"){if(!this.isValid)return NaN;const e=this.start.startOf(t),i=this.end.startOf(t);return Math.floor(i.diff(e,t).get(t))+1}hasSame(t){return!!this.isValid&&(this.isEmpty()||this.e.minus(1).hasSame(this.s,t))}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(t){return!!this.isValid&&this.s>t}isBefore(t){return!!this.isValid&&this.e<=t}contains(t){return!!this.isValid&&(this.s<=t&&this.e>t)}set({start:t,end:e}={}){return this.isValid?On.fromDateTimes(t||this.s,e||this.e):this}splitAt(...t){if(!this.isValid)return[];const e=t.map(Po).filter((t=>this.contains(t))).sort(),i=[];let{s:n}=this,o=0;for(;n<this.e;){const t=e[o]||this.e,s=+t>+this.e?this.e:t;i.push(On.fromDateTimes(n,s)),n=s,o+=1}return i}splitBy(t){const e=Ln.fromDurationLike(t);if(!this.isValid||!e.isValid||0===e.as("milliseconds"))return[];let i,{s:n}=this,o=1;const s=[];for(;n<this.e;){const t=this.start.plus(e.mapUnits((t=>t*o)));i=+t>+this.e?this.e:t,s.push(On.fromDateTimes(n,i)),n=i,o+=1}return s}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s<t.e}abutsStart(t){return!!this.isValid&&+this.e==+t.s}abutsEnd(t){return!!this.isValid&&+t.e==+this.s}engulfs(t){return!!this.isValid&&(this.s<=t.s&&this.e>=t.e)}equals(t){return!(!this.isValid||!t.isValid)&&(this.s.equals(t.s)&&this.e.equals(t.e))}intersection(t){if(!this.isValid)return this;const e=this.s>t.s?this.s:t.s,i=this.e<t.e?this.e:t.e;return e>=i?null:On.fromDateTimes(e,i)}union(t){if(!this.isValid)return this;const e=this.s<t.s?this.s:t.s,i=this.e>t.e?this.e:t.e;return On.fromDateTimes(e,i)}static merge(t){const[e,i]=t.sort(((t,e)=>t.s-e.s)).reduce((([t,e],i)=>e?e.overlaps(i)||e.abutsStart(i)?[t,e.union(i)]:[t.concat([e]),i]:[t,i]),[[],null]);return i&&e.push(i),e}static xor(t){let e=null,i=0;const n=[],o=t.map((t=>[{time:t.s,type:"s"},{time:t.e,type:"e"}])),s=Array.prototype.concat(...o).sort(((t,e)=>t.time-e.time));for(const t of s)i+="s"===t.type?1:-1,1===i?e=t.time:(e&&+e!=+t.time&&n.push(On.fromDateTimes(e,t.time)),e=null);return On.merge(n)}difference(...t){return On.xor([this].concat(t)).map((t=>this.intersection(t))).filter((t=>t&&!t.isEmpty()))}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:An}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:An}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:An}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:An}toFormat(t,{separator:e=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${e}${this.e.toFormat(t)}`:An}toDuration(t,e){return this.isValid?this.e.diff(this.s,t,e):Ln.invalid(this.invalidReason)}mapEndpoints(t){return On.fromDateTimes(t(this.s),t(this.e))}}class Mn{static hasDST(t=ki.defaultZone){const e=Mo.now().setZone(t).set({month:12});return!t.isUniversal&&e.offset!==e.set({month:6}).offset}static isValidIANAZone(t){return di.isValidZone(t)}static normalizeZone(t){return gi(t,ki.defaultZone)}static months(t="long",{locale:e=null,numberingSystem:i=null,locObj:n=null,outputCalendar:o="gregory"}={}){return(n||zi.create(e,i,o)).months(t)}static monthsFormat(t="long",{locale:e=null,numberingSystem:i=null,locObj:n=null,outputCalendar:o="gregory"}={}){return(n||zi.create(e,i,o)).months(t,!0)}static weekdays(t="long",{locale:e=null,numberingSystem:i=null,locObj:n=null}={}){return(n||zi.create(e,i,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:e=null,numberingSystem:i=null,locObj:n=null}={}){return(n||zi.create(e,i,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return zi.create(t).meridiems()}static eras(t="short",{locale:e=null}={}){return zi.create(e,null,"gregory").eras(t)}static features(){return{relative:xe()}}}function Pn(t,e){const i=t=>t.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),n=i(e)-i(t);return Math.floor(Ln.fromMillis(n).as("days"))}function zn(t,e,i,n){let[o,s,r,a]=function(t,e,i){const n=[["years",(t,e)=>e.year-t.year],["quarters",(t,e)=>e.quarter-t.quarter],["months",(t,e)=>e.month-t.month+12*(e.year-t.year)],["weeks",(t,e)=>{const i=Pn(t,e);return(i-i%7)/7}],["days",Pn]],o={};let s,r;for(const[a,l]of n)if(i.indexOf(a)>=0){s=a;let i=l(t,e);r=t.plus({[a]:i}),r>e?(t=t.plus({[a]:i-1}),i-=1):t=r,o[a]=i}return[t,o,r,s]}(t,e,i);const l=e-o,c=i.filter((t=>["hours","minutes","seconds","milliseconds"].indexOf(t)>=0));0===c.length&&(r<e&&(r=o.plus({[a]:1})),r!==o&&(s[a]=(s[a]||0)+l/(r-o)));const h=Ln.fromObject(s,n);return c.length>0?Ln.fromMillis(l,n).shiftTo(...c).plus(h):h}const In={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Dn={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Nn=In.hanidec.replace(/[\[|\]]/g,"").split("");function Rn({numberingSystem:t},e=""){return new RegExp(`${In[t||"latn"]}${e}`)}function Bn(t,e=(t=>t)){return{regex:t,deser:([t])=>e(function(t){let e=parseInt(t,10);if(isNaN(e)){e="";for(let i=0;i<t.length;i++){const n=t.charCodeAt(i);if(-1!==t[i].search(In.hanidec))e+=Nn.indexOf(t[i]);else for(const t in Dn){const[i,o]=Dn[t];n>=i&&n<=o&&(e+=n-i)}}return parseInt(e,10)}return e}(t))}}const qn=`[ ${String.fromCharCode(160)}]`,Zn=new RegExp(qn,"g");function Fn(t){return t.replace(/\./g,"\\.?").replace(Zn,qn)}function Vn(t){return t.replace(/\./g,"").replace(Zn," ").toLowerCase()}function jn(t,e){return null===t?null:{regex:RegExp(t.map(Fn).join("|")),deser:([i])=>t.findIndex((t=>Vn(i)===Vn(t)))+e}}function Un(t,e){return{regex:t,deser:([,t,e])=>Ne(t,e),groups:e}}function Hn(t){return{regex:t,deser:([t])=>t}}const Gn={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"}};let Wn=null;function Kn(t,e){if(t.literal)return t;const i=oi.macroTokenToFormatOpts(t.val);if(!i)return t;const n=oi.create(e,i).formatDateTimeParts((Wn||(Wn=Mo.fromMillis(1555555555555)),Wn)).map((t=>function(t,e,i){const{type:n,value:o}=t;if("literal"===n)return{literal:!0,val:o};const s=i[n];let r=Gn[n];return"object"==typeof r&&(r=r[s]),r?{literal:!1,val:r}:void 0}(t,0,i)));return n.includes(void 0)?t:n}function Yn(t,e,i){const n=function(t,e){return Array.prototype.concat(...t.map((t=>Kn(t,e))))}(oi.parseFormat(i),t),o=n.map((e=>function(t,e){const i=Rn(e),n=Rn(e,"{2}"),o=Rn(e,"{3}"),s=Rn(e,"{4}"),r=Rn(e,"{6}"),a=Rn(e,"{1,2}"),l=Rn(e,"{1,3}"),c=Rn(e,"{1,6}"),h=Rn(e,"{1,9}"),u=Rn(e,"{2,4}"),d=Rn(e,"{4,6}"),p=t=>{return{regex:RegExp((e=t.val,e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"))),deser:([t])=>t,literal:!0};var e},m=(m=>{if(t.literal)return p(m);switch(m.val){case"G":return jn(e.eras("short",!1),0);case"GG":return jn(e.eras("long",!1),0);case"y":return Bn(c);case"yy":case"kk":return Bn(u,Ie);case"yyyy":case"kkkk":return Bn(s);case"yyyyy":return Bn(d);case"yyyyyy":return Bn(r);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return Bn(a);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return Bn(n);case"MMM":return jn(e.months("short",!0,!1),1);case"MMMM":return jn(e.months("long",!0,!1),1);case"LLL":return jn(e.months("short",!1,!1),1);case"LLLL":return jn(e.months("long",!1,!1),1);case"o":case"S":return Bn(l);case"ooo":case"SSS":return Bn(o);case"u":return Hn(h);case"uu":return Hn(a);case"uuu":case"E":case"c":return Bn(i);case"a":return jn(e.meridiems(),0);case"EEE":return jn(e.weekdays("short",!1,!1),1);case"EEEE":return jn(e.weekdays("long",!1,!1),1);case"ccc":return jn(e.weekdays("short",!0,!1),1);case"cccc":return jn(e.weekdays("long",!0,!1),1);case"Z":case"ZZ":return Un(new RegExp(`([+-]${a.source})(?::(${n.source}))?`),2);case"ZZZ":return Un(new RegExp(`([+-]${a.source})(${n.source})?`),2);case"z":return Hn(/[a-z_+-/]{1,256}?/i);default:return p(m)}})(t)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"};return m.token=t,m}(e,t))),s=o.find((t=>t.invalidReason));if(s)return{input:e,tokens:n,invalidReason:s.invalidReason};{const[t,i]=function(t){const e=t.map((t=>t.regex)).reduce(((t,e)=>`${t}(${e.source})`),"");return[`^${e}$`,t]}(o),s=RegExp(t,"i"),[r,a]=function(t,e,i){const n=t.match(e);if(n){const t={};let e=1;for(const o in i)if(ke(i,o)){const s=i[o],r=s.groups?s.groups+1:1;!s.literal&&s.token&&(t[s.token.val[0]]=s.deser(n.slice(e,e+r))),e+=r}return[n,t]}return[n,{}]}(e,s,i),[l,c,h]=a?function(t){let e,i=null;ye(t.z)||(i=di.create(t.z)),ye(t.Z)||(i||(i=new mi(t.Z)),e=t.Z),ye(t.q)||(t.M=3*(t.q-1)+1),ye(t.h)||(t.h<12&&1===t.a?t.h+=12:12===t.h&&0===t.a&&(t.h=0)),0===t.G&&t.y&&(t.y=-t.y),ye(t.u)||(t.S=$e(t.u));const n=Object.keys(t).reduce(((e,i)=>{const n=(t=>{switch(t){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}})(i);return n&&(e[n]=t[i]),e}),{});return[n,i,e]}(a):[null,null,void 0];if(ke(a,"a")&&ke(a,"H"))throw new Vt("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:n,regex:s,rawMatches:r,matches:a,result:l,zone:c,specificOffset:h}}}const Jn=[0,31,59,90,120,151,181,212,243,273,304,334],Xn=[0,31,60,91,121,152,182,213,244,274,305,335];function Qn(t,e){return new si("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${t}, which is invalid`)}function to(t,e,i){const n=new Date(Date.UTC(t,e-1,i));t<100&&t>=0&&n.setUTCFullYear(n.getUTCFullYear()-1900);const o=n.getUTCDay();return 0===o?7:o}function eo(t,e,i){return i+(Ae(t)?Xn:Jn)[e-1]}function io(t,e){const i=Ae(t)?Xn:Jn,n=i.findIndex((t=>t<e));return{month:n+1,day:e-i[n]}}function no(t){const{year:e,month:i,day:n}=t,o=eo(e,i,n),s=to(e,i,n);let r,a=Math.floor((o-s+10)/7);return a<1?(r=e-1,a=ze(r)):a>ze(e)?(r=e+1,a=1):r=e,{weekYear:r,weekNumber:a,weekday:s,...Ze(t)}}function oo(t){const{weekYear:e,weekNumber:i,weekday:n}=t,o=to(e,1,4),s=Oe(e);let r,a=7*i+n-o-3;a<1?(r=e-1,a+=Oe(r)):a>s?(r=e+1,a-=Oe(e)):r=e;const{month:l,day:c}=io(r,a);return{year:r,month:l,day:c,...Ze(t)}}function so(t){const{year:e,month:i,day:n}=t;return{year:e,ordinal:eo(e,i,n),...Ze(t)}}function ro(t){const{year:e,ordinal:i}=t,{month:n,day:o}=io(e,i);return{year:e,month:n,day:o,...Ze(t)}}function ao(t){const e=_e(t.year),i=Se(t.month,1,12),n=Se(t.day,1,Me(t.year,t.month));return e?i?!n&&Qn("day",t.day):Qn("month",t.month):Qn("year",t.year)}function lo(t){const{hour:e,minute:i,second:n,millisecond:o}=t,s=Se(e,0,23)||24===e&&0===i&&0===n&&0===o,r=Se(i,0,59),a=Se(n,0,59),l=Se(o,0,999);return s?r?a?!l&&Qn("millisecond",o):Qn("second",n):Qn("minute",i):Qn("hour",e)}const co="Invalid DateTime";function ho(t){return new si("unsupported zone",`the zone "${t.name}" is not supported`)}function uo(t){return null===t.weekData&&(t.weekData=no(t.c)),t.weekData}function po(t,e){const i={ts:t.ts,zone:t.zone,c:t.c,o:t.o,loc:t.loc,invalid:t.invalid};return new Mo({...i,...e,old:i})}function mo(t,e,i){let n=t-60*e*1e3;const o=i.offset(n);if(e===o)return[n,e];n-=60*(o-e)*1e3;const s=i.offset(n);return o===s?[n,o]:[t-60*Math.min(o,s)*1e3,Math.max(o,s)]}function fo(t,e){const i=new Date(t+=60*e*1e3);return{year:i.getUTCFullYear(),month:i.getUTCMonth()+1,day:i.getUTCDate(),hour:i.getUTCHours(),minute:i.getUTCMinutes(),second:i.getUTCSeconds(),millisecond:i.getUTCMilliseconds()}}function go(t,e,i){return mo(Pe(t),e,i)}function vo(t,e){const i=t.o,n=t.c.year+Math.trunc(e.years),o=t.c.month+Math.trunc(e.months)+3*Math.trunc(e.quarters),s={...t.c,year:n,month:o,day:Math.min(t.c.day,Me(n,o))+Math.trunc(e.days)+7*Math.trunc(e.weeks)},r=Ln.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),a=Pe(s);let[l,c]=mo(a,i,t.zone);return 0!==r&&(l+=r,c=t.zone.offset(l)),{ts:l,o:c}}function yo(t,e,i,n,o,s){const{setZone:r,zone:a}=i;if(t&&0!==Object.keys(t).length){const n=e||a,o=Mo.fromObject(t,{...i,zone:n,specificOffset:s});return r?o:o.setZone(a)}return Mo.invalid(new si("unparsable",`the input "${o}" can't be parsed as ${n}`))}function bo(t,e,i=!0){return t.isValid?oi.create(zi.create("en-US"),{allowZ:i,forceSimple:!0}).formatDateTimeFromString(t,e):null}function _o(t,e){const i=t.c.year>9999||t.c.year<0;let n="";return i&&t.c.year>=0&&(n+="+"),n+=Ce(t.c.year,i?6:4),e?(n+="-",n+=Ce(t.c.month),n+="-",n+=Ce(t.c.day)):(n+=Ce(t.c.month),n+=Ce(t.c.day)),n}function xo(t,e,i,n,o,s){let r=Ce(t.c.hour);return e?(r+=":",r+=Ce(t.c.minute),0===t.c.second&&i||(r+=":")):r+=Ce(t.c.minute),0===t.c.second&&i||(r+=Ce(t.c.second),0===t.c.millisecond&&n||(r+=".",r+=Ce(t.c.millisecond,3))),o&&(t.isOffsetFixed&&0===t.offset&&!s?r+="Z":t.o<0?(r+="-",r+=Ce(Math.trunc(-t.o/60)),r+=":",r+=Ce(Math.trunc(-t.o%60))):(r+="+",r+=Ce(Math.trunc(t.o/60)),r+=":",r+=Ce(Math.trunc(t.o%60)))),s&&(r+="["+t.zone.ianaName+"]"),r}const wo={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},ko={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},So={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Co=["year","month","day","hour","minute","second","millisecond"],To=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Eo=["year","ordinal","hour","minute","second","millisecond"];function $o(t){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[t.toLowerCase()];if(!e)throw new jt(t);return e}function Lo(t,e){const i=gi(e.zone,ki.defaultZone),n=zi.fromObject(e),o=ki.now();let s,r;if(ye(t.year))s=o;else{for(const e of Co)ye(t[e])&&(t[e]=wo[e]);const e=ao(t)||lo(t);if(e)return Mo.invalid(e);const n=i.offset(o);[s,r]=go(t,n,i)}return new Mo({ts:s,zone:i,loc:n,o:r})}function Ao(t,e,i){const n=!!ye(i.round)||i.round,o=(t,o)=>{t=Le(t,n||i.calendary?0:2,!0);return e.loc.clone(i).relFormatter(i).format(t,o)},s=n=>i.calendary?e.hasSame(t,n)?0:e.startOf(n).diff(t.startOf(n),n).get(n):e.diff(t,n).get(n);if(i.unit)return o(s(i.unit),i.unit);for(const t of i.units){const e=s(t);if(Math.abs(e)>=1)return o(e,t)}return o(t>e?-0:0,i.units[i.units.length-1])}function Oo(t){let e,i={};return t.length>0&&"object"==typeof t[t.length-1]?(i=t[t.length-1],e=Array.from(t).slice(0,t.length-1)):e=Array.from(t),[i,e]}class Mo{constructor(t){const e=t.zone||ki.defaultZone;let i=t.invalid||(Number.isNaN(t.ts)?new si("invalid input"):null)||(e.isValid?null:ho(e));this.ts=ye(t.ts)?ki.now():t.ts;let n=null,o=null;if(!i){if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(e))[n,o]=[t.old.c,t.old.o];else{const t=e.offset(this.ts);n=fo(this.ts,t),i=Number.isNaN(n.year)?new si("invalid input"):null,n=i?null:n,o=i?null:t}}this._zone=e,this.loc=t.loc||zi.create(),this.invalid=i,this.weekData=null,this.c=n,this.o=o,this.isLuxonDateTime=!0}static now(){return new Mo({})}static local(){const[t,e]=Oo(arguments),[i,n,o,s,r,a,l]=e;return Lo({year:i,month:n,day:o,hour:s,minute:r,second:a,millisecond:l},t)}static utc(){const[t,e]=Oo(arguments),[i,n,o,s,r,a,l]=e;return t.zone=mi.utcInstance,Lo({year:i,month:n,day:o,hour:s,minute:r,second:a,millisecond:l},t)}static fromJSDate(t,e={}){const i=function(t){return"[object Date]"===Object.prototype.toString.call(t)}(t)?t.valueOf():NaN;if(Number.isNaN(i))return Mo.invalid("invalid input");const n=gi(e.zone,ki.defaultZone);return n.isValid?new Mo({ts:i,zone:n,loc:zi.fromObject(e)}):Mo.invalid(ho(n))}static fromMillis(t,e={}){if(be(t))return t<-864e13||t>864e13?Mo.invalid("Timestamp out of range"):new Mo({ts:t,zone:gi(e.zone,ki.defaultZone),loc:zi.fromObject(e)});throw new Ut(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,e={}){if(be(t))return new Mo({ts:1e3*t,zone:gi(e.zone,ki.defaultZone),loc:zi.fromObject(e)});throw new Ut("fromSeconds requires a numerical input")}static fromObject(t,e={}){t=t||{};const i=gi(e.zone,ki.defaultZone);if(!i.isValid)return Mo.invalid(ho(i));const n=ki.now(),o=ye(e.specificOffset)?i.offset(n):e.specificOffset,s=Be(t,$o),r=!ye(s.ordinal),a=!ye(s.year),l=!ye(s.month)||!ye(s.day),c=a||l,h=s.weekYear||s.weekNumber,u=zi.fromObject(e);if((c||r)&&h)throw new Vt("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&r)throw new Vt("Can't mix ordinal dates with month/day");const d=h||s.weekday&&!c;let p,m,f=fo(n,o);d?(p=To,m=ko,f=no(f)):r?(p=Eo,m=So,f=so(f)):(p=Co,m=wo);let g=!1;for(const t of p){ye(s[t])?s[t]=g?m[t]:f[t]:g=!0}const v=d?function(t){const e=_e(t.weekYear),i=Se(t.weekNumber,1,ze(t.weekYear)),n=Se(t.weekday,1,7);return e?i?!n&&Qn("weekday",t.weekday):Qn("week",t.week):Qn("weekYear",t.weekYear)}(s):r?function(t){const e=_e(t.year),i=Se(t.ordinal,1,Oe(t.year));return e?!i&&Qn("ordinal",t.ordinal):Qn("year",t.year)}(s):ao(s),y=v||lo(s);if(y)return Mo.invalid(y);const b=d?oo(s):r?ro(s):s,[_,x]=go(b,o,i),w=new Mo({ts:_,zone:i,o:x,loc:u});return s.weekday&&c&&t.weekday!==w.weekday?Mo.invalid("mismatched weekday",`you can't specify both a weekday of ${s.weekday} and a date of ${w.toISO()}`):w}static fromISO(t,e={}){const[i,n]=function(t){return Ni(t,[hn,mn],[un,fn],[dn,gn],[pn,vn])}(t);return yo(i,n,e,"ISO 8601",t)}static fromRFC2822(t,e={}){const[i,n]=function(t){return Ni(function(t){return t.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(t),[nn,on])}(t);return yo(i,n,e,"RFC 2822",t)}static fromHTTP(t,e={}){const[i,n]=function(t){return Ni(t,[sn,ln],[rn,ln],[an,cn])}(t);return yo(i,n,e,"HTTP",e)}static fromFormat(t,e,i={}){if(ye(t)||ye(e))throw new Ut("fromFormat requires an input string and a format");const{locale:n=null,numberingSystem:o=null}=i,s=zi.fromOpts({locale:n,numberingSystem:o,defaultToEN:!0}),[r,a,l,c]=function(t,e,i){const{result:n,zone:o,specificOffset:s,invalidReason:r}=Yn(t,e,i);return[n,o,s,r]}(s,t,e);return c?Mo.invalid(c):yo(r,a,i,`format ${e}`,t,l)}static fromString(t,e,i={}){return Mo.fromFormat(t,e,i)}static fromSQL(t,e={}){const[i,n]=function(t){return Ni(t,[bn,mn],[_n,xn])}(t);return yo(i,n,e,"SQL",t)}static invalid(t,e=null){if(!t)throw new Ut("need to specify a reason the DateTime is invalid");const i=t instanceof si?t:new si(t,e);if(ki.throwOnInvalid)throw new qt(i);return new Mo({invalid:i})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}get(t){return this[t]}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?uo(this).weekYear:NaN}get weekNumber(){return this.isValid?uo(this).weekNumber:NaN}get weekday(){return this.isValid?uo(this).weekday:NaN}get ordinal(){return this.isValid?so(this.c).ordinal:NaN}get monthShort(){return this.isValid?Mn.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Mn.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Mn.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Mn.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return!this.isOffsetFixed&&(this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset)}get isInLeapYear(){return Ae(this.year)}get daysInMonth(){return Me(this.year,this.month)}get daysInYear(){return this.isValid?Oe(this.year):NaN}get weeksInWeekYear(){return this.isValid?ze(this.weekYear):NaN}resolvedLocaleOptions(t={}){const{locale:e,numberingSystem:i,calendar:n}=oi.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:e,numberingSystem:i,outputCalendar:n}}toUTC(t=0,e={}){return this.setZone(mi.instance(t),e)}toLocal(){return this.setZone(ki.defaultZone)}setZone(t,{keepLocalTime:e=!1,keepCalendarTime:i=!1}={}){if((t=gi(t,ki.defaultZone)).equals(this.zone))return this;if(t.isValid){let n=this.ts;if(e||i){const e=t.offset(this.ts),i=this.toObject();[n]=go(i,e,t)}return po(this,{ts:n,zone:t})}return Mo.invalid(ho(t))}reconfigure({locale:t,numberingSystem:e,outputCalendar:i}={}){return po(this,{loc:this.loc.clone({locale:t,numberingSystem:e,outputCalendar:i})})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const e=Be(t,$o),i=!ye(e.weekYear)||!ye(e.weekNumber)||!ye(e.weekday),n=!ye(e.ordinal),o=!ye(e.year),s=!ye(e.month)||!ye(e.day),r=o||s,a=e.weekYear||e.weekNumber;if((r||n)&&a)throw new Vt("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(s&&n)throw new Vt("Can't mix ordinal dates with month/day");let l;i?l=oo({...no(this.c),...e}):ye(e.ordinal)?(l={...this.toObject(),...e},ye(e.day)&&(l.day=Math.min(Me(l.year,l.month),l.day))):l=ro({...so(this.c),...e});const[c,h]=go(l,this.o,this.zone);return po(this,{ts:c,o:h})}plus(t){if(!this.isValid)return this;return po(this,vo(this,Ln.fromDurationLike(t)))}minus(t){if(!this.isValid)return this;return po(this,vo(this,Ln.fromDurationLike(t).negate()))}startOf(t){if(!this.isValid)return this;const e={},i=Ln.normalizeUnit(t);switch(i){case"years":e.month=1;case"quarters":case"months":e.day=1;case"weeks":case"days":e.hour=0;case"hours":e.minute=0;case"minutes":e.second=0;case"seconds":e.millisecond=0}if("weeks"===i&&(e.weekday=1),"quarters"===i){const t=Math.ceil(this.month/3);e.month=3*(t-1)+1}return this.set(e)}endOf(t){return this.isValid?this.plus({[t]:1}).startOf(t).minus(1):this}toFormat(t,e={}){return this.isValid?oi.create(this.loc.redefaultToEN(e)).formatDateTimeFromString(this,t):co}toLocaleString(t=Yt,e={}){return this.isValid?oi.create(this.loc.clone(e),t).formatDateTime(this):co}toLocaleParts(t={}){return this.isValid?oi.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:e=!1,suppressMilliseconds:i=!1,includeOffset:n=!0,extendedZone:o=!1}={}){if(!this.isValid)return null;const s="extended"===t;let r=_o(this,s);return r+="T",r+=xo(this,s,e,i,n,o),r}toISODate({format:t="extended"}={}){return this.isValid?_o(this,"extended"===t):null}toISOWeekDate(){return bo(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:e=!1,includeOffset:i=!0,includePrefix:n=!1,extendedZone:o=!1,format:s="extended"}={}){if(!this.isValid)return null;return(n?"T":"")+xo(this,"extended"===s,e,t,i,o)}toRFC2822(){return bo(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return bo(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?_o(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:e=!1,includeOffsetSpace:i=!0}={}){let n="HH:mm:ss.SSS";return(e||t)&&(i&&(n+=" "),e?n+="z":t&&(n+="ZZ")),bo(this,n,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():co}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(t={}){if(!this.isValid)return{};const e={...this.c};return t.includeConfig&&(e.outputCalendar=this.outputCalendar,e.numberingSystem=this.loc.numberingSystem,e.locale=this.loc.locale),e}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(t,e="milliseconds",i={}){if(!this.isValid||!t.isValid)return Ln.invalid("created by diffing an invalid DateTime");const n={locale:this.locale,numberingSystem:this.numberingSystem,...i},o=(a=e,Array.isArray(a)?a:[a]).map(Ln.normalizeUnit),s=t.valueOf()>this.valueOf(),r=zn(s?this:t,s?t:this,o,n);var a;return s?r.negate():r}diffNow(t="milliseconds",e={}){return this.diff(Mo.now(),t,e)}until(t){return this.isValid?On.fromDateTimes(this,t):this}hasSame(t,e){if(!this.isValid)return!1;const i=t.valueOf(),n=this.setZone(t.zone,{keepLocalTime:!0});return n.startOf(e)<=i&&i<=n.endOf(e)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;const e=t.base||Mo.fromObject({},{zone:this.zone}),i=t.padding?this<e?-t.padding:t.padding:0;let n=["years","months","days","hours","minutes","seconds"],o=t.unit;return Array.isArray(t.unit)&&(n=t.unit,o=void 0),Ao(e,this.plus(i),{...t,numeric:"always",units:n,unit:o})}toRelativeCalendar(t={}){return this.isValid?Ao(t.base||Mo.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(Mo.isDateTime))throw new Ut("min requires all arguments be DateTimes");return we(t,(t=>t.valueOf()),Math.min)}static max(...t){if(!t.every(Mo.isDateTime))throw new Ut("max requires all arguments be DateTimes");return we(t,(t=>t.valueOf()),Math.max)}static fromFormatExplain(t,e,i={}){const{locale:n=null,numberingSystem:o=null}=i;return Yn(zi.fromOpts({locale:n,numberingSystem:o,defaultToEN:!0}),t,e)}static fromStringExplain(t,e,i={}){return Mo.fromFormatExplain(t,e,i)}static get DATE_SHORT(){return Yt}static get DATE_MED(){return Jt}static get DATE_MED_WITH_WEEKDAY(){return Xt}static get DATE_FULL(){return Qt}static get DATE_HUGE(){return te}static get TIME_SIMPLE(){return ee}static get TIME_WITH_SECONDS(){return ie}static get TIME_WITH_SHORT_OFFSET(){return ne}static get TIME_WITH_LONG_OFFSET(){return oe}static get TIME_24_SIMPLE(){return se}static get TIME_24_WITH_SECONDS(){return re}static get TIME_24_WITH_SHORT_OFFSET(){return ae}static get TIME_24_WITH_LONG_OFFSET(){return le}static get DATETIME_SHORT(){return ce}static get DATETIME_SHORT_WITH_SECONDS(){return he}static get DATETIME_MED(){return ue}static get DATETIME_MED_WITH_SECONDS(){return de}static get DATETIME_MED_WITH_WEEKDAY(){return pe}static get DATETIME_FULL(){return me}static get DATETIME_FULL_WITH_SECONDS(){return fe}static get DATETIME_HUGE(){return ge}static get DATETIME_HUGE_WITH_SECONDS(){return ve}}function Po(t){if(Mo.isDateTime(t))return t;if(t&&t.valueOf&&be(t.valueOf()))return Mo.fromJSDate(t);if(t&&"object"==typeof t)return Mo.fromObject(t);throw new Ut(`Unknown datetime argument: ${t}, of type ${typeof t}`)}class zo extends tt{constructor(){super(...arguments),this.ttl=6e4,this.max=20,this.keyedAssets={},this.locale=[...navigator.languages],this.fields={},this.groups={},this.languages={},this.pinnedFields=[],this.langService=new Nt,this.humanizer=new Rt(this.langService),this.pendingResolves={},this.fetching={}}reset(){this.cache=Dt(this.max,this.ttl);const t=[];this.completionEndpoint&&t.push(ft(this.completionEndpoint).then((t=>{this.schema=t.json.context,this.fnOptions=t.json.functions}))),this.fieldsEndpoint&&t.push(_t(this.fieldsEndpoint).then((t=>{this.keyedAssets.fields=[],this.pinnedFields=[],t.forEach((t=>{this.keyedAssets.fields.push(t.key),this.fields[t.key]=t,t.pinned&&this.pinnedFields.push(t)})),this.pinnedFields.sort(((t,e)=>e.priority-t.priority))}))),this.globalsEndpoint&&t.push(_t(this.globalsEndpoint).then((t=>{this.keyedAssets.globals=t.map((t=>t.key))}))),this.languagesEndpoint&&t.push(_t(this.languagesEndpoint).then((t=>{this.languages=t.reduce((function(t,e){return t[e.value]=e.name,t}),{})}))),this.groupsEndpoint&&t.push(_t(this.groupsEndpoint).then((t=>{t.forEach((t=>{this.groups[t.uuid]=t}))}))),this.workspaceEndpoint&&t.push(ft(this.workspaceEndpoint).then((t=>{this.workspace=t.json;const e=t.headers.get("content-language");e&&(this.locale=[e,...this.locale])}))),this.httpComplete=Promise.all(t)}firstUpdated(){this.reset()}getLanguageCode(){return this.locale.length>0?this.locale[0].split("-")[0]:"en"}getShortDuration(t,e=null,i=!1){const n=Mo.fromISO(t),o=e?Mo.fromISO(e):Mo.now(),s=n.diff(o).valueOf();return i?this.humanizer.humanize(s,{language:this.getLanguageCode(),largest:1,round:!0}):Math.abs(s)<6e4?"just now":this.humanizer.humanize(s,{language:this.getLanguageCode(),largest:1,round:!1})}setKeyedAssets(t,e){this.keyedAssets[t]=e}updated(t){super.updated(t)}getCompletionSchema(){return this.schema}getFunctions(){return this.fnOptions}getKeyedAssets(){return this.keyedAssets}getContactField(t){return this.fields[t]}getPinnedFields(){return this.pinnedFields}getLanguageName(t){return this.languages[t]}isDynamicGroup(t){const e=this.groups[t];return!(!e||!e.query)}getWorkspace(){return this.workspace}formatDate(t){return new Date(t).toLocaleString(this.locale,{year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric"})}postUrl(t,e="",i={},n=null){return xt(t,e,i,n)}getUrl(t,e){return!(e=e||{}).force&&this.cache.has(t)?new Promise((e=>{e(this.cache.get(t))})):ft(t,e.controller,e.headers||{}).then((e=>new Promise(((i,n)=>{e.status>=200&&e.status<=300?(this.cache.set(t,e),i(e)):n("Status: "+e.status)}))))}getResults(t,e){e=e||{};const i="results_"+t,n=this.cache.get(i);return!e.force&&n?new Promise((t=>{t(n)})):new Promise((e=>{const n=this.pendingResolves[t]||[];n.push(e),this.pendingResolves[t]=n,n.length<=1&&yt(t).then((e=>{this.cache.set(i,e);const n=this.pendingResolves[t]||[];for(;n.length>0;){n.pop()(e)}}))}))}updateCache(t,e){this.cache.set(t,e),this.fireCustomEvent(zt.StoreUpdated,{url:t,data:e})}makeRequest(t,e){const i=this.fetching[t],n=(new Date).getTime();if(i&&n-i<500)return;this.fetching[t]=n,e=e||{};const o=this.cache.get(t);o&&!e.force?this.fireCustomEvent(zt.StoreUpdated,{url:t,data:o}):yt(t).then((i=>{i=e.prepareData?e.prepareData(i):i,this.cache.set(t,i),this.fireCustomEvent(zt.StoreUpdated,{url:t,data:i}),delete this.fetching[t]}))}}t([it({type:Number})],zo.prototype,"ttl",void 0),t([it({type:Number})],zo.prototype,"max",void 0),t([it({type:String,attribute:"completion"})],zo.prototype,"completionEndpoint",void 0),t([it({type:String,attribute:"fields"})],zo.prototype,"fieldsEndpoint",void 0),t([it({type:String,attribute:"groups"})],zo.prototype,"groupsEndpoint",void 0),t([it({type:String,attribute:"globals"})],zo.prototype,"globalsEndpoint",void 0),t([it({type:String,attribute:"languages"})],zo.prototype,"languagesEndpoint",void 0),t([it({type:String,attribute:"workspace"})],zo.prototype,"workspaceEndpoint",void 0),t([it({type:Object,attribute:!1})],zo.prototype,"schema",void 0),t([it({type:Object,attribute:!1})],zo.prototype,"fnOptions",void 0),t([it({type:Object,attribute:!1})],zo.prototype,"keyedAssets",void 0);class Io extends tt{constructor(){super(...arguments),this.marginHorizontal=0,this.marginVertical=7,this.scrollPct=75,this.cursorIndex=-1,this.nameKey="name",this.loading=!1,this.hideShadow=!1,this.getName=function(t){return t[this.nameKey||"name"]},this.renderInputOption=function(){return null},this.scrollHeight=0,this.triggerScroll=!1,this.scrollParent=null,this.setCursor=Tt((function(t){t!==this.cursorIndex&&(this.cursorIndex=t)}),50)}static get styles(){return s`
290
225
  .options-container {
291
226
  background: var(--color-options-bg);
292
227
  user-select: none;
@@ -448,26 +383,26 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
448
383
  .loading .loader-bar {
449
384
  max-height: 1.1em;
450
385
  }
451
- `}firstUpdated(){this.block||(this.scrollParent=ee(this),this.calculatePosition=this.calculatePosition.bind(this),this.scrollParent&&this.scrollParent.addEventListener("scroll",this.calculatePosition),this.calculatePosition()),this.resolvedRenderOption=(this.renderOption||this.renderOptionDefault).bind(this)}disconnectedCallback(){this.block||this.scrollParent&&this.scrollParent.removeEventListener("scroll",this.calculatePosition)}isFocused(){return this.closestElement(document.activeElement.tagName)===document.activeElement}updated(t){if(super.updated(t),t.has("cursorIndex")){const t=this.shadowRoot.querySelector(`div[data-option-index="${this.cursorIndex}"]`);if(t){const e=this.shadowRoot.querySelector(".options-container"),i=e.getBoundingClientRect().height,n=t.getBoundingClientRect().height;if(t.offsetTop+n>e.scrollTop+i-5){const o=t.offsetTop-i+n+5;e.scrollTop=o}else if(t.offsetTop<e.scrollTop){const i=t.offsetTop-5;e.scrollTop=i}}this.fireCustomEvent(ue.CursorChanged,{index:this.cursorIndex})}if(t.has("visible")&&t.has("options")&&(this.visible||0!=this.options.length||(this.tempOptions=t.get("options"),window.setTimeout((()=>{this.tempOptions=[]}),300))),t.has("options")){this.calculatePosition(),this.triggerScroll=!0;const e=t.get("options"),i=e?e.length:0,n=this.options?this.options.length:0;(-1===this.cursorIndex||n<i||0===i&&n>0&&!t.has("cursorIndex"))&&(this.block?this.cursorIndex>=n&&(this.cursorIndex=n-1):this.cursorIndex=0,this.block&&this.handleSelection(!1));const o=this.shadowRoot.querySelector(".options");o.scrollHeight==o.clientHeight&&this.fireCustomEvent(ue.ScrollThreshold)}t.has("visible")&&window.setTimeout((()=>{this.calculatePosition()}),100)}renderOptionDefault(t,e){const i=(this.renderOptionName||this.renderOptionNameDefault).bind(this),n=(this.renderOptionDetail||this.renderOptionDetailDefault).bind(this);return e?O`
386
+ `}firstUpdated(){this.block||(this.scrollParent=kt(this),this.calculatePosition=this.calculatePosition.bind(this),this.scrollParent&&this.scrollParent.addEventListener("scroll",this.calculatePosition),this.calculatePosition()),this.resolvedRenderOption=(this.renderOption||this.renderOptionDefault).bind(this)}disconnectedCallback(){this.block||this.scrollParent&&this.scrollParent.removeEventListener("scroll",this.calculatePosition)}isFocused(){return this.closestElement(document.activeElement.tagName)===document.activeElement}updated(t){if(super.updated(t),t.has("cursorIndex")){const t=this.shadowRoot.querySelector(`div[data-option-index="${this.cursorIndex}"]`);if(t){const e=this.shadowRoot.querySelector(".options-container"),i=e.getBoundingClientRect().height,n=t.getBoundingClientRect().height;if(t.offsetTop+n>e.scrollTop+i-5){const o=t.offsetTop-i+n+5;e.scrollTop=o}else if(t.offsetTop<e.scrollTop){const i=t.offsetTop-5;e.scrollTop=i}}this.fireCustomEvent(zt.CursorChanged,{index:this.cursorIndex})}if(t.has("visible")&&t.has("options")&&(this.visible||0!=this.options.length||(this.tempOptions=t.get("options"),window.setTimeout((()=>{this.tempOptions=[]}),300))),t.has("options")){this.calculatePosition(),this.triggerScroll=!0;const e=t.get("options"),i=e?e.length:0,n=this.options?this.options.length:0;(-1===this.cursorIndex||n<i||0===i&&n>0&&!t.has("cursorIndex"))&&(this.block?this.cursorIndex>=n&&(this.cursorIndex=n-1):this.cursorIndex=0,this.block&&this.handleSelection(!1));const o=this.shadowRoot.querySelector(".options");o.scrollHeight==o.clientHeight&&this.fireCustomEvent(zt.ScrollThreshold)}t.has("visible")&&window.setTimeout((()=>{this.calculatePosition()}),100)}renderOptionDefault(t,e){const i=(this.renderOptionName||this.renderOptionNameDefault).bind(this),n=(this.renderOptionDetail||this.renderOptionDetailDefault).bind(this);return e?P`
452
387
  <div class="name">${i(t,e)}</div>
453
388
  <div class="detail">${n(t,e)}</div>
454
- `:O`
389
+ `:P`
455
390
  <div class="name">${i(t,e)}</div>
456
- `}renderOptionNameDefault(t){return O`<div style="display:flex; align-items:flex-start">
457
- ${t.icon?O`<temba-icon
391
+ `}renderOptionNameDefault(t){return P`<div style="display:flex; align-items:flex-start">
392
+ ${t.icon?P`<temba-icon
458
393
  name="${t.icon}"
459
394
  style="margin-right:0.5em; fill: var(--color-text-dark);"
460
395
  ></temba-icon>`:null}
461
396
  <div style="flex-grow:1">${t.prefix}${this.getName(t)}</div>
462
- </div>`}renderOptionDetailDefault(t){return O` ${t.detail} `}handleSelection(t=!1,e=-1){-1===e&&(e=this.cursorIndex);const i=this.options[e];this.fireCustomEvent(ue.Selection,{selected:i,tabbed:t,index:e})}moveCursor(t){const e=Math.max(Math.min(this.cursorIndex+t,this.options.length-1),0);this.setCursor(e)}handleKeyDown(t){this.block&&!this.isFocused()||this.options&&this.options.length>0&&(t.ctrlKey&&"n"===t.key||"ArrowDown"===t.key?(this.moveCursor(1),t.preventDefault(),t.stopPropagation(),this.block&&this.handleSelection(!1)):t.ctrlKey&&"p"===t.key||"ArrowUp"===t.key?(this.moveCursor(-1),t.preventDefault(),this.block&&this.handleSelection(!1)):("Enter"===t.key||"Tab"===t.key||this.spaceSelect&&" "===t.key)&&(t.preventDefault(),t.stopPropagation(),this.handleSelection("Tab"===t.key)),"Escape"===t.key&&this.fireCustomEvent(ue.Canceled))}handleInnerScroll(t){const e=t.target;if(e.scrollHeight>this.scrollHeight&&(this.scrollHeight=e.scrollHeight,this.triggerScroll=!0),this.triggerScroll){100*(e.scrollTop/(e.scrollHeight-e.clientHeight))>this.scrollPct&&(this.fireCustomEvent(ue.ScrollThreshold),this.triggerScroll=!1)}}calculatePosition(){if(this.visible&&!this.block){const t=this.shadowRoot.querySelector(".options-container").getBoundingClientRect();if(this.anchorTo){const e=this.anchorTo.getBoundingClientRect(),i=e.top-t.height;this.anchorTo&&this.scrollParent&&((t,e)=>{e=e||document.body;const{top:i,bottom:n}=t.getBoundingClientRect(),o=e.getBoundingClientRect();i<=o.top?o.top:o.bottom})(this.anchorTo,this.scrollParent),i>0&&e.bottom+t.height>window.innerHeight?(this.top=i,this.poppedTop=!0):(this.top=e.bottom,this.poppedTop=!1),this.left=e.left,this.width=this.staticWidth>0?this.staticWidth:e.width-2-2*this.marginHorizontal,this.anchorRight&&(this.left=e.right-this.width)}}}getEventHandlers(){return[{event:"keydown",method:this.handleKeyDown,isDocument:!0},{event:"scroll",method:this.calculatePosition,isDocument:!0}]}handleMouseMove(t){if(!this.block&&Math.abs(t.movementX)+Math.abs(t.movementY)>0){const e=t.currentTarget.getAttribute("data-option-index");this.setCursor(parseInt(e))}}handleMouseDown(t){t.preventDefault(),t.stopPropagation()}handleOptionClick(t){t.preventDefault(),t.stopPropagation();const e=t.currentTarget.getAttribute("data-option-index");if(e){const t=parseInt(e);this.setCursor(t),this.handleSelection(!1,t)}}render(){let t=this.block?0:this.marginVertical;this.poppedTop&&(t*=-1);const e={top:this.top?`${this.top}px`:"0px",left:this.left?`${this.left}px`:"0px","margin-left":`${this.marginHorizontal}px`,"margin-top":`${t}px`},i={};this.width&&(i.width=`${this.width}px`);const n=Gt({"options-container":!0,show:this.visible,top:this.poppedTop,anchored:!this.block,loading:this.loading,shadow:!this.hideShadow,bordered:this.hideShadow}),o=Gt({options:!0});let r=this.options||[];return 0==r.length&&this.tempOptions&&this.tempOptions.length>0&&(r=this.tempOptions),O`
463
- <div class=${n} style=${dt(e)}>
397
+ </div>`}renderOptionDetailDefault(t){return P` ${t.detail} `}handleSelection(t=!1,e=-1){-1===e&&(e=this.cursorIndex);const i=this.options[e];this.fireCustomEvent(zt.Selection,{selected:i,tabbed:t,index:e})}moveCursor(t){const e=Math.max(Math.min(this.cursorIndex+t,this.options.length-1),0);this.setCursor(e)}handleKeyDown(t){this.block&&!this.isFocused()||this.options&&this.options.length>0&&(t.ctrlKey&&"n"===t.key||"ArrowDown"===t.key?(this.moveCursor(1),t.preventDefault(),t.stopPropagation(),this.block&&this.handleSelection(!1)):t.ctrlKey&&"p"===t.key||"ArrowUp"===t.key?(this.moveCursor(-1),t.preventDefault(),this.block&&this.handleSelection(!1)):("Enter"===t.key||"Tab"===t.key||this.spaceSelect&&" "===t.key)&&(t.preventDefault(),t.stopPropagation(),this.handleSelection("Tab"===t.key)),"Escape"===t.key&&this.fireCustomEvent(zt.Canceled))}handleInnerScroll(t){const e=t.target;if(e.scrollHeight>this.scrollHeight&&(this.scrollHeight=e.scrollHeight,this.triggerScroll=!0),this.triggerScroll){100*(e.scrollTop/(e.scrollHeight-e.clientHeight))>this.scrollPct&&(this.fireCustomEvent(zt.ScrollThreshold),this.triggerScroll=!1)}}calculatePosition(){if(this.visible&&!this.block){const t=this.shadowRoot.querySelector(".options-container").getBoundingClientRect();if(this.anchorTo){const e=this.anchorTo.getBoundingClientRect(),i=e.top-t.height;this.anchorTo&&this.scrollParent&&((t,e)=>{e=e||document.body;const{top:i,bottom:n}=t.getBoundingClientRect(),o=e.getBoundingClientRect();i<=o.top?o.top:o.bottom})(this.anchorTo,this.scrollParent),i>0&&e.bottom+t.height>window.innerHeight?(this.top=i,this.poppedTop=!0):(this.top=e.bottom,this.poppedTop=!1),this.left=e.left,this.width=this.staticWidth>0?this.staticWidth:e.width-2-2*this.marginHorizontal,this.anchorRight&&(this.left=e.right-this.width)}}}getEventHandlers(){return[{event:"keydown",method:this.handleKeyDown,isDocument:!0},{event:"scroll",method:this.calculatePosition,isDocument:!0}]}handleMouseMove(t){if(!this.block&&Math.abs(t.movementX)+Math.abs(t.movementY)>0){const e=t.currentTarget.getAttribute("data-option-index");this.setCursor(parseInt(e))}}handleMouseDown(t){t.preventDefault(),t.stopPropagation()}handleOptionClick(t){t.preventDefault(),t.stopPropagation();const e=t.currentTarget.getAttribute("data-option-index");if(e){const t=parseInt(e);this.setCursor(t),this.handleSelection(!1,t)}}render(){let t=this.block?0:this.marginVertical;this.poppedTop&&(t*=-1);const e={top:this.top?`${this.top}px`:"0px",left:this.left?`${this.left}px`:"0px","margin-left":`${this.marginHorizontal}px`,"margin-top":`${t}px`},i={};this.width&&(i.width=`${this.width}px`);const n=gt({"options-container":!0,show:this.visible,top:this.poppedTop,anchored:!this.block,loading:this.loading,shadow:!this.hideShadow,bordered:this.hideShadow}),o=gt({options:!0});let s=this.options||[];return 0==s.length&&this.tempOptions&&this.tempOptions.length>0&&(s=this.tempOptions),P`
398
+ <div class=${n} style=${ut(e)}>
464
399
  <div
465
400
  class="options-scroll"
466
401
  @scroll=${this.handleInnerScroll}
467
402
  @mousedown=${this.handleMouseDown}
468
403
  >
469
- <div class="${o}" style=${dt(i)}>
470
- ${r.map(((t,e)=>O`<div
404
+ <div class="${o}" style=${ut(i)}>
405
+ ${s.map(((t,e)=>P`<div
471
406
  data-option-index="${e}"
472
407
  @mousemove=${this.handleMouseMove}
473
408
  @click=${this.handleOptionClick}
@@ -476,7 +411,7 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
476
411
  >
477
412
  ${this.resolvedRenderOption(t,e===this.cursorIndex)}
478
413
  </div>`))}
479
- ${this.block?O`<div style="height:0.1em"></div>`:null}
414
+ ${this.block?P`<div style="height:0.1em"></div>`:null}
480
415
  </div>
481
416
  <slot></slot>
482
417
  </div>
@@ -485,25 +420,25 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
485
420
  <temba-loading></temba-loading>
486
421
  </div>
487
422
  </div>
488
- `}}t([it({type:Number})],pr.prototype,"top",void 0),t([it({type:Number})],pr.prototype,"left",void 0),t([it({type:Number})],pr.prototype,"width",void 0),t([it({type:Number,attribute:"static-width"})],pr.prototype,"staticWidth",void 0),t([it({type:Boolean,attribute:"anchor-right"})],pr.prototype,"anchorRight",void 0),t([it({type:Number})],pr.prototype,"marginHorizontal",void 0),t([it({type:Number})],pr.prototype,"marginVertical",void 0),t([it({type:Object})],pr.prototype,"anchorTo",void 0),t([it({type:Boolean})],pr.prototype,"visible",void 0),t([it({type:Boolean})],pr.prototype,"block",void 0),t([it({type:Number})],pr.prototype,"scrollPct",void 0),t([it({type:Number})],pr.prototype,"cursorIndex",void 0),t([it({type:Array})],pr.prototype,"options",void 0),t([it({type:Array})],pr.prototype,"tempOptions",void 0),t([it({type:Boolean})],pr.prototype,"poppedTop",void 0),t([it({type:Boolean})],pr.prototype,"spaceSelect",void 0),t([it({type:String})],pr.prototype,"nameKey",void 0),t([it({type:Boolean})],pr.prototype,"loading",void 0),t([it({type:Boolean})],pr.prototype,"collapsed",void 0),t([it({type:Boolean})],pr.prototype,"hideShadow",void 0),t([it({attribute:!1})],pr.prototype,"getName",void 0),t([it({attribute:!1})],pr.prototype,"renderInputOption",void 0),t([it({attribute:!1})],pr.prototype,"renderOption",void 0),t([it({attribute:!1})],pr.prototype,"renderOptionName",void 0),t([it({attribute:!1})],pr.prototype,"renderOptionDetail",void 0),t([it({type:Number})],pr.prototype,"scrollHeight",void 0),t([it({type:Boolean})],pr.prototype,"triggerScroll",void 0);class mr extends ht{constructor(t){if(super(t),this.it=I,t.type!==lt)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===I||null==t)return this._t=void 0,this.it=t;if(t===P)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}mr.directiveName="unsafeHTML",mr.resultType=1;const fr=ct(mr),gr=(t,e,i)=>{const n=t.substring(1);if("("===n[0])return!0;{const t=n.split(".")[0].toLowerCase();if(!i)return e.indexOf(t)>=0;for(const i of e)if(o=t,0===i.indexOf(o,0))return!0;return!1}var o},vr=t=>t>="a"&&t<="z"||t>="A"&&t<="Z"||t>="0"&&t<="9"||"_"===t,yr=t=>{let e=0;for(const i of t)'"'===i&&e++;return e%2!=0};class br{constructor(t,e){this.expressionPrefix=t,this.allowedTopLevels=e}expressionContext(t){const e=this.findExpressions(t);if(0===e.length)return null;const i=e[e.length-1];return i.end<t.length||i.closed?null:i.text.substring(1)}autoCompleteContext(t){if(yr(t))return null;const e=[];let i="",n=!1,o=!1,r="";for(let s=t.length-1;s>=0;s--){const a=t[s];if(" "===a&&(n=!0),","===a&&(n=!0,"("!==e[e.length-1]&&e.push("(")),")"!==a||o||(n=!0,e.push("("),e.push("(")),'"'===a&&(o=!o),n&&("("!==a||o||("("===e[e.length-1]&&e.pop(),0===e.length&&(n=!1))),"("===a&&""===i&&(r="#"),!(n||o||"("===a&&""===i)){if(!vr(a)&&"."!==a)break;i=a+i}}return i.match(/[A-Za-z][\w]*(\.[\w]+)*/)?r+i:null}functionContext(t){let e=yr(t)?4:6,i="",n="("===t[-1]?0:1;for(let o=t.length-1;o>=0;o--){const r=t[o];if("@"===r)return"";if(6===e)0!==n||!vr(r)&&"."!==r?'"'===r?e=4:"("===r?n--:")"===r&&n++:(e=2,i=r+i);else if(2===e){if(!vr(r)&&"."!==r)return i;i=r+i}else 4===e&&'"'===r&&(e=6)}return""}getContactFields(t){const e={},i=/((parent|child\.)*contact\.)*fields\.([a-z0-9_]+)/g,n=this.findExpressions(t);for(const t of n){let n;for(;n=i.exec(t.text);)e[n[3]]=!0}return Object.keys(e)}findExpressions(t){const e=[];let i=0,n=null,o=0;for(let r=0;r<t.length;r++){const s=t[r],a=r<t.length-1?t[r+1]:0,l=r<t.length-2?t[r+2]:0;if(0===i?s!==this.expressionPrefix||!vr(a)&&"("!==a?s===this.expressionPrefix&&a===this.expressionPrefix&&(i=5):(i=1,n={start:r,end:null,text:s,closed:!1}):1===i?(vr(s)?i=2:"("===s&&(i=3,o+=1),n.text+=s):2===i?n.text+=s:3===i?("("===s?o+=1:")"===s?o-=1:'"'===s&&(i=4),n.text+=s,0===o&&(n.end=r+1)):4===i?('"'===s&&(i=3),n.text+=s):5===i&&(i=0),2===i&&(!vr(a)&&"."!==a||"."===a&&!vr(l))&&(n.end=r+1),null!=n&&(null!=n.end||0===a)){const t=0===a;gr(n.text,this.allowedTopLevels,t)&&(n.closed="("===n.text[1]&&0===o,n.end=r+1,e.push(n)),n=null,i=0}}return e}}var _r={Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",GT:">",Gt:"≫",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",LT:"<",Lt:"≪",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"},xr=Object.prototype.hasOwnProperty;function wr(t){return i=t,(e=_r)&&xr.call(e,i)?_r[t]:t;var e,i}var kr=Object.prototype.hasOwnProperty;function Cr(t){var e=[].slice.call(arguments,1);return e.forEach((function(e){if(e){if("object"!=typeof e)throw new TypeError(e+"must be object");Object.keys(e).forEach((function(i){t[i]=e[i]}))}})),t}var Sr=/\\([\\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;function Er(t){return t.indexOf("\\")<0?t:t.replace(Sr,"$1")}function Tr(t){return!(t>=55296&&t<=57343)&&(!(t>=64976&&t<=65007)&&(65535!=(65535&t)&&65534!=(65535&t)&&(!(t>=0&&t<=8)&&(11!==t&&(!(t>=14&&t<=31)&&(!(t>=127&&t<=159)&&!(t>1114111)))))))}function Mr(t){if(t>65535){var e=55296+((t-=65536)>>10),i=56320+(1023&t);return String.fromCharCode(e,i)}return String.fromCharCode(t)}var $r=/&([a-z#][a-z0-9]{1,31});/gi,Dr=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i;function Ar(t,e){var i=0,n=wr(e);return e!==n?n:35===e.charCodeAt(0)&&Dr.test(e)&&Tr(i="x"===e[1].toLowerCase()?parseInt(e.slice(2),16):parseInt(e.slice(1),10))?Mr(i):t}function Lr(t){return t.indexOf("&")<0?t:t.replace($r,Ar)}var Or=/[&<>"]/,Pr=/[&<>"]/g,Ir={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function zr(t){return Ir[t]}function Nr(t){return Or.test(t)?t.replace(Pr,zr):t}var Rr={};function Br(t,e){return++e>=t.length-2?e:"paragraph_open"===t[e].type&&t[e].tight&&"inline"===t[e+1].type&&0===t[e+1].content.length&&"paragraph_close"===t[e+2].type&&t[e+2].tight?Br(t,e+2):e}Rr.blockquote_open=function(){return"<blockquote>\n"},Rr.blockquote_close=function(t,e){return"</blockquote>"+Fr(t,e)},Rr.code=function(t,e){return t[e].block?"<pre><code>"+Nr(t[e].content)+"</code></pre>"+Fr(t,e):"<code>"+Nr(t[e].content)+"</code>"},Rr.fence=function(t,e,i,n,o){var r,s,a,l,c=t[e],h="",d=i.langPrefix;if(c.params){if(s=(r=c.params.split(/\s+/g)).join(" "),a=o.rules.fence_custom,l=r[0],a&&kr.call(a,l))return o.rules.fence_custom[r[0]](t,e,i,n,o);h=' class="'+d+Nr(Lr(Er(s)))+'"'}return"<pre><code"+h+">"+(i.highlight&&i.highlight.apply(i.highlight,[c.content].concat(r))||Nr(c.content))+"</code></pre>"+Fr(t,e)},Rr.fence_custom={},Rr.heading_open=function(t,e){return"<h"+t[e].hLevel+">"},Rr.heading_close=function(t,e){return"</h"+t[e].hLevel+">\n"},Rr.hr=function(t,e,i){return(i.xhtmlOut?"<hr />":"<hr>")+Fr(t,e)},Rr.bullet_list_open=function(){return"<ul>\n"},Rr.bullet_list_close=function(t,e){return"</ul>"+Fr(t,e)},Rr.list_item_open=function(){return"<li>"},Rr.list_item_close=function(){return"</li>\n"},Rr.ordered_list_open=function(t,e){var i=t[e];return"<ol"+(i.order>1?' start="'+i.order+'"':"")+">\n"},Rr.ordered_list_close=function(t,e){return"</ol>"+Fr(t,e)},Rr.paragraph_open=function(t,e){return t[e].tight?"":"<p>"},Rr.paragraph_close=function(t,e){var i=!(t[e].tight&&e&&"inline"===t[e-1].type&&!t[e-1].content);return(t[e].tight?"":"</p>")+(i?Fr(t,e):"")},Rr.link_open=function(t,e,i){var n=t[e].title?' title="'+Nr(Lr(t[e].title))+'"':"",o=i.linkTarget?' target="'+i.linkTarget+'"':"";return'<a href="'+Nr(t[e].href)+'"'+n+o+">"},Rr.link_close=function(){return"</a>"},Rr.image=function(t,e,i){var n=' src="'+Nr(t[e].src)+'"',o=t[e].title?' title="'+Nr(Lr(t[e].title))+'"':"";return"<img"+n+(' alt="'+(t[e].alt?Nr(Lr(Er(t[e].alt))):"")+'"')+o+(i.xhtmlOut?" /":"")+">"},Rr.table_open=function(){return"<table>\n"},Rr.table_close=function(){return"</table>\n"},Rr.thead_open=function(){return"<thead>\n"},Rr.thead_close=function(){return"</thead>\n"},Rr.tbody_open=function(){return"<tbody>\n"},Rr.tbody_close=function(){return"</tbody>\n"},Rr.tr_open=function(){return"<tr>"},Rr.tr_close=function(){return"</tr>\n"},Rr.th_open=function(t,e){var i=t[e];return"<th"+(i.align?' style="text-align:'+i.align+'"':"")+">"},Rr.th_close=function(){return"</th>"},Rr.td_open=function(t,e){var i=t[e];return"<td"+(i.align?' style="text-align:'+i.align+'"':"")+">"},Rr.td_close=function(){return"</td>"},Rr.strong_open=function(){return"<strong>"},Rr.strong_close=function(){return"</strong>"},Rr.em_open=function(){return"<em>"},Rr.em_close=function(){return"</em>"},Rr.del_open=function(){return"<del>"},Rr.del_close=function(){return"</del>"},Rr.ins_open=function(){return"<ins>"},Rr.ins_close=function(){return"</ins>"},Rr.mark_open=function(){return"<mark>"},Rr.mark_close=function(){return"</mark>"},Rr.sub=function(t,e){return"<sub>"+Nr(t[e].content)+"</sub>"},Rr.sup=function(t,e){return"<sup>"+Nr(t[e].content)+"</sup>"},Rr.hardbreak=function(t,e,i){return i.xhtmlOut?"<br />\n":"<br>\n"},Rr.softbreak=function(t,e,i){return i.breaks?i.xhtmlOut?"<br />\n":"<br>\n":"\n"},Rr.text=function(t,e){return Nr(t[e].content)},Rr.htmlblock=function(t,e){return t[e].content},Rr.htmltag=function(t,e){return t[e].content},Rr.abbr_open=function(t,e){return'<abbr title="'+Nr(Lr(t[e].title))+'">'},Rr.abbr_close=function(){return"</abbr>"},Rr.footnote_ref=function(t,e){var i=Number(t[e].id+1).toString(),n="fnref"+i;return t[e].subId>0&&(n+=":"+t[e].subId),'<sup class="footnote-ref"><a href="#fn'+i+'" id="'+n+'">['+i+"]</a></sup>"},Rr.footnote_block_open=function(t,e,i){return(i.xhtmlOut?'<hr class="footnotes-sep" />\n':'<hr class="footnotes-sep">\n')+'<section class="footnotes">\n<ol class="footnotes-list">\n'},Rr.footnote_block_close=function(){return"</ol>\n</section>\n"},Rr.footnote_open=function(t,e){return'<li id="fn'+Number(t[e].id+1).toString()+'" class="footnote-item">'},Rr.footnote_close=function(){return"</li>\n"},Rr.footnote_anchor=function(t,e){var i="fnref"+Number(t[e].id+1).toString();return t[e].subId>0&&(i+=":"+t[e].subId),' <a href="#'+i+'" class="footnote-backref">↩</a>'},Rr.dl_open=function(){return"<dl>\n"},Rr.dt_open=function(){return"<dt>"},Rr.dd_open=function(){return"<dd>"},Rr.dl_close=function(){return"</dl>\n"},Rr.dt_close=function(){return"</dt>\n"},Rr.dd_close=function(){return"</dd>\n"};var Fr=Rr.getBreak=function(t,e){return(e=Br(t,e))<t.length&&"list_item_close"===t[e].type?"":"\n"};function qr(){this.rules=Cr({},Rr),this.getBreak=Rr.getBreak}function jr(){this.__rules__=[],this.__cache__=null}function Zr(t,e,i,n,o){this.src=t,this.env=n,this.options=i,this.parser=e,this.tokens=o,this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache=[],this.isInLabel=!1,this.linkLevel=0,this.linkContent="",this.labelUnmatchedScopes=0}function Hr(t,e){var i,n,o,r=-1,s=t.posMax,a=t.pos,l=t.isInLabel;if(t.isInLabel)return-1;if(t.labelUnmatchedScopes)return t.labelUnmatchedScopes--,-1;for(t.pos=e+1,t.isInLabel=!0,i=1;t.pos<s;){if(91===(o=t.src.charCodeAt(t.pos)))i++;else if(93===o&&0===--i){n=!0;break}t.parser.skipToken(t)}return n?(r=t.pos,t.labelUnmatchedScopes=0):t.labelUnmatchedScopes=i-1,t.pos=a,t.isInLabel=l,r}function Ur(t,e,i,n){var o,r,s,a,l,c;if(42!==t.charCodeAt(0))return-1;if(91!==t.charCodeAt(1))return-1;if(-1===t.indexOf("]:"))return-1;if((r=Hr(o=new Zr(t,e,i,n,[]),1))<0||58!==t.charCodeAt(r+1))return-1;for(a=o.posMax,s=r+2;s<a&&10!==o.src.charCodeAt(s);s++);return l=t.slice(2,r),0===(c=t.slice(r+2,s).trim()).length?-1:(n.abbreviations||(n.abbreviations={}),void 0===n.abbreviations[":"+l]&&(n.abbreviations[":"+l]=c),s)}function Vr(t){var e=Lr(t);try{e=decodeURI(e)}catch(t){}return encodeURI(e)}function Wr(t,e){var i,n,o,r=e,s=t.posMax;if(60===t.src.charCodeAt(e)){for(e++;e<s;){if(10===(i=t.src.charCodeAt(e)))return!1;if(62===i)return o=Vr(Er(t.src.slice(r+1,e))),!!t.parser.validateLink(o)&&(t.pos=e+1,t.linkContent=o,!0);92===i&&e+1<s?e+=2:e++}return!1}for(n=0;e<s&&32!==(i=t.src.charCodeAt(e))&&!(i<32||127===i);)if(92===i&&e+1<s)e+=2;else{if(40===i&&++n>1)break;if(41===i&&--n<0)break;e++}return r!==e&&(o=Er(t.src.slice(r,e)),!!t.parser.validateLink(o)&&(t.linkContent=o,t.pos=e,!0))}function Gr(t,e){var i,n=e,o=t.posMax,r=t.src.charCodeAt(e);if(34!==r&&39!==r&&40!==r)return!1;for(e++,40===r&&(r=41);e<o;){if((i=t.src.charCodeAt(e))===r)return t.pos=e+1,t.linkContent=Er(t.src.slice(n+1,e)),!0;92===i&&e+1<o?e+=2:e++}return!1}function Yr(t){return t.trim().replace(/\s+/g," ").toUpperCase()}function Kr(t,e,i,n){var o,r,s,a,l,c,h,d,u;if(91!==t.charCodeAt(0))return-1;if(-1===t.indexOf("]:"))return-1;if((r=Hr(o=new Zr(t,e,i,n,[]),0))<0||58!==t.charCodeAt(r+1))return-1;for(a=o.posMax,s=r+2;s<a&&(32===(l=o.src.charCodeAt(s))||10===l);s++);if(!Wr(o,s))return-1;for(h=o.linkContent,c=s=o.pos,s+=1;s<a&&(32===(l=o.src.charCodeAt(s))||10===l);s++);for(s<a&&c!==s&&Gr(o,s)?(d=o.linkContent,s=o.pos):(d="",s=c);s<a&&32===o.src.charCodeAt(s);)s++;return s<a&&10!==o.src.charCodeAt(s)?-1:(u=Yr(t.slice(1,r)),void 0===n.references[u]&&(n.references[u]={title:d,href:h}),s)}qr.prototype.renderInline=function(t,e,i){for(var n=this.rules,o=t.length,r=0,s="";o--;)s+=n[t[r].type](t,r++,e,i,this);return s},qr.prototype.render=function(t,e,i){for(var n=this.rules,o=t.length,r=-1,s="";++r<o;)"inline"===t[r].type?s+=this.renderInline(t[r].children,e,i):s+=n[t[r].type](t,r,e,i,this);return s},jr.prototype.__find__=function(t){for(var e=this.__rules__.length,i=-1;e--;)if(this.__rules__[++i].name===t)return i;return-1},jr.prototype.__compile__=function(){var t=this,e=[""];t.__rules__.forEach((function(t){t.enabled&&t.alt.forEach((function(t){e.indexOf(t)<0&&e.push(t)}))})),t.__cache__={},e.forEach((function(e){t.__cache__[e]=[],t.__rules__.forEach((function(i){i.enabled&&(e&&i.alt.indexOf(e)<0||t.__cache__[e].push(i.fn))}))}))},jr.prototype.at=function(t,e,i){var n=this.__find__(t),o=i||{};if(-1===n)throw new Error("Parser rule not found: "+t);this.__rules__[n].fn=e,this.__rules__[n].alt=o.alt||[],this.__cache__=null},jr.prototype.before=function(t,e,i,n){var o=this.__find__(t),r=n||{};if(-1===o)throw new Error("Parser rule not found: "+t);this.__rules__.splice(o,0,{name:e,enabled:!0,fn:i,alt:r.alt||[]}),this.__cache__=null},jr.prototype.after=function(t,e,i,n){var o=this.__find__(t),r=n||{};if(-1===o)throw new Error("Parser rule not found: "+t);this.__rules__.splice(o+1,0,{name:e,enabled:!0,fn:i,alt:r.alt||[]}),this.__cache__=null},jr.prototype.push=function(t,e,i){var n=i||{};this.__rules__.push({name:t,enabled:!0,fn:e,alt:n.alt||[]}),this.__cache__=null},jr.prototype.enable=function(t,e){t=Array.isArray(t)?t:[t],e&&this.__rules__.forEach((function(t){t.enabled=!1})),t.forEach((function(t){var e=this.__find__(t);if(e<0)throw new Error("Rules manager: invalid rule name "+t);this.__rules__[e].enabled=!0}),this),this.__cache__=null},jr.prototype.disable=function(t){(t=Array.isArray(t)?t:[t]).forEach((function(t){var e=this.__find__(t);if(e<0)throw new Error("Rules manager: invalid rule name "+t);this.__rules__[e].enabled=!1}),this),this.__cache__=null},jr.prototype.getRules=function(t){return null===this.__cache__&&this.__compile__(),this.__cache__[t]||[]},Zr.prototype.pushPending=function(){this.tokens.push({type:"text",content:this.pending,level:this.pendingLevel}),this.pending=""},Zr.prototype.push=function(t){this.pending&&this.pushPending(),this.tokens.push(t),this.pendingLevel=this.level},Zr.prototype.cacheSet=function(t,e){for(var i=this.cache.length;i<=t;i++)this.cache.push(0);this.cache[t]=e},Zr.prototype.cacheGet=function(t){return t<this.cache.length?this.cache[t]:0};function Jr(t){return t.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1")}var Xr=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,Qr=/\((c|tm|r|p)\)/gi,ts={c:"©",r:"®",p:"§",tm:"™"};var es=/['"]/,is=/['"]/g,ns=/[-\s()\[\]]/;function os(t,e){return!(e<0||e>=t.length)&&!ns.test(t[e])}function rs(t,e,i){return t.substr(0,e)+i+t.substr(e+1)}var ss=[["block",function(t){t.inlineMode?t.tokens.push({type:"inline",content:t.src.replace(/\n/g," ").trim(),level:0,lines:[0,1],children:[]}):t.block.parse(t.src,t.options,t.env,t.tokens)}],["abbr",function(t){var e,i,n,o,r=t.tokens;if(!t.inlineMode)for(e=1,i=r.length-1;e<i;e++)if("paragraph_open"===r[e-1].type&&"inline"===r[e].type&&"paragraph_close"===r[e+1].type){for(n=r[e].content;n.length&&!((o=Ur(n,t.inline,t.options,t.env))<0);)n=n.slice(o).trim();r[e].content=n,n.length||(r[e-1].tight=!0,r[e+1].tight=!0)}}],["references",function(t){var e,i,n,o,r=t.tokens;if(t.env.references=t.env.references||{},!t.inlineMode)for(e=1,i=r.length-1;e<i;e++)if("inline"===r[e].type&&"paragraph_open"===r[e-1].type&&"paragraph_close"===r[e+1].type){for(n=r[e].content;n.length&&!((o=Kr(n,t.inline,t.options,t.env))<0);)n=n.slice(o).trim();r[e].content=n,n.length||(r[e-1].tight=!0,r[e+1].tight=!0)}}],["inline",function(t){var e,i,n,o=t.tokens;for(i=0,n=o.length;i<n;i++)"inline"===(e=o[i]).type&&t.inline.parse(e.content,t.options,t.env,e.children)}],["footnote_tail",function(t){var e,i,n,o,r,s,a,l,c,h=0,d=!1,u={};if(t.env.footnotes&&(t.tokens=t.tokens.filter((function(t){return"footnote_reference_open"===t.type?(d=!0,l=[],c=t.label,!1):"footnote_reference_close"===t.type?(d=!1,u[":"+c]=l,!1):(d&&l.push(t),!d)})),t.env.footnotes.list)){for(s=t.env.footnotes.list,t.tokens.push({type:"footnote_block_open",level:h++}),e=0,i=s.length;e<i;e++){for(t.tokens.push({type:"footnote_open",id:e,level:h++}),s[e].tokens?((a=[]).push({type:"paragraph_open",tight:!1,level:h++}),a.push({type:"inline",content:"",level:h,children:s[e].tokens}),a.push({type:"paragraph_close",tight:!1,level:--h})):s[e].label&&(a=u[":"+s[e].label]),t.tokens=t.tokens.concat(a),r="paragraph_close"===t.tokens[t.tokens.length-1].type?t.tokens.pop():null,o=s[e].count>0?s[e].count:1,n=0;n<o;n++)t.tokens.push({type:"footnote_anchor",id:e,subId:n,level:h});r&&t.tokens.push(r),t.tokens.push({type:"footnote_close",level:--h})}t.tokens.push({type:"footnote_block_close",level:--h})}}],["abbr2",function(t){var e,i,n,o,r,s,a,l,c,h,d,u,p=t.tokens;if(t.env.abbreviations)for(t.env.abbrRegExp||(u="(^|["+" \n()[]'\".,!?-".split("").map(Jr).join("")+"])("+Object.keys(t.env.abbreviations).map((function(t){return t.substr(1)})).sort((function(t,e){return e.length-t.length})).map(Jr).join("|")+")($|["+" \n()[]'\".,!?-".split("").map(Jr).join("")+"])",t.env.abbrRegExp=new RegExp(u,"g")),h=t.env.abbrRegExp,i=0,n=p.length;i<n;i++)if("inline"===p[i].type)for(e=(o=p[i].children).length-1;e>=0;e--)if("text"===(r=o[e]).type){for(l=0,s=r.content,h.lastIndex=0,c=r.level,a=[];d=h.exec(s);)h.lastIndex>l&&a.push({type:"text",content:s.slice(l,d.index+d[1].length),level:c}),a.push({type:"abbr_open",title:t.env.abbreviations[":"+d[2]],level:c++}),a.push({type:"text",content:d[2],level:c}),a.push({type:"abbr_close",level:--c}),l=h.lastIndex-d[3].length;a.length&&(l<s.length&&a.push({type:"text",content:s.slice(l),level:c}),p[i].children=o=[].concat(o.slice(0,e),a,o.slice(e+1)))}}],["replacements",function(t){var e,i,n,o,r,s;if(t.options.typographer)for(r=t.tokens.length-1;r>=0;r--)if("inline"===t.tokens[r].type)for(e=(o=t.tokens[r].children).length-1;e>=0;e--)"text"===(i=o[e]).type&&(n=i.content,n=(s=n).indexOf("(")<0?s:s.replace(Qr,(function(t,e){return ts[e.toLowerCase()]})),Xr.test(n)&&(n=n.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---([^-]|$)/gm,"$1—$2").replace(/(^|\s)--(\s|$)/gm,"$1–$2").replace(/(^|[^-\s])--([^-\s]|$)/gm,"$1–$2")),i.content=n)}],["smartquotes",function(t){var e,i,n,o,r,s,a,l,c,h,d,u,p,m,f,g,v;if(t.options.typographer)for(v=[],f=t.tokens.length-1;f>=0;f--)if("inline"===t.tokens[f].type)for(g=t.tokens[f].children,v.length=0,e=0;e<g.length;e++)if("text"===(i=g[e]).type&&!es.test(i.text)){for(a=g[e].level,p=v.length-1;p>=0&&!(v[p].level<=a);p--);v.length=p+1,r=0,s=(n=i.content).length;t:for(;r<s&&(is.lastIndex=r,o=is.exec(n));)if(l=!os(n,o.index-1),r=o.index+1,m="'"===o[0],(c=!os(n,r))||l){if(d=!c,u=!l)for(p=v.length-1;p>=0&&(h=v[p],!(v[p].level<a));p--)if(h.single===m&&v[p].level===a){h=v[p],m?(g[h.token].content=rs(g[h.token].content,h.pos,t.options.quotes[2]),i.content=rs(i.content,o.index,t.options.quotes[3])):(g[h.token].content=rs(g[h.token].content,h.pos,t.options.quotes[0]),i.content=rs(i.content,o.index,t.options.quotes[1])),v.length=p;continue t}d?v.push({token:e,pos:o.index,single:m,level:a}):u&&m&&(i.content=rs(i.content,o.index,"’"))}else m&&(i.content=rs(i.content,o.index,"’"))}}]];function as(){this.options={},this.ruler=new jr;for(var t=0;t<ss.length;t++)this.ruler.push(ss[t][0],ss[t][1])}function ls(t,e,i,n,o){var r,s,a,l,c,h,d;for(this.src=t,this.parser=e,this.options=i,this.env=n,this.tokens=o,this.bMarks=[],this.eMarks=[],this.tShift=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.parentType="root",this.ddIndent=-1,this.level=0,this.result="",h=0,d=!1,a=l=h=0,c=(s=this.src).length;l<c;l++){if(r=s.charCodeAt(l),!d){if(32===r){h++;continue}d=!0}10!==r&&l!==c-1||(10!==r&&l++,this.bMarks.push(a),this.eMarks.push(l),this.tShift.push(h),d=!1,h=0,a=l+1)}this.bMarks.push(s.length),this.eMarks.push(s.length),this.tShift.push(0),this.lineMax=this.bMarks.length-1}function cs(t,e){var i,n,o;return(n=t.bMarks[e]+t.tShift[e])>=(o=t.eMarks[e])||42!==(i=t.src.charCodeAt(n++))&&45!==i&&43!==i||n<o&&32!==t.src.charCodeAt(n)?-1:n}function hs(t,e){var i,n=t.bMarks[e]+t.tShift[e],o=t.eMarks[e];if(n+1>=o)return-1;if((i=t.src.charCodeAt(n++))<48||i>57)return-1;for(;;){if(n>=o)return-1;if(!((i=t.src.charCodeAt(n++))>=48&&i<=57)){if(41===i||46===i)break;return-1}}return n<o&&32!==t.src.charCodeAt(n)?-1:n}as.prototype.process=function(t){var e,i,n;for(e=0,i=(n=this.ruler.getRules("")).length;e<i;e++)n[e](t)},ls.prototype.isEmpty=function(t){return this.bMarks[t]+this.tShift[t]>=this.eMarks[t]},ls.prototype.skipEmptyLines=function(t){for(var e=this.lineMax;t<e&&!(this.bMarks[t]+this.tShift[t]<this.eMarks[t]);t++);return t},ls.prototype.skipSpaces=function(t){for(var e=this.src.length;t<e&&32===this.src.charCodeAt(t);t++);return t},ls.prototype.skipChars=function(t,e){for(var i=this.src.length;t<i&&this.src.charCodeAt(t)===e;t++);return t},ls.prototype.skipCharsBack=function(t,e,i){if(t<=i)return t;for(;t>i;)if(e!==this.src.charCodeAt(--t))return t+1;return t},ls.prototype.getLines=function(t,e,i,n){var o,r,s,a,l,c=t;if(t>=e)return"";if(c+1===e)return r=this.bMarks[c]+Math.min(this.tShift[c],i),s=n?this.eMarks[c]+1:this.eMarks[c],this.src.slice(r,s);for(a=new Array(e-t),o=0;c<e;c++,o++)(l=this.tShift[c])>i&&(l=i),l<0&&(l=0),r=this.bMarks[c]+l,s=c+1<e||n?this.eMarks[c]+1:this.eMarks[c],a[o]=this.src.slice(r,s);return a.join("")};var ds={};["article","aside","button","blockquote","body","canvas","caption","col","colgroup","dd","div","dl","dt","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","iframe","li","map","object","ol","output","p","pre","progress","script","section","style","table","tbody","td","textarea","tfoot","th","tr","thead","ul","video"].forEach((function(t){ds[t]=!0}));var us=/^<([a-zA-Z]{1,15})[\s\/>]/,ps=/^<\/([a-zA-Z]{1,15})[\s>]/;function ms(t,e){var i=t.bMarks[e]+t.blkIndent,n=t.eMarks[e];return t.src.substr(i,n-i)}function fs(t,e){var i,n,o=t.bMarks[e]+t.tShift[e],r=t.eMarks[e];return o>=r||126!==(n=t.src.charCodeAt(o++))&&58!==n||o===(i=t.skipSpaces(o))||i>=r?-1:i}var gs=[["code",function(t,e,i){var n,o;if(t.tShift[e]-t.blkIndent<4)return!1;for(o=n=e+1;n<i;)if(t.isEmpty(n))n++;else{if(!(t.tShift[n]-t.blkIndent>=4))break;o=++n}return t.line=n,t.tokens.push({type:"code",content:t.getLines(e,o,4+t.blkIndent,!0),block:!0,lines:[e,t.line],level:t.level}),!0}],["fences",function(t,e,i,n){var o,r,s,a,l,c=!1,h=t.bMarks[e]+t.tShift[e],d=t.eMarks[e];if(h+3>d)return!1;if(126!==(o=t.src.charCodeAt(h))&&96!==o)return!1;if(l=h,(r=(h=t.skipChars(h,o))-l)<3)return!1;if((s=t.src.slice(h,d).trim()).indexOf("`")>=0)return!1;if(n)return!0;for(a=e;!(++a>=i)&&!((h=l=t.bMarks[a]+t.tShift[a])<(d=t.eMarks[a])&&t.tShift[a]<t.blkIndent);)if(t.src.charCodeAt(h)===o&&!(t.tShift[a]-t.blkIndent>=4||(h=t.skipChars(h,o))-l<r||(h=t.skipSpaces(h))<d)){c=!0;break}return r=t.tShift[e],t.line=a+(c?1:0),t.tokens.push({type:"fence",params:s,content:t.getLines(e+1,a,r,!0),lines:[e,t.line],level:t.level}),!0},["paragraph","blockquote","list"]],["blockquote",function(t,e,i,n){var o,r,s,a,l,c,h,d,u,p,m,f=t.bMarks[e]+t.tShift[e],g=t.eMarks[e];if(f>g)return!1;if(62!==t.src.charCodeAt(f++))return!1;if(t.level>=t.options.maxNesting)return!1;if(n)return!0;for(32===t.src.charCodeAt(f)&&f++,l=t.blkIndent,t.blkIndent=0,a=[t.bMarks[e]],t.bMarks[e]=f,r=(f=f<g?t.skipSpaces(f):f)>=g,s=[t.tShift[e]],t.tShift[e]=f-t.bMarks[e],d=t.parser.ruler.getRules("blockquote"),o=e+1;o<i&&!((f=t.bMarks[o]+t.tShift[o])>=(g=t.eMarks[o]));o++)if(62!==t.src.charCodeAt(f++)){if(r)break;for(m=!1,u=0,p=d.length;u<p;u++)if(d[u](t,o,i,!0)){m=!0;break}if(m)break;a.push(t.bMarks[o]),s.push(t.tShift[o]),t.tShift[o]=-1337}else 32===t.src.charCodeAt(f)&&f++,a.push(t.bMarks[o]),t.bMarks[o]=f,r=(f=f<g?t.skipSpaces(f):f)>=g,s.push(t.tShift[o]),t.tShift[o]=f-t.bMarks[o];for(c=t.parentType,t.parentType="blockquote",t.tokens.push({type:"blockquote_open",lines:h=[e,0],level:t.level++}),t.parser.tokenize(t,e,o),t.tokens.push({type:"blockquote_close",level:--t.level}),t.parentType=c,h[1]=t.line,u=0;u<s.length;u++)t.bMarks[u+e]=a[u],t.tShift[u+e]=s[u];return t.blkIndent=l,!0},["paragraph","blockquote","list"]],["hr",function(t,e,i,n){var o,r,s,a=t.bMarks[e],l=t.eMarks[e];if((a+=t.tShift[e])>l)return!1;if(42!==(o=t.src.charCodeAt(a++))&&45!==o&&95!==o)return!1;for(r=1;a<l;){if((s=t.src.charCodeAt(a++))!==o&&32!==s)return!1;s===o&&r++}return!(r<3)&&(n||(t.line=e+1,t.tokens.push({type:"hr",lines:[e,t.line],level:t.level})),!0)},["paragraph","blockquote","list"]],["list",function(t,e,i,n){var o,r,s,a,l,c,h,d,u,p,m,f,g,v,y,b,_,x,w,k,C,S=!0;if((d=hs(t,e))>=0)f=!0;else{if(!((d=cs(t,e))>=0))return!1;f=!1}if(t.level>=t.options.maxNesting)return!1;if(m=t.src.charCodeAt(d-1),n)return!0;for(v=t.tokens.length,f?(h=t.bMarks[e]+t.tShift[e],p=Number(t.src.substr(h,d-h-1)),t.tokens.push({type:"ordered_list_open",order:p,lines:b=[e,0],level:t.level++})):t.tokens.push({type:"bullet_list_open",lines:b=[e,0],level:t.level++}),o=e,y=!1,x=t.parser.ruler.getRules("list");!(!(o<i)||((u=(g=t.skipSpaces(d))>=t.eMarks[o]?1:g-d)>4&&(u=1),u<1&&(u=1),r=d-t.bMarks[o]+u,t.tokens.push({type:"list_item_open",lines:_=[e,0],level:t.level++}),a=t.blkIndent,l=t.tight,s=t.tShift[e],c=t.parentType,t.tShift[e]=g-t.bMarks[e],t.blkIndent=r,t.tight=!0,t.parentType="list",t.parser.tokenize(t,e,i,!0),t.tight&&!y||(S=!1),y=t.line-e>1&&t.isEmpty(t.line-1),t.blkIndent=a,t.tShift[e]=s,t.tight=l,t.parentType=c,t.tokens.push({type:"list_item_close",level:--t.level}),o=e=t.line,_[1]=o,g=t.bMarks[e],o>=i)||t.isEmpty(o)||t.tShift[o]<t.blkIndent);){for(C=!1,w=0,k=x.length;w<k;w++)if(x[w](t,o,i,!0)){C=!0;break}if(C)break;if(f){if((d=hs(t,o))<0)break}else if((d=cs(t,o))<0)break;if(m!==t.src.charCodeAt(d-1))break}return t.tokens.push({type:f?"ordered_list_close":"bullet_list_close",level:--t.level}),b[1]=o,t.line=o,S&&function(t,e){var i,n,o=t.level+2;for(i=e+2,n=t.tokens.length-2;i<n;i++)t.tokens[i].level===o&&"paragraph_open"===t.tokens[i].type&&(t.tokens[i+2].tight=!0,t.tokens[i].tight=!0,i+=2)}(t,v),!0},["paragraph","blockquote"]],["footnote",function(t,e,i,n){var o,r,s,a,l,c=t.bMarks[e]+t.tShift[e],h=t.eMarks[e];if(c+4>h)return!1;if(91!==t.src.charCodeAt(c))return!1;if(94!==t.src.charCodeAt(c+1))return!1;if(t.level>=t.options.maxNesting)return!1;for(a=c+2;a<h;a++){if(32===t.src.charCodeAt(a))return!1;if(93===t.src.charCodeAt(a))break}return a!==c+2&&(!(a+1>=h||58!==t.src.charCodeAt(++a))&&(n||(a++,t.env.footnotes||(t.env.footnotes={}),t.env.footnotes.refs||(t.env.footnotes.refs={}),l=t.src.slice(c+2,a-2),t.env.footnotes.refs[":"+l]=-1,t.tokens.push({type:"footnote_reference_open",label:l,level:t.level++}),o=t.bMarks[e],r=t.tShift[e],s=t.parentType,t.tShift[e]=t.skipSpaces(a)-a,t.bMarks[e]=a,t.blkIndent+=4,t.parentType="footnote",t.tShift[e]<t.blkIndent&&(t.tShift[e]+=t.blkIndent,t.bMarks[e]-=t.blkIndent),t.parser.tokenize(t,e,i,!0),t.parentType=s,t.blkIndent-=4,t.tShift[e]=r,t.bMarks[e]=o,t.tokens.push({type:"footnote_reference_close",level:--t.level})),!0))},["paragraph"]],["heading",function(t,e,i,n){var o,r,s,a=t.bMarks[e]+t.tShift[e],l=t.eMarks[e];if(a>=l)return!1;if(35!==(o=t.src.charCodeAt(a))||a>=l)return!1;for(r=1,o=t.src.charCodeAt(++a);35===o&&a<l&&r<=6;)r++,o=t.src.charCodeAt(++a);return!(r>6||a<l&&32!==o)&&(n||(l=t.skipCharsBack(l,32,a),(s=t.skipCharsBack(l,35,a))>a&&32===t.src.charCodeAt(s-1)&&(l=s),t.line=e+1,t.tokens.push({type:"heading_open",hLevel:r,lines:[e,t.line],level:t.level}),a<l&&t.tokens.push({type:"inline",content:t.src.slice(a,l).trim(),level:t.level+1,lines:[e,t.line],children:[]}),t.tokens.push({type:"heading_close",hLevel:r,level:t.level})),!0)},["paragraph","blockquote"]],["lheading",function(t,e,i){var n,o,r,s=e+1;return!(s>=i)&&(!(t.tShift[s]<t.blkIndent)&&(!(t.tShift[s]-t.blkIndent>3)&&(!((o=t.bMarks[s]+t.tShift[s])>=(r=t.eMarks[s]))&&((45===(n=t.src.charCodeAt(o))||61===n)&&(o=t.skipChars(o,n),!((o=t.skipSpaces(o))<r)&&(o=t.bMarks[e]+t.tShift[e],t.line=s+1,t.tokens.push({type:"heading_open",hLevel:61===n?1:2,lines:[e,t.line],level:t.level}),t.tokens.push({type:"inline",content:t.src.slice(o,t.eMarks[e]).trim(),level:t.level+1,lines:[e,t.line-1],children:[]}),t.tokens.push({type:"heading_close",hLevel:61===n?1:2,level:t.level}),!0))))))}],["htmlblock",function(t,e,i,n){var o,r,s,a=t.bMarks[e],l=t.eMarks[e],c=t.tShift[e];if(a+=c,!t.options.html)return!1;if(c>3||a+2>=l)return!1;if(60!==t.src.charCodeAt(a))return!1;if(33===(o=t.src.charCodeAt(a+1))||63===o){if(n)return!0}else{if(47!==o&&!function(t){var e=32|t;return e>=97&&e<=122}(o))return!1;if(47===o){if(!(r=t.src.slice(a,l).match(ps)))return!1}else if(!(r=t.src.slice(a,l).match(us)))return!1;if(!0!==ds[r[1].toLowerCase()])return!1;if(n)return!0}for(s=e+1;s<t.lineMax&&!t.isEmpty(s);)s++;return t.line=s,t.tokens.push({type:"htmlblock",level:t.level,lines:[e,t.line],content:t.getLines(e,s,0,!0)}),!0},["paragraph","blockquote"]],["table",function(t,e,i,n){var o,r,s,a,l,c,h,d,u,p,m;if(e+2>i)return!1;if(l=e+1,t.tShift[l]<t.blkIndent)return!1;if((s=t.bMarks[l]+t.tShift[l])>=t.eMarks[l])return!1;if(124!==(o=t.src.charCodeAt(s))&&45!==o&&58!==o)return!1;if(r=ms(t,e+1),!/^[-:| ]+$/.test(r))return!1;if((c=r.split("|"))<=2)return!1;for(d=[],a=0;a<c.length;a++){if(!(u=c[a].trim())){if(0===a||a===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(u))return!1;58===u.charCodeAt(u.length-1)?d.push(58===u.charCodeAt(0)?"center":"right"):58===u.charCodeAt(0)?d.push("left"):d.push("")}if(-1===(r=ms(t,e).trim()).indexOf("|"))return!1;if(c=r.replace(/^\||\|$/g,"").split("|"),d.length!==c.length)return!1;if(n)return!0;for(t.tokens.push({type:"table_open",lines:p=[e,0],level:t.level++}),t.tokens.push({type:"thead_open",lines:[e,e+1],level:t.level++}),t.tokens.push({type:"tr_open",lines:[e,e+1],level:t.level++}),a=0;a<c.length;a++)t.tokens.push({type:"th_open",align:d[a],lines:[e,e+1],level:t.level++}),t.tokens.push({type:"inline",content:c[a].trim(),lines:[e,e+1],level:t.level,children:[]}),t.tokens.push({type:"th_close",level:--t.level});for(t.tokens.push({type:"tr_close",level:--t.level}),t.tokens.push({type:"thead_close",level:--t.level}),t.tokens.push({type:"tbody_open",lines:m=[e+2,0],level:t.level++}),l=e+2;l<i&&!(t.tShift[l]<t.blkIndent)&&-1!==(r=ms(t,l).trim()).indexOf("|");l++){for(c=r.replace(/^\||\|$/g,"").split("|"),t.tokens.push({type:"tr_open",level:t.level++}),a=0;a<c.length;a++)t.tokens.push({type:"td_open",align:d[a],level:t.level++}),h=c[a].substring(124===c[a].charCodeAt(0)?1:0,124===c[a].charCodeAt(c[a].length-1)?c[a].length-1:c[a].length).trim(),t.tokens.push({type:"inline",content:h,level:t.level,children:[]}),t.tokens.push({type:"td_close",level:--t.level});t.tokens.push({type:"tr_close",level:--t.level})}return t.tokens.push({type:"tbody_close",level:--t.level}),t.tokens.push({type:"table_close",level:--t.level}),p[1]=m[1]=l,t.line=l,!0},["paragraph"]],["deflist",function(t,e,i,n){var o,r,s,a,l,c,h,d,u,p,m,f,g,v;if(n)return!(t.ddIndent<0)&&fs(t,e)>=0;if(h=e+1,t.isEmpty(h)&&++h>i)return!1;if(t.tShift[h]<t.blkIndent)return!1;if((o=fs(t,h))<0)return!1;if(t.level>=t.options.maxNesting)return!1;c=t.tokens.length,t.tokens.push({type:"dl_open",lines:l=[e,0],level:t.level++}),s=e,r=h;t:for(;;){for(v=!0,g=!1,t.tokens.push({type:"dt_open",lines:[s,s],level:t.level++}),t.tokens.push({type:"inline",content:t.getLines(s,s+1,t.blkIndent,!1).trim(),level:t.level+1,lines:[s,s],children:[]}),t.tokens.push({type:"dt_close",level:--t.level});;){if(t.tokens.push({type:"dd_open",lines:a=[h,0],level:t.level++}),f=t.tight,u=t.ddIndent,d=t.blkIndent,m=t.tShift[r],p=t.parentType,t.blkIndent=t.ddIndent=t.tShift[r]+2,t.tShift[r]=o-t.bMarks[r],t.tight=!0,t.parentType="deflist",t.parser.tokenize(t,r,i,!0),t.tight&&!g||(v=!1),g=t.line-r>1&&t.isEmpty(t.line-1),t.tShift[r]=m,t.tight=f,t.parentType=p,t.blkIndent=d,t.ddIndent=u,t.tokens.push({type:"dd_close",level:--t.level}),a[1]=h=t.line,h>=i)break t;if(t.tShift[h]<t.blkIndent)break t;if((o=fs(t,h))<0)break;r=h}if(h>=i)break;if(s=h,t.isEmpty(s))break;if(t.tShift[s]<t.blkIndent)break;if((r=s+1)>=i)break;if(t.isEmpty(r)&&r++,r>=i)break;if(t.tShift[r]<t.blkIndent)break;if((o=fs(t,r))<0)break}return t.tokens.push({type:"dl_close",level:--t.level}),l[1]=h,t.line=h,v&&function(t,e){var i,n,o=t.level+2;for(i=e+2,n=t.tokens.length-2;i<n;i++)t.tokens[i].level===o&&"paragraph_open"===t.tokens[i].type&&(t.tokens[i+2].tight=!0,t.tokens[i].tight=!0,i+=2)}(t,c),!0},["paragraph"]],["paragraph",function(t,e){var i,n,o,r,s,a,l=e+1;if(l<(i=t.lineMax)&&!t.isEmpty(l))for(a=t.parser.ruler.getRules("paragraph");l<i&&!t.isEmpty(l);l++)if(!(t.tShift[l]-t.blkIndent>3)){for(o=!1,r=0,s=a.length;r<s;r++)if(a[r](t,l,i,!0)){o=!0;break}if(o)break}return n=t.getLines(e,l,t.blkIndent,!1).trim(),t.line=l,n.length&&(t.tokens.push({type:"paragraph_open",tight:!1,lines:[e,t.line],level:t.level}),t.tokens.push({type:"inline",content:n,level:t.level+1,lines:[e,t.line],children:[]}),t.tokens.push({type:"paragraph_close",tight:!1,level:t.level})),!0}]];function vs(){this.ruler=new jr;for(var t=0;t<gs.length;t++)this.ruler.push(gs[t][0],gs[t][1],{alt:(gs[t][2]||[]).slice()})}vs.prototype.tokenize=function(t,e,i){for(var n,o=this.ruler.getRules(""),r=o.length,s=e,a=!1;s<i&&(t.line=s=t.skipEmptyLines(s),!(s>=i))&&!(t.tShift[s]<t.blkIndent);){for(n=0;n<r&&!o[n](t,s,i,!1);n++);if(t.tight=!a,t.isEmpty(t.line-1)&&(a=!0),(s=t.line)<i&&t.isEmpty(s)){if(a=!0,++s<i&&"list"===t.parentType&&t.isEmpty(s))break;t.line=s}}};var ys=/[\n\t]/g,bs=/\r[\n\u0085]|[\u2424\u2028\u0085]/g,_s=/\u00a0/g;function xs(t){switch(t){case 10:case 92:case 96:case 42:case 95:case 94:case 91:case 93:case 33:case 38:case 60:case 62:case 123:case 125:case 36:case 37:case 64:case 126:case 43:case 61:case 58:return!0;default:return!1}}vs.prototype.parse=function(t,e,i,n){var o,r=0,s=0;if(!t)return[];(t=(t=t.replace(_s," ")).replace(bs,"\n")).indexOf("\t")>=0&&(t=t.replace(ys,(function(e,i){var n;return 10===t.charCodeAt(i)?(r=i+1,s=0,e):(n=" ".slice((i-r-s)%4),s=i-r+1,n)}))),o=new ls(t,this,e,i,n),this.tokenize(o,o.line,o.lineMax)};for(var ws=[],ks=0;ks<256;ks++)ws.push(0);function Cs(t){return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122}function Ss(t,e){var i,n,o,r=e,s=!0,a=!0,l=t.posMax,c=t.src.charCodeAt(e);for(i=e>0?t.src.charCodeAt(e-1):-1;r<l&&t.src.charCodeAt(r)===c;)r++;return r>=l&&(s=!1),(o=r-e)>=4?s=a=!1:(32!==(n=r<l?t.src.charCodeAt(r):-1)&&10!==n||(s=!1),32!==i&&10!==i||(a=!1),95===c&&(Cs(i)&&(s=!1),Cs(n)&&(a=!1))),{can_open:s,can_close:a,delims:o}}"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach((function(t){ws[t.charCodeAt(0)]=1}));var Es=/\\([ \\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;var Ts=/\\([ \\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;var Ms=["coap","doi","javascript","aaa","aaas","about","acap","cap","cid","crid","data","dav","dict","dns","file","ftp","geo","go","gopher","h323","http","https","iax","icap","im","imap","info","ipp","iris","iris.beep","iris.xpc","iris.xpcs","iris.lwz","ldap","mailto","mid","msrp","msrps","mtqp","mupdate","news","nfs","ni","nih","nntp","opaquelocktoken","pop","pres","rtsp","service","session","shttp","sieve","sip","sips","sms","snmp","soap.beep","soap.beeps","tag","tel","telnet","tftp","thismessage","tn3270","tip","tv","urn","vemmi","ws","wss","xcon","xcon-userid","xmlrpc.beep","xmlrpc.beeps","xmpp","z39.50r","z39.50s","adiumxtra","afp","afs","aim","apt","attachment","aw","beshare","bitcoin","bolo","callto","chrome","chrome-extension","com-eventbrite-attendee","content","cvs","dlna-playsingle","dlna-playcontainer","dtn","dvb","ed2k","facetime","feed","finger","fish","gg","git","gizmoproject","gtalk","hcp","icon","ipn","irc","irc6","ircs","itms","jar","jms","keyparc","lastfm","ldaps","magnet","maps","market","message","mms","ms-help","msnim","mumble","mvn","notes","oid","palm","paparazzi","platform","proxy","psyc","query","res","resource","rmi","rsync","rtmp","secondlife","sftp","sgn","skype","smb","soldat","spotify","ssh","steam","svn","teamspeak","things","udp","unreal","ut2004","ventrilo","view-source","webcal","wtai","wyciwyg","xfire","xri","ymsgr"],$s=/^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/,Ds=/^<([a-zA-Z.\-]{1,25}):([^<>\x00-\x20]*)>/;function As(t,e){return t=t.source,e=e||"",function i(n,o){return n?(o=o.source||o,t=t.replace(n,o),i):new RegExp(t,e)}}var Ls=As(/(?:unquoted|single_quoted|double_quoted)/)("unquoted",/[^"'=<>`\x00-\x20]+/)("single_quoted",/'[^']*'/)("double_quoted",/"[^"]*"/)(),Os=As(/(?:\s+attr_name(?:\s*=\s*attr_value)?)/)("attr_name",/[a-zA-Z_:][a-zA-Z0-9:._-]*/)("attr_value",Ls)(),Ps=As(/<[A-Za-z][A-Za-z0-9]*attribute*\s*\/?>/)("attribute",Os)(),Is=As(/^(?:open_tag|close_tag|comment|processing|declaration|cdata)/)("open_tag",Ps)("close_tag",/<\/[A-Za-z][A-Za-z0-9]*\s*>/)("comment",/<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->/)("processing",/<[?].*?[?]>/)("declaration",/<![A-Z]+\s+[^>]*>/)("cdata",/<!\[CDATA\[[\s\S]*?\]\]>/)();var zs=/^&#((?:x[a-f0-9]{1,8}|[0-9]{1,8}));/i,Ns=/^&([a-z][a-z0-9]{1,31});/i;var Rs=[["text",function(t,e){for(var i=t.pos;i<t.posMax&&!xs(t.src.charCodeAt(i));)i++;return i!==t.pos&&(e||(t.pending+=t.src.slice(t.pos,i)),t.pos=i,!0)}],["newline",function(t,e){var i,n,o=t.pos;if(10!==t.src.charCodeAt(o))return!1;if(i=t.pending.length-1,n=t.posMax,!e)if(i>=0&&32===t.pending.charCodeAt(i))if(i>=1&&32===t.pending.charCodeAt(i-1)){for(var r=i-2;r>=0;r--)if(32!==t.pending.charCodeAt(r)){t.pending=t.pending.substring(0,r+1);break}t.push({type:"hardbreak",level:t.level})}else t.pending=t.pending.slice(0,-1),t.push({type:"softbreak",level:t.level});else t.push({type:"softbreak",level:t.level});for(o++;o<n&&32===t.src.charCodeAt(o);)o++;return t.pos=o,!0}],["escape",function(t,e){var i,n=t.pos,o=t.posMax;if(92!==t.src.charCodeAt(n))return!1;if(++n<o){if((i=t.src.charCodeAt(n))<256&&0!==ws[i])return e||(t.pending+=t.src[n]),t.pos+=2,!0;if(10===i){for(e||t.push({type:"hardbreak",level:t.level}),n++;n<o&&32===t.src.charCodeAt(n);)n++;return t.pos=n,!0}}return e||(t.pending+="\\"),t.pos++,!0}],["backticks",function(t,e){var i,n,o,r,s,a=t.pos;if(96!==t.src.charCodeAt(a))return!1;for(i=a,a++,n=t.posMax;a<n&&96===t.src.charCodeAt(a);)a++;for(o=t.src.slice(i,a),r=s=a;-1!==(r=t.src.indexOf("`",s));){for(s=r+1;s<n&&96===t.src.charCodeAt(s);)s++;if(s-r===o.length)return e||t.push({type:"code",content:t.src.slice(a,r).replace(/[ \n]+/g," ").trim(),block:!1,level:t.level}),t.pos=s,!0}return e||(t.pending+=o),t.pos+=o.length,!0}],["del",function(t,e){var i,n,o,r,s,a=t.posMax,l=t.pos;if(126!==t.src.charCodeAt(l))return!1;if(e)return!1;if(l+4>=a)return!1;if(126!==t.src.charCodeAt(l+1))return!1;if(t.level>=t.options.maxNesting)return!1;if(r=l>0?t.src.charCodeAt(l-1):-1,s=t.src.charCodeAt(l+2),126===r)return!1;if(126===s)return!1;if(32===s||10===s)return!1;for(n=l+2;n<a&&126===t.src.charCodeAt(n);)n++;if(n>l+3)return t.pos+=n-l,e||(t.pending+=t.src.slice(l,n)),!0;for(t.pos=l+2,o=1;t.pos+1<a;){if(126===t.src.charCodeAt(t.pos)&&126===t.src.charCodeAt(t.pos+1)&&(r=t.src.charCodeAt(t.pos-1),126!==(s=t.pos+2<a?t.src.charCodeAt(t.pos+2):-1)&&126!==r&&(32!==r&&10!==r?o--:32!==s&&10!==s&&o++,o<=0))){i=!0;break}t.parser.skipToken(t)}return i?(t.posMax=t.pos,t.pos=l+2,e||(t.push({type:"del_open",level:t.level++}),t.parser.tokenize(t),t.push({type:"del_close",level:--t.level})),t.pos=t.posMax+2,t.posMax=a,!0):(t.pos=l,!1)}],["ins",function(t,e){var i,n,o,r,s,a=t.posMax,l=t.pos;if(43!==t.src.charCodeAt(l))return!1;if(e)return!1;if(l+4>=a)return!1;if(43!==t.src.charCodeAt(l+1))return!1;if(t.level>=t.options.maxNesting)return!1;if(r=l>0?t.src.charCodeAt(l-1):-1,s=t.src.charCodeAt(l+2),43===r)return!1;if(43===s)return!1;if(32===s||10===s)return!1;for(n=l+2;n<a&&43===t.src.charCodeAt(n);)n++;if(n!==l+2)return t.pos+=n-l,e||(t.pending+=t.src.slice(l,n)),!0;for(t.pos=l+2,o=1;t.pos+1<a;){if(43===t.src.charCodeAt(t.pos)&&43===t.src.charCodeAt(t.pos+1)&&(r=t.src.charCodeAt(t.pos-1),43!==(s=t.pos+2<a?t.src.charCodeAt(t.pos+2):-1)&&43!==r&&(32!==r&&10!==r?o--:32!==s&&10!==s&&o++,o<=0))){i=!0;break}t.parser.skipToken(t)}return i?(t.posMax=t.pos,t.pos=l+2,e||(t.push({type:"ins_open",level:t.level++}),t.parser.tokenize(t),t.push({type:"ins_close",level:--t.level})),t.pos=t.posMax+2,t.posMax=a,!0):(t.pos=l,!1)}],["mark",function(t,e){var i,n,o,r,s,a=t.posMax,l=t.pos;if(61!==t.src.charCodeAt(l))return!1;if(e)return!1;if(l+4>=a)return!1;if(61!==t.src.charCodeAt(l+1))return!1;if(t.level>=t.options.maxNesting)return!1;if(r=l>0?t.src.charCodeAt(l-1):-1,s=t.src.charCodeAt(l+2),61===r)return!1;if(61===s)return!1;if(32===s||10===s)return!1;for(n=l+2;n<a&&61===t.src.charCodeAt(n);)n++;if(n!==l+2)return t.pos+=n-l,e||(t.pending+=t.src.slice(l,n)),!0;for(t.pos=l+2,o=1;t.pos+1<a;){if(61===t.src.charCodeAt(t.pos)&&61===t.src.charCodeAt(t.pos+1)&&(r=t.src.charCodeAt(t.pos-1),61!==(s=t.pos+2<a?t.src.charCodeAt(t.pos+2):-1)&&61!==r&&(32!==r&&10!==r?o--:32!==s&&10!==s&&o++,o<=0))){i=!0;break}t.parser.skipToken(t)}return i?(t.posMax=t.pos,t.pos=l+2,e||(t.push({type:"mark_open",level:t.level++}),t.parser.tokenize(t),t.push({type:"mark_close",level:--t.level})),t.pos=t.posMax+2,t.posMax=a,!0):(t.pos=l,!1)}],["emphasis",function(t,e){var i,n,o,r,s,a,l,c=t.posMax,h=t.pos,d=t.src.charCodeAt(h);if(95!==d&&42!==d)return!1;if(e)return!1;if(i=(l=Ss(t,h)).delims,!l.can_open)return t.pos+=i,e||(t.pending+=t.src.slice(h,t.pos)),!0;if(t.level>=t.options.maxNesting)return!1;for(t.pos=h+i,a=[i];t.pos<c;)if(t.src.charCodeAt(t.pos)!==d)t.parser.skipToken(t);else{if(n=(l=Ss(t,t.pos)).delims,l.can_close){for(r=a.pop(),s=n;r!==s;){if(s<r){a.push(r-s);break}if(s-=r,0===a.length)break;t.pos+=r,r=a.pop()}if(0===a.length){i=r,o=!0;break}t.pos+=n;continue}l.can_open&&a.push(n),t.pos+=n}return o?(t.posMax=t.pos,t.pos=h+i,e||(2!==i&&3!==i||t.push({type:"strong_open",level:t.level++}),1!==i&&3!==i||t.push({type:"em_open",level:t.level++}),t.parser.tokenize(t),1!==i&&3!==i||t.push({type:"em_close",level:--t.level}),2!==i&&3!==i||t.push({type:"strong_close",level:--t.level})),t.pos=t.posMax+i,t.posMax=c,!0):(t.pos=h,!1)}],["sub",function(t,e){var i,n,o=t.posMax,r=t.pos;if(126!==t.src.charCodeAt(r))return!1;if(e)return!1;if(r+2>=o)return!1;if(t.level>=t.options.maxNesting)return!1;for(t.pos=r+1;t.pos<o;){if(126===t.src.charCodeAt(t.pos)){i=!0;break}t.parser.skipToken(t)}return i&&r+1!==t.pos?(n=t.src.slice(r+1,t.pos)).match(/(^|[^\\])(\\\\)*\s/)?(t.pos=r,!1):(t.posMax=t.pos,t.pos=r+1,e||t.push({type:"sub",level:t.level,content:n.replace(Es,"$1")}),t.pos=t.posMax+1,t.posMax=o,!0):(t.pos=r,!1)}],["sup",function(t,e){var i,n,o=t.posMax,r=t.pos;if(94!==t.src.charCodeAt(r))return!1;if(e)return!1;if(r+2>=o)return!1;if(t.level>=t.options.maxNesting)return!1;for(t.pos=r+1;t.pos<o;){if(94===t.src.charCodeAt(t.pos)){i=!0;break}t.parser.skipToken(t)}return i&&r+1!==t.pos?(n=t.src.slice(r+1,t.pos)).match(/(^|[^\\])(\\\\)*\s/)?(t.pos=r,!1):(t.posMax=t.pos,t.pos=r+1,e||t.push({type:"sup",level:t.level,content:n.replace(Ts,"$1")}),t.pos=t.posMax+1,t.posMax=o,!0):(t.pos=r,!1)}],["links",function(t,e){var i,n,o,r,s,a,l,c,h=!1,d=t.pos,u=t.posMax,p=t.pos,m=t.src.charCodeAt(p);if(33===m&&(h=!0,m=t.src.charCodeAt(++p)),91!==m)return!1;if(t.level>=t.options.maxNesting)return!1;if(i=p+1,(n=Hr(t,p))<0)return!1;if((a=n+1)<u&&40===t.src.charCodeAt(a)){for(a++;a<u&&(32===(c=t.src.charCodeAt(a))||10===c);a++);if(a>=u)return!1;for(p=a,Wr(t,a)?(r=t.linkContent,a=t.pos):r="",p=a;a<u&&(32===(c=t.src.charCodeAt(a))||10===c);a++);if(a<u&&p!==a&&Gr(t,a))for(s=t.linkContent,a=t.pos;a<u&&(32===(c=t.src.charCodeAt(a))||10===c);a++);else s="";if(a>=u||41!==t.src.charCodeAt(a))return t.pos=d,!1;a++}else{if(t.linkLevel>0)return!1;for(;a<u&&(32===(c=t.src.charCodeAt(a))||10===c);a++);if(a<u&&91===t.src.charCodeAt(a)&&(p=a+1,(a=Hr(t,a))>=0?o=t.src.slice(p,a++):a=p-1),o||(void 0===o&&(a=n+1),o=t.src.slice(i,n)),!(l=t.env.references[Yr(o)]))return t.pos=d,!1;r=l.href,s=l.title}return e||(t.pos=i,t.posMax=n,h?t.push({type:"image",src:r,title:s,alt:t.src.substr(i,n-i),level:t.level}):(t.push({type:"link_open",href:r,title:s,level:t.level++}),t.linkLevel++,t.parser.tokenize(t),t.linkLevel--,t.push({type:"link_close",level:--t.level}))),t.pos=a,t.posMax=u,!0}],["footnote_inline",function(t,e){var i,n,o,r,s=t.posMax,a=t.pos;return!(a+2>=s)&&(94===t.src.charCodeAt(a)&&(91===t.src.charCodeAt(a+1)&&(!(t.level>=t.options.maxNesting)&&(i=a+2,!((n=Hr(t,a+1))<0)&&(e||(t.env.footnotes||(t.env.footnotes={}),t.env.footnotes.list||(t.env.footnotes.list=[]),o=t.env.footnotes.list.length,t.pos=i,t.posMax=n,t.push({type:"footnote_ref",id:o,level:t.level}),t.linkLevel++,r=t.tokens.length,t.parser.tokenize(t),t.env.footnotes.list[o]={tokens:t.tokens.splice(r)},t.linkLevel--),t.pos=n+1,t.posMax=s,!0)))))}],["footnote_ref",function(t,e){var i,n,o,r,s=t.posMax,a=t.pos;if(a+3>s)return!1;if(!t.env.footnotes||!t.env.footnotes.refs)return!1;if(91!==t.src.charCodeAt(a))return!1;if(94!==t.src.charCodeAt(a+1))return!1;if(t.level>=t.options.maxNesting)return!1;for(n=a+2;n<s;n++){if(32===t.src.charCodeAt(n))return!1;if(10===t.src.charCodeAt(n))return!1;if(93===t.src.charCodeAt(n))break}return n!==a+2&&(!(n>=s)&&(n++,i=t.src.slice(a+2,n-1),void 0!==t.env.footnotes.refs[":"+i]&&(e||(t.env.footnotes.list||(t.env.footnotes.list=[]),t.env.footnotes.refs[":"+i]<0?(o=t.env.footnotes.list.length,t.env.footnotes.list[o]={label:i,count:0},t.env.footnotes.refs[":"+i]=o):o=t.env.footnotes.refs[":"+i],r=t.env.footnotes.list[o].count,t.env.footnotes.list[o].count++,t.push({type:"footnote_ref",id:o,subId:r,level:t.level})),t.pos=n,t.posMax=s,!0)))}],["autolink",function(t,e){var i,n,o,r,s,a=t.pos;return 60===t.src.charCodeAt(a)&&(!((i=t.src.slice(a)).indexOf(">")<0)&&((n=i.match(Ds))?!(Ms.indexOf(n[1].toLowerCase())<0)&&(s=Vr(r=n[0].slice(1,-1)),!!t.parser.validateLink(r)&&(e||(t.push({type:"link_open",href:s,level:t.level}),t.push({type:"text",content:r,level:t.level+1}),t.push({type:"link_close",level:t.level})),t.pos+=n[0].length,!0)):!!(o=i.match($s))&&(s=Vr("mailto:"+(r=o[0].slice(1,-1))),!!t.parser.validateLink(s)&&(e||(t.push({type:"link_open",href:s,level:t.level}),t.push({type:"text",content:r,level:t.level+1}),t.push({type:"link_close",level:t.level})),t.pos+=o[0].length,!0))))}],["htmltag",function(t,e){var i,n,o,r=t.pos;return!!t.options.html&&(o=t.posMax,!(60!==t.src.charCodeAt(r)||r+2>=o)&&(!(33!==(i=t.src.charCodeAt(r+1))&&63!==i&&47!==i&&!function(t){var e=32|t;return e>=97&&e<=122}(i))&&(!!(n=t.src.slice(r).match(Is))&&(e||t.push({type:"htmltag",content:t.src.slice(r,r+n[0].length),level:t.level}),t.pos+=n[0].length,!0))))}],["entity",function(t,e){var i,n,o=t.pos,r=t.posMax;if(38!==t.src.charCodeAt(o))return!1;if(o+1<r)if(35===t.src.charCodeAt(o+1)){if(n=t.src.slice(o).match(zs))return e||(i="x"===n[1][0].toLowerCase()?parseInt(n[1].slice(1),16):parseInt(n[1],10),t.pending+=Tr(i)?Mr(i):Mr(65533)),t.pos+=n[0].length,!0}else if(n=t.src.slice(o).match(Ns)){var s=wr(n[1]);if(n[1]!==s)return e||(t.pending+=s),t.pos+=n[0].length,!0}return e||(t.pending+="&"),t.pos++,!0}]];function Bs(){this.ruler=new jr;for(var t=0;t<Rs.length;t++)this.ruler.push(Rs[t][0],Rs[t][1]);this.validateLink=Fs}function Fs(t){var e=t.trim().toLowerCase();return-1===(e=Lr(e)).indexOf(":")||-1===["vbscript","javascript","file","data"].indexOf(e.split(":")[0])}Bs.prototype.skipToken=function(t){var e,i,n=this.ruler.getRules(""),o=n.length,r=t.pos;if((i=t.cacheGet(r))>0)t.pos=i;else{for(e=0;e<o;e++)if(n[e](t,!0))return void t.cacheSet(r,t.pos);t.pos++,t.cacheSet(r,t.pos)}},Bs.prototype.tokenize=function(t){for(var e,i,n=this.ruler.getRules(""),o=n.length,r=t.posMax;t.pos<r;){for(i=0;i<o&&!(e=n[i](t,!1));i++);if(e){if(t.pos>=r)break}else t.pending+=t.src[t.pos++]}t.pending&&t.pushPending()},Bs.prototype.parse=function(t,e,i,n){var o=new Zr(t,this,e,i,n);this.tokenize(o)};var qs={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkTarget:"",typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["block","inline","references","replacements","smartquotes","references","abbr2","footnote_tail"]},block:{rules:["blockquote","code","fences","footnote","heading","hr","htmlblock","lheading","list","paragraph","table"]},inline:{rules:["autolink","backticks","del","emphasis","entity","escape","footnote_ref","htmltag","links","newline","text"]}}},full:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkTarget:"",typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{},block:{},inline:{}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkTarget:"",typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["block","inline","references","abbr2"]},block:{rules:["blockquote","code","fences","heading","hr","htmlblock","lheading","list","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","htmltag","links","newline","text"]}}}};function js(t,e,i){this.src=e,this.env=i,this.options=t.options,this.tokens=[],this.inlineMode=!1,this.inline=t.inline,this.block=t.block,this.renderer=t.renderer,this.typographer=t.typographer}function Zs(t,e){"string"!=typeof t&&(e=t,t="default"),e&&null!=e.linkify&&console.warn("linkify option is removed. Use linkify plugin instead:\n\nimport Remarkable from 'remarkable';\nimport linkify from 'remarkable/linkify';\nnew Remarkable().use(linkify)\n"),this.inline=new Bs,this.block=new vs,this.core=new as,this.renderer=new qr,this.ruler=new jr,this.options={},this.configure(qs[t]),this.set(e||{})}Zs.prototype.set=function(t){Cr(this.options,t)},Zs.prototype.configure=function(t){var e=this;if(!t)throw new Error("Wrong `remarkable` preset, check name/content");t.options&&e.set(t.options),t.components&&Object.keys(t.components).forEach((function(i){t.components[i].rules&&e[i].ruler.enable(t.components[i].rules,!0)}))},Zs.prototype.use=function(t,e){return t(this,e),this},Zs.prototype.parse=function(t,e){var i=new js(this,t,e);return this.core.process(i),i.tokens},Zs.prototype.render=function(t,e){return e=e||{},this.renderer.render(this.parse(t,e),this.options,e)},Zs.prototype.parseInline=function(t,e){var i=new js(this,t,e);return i.inlineMode=!0,this.core.process(i),i.tokens},Zs.prototype.renderInline=function(t,e){return e=e||{},this.renderer.render(this.parseInline(t,e),this.options,e)};const Hs=new Zs,Us=new br("@",["contact","fields","globals","urns"]),Vs=new br("@",["contact","fields","globals","urns","results","input","run","child","parent","node","webhook","ticket","trigger","resume"]);const Ws=ct(class extends ht{constructor(t){if(super(t),t.type!==lt)throw new Error("renderMarkdown only supports child expressions")}update(t,[e]){return this.render(e)}render(t){return void 0===this.value&&(this.value=t),O`${fr(Hs.render(this.value))}`}}),Gs=(t,e)=>{if(t.signature){const i=t.signature.indexOf("("),n=t.signature.substr(0,i),o=t.signature.substr(i);return O`
423
+ `}}t([it({type:Number})],Io.prototype,"top",void 0),t([it({type:Number})],Io.prototype,"left",void 0),t([it({type:Number})],Io.prototype,"width",void 0),t([it({type:Number,attribute:"static-width"})],Io.prototype,"staticWidth",void 0),t([it({type:Boolean,attribute:"anchor-right"})],Io.prototype,"anchorRight",void 0),t([it({type:Number})],Io.prototype,"marginHorizontal",void 0),t([it({type:Number})],Io.prototype,"marginVertical",void 0),t([it({type:Object})],Io.prototype,"anchorTo",void 0),t([it({type:Boolean})],Io.prototype,"visible",void 0),t([it({type:Boolean})],Io.prototype,"block",void 0),t([it({type:Number})],Io.prototype,"scrollPct",void 0),t([it({type:Number})],Io.prototype,"cursorIndex",void 0),t([it({type:Array})],Io.prototype,"options",void 0),t([it({type:Array})],Io.prototype,"tempOptions",void 0),t([it({type:Boolean})],Io.prototype,"poppedTop",void 0),t([it({type:Boolean})],Io.prototype,"spaceSelect",void 0),t([it({type:String})],Io.prototype,"nameKey",void 0),t([it({type:Boolean})],Io.prototype,"loading",void 0),t([it({type:Boolean})],Io.prototype,"collapsed",void 0),t([it({type:Boolean})],Io.prototype,"hideShadow",void 0),t([it({attribute:!1})],Io.prototype,"getName",void 0),t([it({attribute:!1})],Io.prototype,"renderInputOption",void 0),t([it({attribute:!1})],Io.prototype,"renderOption",void 0),t([it({attribute:!1})],Io.prototype,"renderOptionName",void 0),t([it({attribute:!1})],Io.prototype,"renderOptionDetail",void 0),t([it({type:Number})],Io.prototype,"scrollHeight",void 0),t([it({type:Boolean})],Io.prototype,"triggerScroll",void 0);class Do extends ht{constructor(t){if(super(t),this.it=I,t.type!==lt)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===I||null==t)return this._t=void 0,this.it=t;if(t===z)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}Do.directiveName="unsafeHTML",Do.resultType=1;const No=ct(Do),Ro=(t,e,i)=>{const n=t.substring(1);if("("===n[0])return!0;{const t=n.split(".")[0].toLowerCase();if(!i)return e.indexOf(t)>=0;for(const i of e)if(o=t,0===i.indexOf(o,0))return!0;return!1}var o},Bo=t=>t>="a"&&t<="z"||t>="A"&&t<="Z"||t>="0"&&t<="9"||"_"===t,qo=t=>{let e=0;for(const i of t)'"'===i&&e++;return e%2!=0};class Zo{constructor(t,e){this.expressionPrefix=t,this.allowedTopLevels=e}expressionContext(t){const e=this.findExpressions(t);if(0===e.length)return null;const i=e[e.length-1];return i.end<t.length||i.closed?null:i.text.substring(1)}autoCompleteContext(t){if(qo(t))return null;const e=[];let i="",n=!1,o=!1,s="";for(let r=t.length-1;r>=0;r--){const a=t[r];if(" "===a&&(n=!0),","===a&&(n=!0,"("!==e[e.length-1]&&e.push("(")),")"!==a||o||(n=!0,e.push("("),e.push("(")),'"'===a&&(o=!o),n&&("("!==a||o||("("===e[e.length-1]&&e.pop(),0===e.length&&(n=!1))),"("===a&&""===i&&(s="#"),!(n||o||"("===a&&""===i)){if(!Bo(a)&&"."!==a)break;i=a+i}}return i.match(/[A-Za-z][\w]*(\.[\w]+)*/)?s+i:null}functionContext(t){let e=qo(t)?4:6,i="",n="("===t[-1]?0:1;for(let o=t.length-1;o>=0;o--){const s=t[o];if("@"===s)return"";if(6===e)0!==n||!Bo(s)&&"."!==s?'"'===s?e=4:"("===s?n--:")"===s&&n++:(e=2,i=s+i);else if(2===e){if(!Bo(s)&&"."!==s)return i;i=s+i}else 4===e&&'"'===s&&(e=6)}return""}getContactFields(t){const e={},i=/((parent|child\.)*contact\.)*fields\.([a-z0-9_]+)/g,n=this.findExpressions(t);for(const t of n){let n;for(;n=i.exec(t.text);)e[n[3]]=!0}return Object.keys(e)}findExpressions(t){const e=[];let i=0,n=null,o=0;for(let s=0;s<t.length;s++){const r=t[s],a=s<t.length-1?t[s+1]:0,l=s<t.length-2?t[s+2]:0;if(0===i?r!==this.expressionPrefix||!Bo(a)&&"("!==a?r===this.expressionPrefix&&a===this.expressionPrefix&&(i=5):(i=1,n={start:s,end:null,text:r,closed:!1}):1===i?(Bo(r)?i=2:"("===r&&(i=3,o+=1),n.text+=r):2===i?n.text+=r:3===i?("("===r?o+=1:")"===r?o-=1:'"'===r&&(i=4),n.text+=r,0===o&&(n.end=s+1)):4===i?('"'===r&&(i=3),n.text+=r):5===i&&(i=0),2===i&&(!Bo(a)&&"."!==a||"."===a&&!Bo(l))&&(n.end=s+1),null!=n&&(null!=n.end||0===a)){const t=0===a;Ro(n.text,this.allowedTopLevels,t)&&(n.closed="("===n.text[1]&&0===o,n.end=s+1,e.push(n)),n=null,i=0}}return e}}var Fo={Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",GT:">",Gt:"≫",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",LT:"<",Lt:"≪",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"},Vo=Object.prototype.hasOwnProperty;function jo(t){return i=t,(e=Fo)&&Vo.call(e,i)?Fo[t]:t;var e,i}var Uo=Object.prototype.hasOwnProperty;function Ho(t){var e=[].slice.call(arguments,1);return e.forEach((function(e){if(e){if("object"!=typeof e)throw new TypeError(e+"must be object");Object.keys(e).forEach((function(i){t[i]=e[i]}))}})),t}var Go=/\\([\\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;function Wo(t){return t.indexOf("\\")<0?t:t.replace(Go,"$1")}function Ko(t){return!(t>=55296&&t<=57343)&&(!(t>=64976&&t<=65007)&&(65535!=(65535&t)&&65534!=(65535&t)&&(!(t>=0&&t<=8)&&(11!==t&&(!(t>=14&&t<=31)&&(!(t>=127&&t<=159)&&!(t>1114111)))))))}function Yo(t){if(t>65535){var e=55296+((t-=65536)>>10),i=56320+(1023&t);return String.fromCharCode(e,i)}return String.fromCharCode(t)}var Jo=/&([a-z#][a-z0-9]{1,31});/gi,Xo=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i;function Qo(t,e){var i=0,n=jo(e);return e!==n?n:35===e.charCodeAt(0)&&Xo.test(e)&&Ko(i="x"===e[1].toLowerCase()?parseInt(e.slice(2),16):parseInt(e.slice(1),10))?Yo(i):t}function ts(t){return t.indexOf("&")<0?t:t.replace(Jo,Qo)}var es=/[&<>"]/,is=/[&<>"]/g,ns={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function os(t){return ns[t]}function ss(t){return es.test(t)?t.replace(is,os):t}var rs={};function as(t,e){return++e>=t.length-2?e:"paragraph_open"===t[e].type&&t[e].tight&&"inline"===t[e+1].type&&0===t[e+1].content.length&&"paragraph_close"===t[e+2].type&&t[e+2].tight?as(t,e+2):e}rs.blockquote_open=function(){return"<blockquote>\n"},rs.blockquote_close=function(t,e){return"</blockquote>"+ls(t,e)},rs.code=function(t,e){return t[e].block?"<pre><code>"+ss(t[e].content)+"</code></pre>"+ls(t,e):"<code>"+ss(t[e].content)+"</code>"},rs.fence=function(t,e,i,n,o){var s,r,a,l,c=t[e],h="",u=i.langPrefix;if(c.params){if(r=(s=c.params.split(/\s+/g)).join(" "),a=o.rules.fence_custom,l=s[0],a&&Uo.call(a,l))return o.rules.fence_custom[s[0]](t,e,i,n,o);h=' class="'+u+ss(ts(Wo(r)))+'"'}return"<pre><code"+h+">"+(i.highlight&&i.highlight.apply(i.highlight,[c.content].concat(s))||ss(c.content))+"</code></pre>"+ls(t,e)},rs.fence_custom={},rs.heading_open=function(t,e){return"<h"+t[e].hLevel+">"},rs.heading_close=function(t,e){return"</h"+t[e].hLevel+">\n"},rs.hr=function(t,e,i){return(i.xhtmlOut?"<hr />":"<hr>")+ls(t,e)},rs.bullet_list_open=function(){return"<ul>\n"},rs.bullet_list_close=function(t,e){return"</ul>"+ls(t,e)},rs.list_item_open=function(){return"<li>"},rs.list_item_close=function(){return"</li>\n"},rs.ordered_list_open=function(t,e){var i=t[e];return"<ol"+(i.order>1?' start="'+i.order+'"':"")+">\n"},rs.ordered_list_close=function(t,e){return"</ol>"+ls(t,e)},rs.paragraph_open=function(t,e){return t[e].tight?"":"<p>"},rs.paragraph_close=function(t,e){var i=!(t[e].tight&&e&&"inline"===t[e-1].type&&!t[e-1].content);return(t[e].tight?"":"</p>")+(i?ls(t,e):"")},rs.link_open=function(t,e,i){var n=t[e].title?' title="'+ss(ts(t[e].title))+'"':"",o=i.linkTarget?' target="'+i.linkTarget+'"':"";return'<a href="'+ss(t[e].href)+'"'+n+o+">"},rs.link_close=function(){return"</a>"},rs.image=function(t,e,i){var n=' src="'+ss(t[e].src)+'"',o=t[e].title?' title="'+ss(ts(t[e].title))+'"':"";return"<img"+n+(' alt="'+(t[e].alt?ss(ts(Wo(t[e].alt))):"")+'"')+o+(i.xhtmlOut?" /":"")+">"},rs.table_open=function(){return"<table>\n"},rs.table_close=function(){return"</table>\n"},rs.thead_open=function(){return"<thead>\n"},rs.thead_close=function(){return"</thead>\n"},rs.tbody_open=function(){return"<tbody>\n"},rs.tbody_close=function(){return"</tbody>\n"},rs.tr_open=function(){return"<tr>"},rs.tr_close=function(){return"</tr>\n"},rs.th_open=function(t,e){var i=t[e];return"<th"+(i.align?' style="text-align:'+i.align+'"':"")+">"},rs.th_close=function(){return"</th>"},rs.td_open=function(t,e){var i=t[e];return"<td"+(i.align?' style="text-align:'+i.align+'"':"")+">"},rs.td_close=function(){return"</td>"},rs.strong_open=function(){return"<strong>"},rs.strong_close=function(){return"</strong>"},rs.em_open=function(){return"<em>"},rs.em_close=function(){return"</em>"},rs.del_open=function(){return"<del>"},rs.del_close=function(){return"</del>"},rs.ins_open=function(){return"<ins>"},rs.ins_close=function(){return"</ins>"},rs.mark_open=function(){return"<mark>"},rs.mark_close=function(){return"</mark>"},rs.sub=function(t,e){return"<sub>"+ss(t[e].content)+"</sub>"},rs.sup=function(t,e){return"<sup>"+ss(t[e].content)+"</sup>"},rs.hardbreak=function(t,e,i){return i.xhtmlOut?"<br />\n":"<br>\n"},rs.softbreak=function(t,e,i){return i.breaks?i.xhtmlOut?"<br />\n":"<br>\n":"\n"},rs.text=function(t,e){return ss(t[e].content)},rs.htmlblock=function(t,e){return t[e].content},rs.htmltag=function(t,e){return t[e].content},rs.abbr_open=function(t,e){return'<abbr title="'+ss(ts(t[e].title))+'">'},rs.abbr_close=function(){return"</abbr>"},rs.footnote_ref=function(t,e){var i=Number(t[e].id+1).toString(),n="fnref"+i;return t[e].subId>0&&(n+=":"+t[e].subId),'<sup class="footnote-ref"><a href="#fn'+i+'" id="'+n+'">['+i+"]</a></sup>"},rs.footnote_block_open=function(t,e,i){return(i.xhtmlOut?'<hr class="footnotes-sep" />\n':'<hr class="footnotes-sep">\n')+'<section class="footnotes">\n<ol class="footnotes-list">\n'},rs.footnote_block_close=function(){return"</ol>\n</section>\n"},rs.footnote_open=function(t,e){return'<li id="fn'+Number(t[e].id+1).toString()+'" class="footnote-item">'},rs.footnote_close=function(){return"</li>\n"},rs.footnote_anchor=function(t,e){var i="fnref"+Number(t[e].id+1).toString();return t[e].subId>0&&(i+=":"+t[e].subId),' <a href="#'+i+'" class="footnote-backref">↩</a>'},rs.dl_open=function(){return"<dl>\n"},rs.dt_open=function(){return"<dt>"},rs.dd_open=function(){return"<dd>"},rs.dl_close=function(){return"</dl>\n"},rs.dt_close=function(){return"</dt>\n"},rs.dd_close=function(){return"</dd>\n"};var ls=rs.getBreak=function(t,e){return(e=as(t,e))<t.length&&"list_item_close"===t[e].type?"":"\n"};function cs(){this.rules=Ho({},rs),this.getBreak=rs.getBreak}function hs(){this.__rules__=[],this.__cache__=null}function us(t,e,i,n,o){this.src=t,this.env=n,this.options=i,this.parser=e,this.tokens=o,this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache=[],this.isInLabel=!1,this.linkLevel=0,this.linkContent="",this.labelUnmatchedScopes=0}function ds(t,e){var i,n,o,s=-1,r=t.posMax,a=t.pos,l=t.isInLabel;if(t.isInLabel)return-1;if(t.labelUnmatchedScopes)return t.labelUnmatchedScopes--,-1;for(t.pos=e+1,t.isInLabel=!0,i=1;t.pos<r;){if(91===(o=t.src.charCodeAt(t.pos)))i++;else if(93===o&&0===--i){n=!0;break}t.parser.skipToken(t)}return n?(s=t.pos,t.labelUnmatchedScopes=0):t.labelUnmatchedScopes=i-1,t.pos=a,t.isInLabel=l,s}function ps(t,e,i,n){var o,s,r,a,l,c;if(42!==t.charCodeAt(0))return-1;if(91!==t.charCodeAt(1))return-1;if(-1===t.indexOf("]:"))return-1;if((s=ds(o=new us(t,e,i,n,[]),1))<0||58!==t.charCodeAt(s+1))return-1;for(a=o.posMax,r=s+2;r<a&&10!==o.src.charCodeAt(r);r++);return l=t.slice(2,s),0===(c=t.slice(s+2,r).trim()).length?-1:(n.abbreviations||(n.abbreviations={}),void 0===n.abbreviations[":"+l]&&(n.abbreviations[":"+l]=c),r)}function ms(t){var e=ts(t);try{e=decodeURI(e)}catch(t){}return encodeURI(e)}function fs(t,e){var i,n,o,s=e,r=t.posMax;if(60===t.src.charCodeAt(e)){for(e++;e<r;){if(10===(i=t.src.charCodeAt(e)))return!1;if(62===i)return o=ms(Wo(t.src.slice(s+1,e))),!!t.parser.validateLink(o)&&(t.pos=e+1,t.linkContent=o,!0);92===i&&e+1<r?e+=2:e++}return!1}for(n=0;e<r&&32!==(i=t.src.charCodeAt(e))&&!(i<32||127===i);)if(92===i&&e+1<r)e+=2;else{if(40===i&&++n>1)break;if(41===i&&--n<0)break;e++}return s!==e&&(o=Wo(t.src.slice(s,e)),!!t.parser.validateLink(o)&&(t.linkContent=o,t.pos=e,!0))}function gs(t,e){var i,n=e,o=t.posMax,s=t.src.charCodeAt(e);if(34!==s&&39!==s&&40!==s)return!1;for(e++,40===s&&(s=41);e<o;){if((i=t.src.charCodeAt(e))===s)return t.pos=e+1,t.linkContent=Wo(t.src.slice(n+1,e)),!0;92===i&&e+1<o?e+=2:e++}return!1}function vs(t){return t.trim().replace(/\s+/g," ").toUpperCase()}function ys(t,e,i,n){var o,s,r,a,l,c,h,u,d;if(91!==t.charCodeAt(0))return-1;if(-1===t.indexOf("]:"))return-1;if((s=ds(o=new us(t,e,i,n,[]),0))<0||58!==t.charCodeAt(s+1))return-1;for(a=o.posMax,r=s+2;r<a&&(32===(l=o.src.charCodeAt(r))||10===l);r++);if(!fs(o,r))return-1;for(h=o.linkContent,c=r=o.pos,r+=1;r<a&&(32===(l=o.src.charCodeAt(r))||10===l);r++);for(r<a&&c!==r&&gs(o,r)?(u=o.linkContent,r=o.pos):(u="",r=c);r<a&&32===o.src.charCodeAt(r);)r++;return r<a&&10!==o.src.charCodeAt(r)?-1:(d=vs(t.slice(1,s)),void 0===n.references[d]&&(n.references[d]={title:u,href:h}),r)}cs.prototype.renderInline=function(t,e,i){for(var n=this.rules,o=t.length,s=0,r="";o--;)r+=n[t[s].type](t,s++,e,i,this);return r},cs.prototype.render=function(t,e,i){for(var n=this.rules,o=t.length,s=-1,r="";++s<o;)"inline"===t[s].type?r+=this.renderInline(t[s].children,e,i):r+=n[t[s].type](t,s,e,i,this);return r},hs.prototype.__find__=function(t){for(var e=this.__rules__.length,i=-1;e--;)if(this.__rules__[++i].name===t)return i;return-1},hs.prototype.__compile__=function(){var t=this,e=[""];t.__rules__.forEach((function(t){t.enabled&&t.alt.forEach((function(t){e.indexOf(t)<0&&e.push(t)}))})),t.__cache__={},e.forEach((function(e){t.__cache__[e]=[],t.__rules__.forEach((function(i){i.enabled&&(e&&i.alt.indexOf(e)<0||t.__cache__[e].push(i.fn))}))}))},hs.prototype.at=function(t,e,i){var n=this.__find__(t),o=i||{};if(-1===n)throw new Error("Parser rule not found: "+t);this.__rules__[n].fn=e,this.__rules__[n].alt=o.alt||[],this.__cache__=null},hs.prototype.before=function(t,e,i,n){var o=this.__find__(t),s=n||{};if(-1===o)throw new Error("Parser rule not found: "+t);this.__rules__.splice(o,0,{name:e,enabled:!0,fn:i,alt:s.alt||[]}),this.__cache__=null},hs.prototype.after=function(t,e,i,n){var o=this.__find__(t),s=n||{};if(-1===o)throw new Error("Parser rule not found: "+t);this.__rules__.splice(o+1,0,{name:e,enabled:!0,fn:i,alt:s.alt||[]}),this.__cache__=null},hs.prototype.push=function(t,e,i){var n=i||{};this.__rules__.push({name:t,enabled:!0,fn:e,alt:n.alt||[]}),this.__cache__=null},hs.prototype.enable=function(t,e){t=Array.isArray(t)?t:[t],e&&this.__rules__.forEach((function(t){t.enabled=!1})),t.forEach((function(t){var e=this.__find__(t);if(e<0)throw new Error("Rules manager: invalid rule name "+t);this.__rules__[e].enabled=!0}),this),this.__cache__=null},hs.prototype.disable=function(t){(t=Array.isArray(t)?t:[t]).forEach((function(t){var e=this.__find__(t);if(e<0)throw new Error("Rules manager: invalid rule name "+t);this.__rules__[e].enabled=!1}),this),this.__cache__=null},hs.prototype.getRules=function(t){return null===this.__cache__&&this.__compile__(),this.__cache__[t]||[]},us.prototype.pushPending=function(){this.tokens.push({type:"text",content:this.pending,level:this.pendingLevel}),this.pending=""},us.prototype.push=function(t){this.pending&&this.pushPending(),this.tokens.push(t),this.pendingLevel=this.level},us.prototype.cacheSet=function(t,e){for(var i=this.cache.length;i<=t;i++)this.cache.push(0);this.cache[t]=e},us.prototype.cacheGet=function(t){return t<this.cache.length?this.cache[t]:0};function bs(t){return t.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1")}var _s=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,xs=/\((c|tm|r|p)\)/gi,ws={c:"©",r:"®",p:"§",tm:"™"};var ks=/['"]/,Ss=/['"]/g,Cs=/[-\s()\[\]]/;function Ts(t,e){return!(e<0||e>=t.length)&&!Cs.test(t[e])}function Es(t,e,i){return t.substr(0,e)+i+t.substr(e+1)}var $s=[["block",function(t){t.inlineMode?t.tokens.push({type:"inline",content:t.src.replace(/\n/g," ").trim(),level:0,lines:[0,1],children:[]}):t.block.parse(t.src,t.options,t.env,t.tokens)}],["abbr",function(t){var e,i,n,o,s=t.tokens;if(!t.inlineMode)for(e=1,i=s.length-1;e<i;e++)if("paragraph_open"===s[e-1].type&&"inline"===s[e].type&&"paragraph_close"===s[e+1].type){for(n=s[e].content;n.length&&!((o=ps(n,t.inline,t.options,t.env))<0);)n=n.slice(o).trim();s[e].content=n,n.length||(s[e-1].tight=!0,s[e+1].tight=!0)}}],["references",function(t){var e,i,n,o,s=t.tokens;if(t.env.references=t.env.references||{},!t.inlineMode)for(e=1,i=s.length-1;e<i;e++)if("inline"===s[e].type&&"paragraph_open"===s[e-1].type&&"paragraph_close"===s[e+1].type){for(n=s[e].content;n.length&&!((o=ys(n,t.inline,t.options,t.env))<0);)n=n.slice(o).trim();s[e].content=n,n.length||(s[e-1].tight=!0,s[e+1].tight=!0)}}],["inline",function(t){var e,i,n,o=t.tokens;for(i=0,n=o.length;i<n;i++)"inline"===(e=o[i]).type&&t.inline.parse(e.content,t.options,t.env,e.children)}],["footnote_tail",function(t){var e,i,n,o,s,r,a,l,c,h=0,u=!1,d={};if(t.env.footnotes&&(t.tokens=t.tokens.filter((function(t){return"footnote_reference_open"===t.type?(u=!0,l=[],c=t.label,!1):"footnote_reference_close"===t.type?(u=!1,d[":"+c]=l,!1):(u&&l.push(t),!u)})),t.env.footnotes.list)){for(r=t.env.footnotes.list,t.tokens.push({type:"footnote_block_open",level:h++}),e=0,i=r.length;e<i;e++){for(t.tokens.push({type:"footnote_open",id:e,level:h++}),r[e].tokens?((a=[]).push({type:"paragraph_open",tight:!1,level:h++}),a.push({type:"inline",content:"",level:h,children:r[e].tokens}),a.push({type:"paragraph_close",tight:!1,level:--h})):r[e].label&&(a=d[":"+r[e].label]),t.tokens=t.tokens.concat(a),s="paragraph_close"===t.tokens[t.tokens.length-1].type?t.tokens.pop():null,o=r[e].count>0?r[e].count:1,n=0;n<o;n++)t.tokens.push({type:"footnote_anchor",id:e,subId:n,level:h});s&&t.tokens.push(s),t.tokens.push({type:"footnote_close",level:--h})}t.tokens.push({type:"footnote_block_close",level:--h})}}],["abbr2",function(t){var e,i,n,o,s,r,a,l,c,h,u,d,p=t.tokens;if(t.env.abbreviations)for(t.env.abbrRegExp||(d="(^|["+" \n()[]'\".,!?-".split("").map(bs).join("")+"])("+Object.keys(t.env.abbreviations).map((function(t){return t.substr(1)})).sort((function(t,e){return e.length-t.length})).map(bs).join("|")+")($|["+" \n()[]'\".,!?-".split("").map(bs).join("")+"])",t.env.abbrRegExp=new RegExp(d,"g")),h=t.env.abbrRegExp,i=0,n=p.length;i<n;i++)if("inline"===p[i].type)for(e=(o=p[i].children).length-1;e>=0;e--)if("text"===(s=o[e]).type){for(l=0,r=s.content,h.lastIndex=0,c=s.level,a=[];u=h.exec(r);)h.lastIndex>l&&a.push({type:"text",content:r.slice(l,u.index+u[1].length),level:c}),a.push({type:"abbr_open",title:t.env.abbreviations[":"+u[2]],level:c++}),a.push({type:"text",content:u[2],level:c}),a.push({type:"abbr_close",level:--c}),l=h.lastIndex-u[3].length;a.length&&(l<r.length&&a.push({type:"text",content:r.slice(l),level:c}),p[i].children=o=[].concat(o.slice(0,e),a,o.slice(e+1)))}}],["replacements",function(t){var e,i,n,o,s,r;if(t.options.typographer)for(s=t.tokens.length-1;s>=0;s--)if("inline"===t.tokens[s].type)for(e=(o=t.tokens[s].children).length-1;e>=0;e--)"text"===(i=o[e]).type&&(n=i.content,n=(r=n).indexOf("(")<0?r:r.replace(xs,(function(t,e){return ws[e.toLowerCase()]})),_s.test(n)&&(n=n.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---([^-]|$)/gm,"$1—$2").replace(/(^|\s)--(\s|$)/gm,"$1–$2").replace(/(^|[^-\s])--([^-\s]|$)/gm,"$1–$2")),i.content=n)}],["smartquotes",function(t){var e,i,n,o,s,r,a,l,c,h,u,d,p,m,f,g,v;if(t.options.typographer)for(v=[],f=t.tokens.length-1;f>=0;f--)if("inline"===t.tokens[f].type)for(g=t.tokens[f].children,v.length=0,e=0;e<g.length;e++)if("text"===(i=g[e]).type&&!ks.test(i.text)){for(a=g[e].level,p=v.length-1;p>=0&&!(v[p].level<=a);p--);v.length=p+1,s=0,r=(n=i.content).length;t:for(;s<r&&(Ss.lastIndex=s,o=Ss.exec(n));)if(l=!Ts(n,o.index-1),s=o.index+1,m="'"===o[0],(c=!Ts(n,s))||l){if(u=!c,d=!l)for(p=v.length-1;p>=0&&(h=v[p],!(v[p].level<a));p--)if(h.single===m&&v[p].level===a){h=v[p],m?(g[h.token].content=Es(g[h.token].content,h.pos,t.options.quotes[2]),i.content=Es(i.content,o.index,t.options.quotes[3])):(g[h.token].content=Es(g[h.token].content,h.pos,t.options.quotes[0]),i.content=Es(i.content,o.index,t.options.quotes[1])),v.length=p;continue t}u?v.push({token:e,pos:o.index,single:m,level:a}):d&&m&&(i.content=Es(i.content,o.index,"’"))}else m&&(i.content=Es(i.content,o.index,"’"))}}]];function Ls(){this.options={},this.ruler=new hs;for(var t=0;t<$s.length;t++)this.ruler.push($s[t][0],$s[t][1])}function As(t,e,i,n,o){var s,r,a,l,c,h,u;for(this.src=t,this.parser=e,this.options=i,this.env=n,this.tokens=o,this.bMarks=[],this.eMarks=[],this.tShift=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.parentType="root",this.ddIndent=-1,this.level=0,this.result="",h=0,u=!1,a=l=h=0,c=(r=this.src).length;l<c;l++){if(s=r.charCodeAt(l),!u){if(32===s){h++;continue}u=!0}10!==s&&l!==c-1||(10!==s&&l++,this.bMarks.push(a),this.eMarks.push(l),this.tShift.push(h),u=!1,h=0,a=l+1)}this.bMarks.push(r.length),this.eMarks.push(r.length),this.tShift.push(0),this.lineMax=this.bMarks.length-1}function Os(t,e){var i,n,o;return(n=t.bMarks[e]+t.tShift[e])>=(o=t.eMarks[e])||42!==(i=t.src.charCodeAt(n++))&&45!==i&&43!==i||n<o&&32!==t.src.charCodeAt(n)?-1:n}function Ms(t,e){var i,n=t.bMarks[e]+t.tShift[e],o=t.eMarks[e];if(n+1>=o)return-1;if((i=t.src.charCodeAt(n++))<48||i>57)return-1;for(;;){if(n>=o)return-1;if(!((i=t.src.charCodeAt(n++))>=48&&i<=57)){if(41===i||46===i)break;return-1}}return n<o&&32!==t.src.charCodeAt(n)?-1:n}Ls.prototype.process=function(t){var e,i,n;for(e=0,i=(n=this.ruler.getRules("")).length;e<i;e++)n[e](t)},As.prototype.isEmpty=function(t){return this.bMarks[t]+this.tShift[t]>=this.eMarks[t]},As.prototype.skipEmptyLines=function(t){for(var e=this.lineMax;t<e&&!(this.bMarks[t]+this.tShift[t]<this.eMarks[t]);t++);return t},As.prototype.skipSpaces=function(t){for(var e=this.src.length;t<e&&32===this.src.charCodeAt(t);t++);return t},As.prototype.skipChars=function(t,e){for(var i=this.src.length;t<i&&this.src.charCodeAt(t)===e;t++);return t},As.prototype.skipCharsBack=function(t,e,i){if(t<=i)return t;for(;t>i;)if(e!==this.src.charCodeAt(--t))return t+1;return t},As.prototype.getLines=function(t,e,i,n){var o,s,r,a,l,c=t;if(t>=e)return"";if(c+1===e)return s=this.bMarks[c]+Math.min(this.tShift[c],i),r=n?this.eMarks[c]+1:this.eMarks[c],this.src.slice(s,r);for(a=new Array(e-t),o=0;c<e;c++,o++)(l=this.tShift[c])>i&&(l=i),l<0&&(l=0),s=this.bMarks[c]+l,r=c+1<e||n?this.eMarks[c]+1:this.eMarks[c],a[o]=this.src.slice(s,r);return a.join("")};var Ps={};["article","aside","button","blockquote","body","canvas","caption","col","colgroup","dd","div","dl","dt","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","iframe","li","map","object","ol","output","p","pre","progress","script","section","style","table","tbody","td","textarea","tfoot","th","tr","thead","ul","video"].forEach((function(t){Ps[t]=!0}));var zs=/^<([a-zA-Z]{1,15})[\s\/>]/,Is=/^<\/([a-zA-Z]{1,15})[\s>]/;function Ds(t,e){var i=t.bMarks[e]+t.blkIndent,n=t.eMarks[e];return t.src.substr(i,n-i)}function Ns(t,e){var i,n,o=t.bMarks[e]+t.tShift[e],s=t.eMarks[e];return o>=s||126!==(n=t.src.charCodeAt(o++))&&58!==n||o===(i=t.skipSpaces(o))||i>=s?-1:i}var Rs=[["code",function(t,e,i){var n,o;if(t.tShift[e]-t.blkIndent<4)return!1;for(o=n=e+1;n<i;)if(t.isEmpty(n))n++;else{if(!(t.tShift[n]-t.blkIndent>=4))break;o=++n}return t.line=n,t.tokens.push({type:"code",content:t.getLines(e,o,4+t.blkIndent,!0),block:!0,lines:[e,t.line],level:t.level}),!0}],["fences",function(t,e,i,n){var o,s,r,a,l,c=!1,h=t.bMarks[e]+t.tShift[e],u=t.eMarks[e];if(h+3>u)return!1;if(126!==(o=t.src.charCodeAt(h))&&96!==o)return!1;if(l=h,(s=(h=t.skipChars(h,o))-l)<3)return!1;if((r=t.src.slice(h,u).trim()).indexOf("`")>=0)return!1;if(n)return!0;for(a=e;!(++a>=i)&&!((h=l=t.bMarks[a]+t.tShift[a])<(u=t.eMarks[a])&&t.tShift[a]<t.blkIndent);)if(t.src.charCodeAt(h)===o&&!(t.tShift[a]-t.blkIndent>=4||(h=t.skipChars(h,o))-l<s||(h=t.skipSpaces(h))<u)){c=!0;break}return s=t.tShift[e],t.line=a+(c?1:0),t.tokens.push({type:"fence",params:r,content:t.getLines(e+1,a,s,!0),lines:[e,t.line],level:t.level}),!0},["paragraph","blockquote","list"]],["blockquote",function(t,e,i,n){var o,s,r,a,l,c,h,u,d,p,m,f=t.bMarks[e]+t.tShift[e],g=t.eMarks[e];if(f>g)return!1;if(62!==t.src.charCodeAt(f++))return!1;if(t.level>=t.options.maxNesting)return!1;if(n)return!0;for(32===t.src.charCodeAt(f)&&f++,l=t.blkIndent,t.blkIndent=0,a=[t.bMarks[e]],t.bMarks[e]=f,s=(f=f<g?t.skipSpaces(f):f)>=g,r=[t.tShift[e]],t.tShift[e]=f-t.bMarks[e],u=t.parser.ruler.getRules("blockquote"),o=e+1;o<i&&!((f=t.bMarks[o]+t.tShift[o])>=(g=t.eMarks[o]));o++)if(62!==t.src.charCodeAt(f++)){if(s)break;for(m=!1,d=0,p=u.length;d<p;d++)if(u[d](t,o,i,!0)){m=!0;break}if(m)break;a.push(t.bMarks[o]),r.push(t.tShift[o]),t.tShift[o]=-1337}else 32===t.src.charCodeAt(f)&&f++,a.push(t.bMarks[o]),t.bMarks[o]=f,s=(f=f<g?t.skipSpaces(f):f)>=g,r.push(t.tShift[o]),t.tShift[o]=f-t.bMarks[o];for(c=t.parentType,t.parentType="blockquote",t.tokens.push({type:"blockquote_open",lines:h=[e,0],level:t.level++}),t.parser.tokenize(t,e,o),t.tokens.push({type:"blockquote_close",level:--t.level}),t.parentType=c,h[1]=t.line,d=0;d<r.length;d++)t.bMarks[d+e]=a[d],t.tShift[d+e]=r[d];return t.blkIndent=l,!0},["paragraph","blockquote","list"]],["hr",function(t,e,i,n){var o,s,r,a=t.bMarks[e],l=t.eMarks[e];if((a+=t.tShift[e])>l)return!1;if(42!==(o=t.src.charCodeAt(a++))&&45!==o&&95!==o)return!1;for(s=1;a<l;){if((r=t.src.charCodeAt(a++))!==o&&32!==r)return!1;r===o&&s++}return!(s<3)&&(n||(t.line=e+1,t.tokens.push({type:"hr",lines:[e,t.line],level:t.level})),!0)},["paragraph","blockquote","list"]],["list",function(t,e,i,n){var o,s,r,a,l,c,h,u,d,p,m,f,g,v,y,b,_,x,w,k,S,C=!0;if((u=Ms(t,e))>=0)f=!0;else{if(!((u=Os(t,e))>=0))return!1;f=!1}if(t.level>=t.options.maxNesting)return!1;if(m=t.src.charCodeAt(u-1),n)return!0;for(v=t.tokens.length,f?(h=t.bMarks[e]+t.tShift[e],p=Number(t.src.substr(h,u-h-1)),t.tokens.push({type:"ordered_list_open",order:p,lines:b=[e,0],level:t.level++})):t.tokens.push({type:"bullet_list_open",lines:b=[e,0],level:t.level++}),o=e,y=!1,x=t.parser.ruler.getRules("list");!(!(o<i)||((d=(g=t.skipSpaces(u))>=t.eMarks[o]?1:g-u)>4&&(d=1),d<1&&(d=1),s=u-t.bMarks[o]+d,t.tokens.push({type:"list_item_open",lines:_=[e,0],level:t.level++}),a=t.blkIndent,l=t.tight,r=t.tShift[e],c=t.parentType,t.tShift[e]=g-t.bMarks[e],t.blkIndent=s,t.tight=!0,t.parentType="list",t.parser.tokenize(t,e,i,!0),t.tight&&!y||(C=!1),y=t.line-e>1&&t.isEmpty(t.line-1),t.blkIndent=a,t.tShift[e]=r,t.tight=l,t.parentType=c,t.tokens.push({type:"list_item_close",level:--t.level}),o=e=t.line,_[1]=o,g=t.bMarks[e],o>=i)||t.isEmpty(o)||t.tShift[o]<t.blkIndent);){for(S=!1,w=0,k=x.length;w<k;w++)if(x[w](t,o,i,!0)){S=!0;break}if(S)break;if(f){if((u=Ms(t,o))<0)break}else if((u=Os(t,o))<0)break;if(m!==t.src.charCodeAt(u-1))break}return t.tokens.push({type:f?"ordered_list_close":"bullet_list_close",level:--t.level}),b[1]=o,t.line=o,C&&function(t,e){var i,n,o=t.level+2;for(i=e+2,n=t.tokens.length-2;i<n;i++)t.tokens[i].level===o&&"paragraph_open"===t.tokens[i].type&&(t.tokens[i+2].tight=!0,t.tokens[i].tight=!0,i+=2)}(t,v),!0},["paragraph","blockquote"]],["footnote",function(t,e,i,n){var o,s,r,a,l,c=t.bMarks[e]+t.tShift[e],h=t.eMarks[e];if(c+4>h)return!1;if(91!==t.src.charCodeAt(c))return!1;if(94!==t.src.charCodeAt(c+1))return!1;if(t.level>=t.options.maxNesting)return!1;for(a=c+2;a<h;a++){if(32===t.src.charCodeAt(a))return!1;if(93===t.src.charCodeAt(a))break}return a!==c+2&&(!(a+1>=h||58!==t.src.charCodeAt(++a))&&(n||(a++,t.env.footnotes||(t.env.footnotes={}),t.env.footnotes.refs||(t.env.footnotes.refs={}),l=t.src.slice(c+2,a-2),t.env.footnotes.refs[":"+l]=-1,t.tokens.push({type:"footnote_reference_open",label:l,level:t.level++}),o=t.bMarks[e],s=t.tShift[e],r=t.parentType,t.tShift[e]=t.skipSpaces(a)-a,t.bMarks[e]=a,t.blkIndent+=4,t.parentType="footnote",t.tShift[e]<t.blkIndent&&(t.tShift[e]+=t.blkIndent,t.bMarks[e]-=t.blkIndent),t.parser.tokenize(t,e,i,!0),t.parentType=r,t.blkIndent-=4,t.tShift[e]=s,t.bMarks[e]=o,t.tokens.push({type:"footnote_reference_close",level:--t.level})),!0))},["paragraph"]],["heading",function(t,e,i,n){var o,s,r,a=t.bMarks[e]+t.tShift[e],l=t.eMarks[e];if(a>=l)return!1;if(35!==(o=t.src.charCodeAt(a))||a>=l)return!1;for(s=1,o=t.src.charCodeAt(++a);35===o&&a<l&&s<=6;)s++,o=t.src.charCodeAt(++a);return!(s>6||a<l&&32!==o)&&(n||(l=t.skipCharsBack(l,32,a),(r=t.skipCharsBack(l,35,a))>a&&32===t.src.charCodeAt(r-1)&&(l=r),t.line=e+1,t.tokens.push({type:"heading_open",hLevel:s,lines:[e,t.line],level:t.level}),a<l&&t.tokens.push({type:"inline",content:t.src.slice(a,l).trim(),level:t.level+1,lines:[e,t.line],children:[]}),t.tokens.push({type:"heading_close",hLevel:s,level:t.level})),!0)},["paragraph","blockquote"]],["lheading",function(t,e,i){var n,o,s,r=e+1;return!(r>=i)&&(!(t.tShift[r]<t.blkIndent)&&(!(t.tShift[r]-t.blkIndent>3)&&(!((o=t.bMarks[r]+t.tShift[r])>=(s=t.eMarks[r]))&&((45===(n=t.src.charCodeAt(o))||61===n)&&(o=t.skipChars(o,n),!((o=t.skipSpaces(o))<s)&&(o=t.bMarks[e]+t.tShift[e],t.line=r+1,t.tokens.push({type:"heading_open",hLevel:61===n?1:2,lines:[e,t.line],level:t.level}),t.tokens.push({type:"inline",content:t.src.slice(o,t.eMarks[e]).trim(),level:t.level+1,lines:[e,t.line-1],children:[]}),t.tokens.push({type:"heading_close",hLevel:61===n?1:2,level:t.level}),!0))))))}],["htmlblock",function(t,e,i,n){var o,s,r,a=t.bMarks[e],l=t.eMarks[e],c=t.tShift[e];if(a+=c,!t.options.html)return!1;if(c>3||a+2>=l)return!1;if(60!==t.src.charCodeAt(a))return!1;if(33===(o=t.src.charCodeAt(a+1))||63===o){if(n)return!0}else{if(47!==o&&!function(t){var e=32|t;return e>=97&&e<=122}(o))return!1;if(47===o){if(!(s=t.src.slice(a,l).match(Is)))return!1}else if(!(s=t.src.slice(a,l).match(zs)))return!1;if(!0!==Ps[s[1].toLowerCase()])return!1;if(n)return!0}for(r=e+1;r<t.lineMax&&!t.isEmpty(r);)r++;return t.line=r,t.tokens.push({type:"htmlblock",level:t.level,lines:[e,t.line],content:t.getLines(e,r,0,!0)}),!0},["paragraph","blockquote"]],["table",function(t,e,i,n){var o,s,r,a,l,c,h,u,d,p,m;if(e+2>i)return!1;if(l=e+1,t.tShift[l]<t.blkIndent)return!1;if((r=t.bMarks[l]+t.tShift[l])>=t.eMarks[l])return!1;if(124!==(o=t.src.charCodeAt(r))&&45!==o&&58!==o)return!1;if(s=Ds(t,e+1),!/^[-:| ]+$/.test(s))return!1;if((c=s.split("|"))<=2)return!1;for(u=[],a=0;a<c.length;a++){if(!(d=c[a].trim())){if(0===a||a===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(d))return!1;58===d.charCodeAt(d.length-1)?u.push(58===d.charCodeAt(0)?"center":"right"):58===d.charCodeAt(0)?u.push("left"):u.push("")}if(-1===(s=Ds(t,e).trim()).indexOf("|"))return!1;if(c=s.replace(/^\||\|$/g,"").split("|"),u.length!==c.length)return!1;if(n)return!0;for(t.tokens.push({type:"table_open",lines:p=[e,0],level:t.level++}),t.tokens.push({type:"thead_open",lines:[e,e+1],level:t.level++}),t.tokens.push({type:"tr_open",lines:[e,e+1],level:t.level++}),a=0;a<c.length;a++)t.tokens.push({type:"th_open",align:u[a],lines:[e,e+1],level:t.level++}),t.tokens.push({type:"inline",content:c[a].trim(),lines:[e,e+1],level:t.level,children:[]}),t.tokens.push({type:"th_close",level:--t.level});for(t.tokens.push({type:"tr_close",level:--t.level}),t.tokens.push({type:"thead_close",level:--t.level}),t.tokens.push({type:"tbody_open",lines:m=[e+2,0],level:t.level++}),l=e+2;l<i&&!(t.tShift[l]<t.blkIndent)&&-1!==(s=Ds(t,l).trim()).indexOf("|");l++){for(c=s.replace(/^\||\|$/g,"").split("|"),t.tokens.push({type:"tr_open",level:t.level++}),a=0;a<c.length;a++)t.tokens.push({type:"td_open",align:u[a],level:t.level++}),h=c[a].substring(124===c[a].charCodeAt(0)?1:0,124===c[a].charCodeAt(c[a].length-1)?c[a].length-1:c[a].length).trim(),t.tokens.push({type:"inline",content:h,level:t.level,children:[]}),t.tokens.push({type:"td_close",level:--t.level});t.tokens.push({type:"tr_close",level:--t.level})}return t.tokens.push({type:"tbody_close",level:--t.level}),t.tokens.push({type:"table_close",level:--t.level}),p[1]=m[1]=l,t.line=l,!0},["paragraph"]],["deflist",function(t,e,i,n){var o,s,r,a,l,c,h,u,d,p,m,f,g,v;if(n)return!(t.ddIndent<0)&&Ns(t,e)>=0;if(h=e+1,t.isEmpty(h)&&++h>i)return!1;if(t.tShift[h]<t.blkIndent)return!1;if((o=Ns(t,h))<0)return!1;if(t.level>=t.options.maxNesting)return!1;c=t.tokens.length,t.tokens.push({type:"dl_open",lines:l=[e,0],level:t.level++}),r=e,s=h;t:for(;;){for(v=!0,g=!1,t.tokens.push({type:"dt_open",lines:[r,r],level:t.level++}),t.tokens.push({type:"inline",content:t.getLines(r,r+1,t.blkIndent,!1).trim(),level:t.level+1,lines:[r,r],children:[]}),t.tokens.push({type:"dt_close",level:--t.level});;){if(t.tokens.push({type:"dd_open",lines:a=[h,0],level:t.level++}),f=t.tight,d=t.ddIndent,u=t.blkIndent,m=t.tShift[s],p=t.parentType,t.blkIndent=t.ddIndent=t.tShift[s]+2,t.tShift[s]=o-t.bMarks[s],t.tight=!0,t.parentType="deflist",t.parser.tokenize(t,s,i,!0),t.tight&&!g||(v=!1),g=t.line-s>1&&t.isEmpty(t.line-1),t.tShift[s]=m,t.tight=f,t.parentType=p,t.blkIndent=u,t.ddIndent=d,t.tokens.push({type:"dd_close",level:--t.level}),a[1]=h=t.line,h>=i)break t;if(t.tShift[h]<t.blkIndent)break t;if((o=Ns(t,h))<0)break;s=h}if(h>=i)break;if(r=h,t.isEmpty(r))break;if(t.tShift[r]<t.blkIndent)break;if((s=r+1)>=i)break;if(t.isEmpty(s)&&s++,s>=i)break;if(t.tShift[s]<t.blkIndent)break;if((o=Ns(t,s))<0)break}return t.tokens.push({type:"dl_close",level:--t.level}),l[1]=h,t.line=h,v&&function(t,e){var i,n,o=t.level+2;for(i=e+2,n=t.tokens.length-2;i<n;i++)t.tokens[i].level===o&&"paragraph_open"===t.tokens[i].type&&(t.tokens[i+2].tight=!0,t.tokens[i].tight=!0,i+=2)}(t,c),!0},["paragraph"]],["paragraph",function(t,e){var i,n,o,s,r,a,l=e+1;if(l<(i=t.lineMax)&&!t.isEmpty(l))for(a=t.parser.ruler.getRules("paragraph");l<i&&!t.isEmpty(l);l++)if(!(t.tShift[l]-t.blkIndent>3)){for(o=!1,s=0,r=a.length;s<r;s++)if(a[s](t,l,i,!0)){o=!0;break}if(o)break}return n=t.getLines(e,l,t.blkIndent,!1).trim(),t.line=l,n.length&&(t.tokens.push({type:"paragraph_open",tight:!1,lines:[e,t.line],level:t.level}),t.tokens.push({type:"inline",content:n,level:t.level+1,lines:[e,t.line],children:[]}),t.tokens.push({type:"paragraph_close",tight:!1,level:t.level})),!0}]];function Bs(){this.ruler=new hs;for(var t=0;t<Rs.length;t++)this.ruler.push(Rs[t][0],Rs[t][1],{alt:(Rs[t][2]||[]).slice()})}Bs.prototype.tokenize=function(t,e,i){for(var n,o=this.ruler.getRules(""),s=o.length,r=e,a=!1;r<i&&(t.line=r=t.skipEmptyLines(r),!(r>=i))&&!(t.tShift[r]<t.blkIndent);){for(n=0;n<s&&!o[n](t,r,i,!1);n++);if(t.tight=!a,t.isEmpty(t.line-1)&&(a=!0),(r=t.line)<i&&t.isEmpty(r)){if(a=!0,++r<i&&"list"===t.parentType&&t.isEmpty(r))break;t.line=r}}};var qs=/[\n\t]/g,Zs=/\r[\n\u0085]|[\u2424\u2028\u0085]/g,Fs=/\u00a0/g;function Vs(t){switch(t){case 10:case 92:case 96:case 42:case 95:case 94:case 91:case 93:case 33:case 38:case 60:case 62:case 123:case 125:case 36:case 37:case 64:case 126:case 43:case 61:case 58:return!0;default:return!1}}Bs.prototype.parse=function(t,e,i,n){var o,s=0,r=0;if(!t)return[];(t=(t=t.replace(Fs," ")).replace(Zs,"\n")).indexOf("\t")>=0&&(t=t.replace(qs,(function(e,i){var n;return 10===t.charCodeAt(i)?(s=i+1,r=0,e):(n=" ".slice((i-s-r)%4),r=i-s+1,n)}))),o=new As(t,this,e,i,n),this.tokenize(o,o.line,o.lineMax)};for(var js=[],Us=0;Us<256;Us++)js.push(0);function Hs(t){return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122}function Gs(t,e){var i,n,o,s=e,r=!0,a=!0,l=t.posMax,c=t.src.charCodeAt(e);for(i=e>0?t.src.charCodeAt(e-1):-1;s<l&&t.src.charCodeAt(s)===c;)s++;return s>=l&&(r=!1),(o=s-e)>=4?r=a=!1:(32!==(n=s<l?t.src.charCodeAt(s):-1)&&10!==n||(r=!1),32!==i&&10!==i||(a=!1),95===c&&(Hs(i)&&(r=!1),Hs(n)&&(a=!1))),{can_open:r,can_close:a,delims:o}}"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach((function(t){js[t.charCodeAt(0)]=1}));var Ws=/\\([ \\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;var Ks=/\\([ \\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;var Ys=["coap","doi","javascript","aaa","aaas","about","acap","cap","cid","crid","data","dav","dict","dns","file","ftp","geo","go","gopher","h323","http","https","iax","icap","im","imap","info","ipp","iris","iris.beep","iris.xpc","iris.xpcs","iris.lwz","ldap","mailto","mid","msrp","msrps","mtqp","mupdate","news","nfs","ni","nih","nntp","opaquelocktoken","pop","pres","rtsp","service","session","shttp","sieve","sip","sips","sms","snmp","soap.beep","soap.beeps","tag","tel","telnet","tftp","thismessage","tn3270","tip","tv","urn","vemmi","ws","wss","xcon","xcon-userid","xmlrpc.beep","xmlrpc.beeps","xmpp","z39.50r","z39.50s","adiumxtra","afp","afs","aim","apt","attachment","aw","beshare","bitcoin","bolo","callto","chrome","chrome-extension","com-eventbrite-attendee","content","cvs","dlna-playsingle","dlna-playcontainer","dtn","dvb","ed2k","facetime","feed","finger","fish","gg","git","gizmoproject","gtalk","hcp","icon","ipn","irc","irc6","ircs","itms","jar","jms","keyparc","lastfm","ldaps","magnet","maps","market","message","mms","ms-help","msnim","mumble","mvn","notes","oid","palm","paparazzi","platform","proxy","psyc","query","res","resource","rmi","rsync","rtmp","secondlife","sftp","sgn","skype","smb","soldat","spotify","ssh","steam","svn","teamspeak","things","udp","unreal","ut2004","ventrilo","view-source","webcal","wtai","wyciwyg","xfire","xri","ymsgr"],Js=/^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/,Xs=/^<([a-zA-Z.\-]{1,25}):([^<>\x00-\x20]*)>/;function Qs(t,e){return t=t.source,e=e||"",function i(n,o){return n?(o=o.source||o,t=t.replace(n,o),i):new RegExp(t,e)}}var tr=Qs(/(?:unquoted|single_quoted|double_quoted)/)("unquoted",/[^"'=<>`\x00-\x20]+/)("single_quoted",/'[^']*'/)("double_quoted",/"[^"]*"/)(),er=Qs(/(?:\s+attr_name(?:\s*=\s*attr_value)?)/)("attr_name",/[a-zA-Z_:][a-zA-Z0-9:._-]*/)("attr_value",tr)(),ir=Qs(/<[A-Za-z][A-Za-z0-9]*attribute*\s*\/?>/)("attribute",er)(),nr=Qs(/^(?:open_tag|close_tag|comment|processing|declaration|cdata)/)("open_tag",ir)("close_tag",/<\/[A-Za-z][A-Za-z0-9]*\s*>/)("comment",/<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->/)("processing",/<[?].*?[?]>/)("declaration",/<![A-Z]+\s+[^>]*>/)("cdata",/<!\[CDATA\[[\s\S]*?\]\]>/)();var or=/^&#((?:x[a-f0-9]{1,8}|[0-9]{1,8}));/i,sr=/^&([a-z][a-z0-9]{1,31});/i;var rr=[["text",function(t,e){for(var i=t.pos;i<t.posMax&&!Vs(t.src.charCodeAt(i));)i++;return i!==t.pos&&(e||(t.pending+=t.src.slice(t.pos,i)),t.pos=i,!0)}],["newline",function(t,e){var i,n,o=t.pos;if(10!==t.src.charCodeAt(o))return!1;if(i=t.pending.length-1,n=t.posMax,!e)if(i>=0&&32===t.pending.charCodeAt(i))if(i>=1&&32===t.pending.charCodeAt(i-1)){for(var s=i-2;s>=0;s--)if(32!==t.pending.charCodeAt(s)){t.pending=t.pending.substring(0,s+1);break}t.push({type:"hardbreak",level:t.level})}else t.pending=t.pending.slice(0,-1),t.push({type:"softbreak",level:t.level});else t.push({type:"softbreak",level:t.level});for(o++;o<n&&32===t.src.charCodeAt(o);)o++;return t.pos=o,!0}],["escape",function(t,e){var i,n=t.pos,o=t.posMax;if(92!==t.src.charCodeAt(n))return!1;if(++n<o){if((i=t.src.charCodeAt(n))<256&&0!==js[i])return e||(t.pending+=t.src[n]),t.pos+=2,!0;if(10===i){for(e||t.push({type:"hardbreak",level:t.level}),n++;n<o&&32===t.src.charCodeAt(n);)n++;return t.pos=n,!0}}return e||(t.pending+="\\"),t.pos++,!0}],["backticks",function(t,e){var i,n,o,s,r,a=t.pos;if(96!==t.src.charCodeAt(a))return!1;for(i=a,a++,n=t.posMax;a<n&&96===t.src.charCodeAt(a);)a++;for(o=t.src.slice(i,a),s=r=a;-1!==(s=t.src.indexOf("`",r));){for(r=s+1;r<n&&96===t.src.charCodeAt(r);)r++;if(r-s===o.length)return e||t.push({type:"code",content:t.src.slice(a,s).replace(/[ \n]+/g," ").trim(),block:!1,level:t.level}),t.pos=r,!0}return e||(t.pending+=o),t.pos+=o.length,!0}],["del",function(t,e){var i,n,o,s,r,a=t.posMax,l=t.pos;if(126!==t.src.charCodeAt(l))return!1;if(e)return!1;if(l+4>=a)return!1;if(126!==t.src.charCodeAt(l+1))return!1;if(t.level>=t.options.maxNesting)return!1;if(s=l>0?t.src.charCodeAt(l-1):-1,r=t.src.charCodeAt(l+2),126===s)return!1;if(126===r)return!1;if(32===r||10===r)return!1;for(n=l+2;n<a&&126===t.src.charCodeAt(n);)n++;if(n>l+3)return t.pos+=n-l,e||(t.pending+=t.src.slice(l,n)),!0;for(t.pos=l+2,o=1;t.pos+1<a;){if(126===t.src.charCodeAt(t.pos)&&126===t.src.charCodeAt(t.pos+1)&&(s=t.src.charCodeAt(t.pos-1),126!==(r=t.pos+2<a?t.src.charCodeAt(t.pos+2):-1)&&126!==s&&(32!==s&&10!==s?o--:32!==r&&10!==r&&o++,o<=0))){i=!0;break}t.parser.skipToken(t)}return i?(t.posMax=t.pos,t.pos=l+2,e||(t.push({type:"del_open",level:t.level++}),t.parser.tokenize(t),t.push({type:"del_close",level:--t.level})),t.pos=t.posMax+2,t.posMax=a,!0):(t.pos=l,!1)}],["ins",function(t,e){var i,n,o,s,r,a=t.posMax,l=t.pos;if(43!==t.src.charCodeAt(l))return!1;if(e)return!1;if(l+4>=a)return!1;if(43!==t.src.charCodeAt(l+1))return!1;if(t.level>=t.options.maxNesting)return!1;if(s=l>0?t.src.charCodeAt(l-1):-1,r=t.src.charCodeAt(l+2),43===s)return!1;if(43===r)return!1;if(32===r||10===r)return!1;for(n=l+2;n<a&&43===t.src.charCodeAt(n);)n++;if(n!==l+2)return t.pos+=n-l,e||(t.pending+=t.src.slice(l,n)),!0;for(t.pos=l+2,o=1;t.pos+1<a;){if(43===t.src.charCodeAt(t.pos)&&43===t.src.charCodeAt(t.pos+1)&&(s=t.src.charCodeAt(t.pos-1),43!==(r=t.pos+2<a?t.src.charCodeAt(t.pos+2):-1)&&43!==s&&(32!==s&&10!==s?o--:32!==r&&10!==r&&o++,o<=0))){i=!0;break}t.parser.skipToken(t)}return i?(t.posMax=t.pos,t.pos=l+2,e||(t.push({type:"ins_open",level:t.level++}),t.parser.tokenize(t),t.push({type:"ins_close",level:--t.level})),t.pos=t.posMax+2,t.posMax=a,!0):(t.pos=l,!1)}],["mark",function(t,e){var i,n,o,s,r,a=t.posMax,l=t.pos;if(61!==t.src.charCodeAt(l))return!1;if(e)return!1;if(l+4>=a)return!1;if(61!==t.src.charCodeAt(l+1))return!1;if(t.level>=t.options.maxNesting)return!1;if(s=l>0?t.src.charCodeAt(l-1):-1,r=t.src.charCodeAt(l+2),61===s)return!1;if(61===r)return!1;if(32===r||10===r)return!1;for(n=l+2;n<a&&61===t.src.charCodeAt(n);)n++;if(n!==l+2)return t.pos+=n-l,e||(t.pending+=t.src.slice(l,n)),!0;for(t.pos=l+2,o=1;t.pos+1<a;){if(61===t.src.charCodeAt(t.pos)&&61===t.src.charCodeAt(t.pos+1)&&(s=t.src.charCodeAt(t.pos-1),61!==(r=t.pos+2<a?t.src.charCodeAt(t.pos+2):-1)&&61!==s&&(32!==s&&10!==s?o--:32!==r&&10!==r&&o++,o<=0))){i=!0;break}t.parser.skipToken(t)}return i?(t.posMax=t.pos,t.pos=l+2,e||(t.push({type:"mark_open",level:t.level++}),t.parser.tokenize(t),t.push({type:"mark_close",level:--t.level})),t.pos=t.posMax+2,t.posMax=a,!0):(t.pos=l,!1)}],["emphasis",function(t,e){var i,n,o,s,r,a,l,c=t.posMax,h=t.pos,u=t.src.charCodeAt(h);if(95!==u&&42!==u)return!1;if(e)return!1;if(i=(l=Gs(t,h)).delims,!l.can_open)return t.pos+=i,e||(t.pending+=t.src.slice(h,t.pos)),!0;if(t.level>=t.options.maxNesting)return!1;for(t.pos=h+i,a=[i];t.pos<c;)if(t.src.charCodeAt(t.pos)!==u)t.parser.skipToken(t);else{if(n=(l=Gs(t,t.pos)).delims,l.can_close){for(s=a.pop(),r=n;s!==r;){if(r<s){a.push(s-r);break}if(r-=s,0===a.length)break;t.pos+=s,s=a.pop()}if(0===a.length){i=s,o=!0;break}t.pos+=n;continue}l.can_open&&a.push(n),t.pos+=n}return o?(t.posMax=t.pos,t.pos=h+i,e||(2!==i&&3!==i||t.push({type:"strong_open",level:t.level++}),1!==i&&3!==i||t.push({type:"em_open",level:t.level++}),t.parser.tokenize(t),1!==i&&3!==i||t.push({type:"em_close",level:--t.level}),2!==i&&3!==i||t.push({type:"strong_close",level:--t.level})),t.pos=t.posMax+i,t.posMax=c,!0):(t.pos=h,!1)}],["sub",function(t,e){var i,n,o=t.posMax,s=t.pos;if(126!==t.src.charCodeAt(s))return!1;if(e)return!1;if(s+2>=o)return!1;if(t.level>=t.options.maxNesting)return!1;for(t.pos=s+1;t.pos<o;){if(126===t.src.charCodeAt(t.pos)){i=!0;break}t.parser.skipToken(t)}return i&&s+1!==t.pos?(n=t.src.slice(s+1,t.pos)).match(/(^|[^\\])(\\\\)*\s/)?(t.pos=s,!1):(t.posMax=t.pos,t.pos=s+1,e||t.push({type:"sub",level:t.level,content:n.replace(Ws,"$1")}),t.pos=t.posMax+1,t.posMax=o,!0):(t.pos=s,!1)}],["sup",function(t,e){var i,n,o=t.posMax,s=t.pos;if(94!==t.src.charCodeAt(s))return!1;if(e)return!1;if(s+2>=o)return!1;if(t.level>=t.options.maxNesting)return!1;for(t.pos=s+1;t.pos<o;){if(94===t.src.charCodeAt(t.pos)){i=!0;break}t.parser.skipToken(t)}return i&&s+1!==t.pos?(n=t.src.slice(s+1,t.pos)).match(/(^|[^\\])(\\\\)*\s/)?(t.pos=s,!1):(t.posMax=t.pos,t.pos=s+1,e||t.push({type:"sup",level:t.level,content:n.replace(Ks,"$1")}),t.pos=t.posMax+1,t.posMax=o,!0):(t.pos=s,!1)}],["links",function(t,e){var i,n,o,s,r,a,l,c,h=!1,u=t.pos,d=t.posMax,p=t.pos,m=t.src.charCodeAt(p);if(33===m&&(h=!0,m=t.src.charCodeAt(++p)),91!==m)return!1;if(t.level>=t.options.maxNesting)return!1;if(i=p+1,(n=ds(t,p))<0)return!1;if((a=n+1)<d&&40===t.src.charCodeAt(a)){for(a++;a<d&&(32===(c=t.src.charCodeAt(a))||10===c);a++);if(a>=d)return!1;for(p=a,fs(t,a)?(s=t.linkContent,a=t.pos):s="",p=a;a<d&&(32===(c=t.src.charCodeAt(a))||10===c);a++);if(a<d&&p!==a&&gs(t,a))for(r=t.linkContent,a=t.pos;a<d&&(32===(c=t.src.charCodeAt(a))||10===c);a++);else r="";if(a>=d||41!==t.src.charCodeAt(a))return t.pos=u,!1;a++}else{if(t.linkLevel>0)return!1;for(;a<d&&(32===(c=t.src.charCodeAt(a))||10===c);a++);if(a<d&&91===t.src.charCodeAt(a)&&(p=a+1,(a=ds(t,a))>=0?o=t.src.slice(p,a++):a=p-1),o||(void 0===o&&(a=n+1),o=t.src.slice(i,n)),!(l=t.env.references[vs(o)]))return t.pos=u,!1;s=l.href,r=l.title}return e||(t.pos=i,t.posMax=n,h?t.push({type:"image",src:s,title:r,alt:t.src.substr(i,n-i),level:t.level}):(t.push({type:"link_open",href:s,title:r,level:t.level++}),t.linkLevel++,t.parser.tokenize(t),t.linkLevel--,t.push({type:"link_close",level:--t.level}))),t.pos=a,t.posMax=d,!0}],["footnote_inline",function(t,e){var i,n,o,s,r=t.posMax,a=t.pos;return!(a+2>=r)&&(94===t.src.charCodeAt(a)&&(91===t.src.charCodeAt(a+1)&&(!(t.level>=t.options.maxNesting)&&(i=a+2,!((n=ds(t,a+1))<0)&&(e||(t.env.footnotes||(t.env.footnotes={}),t.env.footnotes.list||(t.env.footnotes.list=[]),o=t.env.footnotes.list.length,t.pos=i,t.posMax=n,t.push({type:"footnote_ref",id:o,level:t.level}),t.linkLevel++,s=t.tokens.length,t.parser.tokenize(t),t.env.footnotes.list[o]={tokens:t.tokens.splice(s)},t.linkLevel--),t.pos=n+1,t.posMax=r,!0)))))}],["footnote_ref",function(t,e){var i,n,o,s,r=t.posMax,a=t.pos;if(a+3>r)return!1;if(!t.env.footnotes||!t.env.footnotes.refs)return!1;if(91!==t.src.charCodeAt(a))return!1;if(94!==t.src.charCodeAt(a+1))return!1;if(t.level>=t.options.maxNesting)return!1;for(n=a+2;n<r;n++){if(32===t.src.charCodeAt(n))return!1;if(10===t.src.charCodeAt(n))return!1;if(93===t.src.charCodeAt(n))break}return n!==a+2&&(!(n>=r)&&(n++,i=t.src.slice(a+2,n-1),void 0!==t.env.footnotes.refs[":"+i]&&(e||(t.env.footnotes.list||(t.env.footnotes.list=[]),t.env.footnotes.refs[":"+i]<0?(o=t.env.footnotes.list.length,t.env.footnotes.list[o]={label:i,count:0},t.env.footnotes.refs[":"+i]=o):o=t.env.footnotes.refs[":"+i],s=t.env.footnotes.list[o].count,t.env.footnotes.list[o].count++,t.push({type:"footnote_ref",id:o,subId:s,level:t.level})),t.pos=n,t.posMax=r,!0)))}],["autolink",function(t,e){var i,n,o,s,r,a=t.pos;return 60===t.src.charCodeAt(a)&&(!((i=t.src.slice(a)).indexOf(">")<0)&&((n=i.match(Xs))?!(Ys.indexOf(n[1].toLowerCase())<0)&&(r=ms(s=n[0].slice(1,-1)),!!t.parser.validateLink(s)&&(e||(t.push({type:"link_open",href:r,level:t.level}),t.push({type:"text",content:s,level:t.level+1}),t.push({type:"link_close",level:t.level})),t.pos+=n[0].length,!0)):!!(o=i.match(Js))&&(r=ms("mailto:"+(s=o[0].slice(1,-1))),!!t.parser.validateLink(r)&&(e||(t.push({type:"link_open",href:r,level:t.level}),t.push({type:"text",content:s,level:t.level+1}),t.push({type:"link_close",level:t.level})),t.pos+=o[0].length,!0))))}],["htmltag",function(t,e){var i,n,o,s=t.pos;return!!t.options.html&&(o=t.posMax,!(60!==t.src.charCodeAt(s)||s+2>=o)&&(!(33!==(i=t.src.charCodeAt(s+1))&&63!==i&&47!==i&&!function(t){var e=32|t;return e>=97&&e<=122}(i))&&(!!(n=t.src.slice(s).match(nr))&&(e||t.push({type:"htmltag",content:t.src.slice(s,s+n[0].length),level:t.level}),t.pos+=n[0].length,!0))))}],["entity",function(t,e){var i,n,o=t.pos,s=t.posMax;if(38!==t.src.charCodeAt(o))return!1;if(o+1<s)if(35===t.src.charCodeAt(o+1)){if(n=t.src.slice(o).match(or))return e||(i="x"===n[1][0].toLowerCase()?parseInt(n[1].slice(1),16):parseInt(n[1],10),t.pending+=Ko(i)?Yo(i):Yo(65533)),t.pos+=n[0].length,!0}else if(n=t.src.slice(o).match(sr)){var r=jo(n[1]);if(n[1]!==r)return e||(t.pending+=r),t.pos+=n[0].length,!0}return e||(t.pending+="&"),t.pos++,!0}]];function ar(){this.ruler=new hs;for(var t=0;t<rr.length;t++)this.ruler.push(rr[t][0],rr[t][1]);this.validateLink=lr}function lr(t){var e=t.trim().toLowerCase();return-1===(e=ts(e)).indexOf(":")||-1===["vbscript","javascript","file","data"].indexOf(e.split(":")[0])}ar.prototype.skipToken=function(t){var e,i,n=this.ruler.getRules(""),o=n.length,s=t.pos;if((i=t.cacheGet(s))>0)t.pos=i;else{for(e=0;e<o;e++)if(n[e](t,!0))return void t.cacheSet(s,t.pos);t.pos++,t.cacheSet(s,t.pos)}},ar.prototype.tokenize=function(t){for(var e,i,n=this.ruler.getRules(""),o=n.length,s=t.posMax;t.pos<s;){for(i=0;i<o&&!(e=n[i](t,!1));i++);if(e){if(t.pos>=s)break}else t.pending+=t.src[t.pos++]}t.pending&&t.pushPending()},ar.prototype.parse=function(t,e,i,n){var o=new us(t,this,e,i,n);this.tokenize(o)};var cr={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkTarget:"",typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["block","inline","references","replacements","smartquotes","references","abbr2","footnote_tail"]},block:{rules:["blockquote","code","fences","footnote","heading","hr","htmlblock","lheading","list","paragraph","table"]},inline:{rules:["autolink","backticks","del","emphasis","entity","escape","footnote_ref","htmltag","links","newline","text"]}}},full:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkTarget:"",typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{},block:{},inline:{}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkTarget:"",typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["block","inline","references","abbr2"]},block:{rules:["blockquote","code","fences","heading","hr","htmlblock","lheading","list","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","htmltag","links","newline","text"]}}}};function hr(t,e,i){this.src=e,this.env=i,this.options=t.options,this.tokens=[],this.inlineMode=!1,this.inline=t.inline,this.block=t.block,this.renderer=t.renderer,this.typographer=t.typographer}function ur(t,e){"string"!=typeof t&&(e=t,t="default"),e&&null!=e.linkify&&console.warn("linkify option is removed. Use linkify plugin instead:\n\nimport Remarkable from 'remarkable';\nimport linkify from 'remarkable/linkify';\nnew Remarkable().use(linkify)\n"),this.inline=new ar,this.block=new Bs,this.core=new Ls,this.renderer=new cs,this.ruler=new hs,this.options={},this.configure(cr[t]),this.set(e||{})}ur.prototype.set=function(t){Ho(this.options,t)},ur.prototype.configure=function(t){var e=this;if(!t)throw new Error("Wrong `remarkable` preset, check name/content");t.options&&e.set(t.options),t.components&&Object.keys(t.components).forEach((function(i){t.components[i].rules&&e[i].ruler.enable(t.components[i].rules,!0)}))},ur.prototype.use=function(t,e){return t(this,e),this},ur.prototype.parse=function(t,e){var i=new hr(this,t,e);return this.core.process(i),i.tokens},ur.prototype.render=function(t,e){return e=e||{},this.renderer.render(this.parse(t,e),this.options,e)},ur.prototype.parseInline=function(t,e){var i=new hr(this,t,e);return i.inlineMode=!0,this.core.process(i),i.tokens},ur.prototype.renderInline=function(t,e){return e=e||{},this.renderer.render(this.parseInline(t,e),this.options,e)};const dr=new ur,pr=new Zo("@",["contact","fields","globals","urns"]),mr=new Zo("@",["contact","fields","globals","urns","results","input","run","child","parent","node","webhook","ticket","trigger","resume"]);const fr=ct(class extends ht{constructor(t){if(super(t),t.type!==lt)throw new Error("renderMarkdown only supports child expressions")}update(t,[e]){return this.render(e)}render(t){return void 0===this.value&&(this.value=t),P`${No(dr.render(this.value))}`}}),gr=(t,e)=>{if(t.signature){const i=t.signature.indexOf("("),n=t.signature.substr(0,i),o=t.signature.substr(i);return P`
489
424
  <div style="${e?"font-weight: 400":""}">
490
425
  <div style="display:inline-block;margin-right: 5px">ƒ</div>
491
426
  <div style="display:inline-block">${n}</div>
492
- ${e?O`
427
+ ${e?P`
493
428
  <div
494
429
  style="display:inline-block; font-weight: 300; font-size: 85%"
495
430
  >
496
431
  ${o}
497
432
  </div>
498
- <div class="detail">${Ws(t.summary)}</div>
433
+ <div class="detail">${fr(t.summary)}</div>
499
434
  `:null}
500
435
  </div>
501
- `}return O`
436
+ `}return P`
502
437
  <div>
503
438
  <div style="${e?"font-weight: 400":""}">${t.name}</div>
504
- ${e?O` <div style="font-size: 85%">${t.summary}</div> `:null}
439
+ ${e?P` <div style="font-size: 85%">${t.summary}</div> `:null}
505
440
  </div>
506
- `},Ys=(t,e)=>e?t.filter((t=>!!t.signature&&0===t.signature.indexOf((e||"").toLowerCase()))):t,Ks=(t,e,i={},n)=>{const o=(e||"").split(".");let r=n?t.root:t.root_no_session;if(!r)return[];let s="",a="";for(;o.length>0;)if(a=o.shift(),a){const e=r.find((t=>t.key===a));if(!e){r=r.filter((t=>t.key.startsWith(a.toLowerCase())));break}{const n=t.types.find((t=>t.name===e.type));if(n&&n.properties)r=n.properties,s+=a+".";else{if(!n||!n.property_template){r=r.filter((t=>t.key.startsWith(a.toLowerCase())));break}{s+=a+".";const t=n.property_template;r=i[n.name]?i[n.name].map((e=>({key:t.key.replace("{key}",e),help:t.help.replace("{key}",e),type:t.type}))):[]}}}}return r.map((t=>({name:"__default__"===t.key?s.substr(0,s.length-1):s+t.key,summary:t.help})))},Js=(t,e)=>{const{offsetLeft:i,offsetTop:n}=t,o=document.createElement("div"),r=getComputedStyle(t);for(const t of r)o.style[t]=r[t];o.style.position="relative";const s="INPUT"===t.tagName?t.value.replace(/ /g,"."):t.value,a=s.substr(0,e);o.textContent=a,"TEXTAREA"===t.tagName&&(o.style.height="auto"),"INPUT"===t.tagName&&(o.style.width="auto");const l=document.createElement("span");l.textContent=s.substr(e)||".",o.appendChild(l),document.body.appendChild(o);const{offsetLeft:c,offsetTop:h}=l;return document.body.removeChild(o),{left:i+c,top:n+h}},Xs=(t,e,i)=>{let n="";n=i.signature?i.signature.substr(0,i.signature.indexOf("(")+1):i.name;const o=t.length;if(e){const t=e.value,i=e.selectionStart-o,r=t.substr(0,i),s=t.substr(i+o),a=r.length+n.length;e.value=r+n+s,e.setSelectionRange(a,a);const l=Js(e,a);l.left>e.width&&(e.scrollLeft=l.left),e.dispatchEvent(new Event("input"))}},Qs=(t,e,i)=>{const n={currentFunction:null,options:[],anchorPosition:null,query:null};if(!e)return n;const o=t.selectionStart,r=t.value.substring(0,o),s=i?Vs:Us,a=s.findExpressions(r).find((t=>t.start<=o&&(t.end>o||t.end===o&&!t.closed)));if(a){const o=a.text.indexOf("(")>-1;if(o){const t=s.functionContext(a.text);if(t){const i=Ys(e.getFunctions(),t);i.length>0&&(n.currentFunction=i[0])}}for(let r=a.text.length;r>=0;r--){const s=a.text[r];if("@"===s||"("===s||" "===s||","===s||")"===s||0===r){"("!==s&&" "!==s&&","!==s&&")"!==s&&"@"!==s||r++;const l=Js(t,a.start+r);return n.anchorPosition={left:l.left-2-t.scrollLeft,top:l.top-t.scrollTop},n.query=a.text.substr(r,a.text.length-r),n.options=[...Ks(e.getCompletionSchema(),n.query,e.getKeyedAssets(),i),...o?Ys(e.getFunctions(),n.query):[]],n}}}else n.options=[],n.query="";return n};class ta extends ot{constructor(){super(...arguments),this.multi=!1,this.searchOnFocus=!1,this.placeholder="",this.name="",this.nameKey="name",this.valueKey="value",this.queryParam=null,this.input="",this.visibleOptions=[],this.completionOptions=[],this.quietMillis=0,this.searchable=!1,this.cache=!0,this.cacheKey="",this.focused=!1,this.disabled=!1,this.selectedIndex=-1,this.anchorPosition={left:0,top:0},this.tags=!1,this.flavor="default",this.infoText="",this.getName=t=>t[this.nameKey||"name"],this.isMatch=(t,e)=>(this.getName(t)||"").toLowerCase().indexOf(e)>-1,this.getValue=t=>t[this.valueKey||"value"]||t.id,this.renderOptionDetail=()=>O``,this.renderSelectedItem=this.renderSelectedItemDefault,this.createArbitraryOption=this.createArbitraryOptionDefault,this.getOptions=this.getOptionsDefault,this.isComplete=this.isCompleteDefault,this.staticOptions=[],this.next=null,this.lruCache=me(20,6e4),this.getNameInternal=t=>this.getName(t)}static get styles(){return r`
441
+ `},vr=(t,e)=>e?t.filter((t=>!!t.signature&&0===t.signature.indexOf((e||"").toLowerCase()))):t,yr=(t,e,i={},n)=>{const o=(e||"").split(".");let s=n?t.root:t.root_no_session;if(!s)return[];let r="",a="";for(;o.length>0;)if(a=o.shift(),a){const e=s.find((t=>t.key===a));if(!e){s=s.filter((t=>t.key.startsWith(a.toLowerCase())));break}{const n=t.types.find((t=>t.name===e.type));if(n&&n.properties)s=n.properties,r+=a+".";else{if(!n||!n.property_template){s=s.filter((t=>t.key.startsWith(a.toLowerCase())));break}{r+=a+".";const t=n.property_template;s=i[n.name]?i[n.name].map((e=>({key:t.key.replace("{key}",e),help:t.help.replace("{key}",e),type:t.type}))):[]}}}}return s.map((t=>({name:"__default__"===t.key?r.substr(0,r.length-1):r+t.key,summary:t.help})))},br=(t,e)=>{const{offsetLeft:i,offsetTop:n}=t,o=document.createElement("div"),s=getComputedStyle(t);for(const t of s)o.style[t]=s[t];o.style.position="relative";const r="INPUT"===t.tagName?t.value.replace(/ /g,"."):t.value,a=r.substr(0,e);o.textContent=a,"TEXTAREA"===t.tagName&&(o.style.height="auto"),"INPUT"===t.tagName&&(o.style.width="auto");const l=document.createElement("span");l.textContent=r.substr(e)||".",o.appendChild(l),document.body.appendChild(o);const{offsetLeft:c,offsetTop:h}=l;return document.body.removeChild(o),{left:i+c,top:n+h}},_r=(t,e,i)=>{let n="";n=i.signature?i.signature.substr(0,i.signature.indexOf("(")+1):i.name;const o=t.length;if(e){const t=e.value,i=e.selectionStart-o,s=t.substr(0,i),r=t.substr(i+o),a=s.length+n.length;e.value=s+n+r,e.setSelectionRange(a,a);const l=br(e,a);l.left>e.width&&(e.scrollLeft=l.left),e.dispatchEvent(new Event("input"))}},xr=(t,e,i)=>{const n={currentFunction:null,options:[],anchorPosition:null,query:null};if(!e)return n;const o=t.selectionStart,s=t.value.substring(0,o),r=i?mr:pr,a=r.findExpressions(s).find((t=>t.start<=o&&(t.end>o||t.end===o&&!t.closed)));if(a){const o=a.text.indexOf("(")>-1;if(o){const t=r.functionContext(a.text);if(t){const i=vr(e.getFunctions(),t);i.length>0&&(n.currentFunction=i[0])}}for(let s=a.text.length;s>=0;s--){const r=a.text[s];if("@"===r||"("===r||" "===r||","===r||")"===r||0===s){"("!==r&&" "!==r&&","!==r&&")"!==r&&"@"!==r||s++;const l=br(t,a.start+s);return n.anchorPosition={left:l.left-2-t.scrollLeft,top:l.top-t.scrollTop},n.query=a.text.substr(s,a.text.length-s),n.options=[...yr(e.getCompletionSchema(),n.query,e.getKeyedAssets(),i),...o?vr(e.getFunctions(),n.query):[]],n}}}else n.options=[],n.query="";return n};class wr extends ot{constructor(){super(...arguments),this.multi=!1,this.searchOnFocus=!1,this.placeholder="",this.name="",this.nameKey="name",this.valueKey="value",this.queryParam=null,this.input="",this.visibleOptions=[],this.completionOptions=[],this.quietMillis=0,this.searchable=!1,this.cache=!0,this.cacheKey="",this.focused=!1,this.disabled=!1,this.selectedIndex=-1,this.anchorPosition={left:0,top:0},this.tags=!1,this.flavor="default",this.infoText="",this.getName=t=>t[this.nameKey||"name"],this.isMatch=(t,e)=>(this.getName(t)||"").toLowerCase().indexOf(e)>-1,this.getValue=t=>t[this.valueKey||"value"]||t.id,this.renderOptionDetail=()=>P``,this.renderSelectedItem=this.renderSelectedItemDefault,this.createArbitraryOption=this.createArbitraryOptionDefault,this.getOptions=this.getOptionsDefault,this.isComplete=this.isCompleteDefault,this.staticOptions=[],this.next=null,this.lruCache=Dt(20,6e4),this.getNameInternal=t=>this.getName(t)}static get styles(){return s`
507
442
  :host {
508
443
  font-family: var(--font-family);
509
444
  transition: all ease-in-out var(--transition-speed);
@@ -816,21 +751,21 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
816
751
  margin-top: -2em;
817
752
  pointer-events: none;
818
753
  }
819
- `}updated(t){if(super.updated(t),t.has("cacheKey")&&this.lruCache.clear(),t.has("input")&&!t.has("values")&&!t.has("options")&&this.focused&&(this.lastQuery&&window.clearTimeout(this.lastQuery),this.lastQuery=window.setTimeout((()=>{this.expressions&&this.input.indexOf("@")>-1?this.fetchExpressions():this.fetchOptions(this.input)}),this.quietMillis)),(t.has("cursorIndex")||t.has("visibleOptions"))&&this.endpoint&&!this.fetching&&(this.visibleOptions.length>0||this.next)&&!this.complete&&(this.cursorIndex||0)>this.visibleOptions.length-20&&this.fetchOptions(this.query,this.page+1),t.has("value")&&this.value){const t=this.staticOptions.find((t=>this.getValue(t)===this.value));t&&this.setValue(t)}0===this.values.length&&!this.placeholder&&this.staticOptions.length>0&&this.setValue(this.staticOptions[0])}setSelectedOption(t){this.multi?this.addValue(t):this.setValue(t),this.multi&&this.searchable||(this.blur(),this.focused=!1),this.visibleOptions=[],this.input="",this.next=null,this.complete=!0,this.selectedIndex=-1,this.fireEvent("change")}handleOptionSelection(t){const e=t.detail.selected;e.post&&this.endpoint?te(this.endpoint,e).then((t=>{t.status>=200&&t.status<300?(this.setSelectedOption(t.json),this.lruCache=me(20,6e4)):this.blur()})):this.setSelectedOption(e)}handleExpressionSelection(t){const e=t.detail.selected,i=t.detail.tabbed,n=this.shadowRoot.querySelector(".searchbox");Xs(this.query,n,e),this.query="",this.completionOptions=[],i?this.fetchExpressions():-1===this.input.indexOf("(")&&this.addInputAsValue()}getOptionsDefault(t){return t.json.results}isCompleteDefault(t,e){const i=e.json;return!i.more&&!i.next}handleRemoveSelection(t){this.removeValue(t),this.visibleOptions=[],this.fireEvent("change")}createArbitraryOptionDefault(){return null}open(){this.requestUpdate("input")}isOpen(){return this.visibleOptions.length>0}setOptions(t){this.staticOptions=t}setVisibleOptions(t){if(t=t.filter((t=>!!this.getNameInternal(t)&&(!this.shouldExclude||!this.shouldExclude(t)))),this.input){if(this.searchable&&!this.queryParam){const e=this.input.trim().toLowerCase();t=t.filter((t=>this.isMatch(t,e)))}const e=this.createArbitraryOption(this.input,t);if(e){e.arbitrary=!0;t.find((t=>this.getValue(t)===this.getValue(e)))||(t.length>0&&t[0].arbitrary?t[0]=e:t.unshift(e))}}this.values.length>0&&(this.multi?t=t.filter((t=>!this.values.find((e=>this.getValue(e)===this.getValue(t))))):(this.input?this.cursorIndex=0:this.cursorIndex=t.findIndex((t=>this.getValue(t)===this.getValue(this.values[0]))),this.requestUpdate("cursorIndex"))),this.sortFunction&&t.sort(this.sortFunction),this.visibleOptions=t}fetchExpressions(){const t=document.querySelector("temba-store");if(this.expressions&&t){const e=this.shadowRoot.querySelector(".searchbox"),i=Qs(e,t,"session"===this.expressions);return this.query=i.query,this.completionOptions=i.options,this.visibleOptions=[],void(this.anchorPosition=i.anchorPosition)}}fetchOptions(t,e=0){if(this.completionOptions=[],!this.fetching){this.fetching=!0;const i=[...this.staticOptions],n=(t||"").trim().toLowerCase();if(this.tags&&n&&(i.find((t=>this.getValue(t)&&this.getValue(t).toLowerCase()===n))||i.splice(0,0,{name:t,value:t})),this.endpoint){let o=this.endpoint;t&&this.queryParam&&(o.indexOf("?")>-1?o+="&":o+="?",o+=this.queryParam+"="+encodeURIComponent(t)),e&&(o.indexOf("?")>-1?o+="&":o+="?",o+="page="+e),this.next&&(o=this.next);const r=this.lruCache.get(o);if(this.cache&&!this.tags&&r)return 0!==e||this.next?this.setVisibleOptions([...this.visibleOptions,...r.options]):(this.cursorIndex=0,this.setVisibleOptions([...i,...r.options])),this.complete=r.complete,this.next=r.next,void(this.fetching=!1);this.searchable&&!this.queryParam?Kt(o).then((t=>{this.cache&&!this.tags&&(this.lruCache.set(o,{options:t,complete:!0,next:null}),this.complete=!0,this.next=null,this.setVisibleOptions([...i,...t]),this.fetching=!1)})):this.httpComplete=Wt(o).then((r=>{const s=this.getOptions(r).filter((t=>this.isMatch(t,n))),a=r.json;a.next&&(this.next=a.next),0!==e||this.next?(s.length>0&&this.setVisibleOptions([...this.visibleOptions,...s]),this.complete=this.isComplete(s,r)):(this.cursorIndex=0,this.setVisibleOptions([...i,...s]),this.query=t,this.complete=this.isComplete(this.visibleOptions,r)),this.cache&&!this.tags&&this.lruCache.set(o,{options:s,complete:this.complete,next:this.next}),this.fetching=!1,this.page=e})).catch((t=>{this.fetching=!1,console.error(t)}))}else this.fetching=!1,this.setVisibleOptions(i)}}handleFocus(){this.focused||0!==this.visibleOptions.length||(this.focused=!0,this.searchOnFocus&&!this.removingSelection&&this.requestUpdate("input"))}handleBlur(){this.focused=!1,this.visibleOptions.length>0&&(this.input="",this.next=null,this.complete=!0,this.visibleOptions=[],this.cursorIndex=0)}handleClick(){this.selectedIndex=-1,this.requestUpdate("input")}addInputAsValue(){const t=this.shadowRoot.querySelector(".searchbox"),e={name:t.value,value:t.value,expression:!0};this.multi?this.values.find((t=>t.expression&&t.value&&e.value&&t.value.toLowerCase().trim()==e.value.toLowerCase().trim()))||this.addValue(e):this.setValue(e),this.input="",this.multi||this.blur(),this.fireEvent("change")}handleKeyDown(t){if("Enter"===t.key&&this.expressions&&0===this.completionOptions.length&&this.input.indexOf("@")>-1&&this.addInputAsValue(),("Enter"===t.key||"ArrowDown"===t.key||"n"===t.key&&t.ctrlKey)&&0===this.visibleOptions.length&&0===this.completionOptions.length)this.requestUpdate("input");else if(this.multi&&"Backspace"===t.key&&!this.input){if(this.visibleOptions.length>0)return void(this.visibleOptions=[]);-1===this.selectedIndex?(this.selectedIndex=this.values.length-1,this.visibleOptions=[]):(this.popValue(),this.selectedIndex=-1),this.fireEvent("change")}else this.selectedIndex=-1}getStaticOptions(){return this.staticOptions}handleInput(t){const e=t.currentTarget;this.input=e.value}handleCancel(){this.visibleOptions=[]}handleCursorChanged(t){this.cursorIndex=t.detail.index}handleContainerClick(t){if(this.focused=!0,"INPUT"!==t.target.tagName){const e=this.shadowRoot.querySelector("input");if(e)return e.click(),void e.focus();this.visibleOptions.length>0?(this.visibleOptions=[],t.preventDefault(),t.stopPropagation()):this.requestUpdate("input")}}getEventHandlers(){return[{event:ue.Canceled,method:this.handleCancel},{event:ue.CursorChanged,method:this.handleCursorChanged},{event:"blur",method:this.handleBlur},{event:"focus",method:this.handleFocus}]}firstUpdated(t){super.firstUpdated(t),this.anchorElement=this.shadowRoot.querySelector(".select-container"),this.anchorExpressions=this.shadowRoot.querySelector("#anchor"),window.setTimeout((()=>{for(const t of this.children)if("TEMBA-OPTION"===t.tagName){const e={};for(const i of t.attributes)e[i.name]=i.value;this.staticOptions.push(e),null===t.getAttribute("selected")&&this.getValue(e)!=this.value||(null!==this.getAttribute("multi")?this.addValue(e):(this.setValue(e),this.fireEvent("change")))}0!==this.values.length||this.placeholder||(0==this.staticOptions.length&&this.endpoint?Kt(this.endpoint).then((t=>{t.length>0&&(this.setValue(t[0]),this.fireEvent("change"))})):(null!==this.getAttribute("multi")?this.addValue(this.staticOptions[0]):this.setValue(this.staticOptions[0]),this.fireEvent("change"))),this.searchable&&0===this.staticOptions.length&&(this.quietMillis=200)}),0)}handleArrowClick(t){this.visibleOptions.length>0&&(this.visibleOptions=[],t.preventDefault(),t.stopPropagation())}renderSelectedItemDefault(t){return O`
754
+ `}updated(t){if(super.updated(t),t.has("cacheKey")&&this.lruCache.clear(),t.has("input")&&!t.has("values")&&!t.has("options")&&this.focused&&(this.lastQuery&&window.clearTimeout(this.lastQuery),this.lastQuery=window.setTimeout((()=>{this.expressions&&this.input.indexOf("@")>-1?this.fetchExpressions():this.fetchOptions(this.input)}),this.quietMillis)),(t.has("cursorIndex")||t.has("visibleOptions"))&&this.endpoint&&!this.fetching&&(this.visibleOptions.length>0||this.next)&&!this.complete&&(this.cursorIndex||0)>this.visibleOptions.length-20&&this.fetchOptions(this.query,this.page+1),t.has("value")&&this.value){const t=this.staticOptions.find((t=>this.getValue(t)===this.value));t&&this.setValue(t)}0===this.values.length&&!this.placeholder&&this.staticOptions.length>0&&this.setValue(this.staticOptions[0])}setSelectedOption(t){this.multi?this.addValue(t):this.setValue(t),this.multi&&this.searchable||(this.blur(),this.focused=!1),this.visibleOptions=[],this.input="",this.next=null,this.complete=!0,this.selectedIndex=-1,this.fireEvent("change")}handleOptionSelection(t){const e=t.detail.selected;e.post&&this.endpoint?wt(this.endpoint,e).then((t=>{t.status>=200&&t.status<300?(this.setSelectedOption(t.json),this.lruCache=Dt(20,6e4)):this.blur()})):this.setSelectedOption(e)}handleExpressionSelection(t){const e=t.detail.selected,i=t.detail.tabbed,n=this.shadowRoot.querySelector(".searchbox");_r(this.query,n,e),this.query="",this.completionOptions=[],i?this.fetchExpressions():-1===this.input.indexOf("(")&&this.addInputAsValue()}getOptionsDefault(t){return t.json.results}isCompleteDefault(t,e){const i=e.json;return!i.more&&!i.next}handleRemoveSelection(t){this.removeValue(t),this.visibleOptions=[],this.fireEvent("change")}createArbitraryOptionDefault(){return null}open(){this.requestUpdate("input")}isOpen(){return this.visibleOptions.length>0}setOptions(t){this.staticOptions=t}setVisibleOptions(t){if(t=t.filter((t=>!!this.getNameInternal(t)&&(!this.shouldExclude||!this.shouldExclude(t)))),this.input){if(this.searchable&&!this.queryParam){const e=this.input.trim().toLowerCase();t=t.filter((t=>this.isMatch(t,e)))}const e=this.createArbitraryOption(this.input,t);if(e){e.arbitrary=!0;t.find((t=>this.getValue(t)===this.getValue(e)))||(t.length>0&&t[0].arbitrary?t[0]=e:t.unshift(e))}}this.values.length>0&&(this.multi?t=t.filter((t=>!this.values.find((e=>this.getValue(e)===this.getValue(t))))):(this.input?this.cursorIndex=0:this.cursorIndex=t.findIndex((t=>this.getValue(t)===this.getValue(this.values[0]))),this.requestUpdate("cursorIndex"))),this.sortFunction&&t.sort(this.sortFunction),this.visibleOptions=t}fetchExpressions(){const t=document.querySelector("temba-store");if(this.expressions&&t){const e=this.shadowRoot.querySelector(".searchbox"),i=xr(e,t,"session"===this.expressions);return this.query=i.query,this.completionOptions=i.options,this.visibleOptions=[],void(this.anchorPosition=i.anchorPosition)}}fetchOptions(t,e=0){if(this.completionOptions=[],!this.fetching){this.fetching=!0;const i=[...this.staticOptions],n=(t||"").trim().toLowerCase();if(this.tags&&n&&(i.find((t=>this.getValue(t)&&this.getValue(t).toLowerCase()===n))||i.splice(0,0,{name:t,value:t})),this.endpoint){let o=this.endpoint;t&&this.queryParam&&(o.indexOf("?")>-1?o+="&":o+="?",o+=this.queryParam+"="+encodeURIComponent(t)),e&&(o.indexOf("?")>-1?o+="&":o+="?",o+="page="+e),this.next&&(o=this.next);const s=this.lruCache.get(o);if(this.cache&&!this.tags&&s)return 0!==e||this.next?this.setVisibleOptions([...this.visibleOptions,...s.options]):(this.cursorIndex=0,this.setVisibleOptions([...i,...s.options])),this.complete=s.complete,this.next=s.next,void(this.fetching=!1);this.searchable&&!this.queryParam?yt(o).then((t=>{this.cache&&!this.tags&&(this.lruCache.set(o,{options:t,complete:!0,next:null}),this.complete=!0,this.next=null,this.setVisibleOptions([...i,...t]),this.fetching=!1)})):this.httpComplete=ft(o).then((s=>{const r=this.getOptions(s).filter((t=>this.isMatch(t,n))),a=s.json;a.next&&(this.next=a.next),0!==e||this.next?(r.length>0&&this.setVisibleOptions([...this.visibleOptions,...r]),this.complete=this.isComplete(r,s)):(this.cursorIndex=0,this.setVisibleOptions([...i,...r]),this.query=t,this.complete=this.isComplete(this.visibleOptions,s)),this.cache&&!this.tags&&this.lruCache.set(o,{options:r,complete:this.complete,next:this.next}),this.fetching=!1,this.page=e})).catch((t=>{this.fetching=!1,console.error(t)}))}else this.fetching=!1,this.setVisibleOptions(i)}}handleFocus(){this.focused||0!==this.visibleOptions.length||(this.focused=!0,this.searchOnFocus&&!this.removingSelection&&this.requestUpdate("input"))}handleBlur(){this.focused=!1,this.visibleOptions.length>0&&(this.input="",this.next=null,this.complete=!0,this.visibleOptions=[],this.cursorIndex=0)}handleClick(){this.selectedIndex=-1,this.requestUpdate("input")}addInputAsValue(){const t=this.shadowRoot.querySelector(".searchbox"),e={name:t.value,value:t.value,expression:!0};this.multi?this.values.find((t=>t.expression&&t.value&&e.value&&t.value.toLowerCase().trim()==e.value.toLowerCase().trim()))||this.addValue(e):this.setValue(e),this.input="",this.multi||this.blur(),this.fireEvent("change")}handleKeyDown(t){if("Enter"===t.key&&this.expressions&&0===this.completionOptions.length&&this.input.indexOf("@")>-1&&this.addInputAsValue(),("Enter"===t.key||"ArrowDown"===t.key||"n"===t.key&&t.ctrlKey)&&0===this.visibleOptions.length&&0===this.completionOptions.length)this.requestUpdate("input");else if(this.multi&&"Backspace"===t.key&&!this.input){if(this.visibleOptions.length>0)return void(this.visibleOptions=[]);-1===this.selectedIndex?(this.selectedIndex=this.values.length-1,this.visibleOptions=[]):(this.popValue(),this.selectedIndex=-1),this.fireEvent("change")}else this.selectedIndex=-1}getStaticOptions(){return this.staticOptions}handleInput(t){const e=t.currentTarget;this.input=e.value}handleCancel(){this.visibleOptions=[]}handleCursorChanged(t){this.cursorIndex=t.detail.index}handleContainerClick(t){if(this.focused=!0,"INPUT"!==t.target.tagName){const e=this.shadowRoot.querySelector("input");if(e)return e.click(),void e.focus();this.visibleOptions.length>0?(this.visibleOptions=[],t.preventDefault(),t.stopPropagation()):this.requestUpdate("input")}}getEventHandlers(){return[{event:zt.Canceled,method:this.handleCancel},{event:zt.CursorChanged,method:this.handleCursorChanged},{event:"blur",method:this.handleBlur},{event:"focus",method:this.handleFocus}]}firstUpdated(t){super.firstUpdated(t),this.anchorElement=this.shadowRoot.querySelector(".select-container"),this.anchorExpressions=this.shadowRoot.querySelector("#anchor"),window.setTimeout((()=>{for(const t of this.children)if("TEMBA-OPTION"===t.tagName){const e={};for(const i of t.attributes)e[i.name]=i.value;this.staticOptions.push(e),null===t.getAttribute("selected")&&this.getValue(e)!=this.value||(null!==this.getAttribute("multi")?this.addValue(e):(this.setValue(e),this.fireEvent("change")))}0!==this.values.length||this.placeholder||(0==this.staticOptions.length&&this.endpoint?yt(this.endpoint).then((t=>{t.length>0&&(this.setValue(t[0]),this.fireEvent("change"))})):(null!==this.getAttribute("multi")?this.addValue(this.staticOptions[0]):this.setValue(this.staticOptions[0]),this.fireEvent("change"))),this.searchable&&0===this.staticOptions.length&&(this.quietMillis=200)}),0)}handleArrowClick(t){this.visibleOptions.length>0&&(this.visibleOptions=[],t.preventDefault(),t.stopPropagation())}renderSelectedItemDefault(t){return P`
820
755
  <div class="option-name" style="display:flex">
821
- ${t.icon?O`<temba-icon
756
+ ${t.icon?P`<temba-icon
822
757
  name="${t.icon}"
823
758
  style="margin-right:0.5em;"
824
759
  ></temba-icon>`:null}<span>${this.getName(t)}</span>
825
760
  </div>
826
- `}serializeValue(t){return!this.jsonValue&&(this.staticOptions.length>0||this.tags)?t.value:super.serializeValue(t)}setSelection(t){for(const e of this.staticOptions)if(e.value===t)return void(0!==this.values.length&&this.values[0].value===""+t||(this.setValue(e),this.fireEvent("change")))}handleClear(t){t.preventDefault(),t.stopPropagation(),this.setValues([]),this.fireEvent("change")}render(){const t=0===this.values.length?this.placeholder:"",e=O`
761
+ `}serializeValue(t){return!this.jsonValue&&(this.staticOptions.length>0||this.tags)?t.value:super.serializeValue(t)}setSelection(t){for(const e of this.staticOptions)if(e.value===t)return void(0!==this.values.length&&this.values[0].value===""+t||(this.setValue(e),this.fireEvent("change")))}handleClear(t){t.preventDefault(),t.stopPropagation(),this.setValues([]),this.fireEvent("change")}render(){const t=0===this.values.length?this.placeholder:"",e=P`
827
762
  <div class="placeholder">${t}</div>
828
- `,i=this.clearable&&this.values.length>0&&!this.multi?O`<temba-icon
763
+ `,i=this.clearable&&this.values.length>0&&!this.multi?P`<temba-icon
829
764
  name="x"
830
765
  size="1.1"
831
766
  class="clear-button"
832
767
  @click=${this.handleClear}
833
- />`:null,n=Gt({multi:this.multi,single:!this.multi,searchable:this.searchable,empty:0===this.values.length,options:this.visibleOptions.length>0,focused:this.focused,"search-input":this.input.length>0,"no-search-input":0===this.input.length,[this.flavor]:null!==this.flavor,disabled:this.disabled}),o=this.anchorPosition?{top:"0px",left:this.anchorPosition.left-10+"px"}:{},r=this.searchable?O`
768
+ />`:null,n=gt({multi:this.multi,single:!this.multi,searchable:this.searchable,empty:0===this.values.length,options:this.visibleOptions.length>0,focused:this.focused,"search-input":this.input.length>0,"no-search-input":0===this.input.length,[this.flavor]:null!==this.flavor,disabled:this.disabled}),o=this.anchorPosition?{top:"0px",left:this.anchorPosition.left-10+"px"}:{},s=this.searchable?P`
834
769
  <div class="input-wrapper">
835
770
  <input
836
771
  class="searchbox"
@@ -841,9 +776,9 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
841
776
  placeholder=${t}
842
777
  .value=${this.input}
843
778
  />
844
- <div id="anchor" style=${dt(o)}></div>
779
+ <div id="anchor" style=${ut(o)}></div>
845
780
  </div>
846
- `:e;return O`
781
+ `:e;return P`
847
782
  <temba-field
848
783
  name=${this.name}
849
784
  .label=${this.label}
@@ -862,12 +797,12 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
862
797
  >
863
798
  <div class="left-side">
864
799
  <div class="selected">
865
- ${this.multi?null:r}
866
- ${this.values.map(((t,e)=>O`
800
+ ${this.multi?null:s}
801
+ ${this.values.map(((t,e)=>P`
867
802
  <div
868
803
  class="selected-item ${e===this.selectedIndex?"focused":""}"
869
804
  >
870
- ${this.multi?O`
805
+ ${this.multi?P`
871
806
  <div
872
807
  class="remove-item"
873
808
  style="margin-top:1px"
@@ -881,13 +816,13 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
881
816
  ${this.renderSelectedItem(t)}
882
817
  </div>
883
818
  `))}
884
- ${this.multi?r:null}
819
+ ${this.multi?s:null}
885
820
  </div>
886
821
  </div>
887
822
 
888
823
  ${i}
889
824
 
890
- ${this.tags?null:O`<div
825
+ ${this.tags?null:P`<div
891
826
  class="right-side"
892
827
  style="display:block;margin-right:5px"
893
828
  @click=${this.handleArrowClick}
@@ -924,12 +859,12 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
924
859
  @temba-canceled=${()=>{}}
925
860
  .anchorTo=${this.anchorExpressions}
926
861
  .options=${this.completionOptions}
927
- .renderOption=${Gs}
862
+ .renderOption=${gr}
928
863
  ?visible=${this.completionOptions.length>0}
929
864
  >
930
- ${this.currentFunction?O`
865
+ ${this.currentFunction?P`
931
866
  <div class="current-fn">
932
- ${Gs(this.currentFunction,!0)}
867
+ ${gr(this.currentFunction,!0)}
933
868
  </div>
934
869
  `:null}
935
870
  <div class="footer">Tab to complete, enter to select</div>
@@ -939,7 +874,7 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
939
874
 
940
875
  </temba-field>
941
876
 
942
- `}}t([it({type:Boolean})],ta.prototype,"multi",void 0),t([it({type:Boolean})],ta.prototype,"searchOnFocus",void 0),t([it({type:String})],ta.prototype,"placeholder",void 0),t([it()],ta.prototype,"name",void 0),t([it()],ta.prototype,"endpoint",void 0),t([it({type:String})],ta.prototype,"nameKey",void 0),t([it({type:String})],ta.prototype,"valueKey",void 0),t([it({attribute:!1})],ta.prototype,"currentFunction",void 0),t([it({type:String})],ta.prototype,"queryParam",void 0),t([it({type:String})],ta.prototype,"input",void 0),t([it({type:Array})],ta.prototype,"visibleOptions",void 0),t([it({type:Array})],ta.prototype,"completionOptions",void 0),t([it({type:Number})],ta.prototype,"quietMillis",void 0),t([it({type:Boolean})],ta.prototype,"fetching",void 0),t([it({type:Boolean})],ta.prototype,"searchable",void 0),t([it({type:String})],ta.prototype,"expressions",void 0),t([it({type:Boolean})],ta.prototype,"cache",void 0),t([it({type:String})],ta.prototype,"cacheKey",void 0),t([it({type:Boolean})],ta.prototype,"focused",void 0),t([it({type:Boolean})],ta.prototype,"disabled",void 0),t([it({attribute:!1})],ta.prototype,"selectedIndex",void 0),t([it({type:Number})],ta.prototype,"cursorIndex",void 0),t([it({attribute:!1})],ta.prototype,"anchorElement",void 0),t([it({attribute:!1})],ta.prototype,"anchorExpressions",void 0),t([it({type:Object})],ta.prototype,"anchorPosition",void 0),t([it({type:Boolean})],ta.prototype,"tags",void 0),t([it({type:Boolean,attribute:"space_select"})],ta.prototype,"spaceSelect",void 0),t([it({type:Boolean})],ta.prototype,"jsonValue",void 0),t([it({type:Boolean})],ta.prototype,"hideErrors",void 0),t([it({type:Boolean})],ta.prototype,"clearable",void 0),t([it({type:String})],ta.prototype,"flavor",void 0),t([it({type:String,attribute:"info_text"})],ta.prototype,"infoText",void 0),t([it({attribute:!1})],ta.prototype,"getName",void 0),t([it({attribute:!1})],ta.prototype,"isMatch",void 0),t([it({attribute:!1})],ta.prototype,"getValue",void 0),t([it({type:Number,attribute:"option-width"})],ta.prototype,"optionWidth",void 0),t([it({type:Boolean,attribute:"anchor-right"})],ta.prototype,"anchorRight",void 0),t([it({attribute:!1})],ta.prototype,"shouldExclude",void 0),t([it({attribute:!1})],ta.prototype,"sortFunction",void 0),t([it({attribute:!1})],ta.prototype,"renderOption",void 0),t([it({attribute:!1})],ta.prototype,"renderOptionName",void 0),t([it({attribute:!1})],ta.prototype,"renderOptionDetail",void 0),t([it({attribute:!1})],ta.prototype,"renderSelectedItem",void 0),t([it({attribute:!1})],ta.prototype,"createArbitraryOption",void 0),t([it({attribute:!1})],ta.prototype,"getOptions",void 0),t([it({attribute:!1})],ta.prototype,"isComplete",void 0),t([it({type:Array,attribute:"options"})],ta.prototype,"staticOptions",void 0);class ea extends ot{constructor(){super(...arguments),this.submitOnEnter=!1,this.anchorPosition={left:0,top:0},this.placeholder="",this.options=[],this.name="",this.value=""}static get styles(){return r`
877
+ `}}t([it({type:Boolean})],wr.prototype,"multi",void 0),t([it({type:Boolean})],wr.prototype,"searchOnFocus",void 0),t([it({type:String})],wr.prototype,"placeholder",void 0),t([it()],wr.prototype,"name",void 0),t([it()],wr.prototype,"endpoint",void 0),t([it({type:String})],wr.prototype,"nameKey",void 0),t([it({type:String})],wr.prototype,"valueKey",void 0),t([it({attribute:!1})],wr.prototype,"currentFunction",void 0),t([it({type:String})],wr.prototype,"queryParam",void 0),t([it({type:String})],wr.prototype,"input",void 0),t([it({type:Array})],wr.prototype,"visibleOptions",void 0),t([it({type:Array})],wr.prototype,"completionOptions",void 0),t([it({type:Number})],wr.prototype,"quietMillis",void 0),t([it({type:Boolean})],wr.prototype,"fetching",void 0),t([it({type:Boolean})],wr.prototype,"searchable",void 0),t([it({type:String})],wr.prototype,"expressions",void 0),t([it({type:Boolean})],wr.prototype,"cache",void 0),t([it({type:String})],wr.prototype,"cacheKey",void 0),t([it({type:Boolean})],wr.prototype,"focused",void 0),t([it({type:Boolean})],wr.prototype,"disabled",void 0),t([it({attribute:!1})],wr.prototype,"selectedIndex",void 0),t([it({type:Number})],wr.prototype,"cursorIndex",void 0),t([it({attribute:!1})],wr.prototype,"anchorElement",void 0),t([it({attribute:!1})],wr.prototype,"anchorExpressions",void 0),t([it({type:Object})],wr.prototype,"anchorPosition",void 0),t([it({type:Boolean})],wr.prototype,"tags",void 0),t([it({type:Boolean,attribute:"space_select"})],wr.prototype,"spaceSelect",void 0),t([it({type:Boolean})],wr.prototype,"jsonValue",void 0),t([it({type:Boolean})],wr.prototype,"hideErrors",void 0),t([it({type:Boolean})],wr.prototype,"clearable",void 0),t([it({type:String})],wr.prototype,"flavor",void 0),t([it({type:String,attribute:"info_text"})],wr.prototype,"infoText",void 0),t([it({attribute:!1})],wr.prototype,"getName",void 0),t([it({attribute:!1})],wr.prototype,"isMatch",void 0),t([it({attribute:!1})],wr.prototype,"getValue",void 0),t([it({type:Number,attribute:"option-width"})],wr.prototype,"optionWidth",void 0),t([it({type:Boolean,attribute:"anchor-right"})],wr.prototype,"anchorRight",void 0),t([it({attribute:!1})],wr.prototype,"shouldExclude",void 0),t([it({attribute:!1})],wr.prototype,"sortFunction",void 0),t([it({attribute:!1})],wr.prototype,"renderOption",void 0),t([it({attribute:!1})],wr.prototype,"renderOptionName",void 0),t([it({attribute:!1})],wr.prototype,"renderOptionDetail",void 0),t([it({attribute:!1})],wr.prototype,"renderSelectedItem",void 0),t([it({attribute:!1})],wr.prototype,"createArbitraryOption",void 0),t([it({attribute:!1})],wr.prototype,"getOptions",void 0),t([it({attribute:!1})],wr.prototype,"isComplete",void 0),t([it({type:Array,attribute:"options"})],wr.prototype,"staticOptions",void 0);class kr extends ot{constructor(){super(...arguments),this.submitOnEnter=!1,this.anchorPosition={left:0,top:0},this.placeholder="",this.options=[],this.name="",this.value=""}static get styles(){return s`
943
878
  :host {
944
879
  display: block;
945
880
  }
@@ -994,7 +929,7 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
994
929
  padding: 1px 5px;
995
930
  border-radius: var(--curvature);
996
931
  }
997
- `}firstUpdated(){this.textInputElement=this.shadowRoot.querySelector("temba-textinput"),this.anchorElement=this.shadowRoot.querySelector("#anchor"),this.hiddenElement=document.createElement("input"),this.hiddenElement.setAttribute("type","hidden"),this.hiddenElement.setAttribute("name",this.getAttribute("name")),this.hiddenElement.setAttribute("value",this.getAttribute("value")||""),this.appendChild(this.hiddenElement)}handleKeyUp(t){if(this.options&&this.options.length>0){if("ArrowUp"===t.key||"ArrowDown"===t.key)return;if(t.ctrlKey&&("n"===t.key||"p"===t.key))return;if("Enter"===t.key||"Escape"===t.key||"Tab"===t.key||t.key.startsWith("Control"))return t.stopPropagation(),void t.preventDefault();this.executeQuery(t.currentTarget)}}hasVisibleOptions(){return this.options.length>0}executeQuery(t){const e=document.querySelector("temba-store"),i=Qs(t.inputElement,e,this.session);this.query=i.query,this.options=i.options,this.anchorPosition=i.anchorPosition}handleClick(t){this.executeQuery(t.currentTarget)}updated(t){super.updated(t),t.has("value")&&this.hiddenElement.setAttribute("value",this.value)}handleInput(t){const e=t.currentTarget;this.executeQuery(e),this.value=e.inputElement.value,this.fireEvent("change")}handleOptionCanceled(){window.setTimeout((()=>{this.options=[],this.query=""}),100)}handleOptionSelection(t){const e=t.detail.selected,i=t.detail.tabbed;Xs(this.query,this.textInputElement.inputElement,e),this.query="",this.options=[],i&&this.executeQuery(this.textInputElement)}click(){super.click();const t=this.shadowRoot.querySelector("temba-textinput");t&&t.click()}render(){const t=this.anchorPosition?{top:`${this.anchorPosition.top}px`,left:`${this.anchorPosition.left}px`}:{};return O`
932
+ `}firstUpdated(){this.textInputElement=this.shadowRoot.querySelector("temba-textinput"),this.anchorElement=this.shadowRoot.querySelector("#anchor"),this.hiddenElement=document.createElement("input"),this.hiddenElement.setAttribute("type","hidden"),this.hiddenElement.setAttribute("name",this.getAttribute("name")),this.hiddenElement.setAttribute("value",this.getAttribute("value")||""),this.appendChild(this.hiddenElement)}handleKeyUp(t){if(this.options&&this.options.length>0){if("ArrowUp"===t.key||"ArrowDown"===t.key)return;if(t.ctrlKey&&("n"===t.key||"p"===t.key))return;if("Enter"===t.key||"Escape"===t.key||"Tab"===t.key||t.key.startsWith("Control"))return t.stopPropagation(),void t.preventDefault();this.executeQuery(t.currentTarget)}}hasVisibleOptions(){return this.options.length>0}executeQuery(t){const e=document.querySelector("temba-store"),i=xr(t.inputElement,e,this.session);this.query=i.query,this.options=i.options,this.anchorPosition=i.anchorPosition}handleClick(t){this.executeQuery(t.currentTarget)}updated(t){super.updated(t),t.has("value")&&this.hiddenElement.setAttribute("value",this.value)}handleInput(t){const e=t.currentTarget;this.executeQuery(e),this.value=e.inputElement.value,this.fireEvent("change")}handleOptionCanceled(){window.setTimeout((()=>{this.options=[],this.query=""}),100)}handleOptionSelection(t){const e=t.detail.selected,i=t.detail.tabbed;_r(this.query,this.textInputElement.inputElement,e),this.query="",this.options=[],i&&this.executeQuery(this.textInputElement)}click(){super.click();const t=this.shadowRoot.querySelector("temba-textinput");t&&t.click()}render(){const t=this.anchorPosition?{top:`${this.anchorPosition.top}px`,left:`${this.anchorPosition.left}px`}:{};return P`
998
933
  <temba-field
999
934
  name=${this.name}
1000
935
  .label=${this.label}
@@ -1003,12 +938,12 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
1003
938
  .widgetOnly=${this.widgetOnly}
1004
939
  >
1005
940
  <div class="comp-container">
1006
- <div id="anchor" style=${dt(t)}></div>
941
+ <div id="anchor" style=${ut(t)}></div>
1007
942
  <temba-textinput
1008
943
  name=${this.name}
1009
944
  placeholder=${this.placeholder}
1010
945
  gsm=${this.gsm}
1011
- counter=${st(this.counter)}
946
+ counter=${rt(this.counter)}
1012
947
  @keyup=${this.handleKeyUp}
1013
948
  @click=${this.handleClick}
1014
949
  @input=${this.handleInput}
@@ -1021,21 +956,21 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
1021
956
  <temba-options
1022
957
  @temba-selection=${this.handleOptionSelection}
1023
958
  @temba-canceled=${this.handleOptionCanceled}
1024
- .renderOption=${Gs}
959
+ .renderOption=${gr}
1025
960
  .anchorTo=${this.anchorElement}
1026
961
  .options=${this.options}
1027
962
  ?visible=${this.options&&this.options.length>0}
1028
963
  >
1029
- ${this.currentFunction?O`
964
+ ${this.currentFunction?P`
1030
965
  <div class="current-fn">
1031
- ${Gs(this.currentFunction,!0)}
966
+ ${gr(this.currentFunction,!0)}
1032
967
  </div>
1033
968
  `:null}
1034
969
  <div class="footer">Tab to complete, enter to select</div>
1035
970
  </temba-options>
1036
971
  </div>
1037
972
  </temba-field>
1038
- `}}t([it({type:Boolean})],ea.prototype,"session",void 0),t([it({type:Boolean})],ea.prototype,"submitOnEnter",void 0),t([it({type:Object})],ea.prototype,"anchorPosition",void 0),t([it({attribute:!1})],ea.prototype,"currentFunction",void 0),t([it({type:String})],ea.prototype,"placeholder",void 0),t([it({attribute:!1})],ea.prototype,"textInputElement",void 0),t([it({attribute:!1})],ea.prototype,"anchorElement",void 0),t([it({type:Array})],ea.prototype,"options",void 0),t([it({type:String})],ea.prototype,"name",void 0),t([it({type:String})],ea.prototype,"value",void 0),t([it({type:Boolean})],ea.prototype,"textarea",void 0),t([it({type:Boolean})],ea.prototype,"gsm",void 0),t([it({type:String})],ea.prototype,"counter",void 0);class ia extends tt{constructor(){super(...arguments),this.header="",this.open=!1,this.fetching=!1,this.headers={},this.body=this.getLoading(),this.disabled=!1,this.suspendSubmit=!1}static get styles(){return r`
973
+ `}}t([it({type:Boolean})],kr.prototype,"session",void 0),t([it({type:Boolean})],kr.prototype,"submitOnEnter",void 0),t([it({type:Object})],kr.prototype,"anchorPosition",void 0),t([it({attribute:!1})],kr.prototype,"currentFunction",void 0),t([it({type:String})],kr.prototype,"placeholder",void 0),t([it({attribute:!1})],kr.prototype,"textInputElement",void 0),t([it({attribute:!1})],kr.prototype,"anchorElement",void 0),t([it({type:Array})],kr.prototype,"options",void 0),t([it({type:String})],kr.prototype,"name",void 0),t([it({type:String})],kr.prototype,"value",void 0),t([it({type:Boolean})],kr.prototype,"textarea",void 0),t([it({type:Boolean})],kr.prototype,"gsm",void 0),t([it({type:String})],kr.prototype,"counter",void 0);class Sr extends tt{constructor(){super(...arguments),this.header="",this.open=!1,this.fetching=!1,this.headers={},this.body=this.getLoading(),this.disabled=!1,this.suspendSubmit=!1}static get styles(){return s`
1039
974
  :host {
1040
975
  }
1041
976
 
@@ -1100,7 +1035,7 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
1100
1035
  border-radius: 6px;
1101
1036
  font-weight: 300;
1102
1037
  }
1103
- `}handleSlotClicked(){this.open=!0}updated(t){if(super.updated(t),t.has("open")&&(this.open?this.fetchForm():void 0!==t.get("open")&&window.setTimeout((()=>{this.body=this.getLoading(),this.submitting=!1}),500)),t.has("body")&&this.open&&this.body&&!this.fetching){this.shadowRoot.querySelector("temba-dialog").focusFirstInput()}}getLoading(){return O`<temba-loading units="6" size="8"></temba-loading>`}updatePrimaryButton(){this.noSubmit||window.setTimeout((()=>{const t=this.shadowRoot.querySelector("input[type='submit']");t?this.primaryName=t.value:(this.primaryName=null,this.cancelName="Ok"),this.submitting=!1}),0)}setBody(t){const e=this.shadowRoot.querySelector(".scripts");for(const t of e.children)t.remove();const i=this.ownerDocument.createElement("div");i.innerHTML=t;const n=i.getElementsByTagName("script"),o=i.getElementsByClassName("span12");for(const t of o)t.className="";const r=[];for(let t=n.length-1;t>=0;t--){const e=this.ownerDocument.createElement("script"),i=n[t].innerText;n[t].src?(e.src=n[t].src,e.type="text/javascript",e.async=!0,e.onload=function(){},r.push(e)):i&&(e.appendChild(this.ownerDocument.createTextNode(i)),r.push(e)),n[t].remove()}const s=!!i.querySelector(".success-script");return s||(this.body=fr(i.innerHTML)),window.setTimeout((()=>{for(const t of r)e.appendChild(t)}),0),!s}getHeaders(){const t=this.headers;return t["X-PJAX"]=1,t}fetchForm(){this.fetching=!0,this.body=this.getLoading(),this.httpComplete=Wt(this.endpoint,null,this.getHeaders()).then((t=>{this.setBody(t.body),this.updatePrimaryButton(),this.fetching=!1,window.setTimeout((()=>{this.fireCustomEvent(ue.Loaded,{body:this.getBody()})}),0)}))}submit(){this.submitting=!0;const t=this.shadowRoot.querySelector("form"),e=t?function(t){const e=[];for(let i=0;i<t.elements.length;i++){const n=t.elements[i];if(n.name&&!n.disabled&&"file"!==n.type&&"reset"!==n.type&&"submit"!==n.type&&"button"!==n.type)if("select-multiple"===n.type)for(let t=0;t<n.options.length;t++)n.options[t].selected&&e.push(encodeURIComponent(n.name)+"="+encodeURIComponent(n.options[t].value));else("checkbox"!==n.type&&"radio"!==n.type||n.checked)&&e.push(encodeURIComponent(n.name)+"="+encodeURIComponent(n.value))}return e.join("&")}(t):{};this.httpComplete=Qt(this.endpoint,e,this.getHeaders(),"application/x-www-form-urlencoded").then((t=>{window.setTimeout((()=>{let e=t.headers.get("temba-success");!e&&t.url&&-1===t.url.indexOf(this.endpoint)&&(e=t.url),e?"hide"===e?window.setTimeout((()=>{this.open=!1,this.fireCustomEvent(ue.Submitted)}),0):(this.fireCustomEvent(ue.Redirected,{url:e}),this.open=!1):this.setBody(t.body)&&this.updatePrimaryButton()}),1e3)})).catch((t=>{console.error(t)}))}handleDialogClick(t){const e=t.detail.button;e.disabled||e.submitting||e.name===this.primaryName&&(this.suspendSubmit||this.submit()),e.name===(this.cancelName||"Cancel")&&(this.open=!1,this.fetching=!1,this.cancelName=void 0)}handleDialogHidden(){this.open=!1,this.fetching=!1}isDestructive(){return this.endpoint&&this.endpoint.indexOf("delete")>-1}getBody(){return this.shadowRoot.querySelector(".modax-body")}render(){return O`
1038
+ `}handleSlotClicked(){this.open=!0}updated(t){if(super.updated(t),t.has("open")&&(this.open?this.fetchForm():void 0!==t.get("open")&&window.setTimeout((()=>{this.body=this.getLoading(),this.submitting=!1}),500)),t.has("body")&&this.open&&this.body&&!this.fetching){this.shadowRoot.querySelector("temba-dialog").focusFirstInput()}}getLoading(){return P`<temba-loading units="6" size="8"></temba-loading>`}updatePrimaryButton(){this.noSubmit||window.setTimeout((()=>{const t=this.shadowRoot.querySelector("input[type='submit']");t?this.primaryName=t.value:(this.primaryName=null,this.cancelName="Ok"),this.submitting=!1}),0)}setBody(t){const e=this.shadowRoot.querySelector(".scripts");for(const t of e.children)t.remove();const i=this.ownerDocument.createElement("div");i.innerHTML=t;const n=i.getElementsByTagName("script"),o=i.getElementsByClassName("span12");for(const t of o)t.className="";const s=[];for(let t=n.length-1;t>=0;t--){const e=this.ownerDocument.createElement("script"),i=n[t].innerText;n[t].src?(e.src=n[t].src,e.type="text/javascript",e.async=!0,e.onload=function(){},s.push(e)):i&&(e.appendChild(this.ownerDocument.createTextNode(i)),s.push(e)),n[t].remove()}const r=!!i.querySelector(".success-script");return r||(this.body=No(i.innerHTML)),window.setTimeout((()=>{for(const t of s)e.appendChild(t)}),0),!r}getHeaders(){const t=this.headers;return t["X-PJAX"]=1,t}fetchForm(){this.fetching=!0,this.body=this.getLoading(),this.httpComplete=ft(this.endpoint,null,this.getHeaders()).then((t=>{this.setBody(t.body),this.updatePrimaryButton(),this.fetching=!1,window.setTimeout((()=>{this.fireCustomEvent(zt.Loaded,{body:this.getBody()})}),0)}))}submit(){this.submitting=!0;const t=this.shadowRoot.querySelector("form"),e=t?function(t){const e=[];for(let i=0;i<t.elements.length;i++){const n=t.elements[i];if(n.name&&!n.disabled&&"file"!==n.type&&"reset"!==n.type&&"submit"!==n.type&&"button"!==n.type)if("select-multiple"===n.type)for(let t=0;t<n.options.length;t++)n.options[t].selected&&e.push(encodeURIComponent(n.name)+"="+encodeURIComponent(n.options[t].value));else("checkbox"!==n.type&&"radio"!==n.type||n.checked)&&e.push(encodeURIComponent(n.name)+"="+encodeURIComponent(n.value))}return e.join("&")}(t):{};this.httpComplete=xt(this.endpoint,e,this.getHeaders(),"application/x-www-form-urlencoded").then((t=>{window.setTimeout((()=>{let e=t.headers.get("temba-success");!e&&t.url&&-1===t.url.indexOf(this.endpoint)&&(e=t.url),e?"hide"===e?window.setTimeout((()=>{this.open=!1,this.fireCustomEvent(zt.Submitted)}),0):(this.fireCustomEvent(zt.Redirected,{url:e}),this.open=!1):this.setBody(t.body)&&this.updatePrimaryButton()}),1e3)})).catch((t=>{console.error(t)}))}handleDialogClick(t){const e=t.detail.button;e.disabled||e.submitting||e.name===this.primaryName&&(this.suspendSubmit||this.submit()),e.name===(this.cancelName||"Cancel")&&(this.open=!1,this.fetching=!1,this.cancelName=void 0)}handleDialogHidden(){this.open=!1,this.fetching=!1}isDestructive(){return this.endpoint&&this.endpoint.indexOf("delete")>-1}getBody(){return this.shadowRoot.querySelector(".modax-body")}render(){return P`
1104
1039
  <temba-dialog
1105
1040
  header=${this.header}
1106
1041
  .primaryButtonName=${this.noSubmit?null:this.primaryName}
@@ -1122,7 +1057,7 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
1122
1057
  <div class="slot-wrapper" @click=${this.handleSlotClicked}>
1123
1058
  <slot></slot>
1124
1059
  </div>
1125
- `}}t([it({type:String})],ia.prototype,"header",void 0),t([it({type:String})],ia.prototype,"endpoint",void 0),t([it({type:Boolean,reflect:!0})],ia.prototype,"open",void 0),t([it({type:Boolean})],ia.prototype,"fetching",void 0),t([it({type:Boolean})],ia.prototype,"submitting",void 0),t([it({type:String})],ia.prototype,"primaryName",void 0),t([it({type:String})],ia.prototype,"cancelName",void 0),t([it({type:String})],ia.prototype,"onLoaded",void 0),t([it({type:Boolean})],ia.prototype,"noSubmit",void 0),t([it({type:Object})],ia.prototype,"headers",void 0),t([it({type:String})],ia.prototype,"body",void 0),t([it({type:Boolean})],ia.prototype,"disabled",void 0),t([it({type:Boolean})],ia.prototype,"suspendSubmit",void 0);class na extends tt{constructor(){super(),this.size="medium",this.primaryButtonName="Ok",this.cancelButtonName="Cancel",this.width=null,this.submittingName="Saving",this.scrollOffset=0}static get widths(){return{small:"400px",medium:"600px",large:"655px"}}static get styles(){return r`
1060
+ `}}t([it({type:String})],Sr.prototype,"header",void 0),t([it({type:String})],Sr.prototype,"endpoint",void 0),t([it({type:Boolean,reflect:!0})],Sr.prototype,"open",void 0),t([it({type:Boolean})],Sr.prototype,"fetching",void 0),t([it({type:Boolean})],Sr.prototype,"submitting",void 0),t([it({type:String})],Sr.prototype,"primaryName",void 0),t([it({type:String})],Sr.prototype,"cancelName",void 0),t([it({type:String})],Sr.prototype,"onLoaded",void 0),t([it({type:Boolean})],Sr.prototype,"noSubmit",void 0),t([it({type:Object})],Sr.prototype,"headers",void 0),t([it({type:String})],Sr.prototype,"body",void 0),t([it({type:Boolean})],Sr.prototype,"disabled",void 0),t([it({type:Boolean})],Sr.prototype,"suspendSubmit",void 0);class Cr extends tt{constructor(){super(),this.size="medium",this.primaryButtonName="Ok",this.cancelButtonName="Cancel",this.width=null,this.submittingName="Saving",this.scrollOffset=0}static get widths(){return{small:"400px",medium:"600px",large:"655px"}}static get styles(){return s`
1126
1061
  :host {
1127
1062
  position: absolute;
1128
1063
  z-index: 10000;
@@ -1250,16 +1185,16 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
1250
1185
  flex-grow: 1;
1251
1186
  text-align: right;
1252
1187
  }
1253
- `}updated(t){if(t.has("open")){const e=document.querySelector("body");if(this.open){this.animationEnd=!0,window.setTimeout((()=>{this.ready=!0,this.animationEnd=!1}),400);const t=window.outerWidth-e.clientWidth;this.scrollOffset=-document.documentElement.scrollTop,e.style.position="fixed",e.style.overflowY="scroll",e.style.top=this.scrollOffset+"px",e.style.width="100%",e.style.overflowY="hidden",e.style.paddingRight=t+"px"}else e.style.position="",e.style.overflowY="",e.style.width="",e.style.marginRight="",e.style.paddingRight="0px",window.scrollTo(0,-1*parseInt(this.scrollOffset||"0"));this.open&&!t.get("open")?(this.shadowRoot.querySelectorAll("temba-button").forEach((t=>{t&&(t.submitting=!1)})),this.noFocus||this.focusFirstInput()):window.setTimeout((()=>{this.ready=!1}),400)}}focusFirstInput(){window.setTimeout((()=>{let t=this.querySelector('temba-textinput, temba-completion, input[type="text"], textarea');t&&(t=t.textInputElement||t.inputElement||t,t.readOnly||(t.focus(),t.click()))}),100)}handleClick(t){const e=t.currentTarget;e.disabled||(this.fireCustomEvent(ue.ButtonClicked,{button:e}),e.name===this.cancelButtonName&&(this.open=!1))}getDocumentHeight(){const t=document.body,e=document.documentElement;return Math.max(t.scrollHeight,t.offsetHeight,e.clientHeight,e.scrollHeight,e.offsetHeight)}clickCancel(){const t=this.getCancelButton();t&&t.click()}getCancelButton(){return this.shadowRoot.querySelector(`temba-button[name='${this.cancelButtonName}']`)}getPrimaryButton(){return this.shadowRoot.querySelector("temba-button[primary]")}handleKeyUp(t){"Escape"===t.key&&this.clickCancel()}handleClickMask(t){if(this.hideOnClick){const e=t.target.id;"dialog-mask"!==e&&"dialog-bg"!==e||(this.fireCustomEvent(ue.DialogHidden),this.clickCancel())}}show(){this.open=!0}hide(){this.open=!1}render(){const t={height:`${this.getDocumentHeight()+100}px`},e={width:this.width,minWidth:"250px",maxWidth:"600px"};this.width||(e.width=na.widths[this.size]);const i=this.header?O`
1188
+ `}updated(t){if(t.has("open")){const e=document.querySelector("body");if(this.open){this.animationEnd=!0,window.setTimeout((()=>{this.ready=!0,this.animationEnd=!1}),400);const t=window.outerWidth-e.clientWidth;this.scrollOffset=-document.documentElement.scrollTop,e.style.position="fixed",e.style.overflowY="scroll",e.style.top=this.scrollOffset+"px",e.style.width="100%",e.style.overflowY="hidden",e.style.paddingRight=t+"px"}else e.style.position="",e.style.overflowY="",e.style.width="",e.style.marginRight="",e.style.paddingRight="0px",window.scrollTo(0,-1*parseInt(this.scrollOffset||"0"));this.open&&!t.get("open")?(this.shadowRoot.querySelectorAll("temba-button").forEach((t=>{t&&(t.submitting=!1)})),this.noFocus||this.focusFirstInput()):window.setTimeout((()=>{this.ready=!1}),400)}}focusFirstInput(){window.setTimeout((()=>{let t=this.querySelector('temba-textinput, temba-completion, input[type="text"], textarea');t&&(t=t.textInputElement||t.inputElement||t,t.readOnly||(t.focus(),t.click()))}),100)}handleClick(t){const e=t.currentTarget;e.disabled||(this.fireCustomEvent(zt.ButtonClicked,{button:e}),e.name===this.cancelButtonName&&(this.open=!1))}getDocumentHeight(){const t=document.body,e=document.documentElement;return Math.max(t.scrollHeight,t.offsetHeight,e.clientHeight,e.scrollHeight,e.offsetHeight)}clickCancel(){const t=this.getCancelButton();t&&t.click()}getCancelButton(){return this.shadowRoot.querySelector(`temba-button[name='${this.cancelButtonName}']`)}getPrimaryButton(){return this.shadowRoot.querySelector("temba-button[primary]")}handleKeyUp(t){"Escape"===t.key&&this.clickCancel()}handleClickMask(t){if(this.hideOnClick){const e=t.target.id;"dialog-mask"!==e&&"dialog-bg"!==e||(this.fireCustomEvent(zt.DialogHidden),this.clickCancel())}}show(){this.open=!0}hide(){this.open=!1}render(){const t={height:`${this.getDocumentHeight()+100}px`},e={width:this.width,minWidth:"250px",maxWidth:"600px"};this.width||(e.width=Cr.widths[this.size]);const i=this.header?P`
1254
1189
  <div class="dialog-header">
1255
1190
  <div class="header-text">${this.header}</div>
1256
1191
  </div>
1257
- `:null;return O`
1192
+ `:null;return P`
1258
1193
  <div
1259
1194
  id="dialog-mask"
1260
1195
  @click=${this.handleClickMask}
1261
- class="dialog-mask ${Gt({"dialog-open":this.open,"dialog-loading":this.loading,"dialog-animation-end":this.animationEnd,"dialog-ready":this.ready})}"
1262
- style=${dt(t)}
1196
+ class="dialog-mask ${gt({"dialog-open":this.open,"dialog-loading":this.loading,"dialog-animation-end":this.animationEnd,"dialog-ready":this.ready})}"
1197
+ style=${ut(t)}
1263
1198
  >
1264
1199
  <div style="position: absolute; width: 100%;">
1265
1200
  <temba-loading
@@ -1274,17 +1209,17 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
1274
1209
  <div class="flex-grow"></div>
1275
1210
  <div
1276
1211
  @keyup=${this.handleKeyUp}
1277
- style=${dt(e)}
1212
+ style=${ut(e)}
1278
1213
  class="dialog-container"
1279
1214
  >
1280
1215
  ${i}
1281
1216
  <div class="dialog-body" @keypress=${this.handleKeyUp}>
1282
- ${this.body?this.body:O`<slot></slot>`}
1217
+ ${this.body?this.body:P`<slot></slot>`}
1283
1218
  <temba-loading units="6" size="8"></temba-loading>
1284
1219
  </div>
1285
1220
 
1286
1221
  <div class="dialog-footer">
1287
- ${this.primaryButtonName?O`
1222
+ ${this.primaryButtonName?P`
1288
1223
  <temba-button
1289
1224
  @click=${this.handleClick}
1290
1225
  .name=${this.primaryButtonName}
@@ -1307,7 +1242,7 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
1307
1242
  </div>
1308
1243
  </div>
1309
1244
  </div>
1310
- `}}t([it({type:Boolean})],na.prototype,"open",void 0),t([it()],na.prototype,"header",void 0),t([it()],na.prototype,"body",void 0),t([it({type:Boolean})],na.prototype,"submitting",void 0),t([it({type:Boolean})],na.prototype,"destructive",void 0),t([it({type:Boolean})],na.prototype,"disabled",void 0),t([it({type:Boolean})],na.prototype,"loading",void 0),t([it({type:Boolean})],na.prototype,"hideOnClick",void 0),t([it({type:Boolean})],na.prototype,"noFocus",void 0),t([it()],na.prototype,"size",void 0),t([it({type:String})],na.prototype,"primaryButtonName",void 0),t([it({type:String})],na.prototype,"cancelButtonName",void 0),t([it({type:String})],na.prototype,"width",void 0),t([it()],na.prototype,"submittingName",void 0),t([it()],na.prototype,"animationEnd",void 0),t([it()],na.prototype,"ready",void 0),t([it({attribute:!1})],na.prototype,"onButtonClicked",void 0);class oa extends X{constructor(){super(...arguments),this.v=1}static get styles(){return r`
1245
+ `}}t([it({type:Boolean})],Cr.prototype,"open",void 0),t([it()],Cr.prototype,"header",void 0),t([it()],Cr.prototype,"body",void 0),t([it({type:Boolean})],Cr.prototype,"submitting",void 0),t([it({type:Boolean})],Cr.prototype,"destructive",void 0),t([it({type:Boolean})],Cr.prototype,"disabled",void 0),t([it({type:Boolean})],Cr.prototype,"loading",void 0),t([it({type:Boolean})],Cr.prototype,"hideOnClick",void 0),t([it({type:Boolean})],Cr.prototype,"noFocus",void 0),t([it()],Cr.prototype,"size",void 0),t([it({type:String})],Cr.prototype,"primaryButtonName",void 0),t([it({type:String})],Cr.prototype,"cancelButtonName",void 0),t([it({type:String})],Cr.prototype,"width",void 0),t([it()],Cr.prototype,"submittingName",void 0),t([it()],Cr.prototype,"animationEnd",void 0),t([it()],Cr.prototype,"ready",void 0),t([it({attribute:!1})],Cr.prototype,"onButtonClicked",void 0);class Tr extends X{constructor(){super(...arguments),this.v=1}static get styles(){return s`
1311
1246
  :host {
1312
1247
  display: inline-block;
1313
1248
  font-family: var(--font-family);
@@ -1441,13 +1376,13 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
1441
1376
  margin-bottom: -3px;
1442
1377
  line-height: normal;
1443
1378
  }
1444
- `}handleClick(t){this.disabled&&(t.preventDefault(),t.stopPropagation()),this.href&&!this.disabled&&(this.ownerDocument.location.href=this.href,t.preventDefault(),t.stopPropagation())}handleKeyUp(t){this.active=!1,"Enter"===t.key&&this.click()}handleMouseDown(){this.disabled||this.submitting||(this.active=!0,this.classList.add("active"))}handleMouseUp(){this.active=!1,this.classList.remove("active")}render(){const t=this.submitting?O`<div class="submit-animation">
1379
+ `}handleClick(t){this.disabled&&(t.preventDefault(),t.stopPropagation()),this.href&&!this.disabled&&(this.ownerDocument.location.href=this.href,t.preventDefault(),t.stopPropagation())}handleKeyUp(t){this.active=!1,"Enter"===t.key&&this.click()}handleMouseDown(){this.disabled||this.submitting||(this.active=!0,this.classList.add("active"))}handleMouseUp(){this.active=!1,this.classList.remove("active")}render(){const t=this.submitting?P`<div class="submit-animation">
1445
1380
  <temba-loading units="3" size="8" color="#eee"></temba-loading>
1446
- </div>`:this.name;return O`
1381
+ </div>`:this.name;return P`
1447
1382
  <div
1448
1383
  class="button-container
1449
1384
  v-${this.v}
1450
- ${Gt({"primary-button":this.primary||!this.primary&&!this.secondary&&!this.attention&&1==this.v,"secondary-button":this.secondary,"disabled-button":this.disabled,"active-button":this.active,"attention-button":this.attention,"destructive-button":this.destructive,"light-button":this.light})}"
1385
+ ${gt({"primary-button":this.primary||!this.primary&&!this.secondary&&!this.attention&&1==this.v,"secondary-button":this.secondary,"disabled-button":this.disabled,"active-button":this.active,"attention-button":this.attention,"destructive-button":this.destructive,"light-button":this.light})}"
1451
1386
  tabindex="0"
1452
1387
  @mousedown=${this.handleMouseDown}
1453
1388
  @mouseup=${this.handleMouseUp}
@@ -1459,7 +1394,7 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
1459
1394
  <div class="button-name">${t}</div>
1460
1395
  </div>
1461
1396
  </div>
1462
- `}}t([it({type:Boolean})],oa.prototype,"primary",void 0),t([it({type:Boolean})],oa.prototype,"secondary",void 0),t([it({type:Boolean})],oa.prototype,"attention",void 0),t([it({type:Number})],oa.prototype,"v",void 0),t([it({type:Boolean})],oa.prototype,"destructive",void 0),t([it({type:Boolean})],oa.prototype,"light",void 0),t([it()],oa.prototype,"name",void 0),t([it({type:Boolean})],oa.prototype,"disabled",void 0),t([it({type:Boolean})],oa.prototype,"submitting",void 0),t([it({type:Boolean})],oa.prototype,"active",void 0),t([it({type:String})],oa.prototype,"href",void 0);class ra extends X{constructor(){super(...arguments),this.hideLabel=!1,this.widgetOnly=!1,this.errors=[],this.hideErrors=!1,this.helpText="",this.helpAlways=!0,this.label="",this.name="",this.disabled=!1}static get styles(){return r`
1397
+ `}}t([it({type:Boolean})],Tr.prototype,"primary",void 0),t([it({type:Boolean})],Tr.prototype,"secondary",void 0),t([it({type:Boolean})],Tr.prototype,"attention",void 0),t([it({type:Number})],Tr.prototype,"v",void 0),t([it({type:Boolean})],Tr.prototype,"destructive",void 0),t([it({type:Boolean})],Tr.prototype,"light",void 0),t([it()],Tr.prototype,"name",void 0),t([it({type:Boolean})],Tr.prototype,"disabled",void 0),t([it({type:Boolean})],Tr.prototype,"submitting",void 0),t([it({type:Boolean})],Tr.prototype,"active",void 0),t([it({type:String})],Tr.prototype,"href",void 0);class Er extends X{constructor(){super(...arguments),this.hideLabel=!1,this.widgetOnly=!1,this.errors=[],this.hideErrors=!1,this.helpText="",this.helpAlways=!0,this.label="",this.name="",this.disabled=!1}static get styles(){return s`
1463
1398
  :host {
1464
1399
  font-family: var(--font-family);
1465
1400
  }
@@ -1513,12 +1448,12 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
1513
1448
  opacity: 0.6 !important;
1514
1449
  pointer-events: none !important;
1515
1450
  }
1516
- `}render(){const t=this.hideErrors?[]:(this.errors||[]).map((t=>O` <div class="alert-error">${t}</div> `));return this.widgetOnly?O`
1451
+ `}render(){const t=this.hideErrors?[]:(this.errors||[]).map((t=>P` <div class="alert-error">${t}</div> `));return this.widgetOnly?P`
1517
1452
  <div class="${this.disabled?"disabled":""}"><slot></slot></div>
1518
1453
  ${t}
1519
- `:O`
1454
+ `:P`
1520
1455
  <div class="field ${this.disabled?"disabled":""}">
1521
- ${this.name&&!this.hideLabel&&this.label?O`
1456
+ ${this.name&&!this.hideLabel&&this.label?P`
1522
1457
  <label class="control-label" for="${this.name}"
1523
1458
  >${this.label}</label
1524
1459
  >
@@ -1526,14 +1461,14 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
1526
1461
  <div class="widget">
1527
1462
  <slot></slot>
1528
1463
  </div>
1529
- ${this.helpText&&"None"!==this.helpText?O`
1464
+ ${this.helpText&&"None"!==this.helpText?P`
1530
1465
  <div class="help-text ${this.helpAlways?"help-always":null}">
1531
1466
  ${this.helpText}
1532
1467
  </div>
1533
1468
  `:null}
1534
1469
  ${t}
1535
1470
  </div>
1536
- `}}t([it({type:Boolean,attribute:"hide_label"})],ra.prototype,"hideLabel",void 0),t([it({type:Boolean,attribute:"widget_only"})],ra.prototype,"widgetOnly",void 0),t([it({type:Array,attribute:!1})],ra.prototype,"errors",void 0),t([it({type:Boolean})],ra.prototype,"hideErrors",void 0),t([it({type:String,attribute:"help_text"})],ra.prototype,"helpText",void 0),t([it({type:Boolean,attribute:"help_always"})],ra.prototype,"helpAlways",void 0),t([it({type:String})],ra.prototype,"label",void 0),t([it({type:String})],ra.prototype,"name",void 0),t([it({type:Boolean})],ra.prototype,"disabled",void 0);class sa extends X{constructor(){super(...arguments),this.color="var(--color-primary-dark)",this.size=5,this.units=5,this.direction="row"}static get styles(){return r`
1471
+ `}}t([it({type:Boolean,attribute:"hide_label"})],Er.prototype,"hideLabel",void 0),t([it({type:Boolean,attribute:"widget_only"})],Er.prototype,"widgetOnly",void 0),t([it({type:Array,attribute:!1})],Er.prototype,"errors",void 0),t([it({type:Boolean})],Er.prototype,"hideErrors",void 0),t([it({type:String,attribute:"help_text"})],Er.prototype,"helpText",void 0),t([it({type:Boolean,attribute:"help_always"})],Er.prototype,"helpAlways",void 0),t([it({type:String})],Er.prototype,"label",void 0),t([it({type:String})],Er.prototype,"name",void 0),t([it({type:Boolean})],Er.prototype,"disabled",void 0);class $r extends X{constructor(){super(...arguments),this.color="var(--color-primary-dark)",this.size=5,this.units=5,this.direction="row"}static get styles(){return s`
1537
1472
  :host {
1538
1473
  display: block;
1539
1474
  }
@@ -1561,13 +1496,13 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
1561
1496
  opacity: 0.1;
1562
1497
  }
1563
1498
  }
1564
- `}render(){const t=this.size/2;return O`
1499
+ `}render(){const t=this.size/2;return P`
1565
1500
  <div class="loading-container" style="flex-direction:${this.direction}">
1566
- ${(e=0,i=this.units,Array.from({length:i-e},((t,i)=>i+e))).map((e=>{const i={"border-radius":this.square?"0":"50%",width:this.size+"px",height:this.size+"px",margin:t+"px",animationDelay:`-${1-e*(1/this.units)}s`,background:this.color};return O`
1567
- <div class="loading-unit" style=${dt(i)}></div>
1501
+ ${(e=0,i=this.units,Array.from({length:i-e},((t,i)=>i+e))).map((e=>{const i={"border-radius":this.square?"0":"50%",width:this.size+"px",height:this.size+"px",margin:t+"px",animationDelay:`-${1-e*(1/this.units)}s`,background:this.color};return P`
1502
+ <div class="loading-unit" style=${ut(i)}></div>
1568
1503
  `}))}
1569
1504
  </div>
1570
- `;var e,i}}t([it({type:String})],sa.prototype,"color",void 0),t([it({type:Number})],sa.prototype,"size",void 0),t([it({type:Number})],sa.prototype,"units",void 0),t([it({type:Boolean})],sa.prototype,"square",void 0),t([it({type:String})],sa.prototype,"direction",void 0);const aa=[10,12,13,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,161,163,164,165,167,191,196,197,198,199,201,209,214,216,220,223,224,228,229,230,232,233,236,241,242,246,248,249,252,915,916,920,923,926,928,931,934,936,937,8364],la=[12,91,92,93,94,123,124,125,126,8364];function ca(t,e){const i=e.length;let n=0;for(;n<i;){if(t===e[n])return!0;n++}return!1}function ha(t){return ca(t.charCodeAt(0),aa)}function da(t){return t>=55296&&t<=56319}function ua(t){return t>=55296&&t<=56319}const pa=function(t,e={}){const i=e&&e.characterset;e={summary:e&&e.summary};const n=void 0===i&&function(t){for(let e=0;e<t.length;e++)if(!ha(t.charAt(e)))return!1;return!0}(t)||"GSM"===i;let o,r,s,a;n?(o=function(t,e){if(e=e||{summary:!1},""===t)return{parts:[{content:e.summary?void 0:"",length:0,bytes:0}],totalLength:0,totalBytes:0};const i=[];let n=0,o=0,r=0,s=0,a="";function l(){const t={content:e.summary?void 0:a,length:n,bytes:o};i.push(t),s+=n,n=0,r+=o,o=0,a=""}for(let i=0,r=t.length;i<r;i++){let r=t.charAt(i);ha(r)?ca(r.charCodeAt(0),la)&&(152===o&&l(),o++):(da(r.charCodeAt(0))&&i++,r=" "),o++,n++,e.summary||(a+=r),153===o&&l()}return o>0&&l(),i[1]&&r<=160?{parts:[{content:e.summary?void 0:i[0].content+i[1].content,length:s,bytes:r}],totalLength:s,totalBytes:r}:{parts:i,totalLength:s,totalBytes:r}}(t,e),r=160,s=153,a=1):(o=function(t,e){if(e=e||{summary:!1},""===t)return{parts:[{content:e.summary?void 0:"",length:0,bytes:0}],totalLength:0,totalBytes:0};const i=[];let n=0,o=0,r=0,s=0,a=0;function l(l){const c={content:e.summary?void 0:l?t.substring(a,l+1):t.substring(a),length:n,bytes:o};i.push(c),a=l+1,s+=n,n=0,r+=o,o=0}for(let e=0,i=t.length;e<i;e++)ua(t.charCodeAt(e))&&(132===o&&l(e-1),o+=2,e++),o+=2,n++,134===o&&l(e);return o>0&&l(),i[1]&&r<=140?{parts:[{content:e.summary?void 0:t,length:s,bytes:r}],totalLength:s,totalBytes:r}:{parts:i,totalLength:s,totalBytes:r}}(t,e),r=140,s=134,a=2);const l=function(t,e,i,n){return((1===t.length?e:i)-t[t.length-1].bytes)/n}(o.parts,r,s,a);return{characterSet:n?"GSM":"Unicode",parts:o.parts,bytes:o.totalBytes,length:o.totalLength,remainingInPart:l}},ma={0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,"\n":10,"\f":12,"\r":13," ":32,"!":33,'"':34,"#":35,$:36,"%":37,"&":38,"'":39,"(":40,")":41,"*":42,"+":43,",":44,"-":45,".":46,"/":47,":":58,";":59,"<":60,"=":61,">":62,"?":63,"@":64,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,"[":91,"\\":92,"]":93,"^":94,_:95,a:97,b:98,c:99,d:100,e:101,f:102,g:103,h:104,i:105,j:106,k:107,l:108,m:109,n:110,o:111,p:112,q:113,r:114,s:115,t:116,u:117,v:118,w:119,x:120,y:121,z:122,"{":123,"|":124,"}":125,"~":126,"¡":161,"£":163,"¤":164,"¥":165,"§":167,"¿":191,"Ä":196,"Å":197,"Æ":198,"Ç":199,"É":201,"Ñ":209,"Ö":214,"Ø":216,"Ü":220,"ß":223,"à":224,"ä":228,"å":229,"æ":230,"è":232,"é":233,"ì":236,"ñ":241,"ò":242,"ö":246,"ø":248,"ù":249,"ü":252,"Γ":915,"Δ":916,"Θ":920,"Λ":923,"Ξ":926,"Π":928,"Σ":931,"Φ":934,"Ψ":936,"Ω":937,"€":8364};class fa extends tt{constructor(){super(...arguments),this.extended=[]}static get styles(){return r`
1505
+ `;var e,i}}t([it({type:String})],$r.prototype,"color",void 0),t([it({type:Number})],$r.prototype,"size",void 0),t([it({type:Number})],$r.prototype,"units",void 0),t([it({type:Boolean})],$r.prototype,"square",void 0),t([it({type:String})],$r.prototype,"direction",void 0);const Lr=[10,12,13,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,161,163,164,165,167,191,196,197,198,199,201,209,214,216,220,223,224,228,229,230,232,233,236,241,242,246,248,249,252,915,916,920,923,926,928,931,934,936,937,8364],Ar=[12,91,92,93,94,123,124,125,126,8364];function Or(t,e){const i=e.length;let n=0;for(;n<i;){if(t===e[n])return!0;n++}return!1}function Mr(t){return Or(t.charCodeAt(0),Lr)}function Pr(t){return t>=55296&&t<=56319}function zr(t){return t>=55296&&t<=56319}const Ir=function(t,e={}){const i=e&&e.characterset;e={summary:e&&e.summary};const n=void 0===i&&function(t){for(let e=0;e<t.length;e++)if(!Mr(t.charAt(e)))return!1;return!0}(t)||"GSM"===i;let o,s,r,a;n?(o=function(t,e){if(e=e||{summary:!1},""===t)return{parts:[{content:e.summary?void 0:"",length:0,bytes:0}],totalLength:0,totalBytes:0};const i=[];let n=0,o=0,s=0,r=0,a="";function l(){const t={content:e.summary?void 0:a,length:n,bytes:o};i.push(t),r+=n,n=0,s+=o,o=0,a=""}for(let i=0,s=t.length;i<s;i++){let s=t.charAt(i);Mr(s)?Or(s.charCodeAt(0),Ar)&&(152===o&&l(),o++):(Pr(s.charCodeAt(0))&&i++,s=" "),o++,n++,e.summary||(a+=s),153===o&&l()}return o>0&&l(),i[1]&&s<=160?{parts:[{content:e.summary?void 0:i[0].content+i[1].content,length:r,bytes:s}],totalLength:r,totalBytes:s}:{parts:i,totalLength:r,totalBytes:s}}(t,e),s=160,r=153,a=1):(o=function(t,e){if(e=e||{summary:!1},""===t)return{parts:[{content:e.summary?void 0:"",length:0,bytes:0}],totalLength:0,totalBytes:0};const i=[];let n=0,o=0,s=0,r=0,a=0;function l(l){const c={content:e.summary?void 0:l?t.substring(a,l+1):t.substring(a),length:n,bytes:o};i.push(c),a=l+1,r+=n,n=0,s+=o,o=0}for(let e=0,i=t.length;e<i;e++)zr(t.charCodeAt(e))&&(132===o&&l(e-1),o+=2,e++),o+=2,n++,134===o&&l(e);return o>0&&l(),i[1]&&s<=140?{parts:[{content:e.summary?void 0:t,length:r,bytes:s}],totalLength:r,totalBytes:s}:{parts:i,totalLength:r,totalBytes:s}}(t,e),s=140,r=134,a=2);const l=function(t,e,i,n){return((1===t.length?e:i)-t[t.length-1].bytes)/n}(o.parts,s,r,a);return{characterSet:n?"GSM":"Unicode",parts:o.parts,bytes:o.totalBytes,length:o.totalLength,remainingInPart:l}},Dr={0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,"\n":10,"\f":12,"\r":13," ":32,"!":33,'"':34,"#":35,$:36,"%":37,"&":38,"'":39,"(":40,")":41,"*":42,"+":43,",":44,"-":45,".":46,"/":47,":":58,";":59,"<":60,"=":61,">":62,"?":63,"@":64,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,"[":91,"\\":92,"]":93,"^":94,_:95,a:97,b:98,c:99,d:100,e:101,f:102,g:103,h:104,i:105,j:106,k:107,l:108,m:109,n:110,o:111,p:112,q:113,r:114,s:115,t:116,u:117,v:118,w:119,x:120,y:121,z:122,"{":123,"|":124,"}":125,"~":126,"¡":161,"£":163,"¤":164,"¥":165,"§":167,"¿":191,"Ä":196,"Å":197,"Æ":198,"Ç":199,"É":201,"Ñ":209,"Ö":214,"Ø":216,"Ü":220,"ß":223,"à":224,"ä":228,"å":229,"æ":230,"è":232,"é":233,"ì":236,"ñ":241,"ò":242,"ö":246,"ø":248,"ù":249,"ü":252,"Γ":915,"Δ":916,"Θ":920,"Λ":923,"Ξ":926,"Π":928,"Σ":931,"Φ":934,"Ψ":936,"Ω":937,"€":8364};class Nr extends tt{constructor(){super(...arguments),this.extended=[]}static get styles(){return s`
1571
1506
  :host {
1572
1507
  overflow: auto;
1573
1508
  }
@@ -1670,28 +1605,28 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
1670
1605
  transform: scale(1);
1671
1606
  visibility: visible;
1672
1607
  }
1673
- `}updated(t){super.updated(t),t.has("text")&&this.updateSegments()}updateSegments(){const t=pa(this.text);this.count=t.length,this.segments=t.parts.length,this.extended=(t=>{const e={};for(const n of t)i=n,ma.hasOwnProperty(i)||(e[n]=!0);var i;return Object.keys(e)})(this.text),this.count=this.text.length}render(){const t=this.text&&this.text.indexOf("@")>-1;let e=O`.`;e=this.segments>1?O`and will use ${t?O`at least`:null}
1674
- <b>${this.segments} messages</b> to send over SMS.`:O`and will use ${t?O`at least`:null} one
1675
- message to send over SMS.`;let i=null;this.extended.length>0&&(this.segments>1||t)&&(i=this.extended.map((t=>O`<div class="extended-char">${t}</div>`)),i=O`
1608
+ `}updated(t){super.updated(t),t.has("text")&&this.updateSegments()}updateSegments(){const t=Ir(this.text);this.count=t.length,this.segments=t.parts.length,this.extended=(t=>{const e={};for(const n of t)i=n,Dr.hasOwnProperty(i)||(e[n]=!0);var i;return Object.keys(e)})(this.text),this.count=this.text.length}render(){const t=this.text&&this.text.indexOf("@")>-1;let e=P`.`;e=this.segments>1?P`and will use ${t?P`at least`:null}
1609
+ <b>${this.segments} messages</b> to send over SMS.`:P`and will use ${t?P`at least`:null} one
1610
+ message to send over SMS.`;let i=null;this.extended.length>0&&(this.segments>1||t)&&(i=this.extended.map((t=>P`<div class="extended-char">${t}</div>`)),i=P`
1676
1611
  <div class="extended-warning">
1677
1612
  Some characters require more space over SMS. To save on fees, consider
1678
1613
  replacing them.
1679
1614
  <div class="extended">${i}</div>
1680
1615
  </div>
1681
- `);const n=this.count>1?O` <div class="summary">
1616
+ `);const n=this.count>1?P` <div class="summary">
1682
1617
  This message is <b>${this.count} characters</b>
1683
1618
  ${e} ${i}
1684
- ${t?O`
1619
+ ${t?P`
1685
1620
  <div class="fine-print">
1686
1621
  <div class="note">NOTE</div>
1687
1622
  Using variables may result in more messages when sending
1688
1623
  over SMS than this estimate.
1689
1624
  </div>
1690
1625
  `:null}
1691
- </div>`:null;return O`<div class="counter${i?" attention":""}"><div class="counts">${this.count}${this.segments>1||t?O`<div class="segments">
1692
- &nbsp;/&nbsp;${this.segments}${t?O`+`:null}
1626
+ </div>`:null;return P`<div class="counter${i?" attention":""}"><div class="counts">${this.count}${this.segments>1||t?P`<div class="segments">
1627
+ &nbsp;/&nbsp;${this.segments}${t?P`+`:null}
1693
1628
  <div></div>
1694
- </div>`:null}</div> ${n}</div></div>`}}t([it({type:String})],fa.prototype,"text",void 0),t([it({type:Number})],fa.prototype,"count",void 0),t([it({type:Number,attribute:!1})],fa.prototype,"segments",void 0),t([it({type:Object,attribute:!1})],fa.prototype,"extended",void 0);class ga extends tt{prepareData(t){return t}refresh(){this.store.makeRequest(this.url,{prepareData:this.prepareData,force:!0})}handleStoreUpdated(t){t.detail.url===this.url&&(this.data=t.detail.data,this.fireCustomEvent(ue.Refreshed,{data:this.data}))}updated(t){super.updated(t),t.has("url")&&this.url&&this.store.makeRequest(this.url,{prepareData:this.prepareData})}connectedCallback(){super.connectedCallback(),this.store=document.querySelector("temba-store"),this.handleStoreUpdated=this.handleStoreUpdated.bind(this),this.prepareData=this.prepareData.bind(this),this.store&&this.store.addEventListener(ue.StoreUpdated,this.handleStoreUpdated)}disconnectedCallback(){super.disconnectedCallback(),this.store&&this.store.removeEventListener(ue.StoreUpdated,this.handleStoreUpdated)}}t([it({type:String})],ga.prototype,"url",void 0),t([it({type:Object,attribute:!1})],ga.prototype,"data",void 0);class va extends ga{constructor(){super(...arguments),this.endpoint="/api/v2/contacts.json?uuid="}prepareData(t){return t&&t.length>0?((t=t[0]).groups.forEach((t=>{t.is_dynamic=this.store.isDynamicGroup(t.uuid)})),t.groups.sort(((t,e)=>{if(!t.is_dynamic||!e.is_dynamic){if(t.is_dynamic)return-1;if(e.is_dynamic)return 1}return t.name.localeCompare(e.name)})),t):null}updateStoreContact(t){this.store.updateCache(`${this.endpoint}${this.contact}`,t)}updated(t){super.updated(t),t.has("contact")&&(this.contact?this.url=`${this.endpoint}${this.contact}`:this.url=null)}}t([it({type:String})],va.prototype,"contact",void 0),t([it({type:Object,attribute:!1})],va.prototype,"data",void 0),t([it({type:String})],va.prototype,"endpoint",void 0);class ya extends va{constructor(){super(),this.contactsEndpoint="/api/v2/contacts.json",this.currentChat="",this.currentNote="",this.showDetails=!0,this.toolbar=!1,this.monitor=!1,this.currentTicket=null,this.currentContact=null,this.agent="",this.refreshInterval=null,this.showDetails=ae(le.TICKET_SHOW_DETAILS)}static get styles(){return r`
1629
+ </div>`:null}</div> ${n}</div></div>`}}t([it({type:String})],Nr.prototype,"text",void 0),t([it({type:Number})],Nr.prototype,"count",void 0),t([it({type:Number,attribute:!1})],Nr.prototype,"segments",void 0),t([it({type:Object,attribute:!1})],Nr.prototype,"extended",void 0);class Rr extends tt{prepareData(t){return t}refresh(){this.store.makeRequest(this.url,{prepareData:this.prepareData,force:!0})}handleStoreUpdated(t){t.detail.url===this.url&&(this.data=t.detail.data,this.fireCustomEvent(zt.Refreshed,{data:this.data}))}updated(t){super.updated(t),t.has("url")&&this.url&&this.store.makeRequest(this.url,{prepareData:this.prepareData})}connectedCallback(){super.connectedCallback(),this.store=document.querySelector("temba-store"),this.handleStoreUpdated=this.handleStoreUpdated.bind(this),this.prepareData=this.prepareData.bind(this),this.store&&this.store.addEventListener(zt.StoreUpdated,this.handleStoreUpdated)}disconnectedCallback(){super.disconnectedCallback(),this.store&&this.store.removeEventListener(zt.StoreUpdated,this.handleStoreUpdated)}}t([it({type:String})],Rr.prototype,"url",void 0),t([it({type:Object,attribute:!1})],Rr.prototype,"data",void 0);class Br extends Rr{constructor(){super(...arguments),this.endpoint="/api/v2/contacts.json?uuid="}prepareData(t){return t&&t.length>0?((t=t[0]).groups.forEach((t=>{t.is_dynamic=this.store.isDynamicGroup(t.uuid)})),t.groups.sort(((t,e)=>{if(!t.is_dynamic||!e.is_dynamic){if(t.is_dynamic)return-1;if(e.is_dynamic)return 1}return t.name.localeCompare(e.name)})),t):null}updateStoreContact(t){this.store.updateCache(`${this.endpoint}${this.contact}`,t)}updated(t){super.updated(t),t.has("contact")&&(this.contact?this.url=`${this.endpoint}${this.contact}`:this.url=null)}}t([it({type:String})],Br.prototype,"contact",void 0),t([it({type:Object,attribute:!1})],Br.prototype,"data",void 0),t([it({type:String})],Br.prototype,"endpoint",void 0);class qr extends Br{constructor(){super(),this.contactsEndpoint="/api/v2/contacts.json",this.currentChat="",this.currentNote="",this.showDetails=!0,this.toolbar=!1,this.monitor=!1,this.currentTicket=null,this.currentContact=null,this.agent="",this.refreshInterval=null,this.showDetails=Lt(At.TICKET_SHOW_DETAILS)}static get styles(){return s`
1695
1630
  .left-pane {
1696
1631
  box-shadow: -13px 10px 7px 14px rgba(0, 0, 0, 0);
1697
1632
  transition: box-shadow 600ms linear;
@@ -1839,13 +1774,13 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
1839
1774
  --header-text: #555;
1840
1775
  --textarea-height: 5em;
1841
1776
  }
1842
- `}connectedCallback(){super.connectedCallback(),this.monitor&&(this.refreshInterval=setInterval((()=>{this.currentTicket&&this.currentTicket.closed_on||this.refresh()}),1e4))}disconnectedCallback(){this.refreshInterval&&clearInterval(this.refreshInterval)}getContactHistory(){return this.shadowRoot.querySelector("temba-contact-history")}refresh(t=!1){const e=this.getContactHistory();e&&(t&&e.scrollToBottom(),e.refresh())}updated(t){if(super.updated(t),t.has("data")||t.has("currentContact")){this.currentContact=this.data;const e=t.get("contact");if(!e||this.currentContact&&this.currentContact.ticket&&this.currentContact.ticket.uuid!==e.ticket.uuid){const t=this.shadowRoot.querySelector("temba-completion");t&&window.setTimeout((()=>{t.click()}),0)}}}handleChatChange(t){t.stopPropagation(),t.preventDefault();const e=t.currentTarget;this.currentChat=e.value}handleReopen(){const t=this.currentTicket.uuid;te("/api/v2/ticket_actions.json",{tickets:[t],action:"reopen"}).then((()=>{this.refresh(),this.fireCustomEvent(ue.ContentChanged,{ticket:{uuid:t,status:"open"}})})).catch((t=>{console.error(t)}))}handleSend(){const t={contacts:[this.currentContact.uuid],text:this.currentChat};this.currentTicket&&(t.ticket=this.currentTicket.uuid),te("/api/v2/broadcasts.json",t).then((()=>{this.currentChat="",this.refresh(!0)})).catch((t=>{console.error(t)}))}handleTicketAssigned(){this.refresh(),this.getContactHistory().checkForAgentAssignmentEvent(this.agent)}handleDetailSlider(){this.showDetails=!this.showDetails,((t,e,i)=>{if(!i){const t=document.location.pathname;i=t.substring(0,t.indexOf("/",1))}const n=new Date;n.setTime(n.getTime()+2592e6),document.cookie=`${t}=${e};expires=${n.toUTCString()};path=${i}`})(le.TICKET_SHOW_DETAILS,this.showDetails)}render(){return O`
1777
+ `}connectedCallback(){super.connectedCallback(),this.monitor&&(this.refreshInterval=setInterval((()=>{this.currentTicket&&this.currentTicket.closed_on||this.refresh()}),1e4))}disconnectedCallback(){this.refreshInterval&&clearInterval(this.refreshInterval)}getContactHistory(){return this.shadowRoot.querySelector("temba-contact-history")}refresh(t=!1){const e=this.getContactHistory();e&&(t&&e.scrollToBottom(),e.refresh())}updated(t){if(super.updated(t),t.has("data")||t.has("currentContact")){this.currentContact=this.data;const e=t.get("contact");if(!e||this.currentContact&&this.currentContact.ticket&&this.currentContact.ticket.uuid!==e.ticket.uuid){const t=this.shadowRoot.querySelector("temba-completion");t&&window.setTimeout((()=>{t.click()}),0)}}}handleChatChange(t){t.stopPropagation(),t.preventDefault();const e=t.currentTarget;this.currentChat=e.value}handleReopen(){const t=this.currentTicket.uuid;wt("/api/v2/ticket_actions.json",{tickets:[t],action:"reopen"}).then((()=>{this.refresh(),this.fireCustomEvent(zt.ContentChanged,{ticket:{uuid:t,status:"open"}})})).catch((t=>{console.error(t)}))}handleSend(){const t={contacts:[this.currentContact.uuid],text:this.currentChat};this.currentTicket&&(t.ticket=this.currentTicket.uuid),wt("/api/v2/broadcasts.json",t).then((()=>{this.currentChat="",this.refresh(!0)})).catch((t=>{console.error(t)}))}handleTicketAssigned(){this.refresh(),this.getContactHistory().checkForAgentAssignmentEvent(this.agent)}handleDetailSlider(){this.showDetails=!this.showDetails,((t,e,i)=>{if(!i){const t=document.location.pathname;i=t.substring(0,t.indexOf("/",1))}const n=new Date;n.setTime(n.getTime()+2592e6),document.cookie=`${t}=${e};expires=${n.toUTCString()};path=${i}`})(At.TICKET_SHOW_DETAILS,this.showDetails)}render(){return P`
1843
1778
  <div
1844
1779
  style="flex-grow: 1; margin-right: 0em; display:flex; flex-direction:row; min-height: 0;"
1845
1780
  class="left-pane ${this.showDetails?"open":""}"
1846
1781
  >
1847
1782
  <div class="chat-wrapper">
1848
- ${this.currentContact?O`<temba-contact-history
1783
+ ${this.currentContact?P`<temba-contact-history
1849
1784
  .uuid=${this.currentContact.uuid}
1850
1785
  .contact=${this.currentContact}
1851
1786
  .ticket=${this.currentTicket?this.currentTicket.uuid:null}
@@ -1853,13 +1788,13 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
1853
1788
  .agent=${this.agent}
1854
1789
  ></temba-contact-history>
1855
1790
 
1856
- ${this.currentTicket&&this.currentTicket.closed_on?O`<div class="closed-footer">
1791
+ ${this.currentTicket&&this.currentTicket.closed_on?P`<div class="closed-footer">
1857
1792
  <temba-button
1858
1793
  id="reopen-button"
1859
1794
  name="Reopen"
1860
1795
  @click=${this.handleReopen}
1861
1796
  ></temba-button>
1862
- </div>`:O` <div
1797
+ </div>`:P` <div
1863
1798
  class="chatbox ${this.toolbar?"full":""}"
1864
1799
  style="${"active"!==this.currentContact.status?"display:none":""}"
1865
1800
  >
@@ -1881,7 +1816,7 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
1881
1816
  </div>
1882
1817
  </div>
1883
1818
 
1884
- ${this.toolbar?O`${this.currentContact?O`<temba-contact-details
1819
+ ${this.toolbar?P`${this.currentContact?P`<temba-contact-details
1885
1820
  style="z-index: 10"
1886
1821
  class="${this.showDetails?"":"hidden"}"
1887
1822
  showGroups="true"
@@ -1891,7 +1826,7 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
1891
1826
  ></temba-contact-details>`:null}
1892
1827
 
1893
1828
  <div class="toolbar ${this.showDetails?"":"closed"}">
1894
- ${this.currentContact?O`
1829
+ ${this.currentContact?P`
1895
1830
  <temba-tip
1896
1831
  style="margin-top:5px"
1897
1832
  text="${this.showDetails?"Hide Details":"Show Details"}"
@@ -1907,7 +1842,7 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
1907
1842
  ></temba-icon>
1908
1843
  </temba-tip>
1909
1844
 
1910
- ${this.currentTicket?O`<temba-tip
1845
+ ${this.currentTicket?P`<temba-tip
1911
1846
  style="margin-top:5px"
1912
1847
  text="Assign"
1913
1848
  position="left"
@@ -1935,7 +1870,7 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
1935
1870
  </div>
1936
1871
  </div>
1937
1872
 
1938
- ${this.currentTicket?O`<temba-modax
1873
+ ${this.currentTicket?P`<temba-modax
1939
1874
  header="Add Note"
1940
1875
  id="note-dialog"
1941
1876
  @temba-submitted=${this.refresh}
@@ -1947,7 +1882,7 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
1947
1882
  @temba-submitted=${this.handleTicketAssigned}
1948
1883
  endpoint="/ticket/assign/${this.currentTicket.uuid}/"
1949
1884
  /></temba-modax>`:null}`:null}
1950
- `}}t([it({type:String,attribute:"ticket"})],ya.prototype,"ticketUUID",void 0),t([it({type:String})],ya.prototype,"contactsEndpoint",void 0),t([it({type:String})],ya.prototype,"currentChat",void 0),t([it({type:String})],ya.prototype,"currentNote",void 0),t([it({type:Boolean})],ya.prototype,"showDetails",void 0),t([it({type:Boolean})],ya.prototype,"toolbar",void 0),t([it({type:Boolean})],ya.prototype,"monitor",void 0),t([it({type:Object})],ya.prototype,"currentTicket",void 0),t([it({type:Object})],ya.prototype,"currentContact",void 0),t([it({type:String})],ya.prototype,"agent",void 0);let ba=[];const _a=(t,e,i,n,o)=>(t&&(ba.forEach((t=>{t.abort()})),ba=[]),new Promise((t=>{const r=new AbortController;ba.push(r);let s=e;n&&(s+=`&before=${n}`),o&&(s+=`&after=${o}`),i&&(s+=`&ticket=${i}`),Wt(s,r).then((e=>{ba=ba.filter((t=>e.controller===t)),t(e.json)})).catch((()=>{}))}))),xa=t=>t?t.first_name&&t.last_name?`${t.first_name} ${t.last_name}`:t.first_name?t.first_name:t.email:"Somebody";var wa;!function(t){t.MESSAGE_CREATED="msg_created",t.MESSAGE_RECEIVED="msg_received",t.BROADCAST_CREATED="broadcast_created",t.IVR_CREATED="ivr_created",t.FLOW_ENTERED="flow_entered",t.FLOW_EXITED="flow_exited",t.RUN_RESULT_CHANGED="run_result_changed",t.CONTACT_FIELD_CHANGED="contact_field_changed",t.CONTACT_GROUPS_CHANGED="contact_groups_changed",t.CONTACT_NAME_CHANGED="contact_name_changed",t.CONTACT_URNS_CHANGED="contact_urns_changed",t.CAMPAIGN_FIRED="campaign_fired",t.CHANNEL_EVENT="channel_event",t.CONTACT_LANGUAGE_CHANGED="contact_language_changed",t.WEBHOOK_CALLED="webhook_called",t.AIRTIME_TRANSFERRED="airtime_transferred",t.CALL_STARTED="call_started",t.EMAIL_SENT="email_sent",t.INPUT_LABELS_ADDED="input_labels_added",t.NOTE_CREATED="note_created",t.TICKET_ASSIGNED="ticket_assigned",t.TICKET_NOTE_ADDED="ticket_note_added",t.TICKET_CLOSED="ticket_closed",t.TICKET_OPENED="ticket_opened",t.TICKET_REOPENED="ticket_reopened",t.ERROR="error",t.FAILURE="failure"}(wa||(wa={}));const ka=(t,e)=>{if(!t)return"messages";switch(t.type){case wa.TICKET_ASSIGNED:case wa.TICKET_NOTE_ADDED:case wa.TICKET_OPENED:case wa.TICKET_CLOSED:case wa.TICKET_REOPENED:if(!e)return"verbose";if(t.ticket.uuid===e)return"tickets";break;case wa.FLOW_ENTERED:case wa.FLOW_EXITED:return"flows";case wa.BROADCAST_CREATED:case wa.MESSAGE_CREATED:case wa.MESSAGE_RECEIVED:case wa.IVR_CREATED:return"messages"}return"verbose"},Ca=(t,e="")=>{const i=t&&t.email===e;return"flow"!==t.email&&t&&t.first_name?O`<temba-tip
1885
+ `}}t([it({type:String,attribute:"ticket"})],qr.prototype,"ticketUUID",void 0),t([it({type:String})],qr.prototype,"contactsEndpoint",void 0),t([it({type:String})],qr.prototype,"currentChat",void 0),t([it({type:String})],qr.prototype,"currentNote",void 0),t([it({type:Boolean})],qr.prototype,"showDetails",void 0),t([it({type:Boolean})],qr.prototype,"toolbar",void 0),t([it({type:Boolean})],qr.prototype,"monitor",void 0),t([it({type:Object})],qr.prototype,"currentTicket",void 0),t([it({type:Object})],qr.prototype,"currentContact",void 0),t([it({type:String})],qr.prototype,"agent",void 0);let Zr=[];const Fr=(t,e,i,n,o)=>(t&&(Zr.forEach((t=>{t.abort()})),Zr=[]),new Promise((t=>{const s=new AbortController;Zr.push(s);let r=e;n&&(r+=`&before=${n}`),o&&(r+=`&after=${o}`),i&&(r+=`&ticket=${i}`),ft(r,s).then((e=>{Zr=Zr.filter((t=>e.controller===t)),t(e.json)})).catch((()=>{}))}))),Vr=t=>t?t.first_name&&t.last_name?`${t.first_name} ${t.last_name}`:t.first_name?t.first_name:t.email:"Somebody";var jr;!function(t){t.MESSAGE_CREATED="msg_created",t.MESSAGE_RECEIVED="msg_received",t.BROADCAST_CREATED="broadcast_created",t.IVR_CREATED="ivr_created",t.FLOW_ENTERED="flow_entered",t.FLOW_EXITED="flow_exited",t.RUN_RESULT_CHANGED="run_result_changed",t.CONTACT_FIELD_CHANGED="contact_field_changed",t.CONTACT_GROUPS_CHANGED="contact_groups_changed",t.CONTACT_NAME_CHANGED="contact_name_changed",t.CONTACT_URNS_CHANGED="contact_urns_changed",t.CAMPAIGN_FIRED="campaign_fired",t.CHANNEL_EVENT="channel_event",t.CONTACT_LANGUAGE_CHANGED="contact_language_changed",t.WEBHOOK_CALLED="webhook_called",t.AIRTIME_TRANSFERRED="airtime_transferred",t.CALL_STARTED="call_started",t.EMAIL_SENT="email_sent",t.INPUT_LABELS_ADDED="input_labels_added",t.NOTE_CREATED="note_created",t.TICKET_ASSIGNED="ticket_assigned",t.TICKET_NOTE_ADDED="ticket_note_added",t.TICKET_CLOSED="ticket_closed",t.TICKET_OPENED="ticket_opened",t.TICKET_REOPENED="ticket_reopened",t.ERROR="error",t.FAILURE="failure"}(jr||(jr={}));const Ur=(t,e)=>{if(!t)return"messages";switch(t.type){case jr.TICKET_ASSIGNED:case jr.TICKET_NOTE_ADDED:case jr.TICKET_OPENED:case jr.TICKET_CLOSED:case jr.TICKET_REOPENED:if(!e)return"verbose";if(t.ticket.uuid===e)return"tickets";break;case jr.FLOW_ENTERED:case jr.FLOW_EXITED:return"flows";case jr.BROADCAST_CREATED:case jr.MESSAGE_CREATED:case jr.MESSAGE_RECEIVED:case jr.IVR_CREATED:return"messages"}return"verbose"},Hr=(t,e="")=>{const i=t&&t.email===e;return"flow"!==t.email&&t&&t.first_name?P`<temba-tip
1951
1886
  text="${t.first_name+" "+t.last_name}"
1952
1887
  position="top"
1953
1888
  >
@@ -1967,44 +1902,44 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
1967
1902
  >
1968
1903
  ${t.first_name[0]+t.last_name[0]}
1969
1904
  </div>
1970
- </temba-tip>`:O`<temba-tip text="Automated message" position="top"
1905
+ </temba-tip>`:P`<temba-tip text="Automated message" position="top"
1971
1906
  ><div class="avatar flow" style="margin-top:0.5em">
1972
1907
  <temba-icon size="1" name="activity" /></div
1973
- ></temba-tip>`},Sa=(t,e)=>{const i=t.type===wa.MESSAGE_RECEIVED,n="E"===t.status,o="F"===t.status,r=[];return t.logs_url?r.push(O` <div class="icon-link">
1908
+ ></temba-tip>`},Gr=(t,e)=>{const i=t.type===jr.MESSAGE_RECEIVED,n="E"===t.status,o="F"===t.status,s=[];return t.logs_url?s.push(P` <div class="icon-link">
1974
1909
  <temba-icon
1975
1910
  onclick="goto(event)"
1976
1911
  href="${t.logs_url}"
1977
1912
  name="log"
1978
1913
  class="${n||o?"error":""}"
1979
1914
  ></temba-icon>
1980
- </div>`):n?r.push(O`<temba-icon
1915
+ </div>`):n?s.push(P`<temba-icon
1981
1916
  title="Message delivery error"
1982
1917
  name="alert-triangle"
1983
- ></temba-icon>`):o&&r.push(O`<temba-icon
1918
+ ></temba-icon>`):o&&s.push(P`<temba-icon
1984
1919
  title="Message delivery failure: ${t.failed_reason_display}"
1985
1920
  name="alert-triangle"
1986
- ></temba-icon>`),t.recipient_count>1&&r.push(O`<temba-icon size="1" name="megaphone"></temba-icon>
1921
+ ></temba-icon>`),t.recipient_count>1&&s.push(P`<temba-icon size="1" name="megaphone"></temba-icon>
1987
1922
  <div class="recipients">${t.recipient_count} contacts</div>
1988
- <div class="separator">•</div>`),r.push(O`<div class="time">${ne(new Date(t.created_on))}</div>`),O`<div style="display:flex;align-items:flex-start">
1923
+ <div class="separator">•</div>`),s.push(P`<div class="time">${Ct(new Date(t.created_on))}</div>`),P`<div style="display:flex;align-items:flex-start">
1989
1924
  <div style="display:flex;flex-direction:column">
1990
- ${t.msg.text?O`<div class="msg">${t.msg.text}</div>`:null}
1991
- ${t.msg.attachments?O`<div class="attachments">
1992
- ${t.msg.attachments.map((t=>(t=>{const e=t.indexOf(":"),i=t.substr(0,e),n=t.substr(e+1),[o,r]=i.split("/",2);let s=null;if("image"!==o){if("pdf"===r)return O`<div
1925
+ ${t.msg.text?P`<div class="msg">${t.msg.text}</div>`:null}
1926
+ ${t.msg.attachments?P`<div class="attachments">
1927
+ ${t.msg.attachments.map((t=>(t=>{const e=t.indexOf(":"),i=t.substr(0,e),n=t.substr(e+1),[o,s]=i.split("/",2);let r=null;if("image"!==o){if("pdf"===s)return P`<div
1993
1928
  style="width:100%;height:300px;border-radius:var(--curvature);box-shadow:0px 0px 12px 0px rgba(0,0,0,.1), 0px 0px 2px 0px rgba(0,0,0,.15);overflow:hidden"
1994
- ><embed src="${n}#view=Fit" type="application/pdf" frameBorder="0" scrolling="auto" height="100%" width="100%"></embed></div>`;if("video"===o)return O`<video
1929
+ ><embed src="${n}#view=Fit" type="application/pdf" frameBorder="0" scrolling="auto" height="100%" width="100%"></embed></div>`;if("video"===o)return P`<video
1995
1930
  style="border-radius:var(--curvature);box-shadow:0px 0px 12px 0px rgba(0,0,0,.1), 0px 0px 2px 0px rgba(0,0,0,.15);max-width:400px"
1996
1931
  height="auto"
1997
1932
  controls
1998
1933
  >
1999
1934
  <source src="${n}" type="video/mp4" />
2000
- </video> `;if("audio"===o)return O`<audio
1935
+ </video> `;if("audio"===o)return P`<audio
2001
1936
  style="border-radius: 99px; box-shadow:0px 0px 12px 0px rgba(0,0,0,.1), 0px 0px 2px 0px rgba(0,0,0,.15);"
2002
1937
  src="${n}"
2003
1938
  type="${i}"
2004
1939
  controls
2005
1940
  >
2006
1941
  <a target="_" href="${n}">${n}</a>
2007
- </audio>`;if("geo"===i){const[t,e]=n.split(","),i=parseFloat(t),o=parseFloat(e);return O` <iframe
1942
+ </audio>`;if("geo"===i){const[t,e]=n.split(","),i=parseFloat(t),o=parseFloat(e);return P` <iframe
2008
1943
  style="border-radius: var(--curvature);box-shadow:0px 0px 12px 0px rgba(0,0,0,.1), 0px 0px 2px 0px rgba(0,0,0,.15);"
2009
1944
  width="300"
2010
1945
  height="300"
@@ -2013,40 +1948,40 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
2013
1948
  marginheight="0"
2014
1949
  marginwidth="0"
2015
1950
  src="https://www.openstreetmap.org/export/embed.html?bbox=${o-.005}000000%2C${i-.005}%2C${o+.005}000000%2C${i+.005}000000&amp;layer=mapnik&amp;marker=${`${t}000000%2C${e}000000`}"
2016
- ></iframe>`}return O`<div style="display:flex">
1951
+ ></iframe>`}return P`<div style="display:flex">
2017
1952
  <temba-icon name="download"></temba-icon>
2018
- <div>Attachment ${r}</div>
2019
- </div>`}return s=O`<div class="linked" onclick="goto(event)" href="${n}"><img src="${n}" style="width:100%;height:auto;display:block"></img></a>`,O`<div
1953
+ <div>Attachment ${s}</div>
1954
+ </div>`}return r=P`<div class="linked" onclick="goto(event)" href="${n}"><img src="${n}" style="width:100%;height:auto;display:block"></img></a>`,P`<div
2020
1955
  style="width:100%;max-width:300px;border-radius:var(--curvature); box-shadow:0px 0px 6px 0px rgba(0,0,0,.15);overflow:hidden"
2021
1956
  >
2022
- ${s}
1957
+ ${r}
2023
1958
  </div>`})(t)))}
2024
1959
  </div> `:null}
2025
- ${t.msg.text||t.msg.attachments?null:O`<div class="unsupported">Unsupported Message</div>`}
1960
+ ${t.msg.text||t.msg.attachments?null:P`<div class="unsupported">Unsupported Message</div>`}
2026
1961
  <div
2027
1962
  class="msg-summary"
2028
1963
  style="flex-direction:row${i?"-reverse":""}"
2029
1964
  >
2030
1965
  <div style="flex-grow:1"></div>
2031
- ${r}
1966
+ ${s}
2032
1967
  </div>
2033
1968
  </div>
2034
1969
 
2035
- ${i?null:O`<div style="margin-left:0.8em;margin-top:0.3em">
2036
- ${t.msg.created_by?O`<div style="font-size:0.8em">
2037
- ${Ca(t.msg.created_by,e)}
2038
- </div>`:Ca({email:"flow"})}
1970
+ ${i?null:P`<div style="margin-left:0.8em;margin-top:0.3em">
1971
+ ${t.msg.created_by?P`<div style="font-size:0.8em">
1972
+ ${Hr(t.msg.created_by,e)}
1973
+ </div>`:Hr({email:"flow"})}
2039
1974
  </div>`}
2040
- </div>`},Ea=t=>O`
1975
+ </div>`},Wr=t=>P`
2041
1976
  <temba-icon name="tag"></temba-icon>
2042
1977
  <div class="description">
2043
1978
  Message labeled with
2044
- <div class="attn">${((t,e="and")=>se(t,(t=>t.name),e))(t.labels,"and")}</div>
1979
+ <div class="attn">${((t,e="and")=>$t(t,(t=>t.name),e))(t.labels,"and")}</div>
2045
1980
  </div>
2046
- `,Ta=t=>{let e="inbox";return t.ticket.ticketer.name.indexOf("Email")>-1?e="mail":t.ticket.ticketer.name.indexOf("Zendesk")>-1&&(e="zendesk"),e},Ma=(t,e,i)=>{const n=new Date(t.created_on),o=Ta(t);return i?O`<div class="" style="display: flex">
1981
+ `,Kr=t=>{let e="inbox";return t.ticket.ticketer.name.indexOf("Email")>-1?e="mail":t.ticket.ticketer.name.indexOf("Zendesk")>-1&&(e="zendesk"),e},Yr=(t,e,i)=>{const n=new Date(t.created_on),o=Kr(t);return i?P`<div class="" style="display: flex">
2047
1982
  <temba-icon name="${o}"></temba-icon>
2048
1983
  <div class="description">
2049
- ${xa(t.created_by)} ${e} a
1984
+ ${Vr(t.created_by)} ${e} a
2050
1985
  <span
2051
1986
  onclick="goto(event)"
2052
1987
  class="linked"
@@ -2055,16 +1990,16 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
2055
1990
  ticket
2056
1991
  </span>
2057
1992
  </div>
2058
- </div>`:O`
1993
+ </div>`:P`
2059
1994
  <div class="assigned active">
2060
1995
  <div style="text-align:center">
2061
- ${xa(t.created_by)} ${e} this ticket
1996
+ ${Vr(t.created_by)} ${e} this ticket
2062
1997
  </div>
2063
1998
  <div class="subtext" style="justify-content:center">
2064
- ${ne(n,{hideRecentText:!0,suffix:" ago"})}
1999
+ ${Ct(n,{hideRecentText:!0,suffix:" ago"})}
2065
2000
  </div>
2066
2001
  </div>
2067
- `},$a=(t,e,i)=>{const n=Ta(t);return i?O`<div class="" style="display: flex">
2002
+ `},Jr=(t,e,i)=>{const n=Kr(t);return i?P`<div class="" style="display: flex">
2068
2003
  <temba-icon name="${n}"></temba-icon>
2069
2004
  <div class="description">
2070
2005
  ${t.ticket.topic.name}
@@ -2076,7 +2011,7 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
2076
2011
  >
2077
2012
  was opened
2078
2013
  </div>
2079
- </div>`:O`
2014
+ </div>`:P`
2080
2015
  <temba-icon size="1.5" name="${n}"></temba-icon>
2081
2016
 
2082
2017
  <div class="active" style="flex-grow:1;">
@@ -2084,9 +2019,9 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
2084
2019
  <div class="attn">
2085
2020
  ${t.ticket.topic?t.ticket.topic.name:"General"}
2086
2021
  </div>
2087
- <div class="subtext">${ne(new Date(t.created_on))}</div>
2022
+ <div class="subtext">${Ct(new Date(t.created_on))}</div>
2088
2023
  </div>
2089
- ${e?O`
2024
+ ${e?P`
2090
2025
  <temba-tip text="Resolve" position="left" style="width:1.5em">
2091
2026
  <temba-icon
2092
2027
  class="clickable"
@@ -2097,8 +2032,8 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
2097
2032
  />
2098
2033
  </temba-tip>
2099
2034
  `:null}
2100
- `},Da=function(t){const e=t.target,i=this.host.getEventsPane();"IMG"==e.tagName&&(this.host.showMessageAlert||i.scrollTop>e.offsetTop-1e3&&e.offsetTop>i.scrollHeight-500&&this.host.scrollToBottom())};class Aa extends tt{constructor(){super(),this.getStickyId=t=>{if(t.type===wa.TICKET_OPENED){const e=this.getTicketForEvent(t);if(e&&"open"===e.status)return e.uuid}},this.eventGroups=[],this.refreshing=!1,this.fetching=!1,this.complete=!1,this.debug=!1,this.showMessageAlert=!1,this.ticket=null,this.endDate=null,this.tickets=null,this.ticketEvents={},this.lastHeight=0,this.refreshTimeout=null,this.empty=!1}connectedCallback(){super.connectedCallback(),this.shadowRoot.addEventListener("load",Da,!0)}disconnectedCallback(){super.disconnectedCallback(),this.shadowRoot.removeEventListener("load",Da,!0)}getTicketForEvent(t){return this.getTicket(t.ticket.uuid)}getTicket(t){return(this.tickets||[]).find((e=>e.uuid===t))}static get styles(){return r`
2101
- ${r`
2035
+ `},Xr=function(t){const e=t.target,i=this.host.getEventsPane();"IMG"==e.tagName&&(this.host.showMessageAlert||i.scrollTop>e.offsetTop-1e3&&e.offsetTop>i.scrollHeight-500&&this.host.scrollToBottom())};class Qr extends tt{constructor(){super(),this.getStickyId=t=>{if(t.type===jr.TICKET_OPENED){const e=this.getTicketForEvent(t);if(e&&"open"===e.status)return e.uuid}},this.eventGroups=[],this.refreshing=!1,this.fetching=!1,this.complete=!1,this.debug=!1,this.showMessageAlert=!1,this.ticket=null,this.endDate=null,this.tickets=null,this.ticketEvents={},this.lastHeight=0,this.refreshTimeout=null,this.empty=!1}connectedCallback(){super.connectedCallback(),this.shadowRoot.addEventListener("load",Xr,!0)}disconnectedCallback(){super.disconnectedCallback(),this.shadowRoot.removeEventListener("load",Xr,!0)}getTicketForEvent(t){return this.getTicket(t.ticket.uuid)}getTicket(t){return(this.tickets||[]).find((e=>e.uuid===t))}static get styles(){return s`
2036
+ ${s`
2102
2037
  .grouping {
2103
2038
  margin-top: 1em;
2104
2039
  }
@@ -2645,7 +2580,7 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
2645
2580
  .sticky-bin .attn {
2646
2581
  color: var(--color-text);
2647
2582
  }
2648
- `}firstUpdated(t){super.firstUpdated(t),this.handleClose=this.handleClose.bind(this)}updated(t){if(super.updated(t),t.has("mostRecentEvent")&&this.fireCustomEvent(ue.Refreshed),t.has("endDate")&&this.refreshTimeout&&this.endDate&&window.clearTimeout(this.refreshTimeout),t.has("uuid"))if(null==this.uuid)this.reset();else{const t=`/contact/history/${this.uuid}/?_format=json`;if(this.endpoint!==t){if(this.reset(),this.endDate){const t=new Date(this.endDate);this.nextBefore=1e3*t.getTime()+1e3}this.endpoint=t,this.refreshTickets()}}if(t.has("ticket")&&(this.endpoint=null,this.requestUpdate("uuid")),t.has("refreshing")&&this.refreshing&&this.endpoint&&!this.endDate){const t=1e3*(this.getLastEventTime()-1);let e=!1;_a(!1,this.endpoint,this.ticket,null,t).then((t=>{t.events&&t.events.length>0&&this.updateMostRecent(t.events[0]),t.events.forEach((t=>{if(t.type===wa.TICKET_OPENED){const e=t;this.ticketEvents[e.ticket.uuid]=e}}));let i=t.events.reverse();i=i.filter((t=>{const e=!!this.eventGroups.find((e=>!!e.events.find((e=>e.created_on===t.created_on&&e.type===t.type))));return!e})),this.lastRefreshAdded=i.length;const n=[...this.eventGroups];if(this.eventGroups.length>0){const t=n.splice(n.length-1,1)[0];e=t.open,i.splice(0,0,...t.events)}const o=this.getEventGroups(i);o.length&&(e&&(o[o.length-1].open=e),this.eventGroups=[...n,...o]),this.refreshing=!1,this.scheduleRefresh()})).catch((()=>{this.refreshing=!1,this.scheduleRefresh()}))}if(t.has("fetching")&&this.fetching&&(this.nextBefore||(this.nextBefore=1e3*(new Date).getTime()-1e3),this.httpComplete=_a(this.empty,this.endpoint,this.ticket,this.nextBefore,this.nextAfter).then((t=>{t.events&&t.events.length>0&&(this.updateMostRecent(t.events[0]),t.events.forEach((t=>{if(t.type===wa.TICKET_OPENED){const e=t;this.ticketEvents[e.ticket.uuid]=e}})));let e=!1;const i=t.events.reverse();if(this.eventGroups.length>0){const t=this.eventGroups.splice(0,1)[0];e=t.open,i.push(...t.events)}const n=this.getEventGroups(i);n.length&&(e&&(n[n.length-1].open=e),this.eventGroups=[...n,...this.eventGroups]),t.next_before===this.nextBefore&&(this.complete=!0),this.nextBefore=t.next_before,this.nextAfter=t.next_after,this.fetching=!1,this.empty=!1}))),t.has("refreshing")&&!this.refreshing&&this.lastRefreshAdded>0){const t=this.getEventsPane();if(this.lastHeight>0){const e=t.scrollHeight-this.lastHeight;t.scrollHeight-t.scrollTop-e-t.clientHeight<500?this.scrollToBottom():this.showMessageAlert=!0}this.eventGroups.length>0&&(this.lastHeight=t.scrollHeight)}if(t.has("fetching")&&!this.fetching&&void 0!==t.get("fetching")){const t=this.getEventsPane();if(this.lastHeight&&t.scrollHeight>this.lastHeight){const e=t.scrollTop+t.scrollHeight-this.lastHeight;t.scrollTop=e}this.lastHeight||this.scrollToBottom(),this.eventGroups.length>0&&(this.lastHeight=t.scrollHeight)}if(t.has("endpoint")&&this.endpoint&&(this.fetching=!0,this.empty=!0),t.has("tickets")){const t=this.getDiv(".sticky-bin"),e=(this.tickets||[]).filter((t=>t&&"closed"===t.status));for(const i of e){const e=t.querySelector(`[data-sticky-id="${i.uuid}"]`);e&&t.removeChild(e)}}}refreshTickets(){if(this.ticket){let t=`/api/v2/tickets.json?contact=${this.uuid}`;this.ticket&&(t=`${t}&ticket=${this.ticket}`),Xt(t).then((t=>{this.tickets=t.reverse()}))}}getEventsPane(){return this.getDiv(".events")}scrollToBottom(t=!1){const e=this.getEventsPane();e.scrollTo({top:e.scrollHeight,behavior:t?"smooth":"auto"}),this.showMessageAlert=!1,window.setTimeout((()=>{e.scrollTo({top:e.scrollHeight,behavior:t?"smooth":"auto"})}),0)}refresh(){this.scheduleRefresh(500)}getEventGroups(t){const e=[];let i;for(const n of t){const t=ka(n,this.ticket);i&&i.type===t?i.events.push(n):(i&&e.push(i),i={open:!1,events:[n],type:t})}return i&&i.events.length>0&&e.push(i),e}scheduleRefresh(t=-1){if(this.endDate)return;let e=t;if(-1===t){const t=this.getLastEventTime();e=Math.max(Math.min(((new Date).getTime()-t)/2,1e4),500)}t>-1&&this.refreshTimeout&&window.clearTimeout(this.refreshTimeout),this.refreshTimeout=window.setTimeout((()=>{this.refreshing?(this.scheduleRefresh(),this.refreshing=!1):this.refreshing=!0}),e)}reset(){const t=this.getDiv(".sticky-bin");if(t)for(;t.childElementCount>0;)t.removeChild(t.firstElementChild);this.endpoint=null,this.tickets=null,this.ticketEvents={},this.eventGroups=[],this.fetching=!1,this.complete=!1,this.nextBefore=null,this.nextAfter=null,this.lastHeight=0}handleEventGroupShow(t){const e=t.currentTarget,i=parseInt(e.getAttribute("data-group-index"));this.eventGroups[this.eventGroups.length-i-1].open=!0,this.requestUpdate("eventGroups")}handleEventGroupHide(t){t.preventDefault(),t.stopPropagation();const e=t.currentTarget,i=parseInt(e.getAttribute("data-group-index"));this.eventGroups[this.eventGroups.length-i-1].open=!1,this.requestUpdate("eventGroups")}handleScroll(){const t=this.getEventsPane(),e=this.getEventsPane().querySelectorAll(".sticky"),i=this.getDiv(".sticky-bin");e.forEach((e=>{const n=t.scrollTop+i.clientHeight+136;if(e.classList.contains("pinned")){const t=e.eventElement;n<e.offsetTop+e.offsetHeight&&(e.appendChild(t),e.classList.remove("pinned"))}else{const t=e.firstElementChild;n>e.offsetTop&&(e.style.height=t.clientHeight+"px",e.classList.add("pinned"),e.eventElement=t,i.appendChild(t))}})),t.scrollTop<=100&&this.eventGroups.length>0&&!this.fetching&&!this.complete&&(this.fetching=!0)}updateMostRecent(t){this.mostRecentEvent&&this.mostRecentEvent.type===t.type&&this.mostRecentEvent.created_on===t.created_on||(this.mostRecentEvent=t)}getLastEventTime(){const t=this.eventGroups[this.eventGroups.length-1];if(t){const e=t.events[t.events.length-1];return new Date(e.created_on).getTime()}return 0}renderEvent(t){switch(t.type){case wa.IVR_CREATED:case wa.MESSAGE_CREATED:case wa.MESSAGE_RECEIVED:case wa.BROADCAST_CREATED:return Sa(t,this.agent);case wa.FLOW_ENTERED:case wa.FLOW_EXITED:return(t=>{let e="Interrupted",i="x-octagon";return"I"!==t.status&&(t.type===wa.FLOW_ENTERED?(e="Started",i="flow"):(e="Completed",i="flow")),O`
2583
+ `}firstUpdated(t){super.firstUpdated(t),this.handleClose=this.handleClose.bind(this)}updated(t){if(super.updated(t),t.has("mostRecentEvent")&&this.fireCustomEvent(zt.Refreshed),t.has("endDate")&&this.refreshTimeout&&this.endDate&&window.clearTimeout(this.refreshTimeout),t.has("uuid"))if(null==this.uuid)this.reset();else{const t=`/contact/history/${this.uuid}/?_format=json`;if(this.endpoint!==t){if(this.reset(),this.endDate){const t=new Date(this.endDate);this.nextBefore=1e3*t.getTime()+1e3}this.endpoint=t,this.refreshTickets()}}if(t.has("ticket")&&(this.endpoint=null,this.requestUpdate("uuid")),t.has("refreshing")&&this.refreshing&&this.endpoint&&!this.endDate){const t=1e3*(this.getLastEventTime()-1);let e=!1;Fr(!1,this.endpoint,this.ticket,null,t).then((t=>{t.events&&t.events.length>0&&this.updateMostRecent(t.events[0]),t.events.forEach((t=>{if(t.type===jr.TICKET_OPENED){const e=t;this.ticketEvents[e.ticket.uuid]=e}}));let i=t.events.reverse();i=i.filter((t=>{const e=!!this.eventGroups.find((e=>!!e.events.find((e=>e.created_on===t.created_on&&e.type===t.type))));return!e})),this.lastRefreshAdded=i.length;const n=[...this.eventGroups];if(this.eventGroups.length>0){const t=n.splice(n.length-1,1)[0];e=t.open,i.splice(0,0,...t.events)}const o=this.getEventGroups(i);o.length&&(e&&(o[o.length-1].open=e),this.eventGroups=[...n,...o]),this.refreshing=!1,this.scheduleRefresh()})).catch((()=>{this.refreshing=!1,this.scheduleRefresh()}))}if(t.has("fetching")&&this.fetching&&(this.nextBefore||(this.nextBefore=1e3*(new Date).getTime()-1e3),this.httpComplete=Fr(this.empty,this.endpoint,this.ticket,this.nextBefore,this.nextAfter).then((t=>{t.events&&t.events.length>0&&(this.updateMostRecent(t.events[0]),t.events.forEach((t=>{if(t.type===jr.TICKET_OPENED){const e=t;this.ticketEvents[e.ticket.uuid]=e}})));let e=!1;const i=t.events.reverse();if(this.eventGroups.length>0){const t=this.eventGroups.splice(0,1)[0];e=t.open,i.push(...t.events)}const n=this.getEventGroups(i);n.length&&(e&&(n[n.length-1].open=e),this.eventGroups=[...n,...this.eventGroups]),t.next_before===this.nextBefore&&(this.complete=!0),this.nextBefore=t.next_before,this.nextAfter=t.next_after,this.fetching=!1,this.empty=!1}))),t.has("refreshing")&&!this.refreshing&&this.lastRefreshAdded>0){const t=this.getEventsPane();if(this.lastHeight>0){const e=t.scrollHeight-this.lastHeight;t.scrollHeight-t.scrollTop-e-t.clientHeight<500?this.scrollToBottom():this.showMessageAlert=!0}this.eventGroups.length>0&&(this.lastHeight=t.scrollHeight)}if(t.has("fetching")&&!this.fetching&&void 0!==t.get("fetching")){const t=this.getEventsPane();if(this.lastHeight&&t.scrollHeight>this.lastHeight){const e=t.scrollTop+t.scrollHeight-this.lastHeight;t.scrollTop=e}this.lastHeight||this.scrollToBottom(),this.eventGroups.length>0&&(this.lastHeight=t.scrollHeight)}if(t.has("endpoint")&&this.endpoint&&(this.fetching=!0,this.empty=!0),t.has("tickets")){const t=this.getDiv(".sticky-bin"),e=(this.tickets||[]).filter((t=>t&&"closed"===t.status));for(const i of e){const e=t.querySelector(`[data-sticky-id="${i.uuid}"]`);e&&t.removeChild(e)}}}refreshTickets(){if(this.ticket){let t=`/api/v2/tickets.json?contact=${this.uuid}`;this.ticket&&(t=`${t}&ticket=${this.ticket}`),_t(t).then((t=>{this.tickets=t.reverse()}))}}getEventsPane(){return this.getDiv(".events")}scrollToBottom(t=!1){const e=this.getEventsPane();e.scrollTo({top:e.scrollHeight,behavior:t?"smooth":"auto"}),this.showMessageAlert=!1,window.setTimeout((()=>{e.scrollTo({top:e.scrollHeight,behavior:t?"smooth":"auto"})}),0)}refresh(){this.scheduleRefresh(500)}getEventGroups(t){const e=[];let i;for(const n of t){const t=Ur(n,this.ticket);i&&i.type===t?i.events.push(n):(i&&e.push(i),i={open:!1,events:[n],type:t})}return i&&i.events.length>0&&e.push(i),e}scheduleRefresh(t=-1){if(this.endDate)return;let e=t;if(-1===t){const t=this.getLastEventTime();e=Math.max(Math.min(((new Date).getTime()-t)/2,1e4),500)}t>-1&&this.refreshTimeout&&window.clearTimeout(this.refreshTimeout),this.refreshTimeout=window.setTimeout((()=>{this.refreshing?(this.scheduleRefresh(),this.refreshing=!1):this.refreshing=!0}),e)}reset(){const t=this.getDiv(".sticky-bin");if(t)for(;t.childElementCount>0;)t.removeChild(t.firstElementChild);this.endpoint=null,this.tickets=null,this.ticketEvents={},this.eventGroups=[],this.fetching=!1,this.complete=!1,this.nextBefore=null,this.nextAfter=null,this.lastHeight=0}handleEventGroupShow(t){const e=t.currentTarget,i=parseInt(e.getAttribute("data-group-index"));this.eventGroups[this.eventGroups.length-i-1].open=!0,this.requestUpdate("eventGroups")}handleEventGroupHide(t){t.preventDefault(),t.stopPropagation();const e=t.currentTarget,i=parseInt(e.getAttribute("data-group-index"));this.eventGroups[this.eventGroups.length-i-1].open=!1,this.requestUpdate("eventGroups")}handleScroll(){const t=this.getEventsPane(),e=this.getEventsPane().querySelectorAll(".sticky"),i=this.getDiv(".sticky-bin");e.forEach((e=>{const n=t.scrollTop+i.clientHeight+136;if(e.classList.contains("pinned")){const t=e.eventElement;n<e.offsetTop+e.offsetHeight&&(e.appendChild(t),e.classList.remove("pinned"))}else{const t=e.firstElementChild;n>e.offsetTop&&(e.style.height=t.clientHeight+"px",e.classList.add("pinned"),e.eventElement=t,i.appendChild(t))}})),t.scrollTop<=100&&this.eventGroups.length>0&&!this.fetching&&!this.complete&&(this.fetching=!0)}updateMostRecent(t){this.mostRecentEvent&&this.mostRecentEvent.type===t.type&&this.mostRecentEvent.created_on===t.created_on||(this.mostRecentEvent=t)}getLastEventTime(){const t=this.eventGroups[this.eventGroups.length-1];if(t){const e=t.events[t.events.length-1];return new Date(e.created_on).getTime()}return 0}renderEvent(t){switch(t.type){case jr.IVR_CREATED:case jr.MESSAGE_CREATED:case jr.MESSAGE_RECEIVED:case jr.BROADCAST_CREATED:return Gr(t,this.agent);case jr.FLOW_ENTERED:case jr.FLOW_EXITED:return(t=>{let e="Interrupted",i="x-octagon";return"I"!==t.status&&(t.type===jr.FLOW_ENTERED?(e="Started",i="flow"):(e="Completed",i="flow")),P`
2649
2584
  <temba-icon name="${i}"></temba-icon>
2650
2585
  <div class="description">
2651
2586
  ${e}
@@ -2657,26 +2592,26 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
2657
2592
  ${t.flow.name}
2658
2593
  </span>
2659
2594
  </div>
2660
- `})(t);case wa.RUN_RESULT_CHANGED:return(t=>t.name.startsWith("_")?null:O`
2595
+ `})(t);case jr.RUN_RESULT_CHANGED:return(t=>t.name.startsWith("_")?null:P`
2661
2596
  <temba-icon name="flow"></temba-icon>
2662
2597
  <div class="description">
2663
2598
  Updated
2664
2599
  <div class="attn">${t.name}</div>
2665
2600
  to
2666
2601
  <div class="attn">${t.value}</div>
2667
- ${t.category?O`with category
2602
+ ${t.category?P`with category
2668
2603
  <div class="attn">${t.category}</div>`:null}
2669
2604
  </div>
2670
- `)(t);case wa.CONTACT_FIELD_CHANGED:return(t=>O`
2605
+ `)(t);case jr.CONTACT_FIELD_CHANGED:return(t=>P`
2671
2606
  <temba-icon name="contact"></temba-icon>
2672
2607
  <div class="description">
2673
- ${t.value?O`Updated
2608
+ ${t.value?P`Updated
2674
2609
  <div class="attn">${t.field.name}</div>
2675
2610
  to
2676
- <div class="attn">${t.value.text}</div>`:O`Cleared
2611
+ <div class="attn">${t.value.text}</div>`:P`Cleared
2677
2612
  <div class="attn">${t.field.name}</div>`}
2678
2613
  </div>
2679
- `)(t);case wa.CONTACT_NAME_CHANGED:return(t=>O`
2614
+ `)(t);case jr.CONTACT_NAME_CHANGED:return(t=>P`
2680
2615
  <temba-icon name="contact"></temba-icon>
2681
2616
  <div class="description">
2682
2617
  Updated
@@ -2684,89 +2619,89 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
2684
2619
  to
2685
2620
  <div class="attn">${t.name}</div>
2686
2621
  </div>
2687
- `)(t);case wa.CONTACT_URNS_CHANGED:return(t=>O`
2622
+ `)(t);case jr.CONTACT_URNS_CHANGED:return(t=>P`
2688
2623
  <temba-icon name="contact"></temba-icon>
2689
2624
  <div class="description">
2690
2625
  Updated
2691
2626
  <div class="attn">URNs</div>
2692
2627
  to
2693
- ${se(t.urns,(t=>O`<div class="attn">${t.split(":")[1].split("?")[0]}</div>`))}
2628
+ ${$t(t.urns,(t=>P`<div class="attn">${t.split(":")[1].split("?")[0]}</div>`))}
2694
2629
  </div>
2695
2630
  </div>
2696
- `)(t);case wa.EMAIL_SENT:return(t=>O`
2631
+ `)(t);case jr.EMAIL_SENT:return(t=>P`
2697
2632
  <temba-icon name="mail"></temba-icon>
2698
2633
  <div class="description">
2699
2634
  Email sent to
2700
- <div class="attn">${re(t.to,"and")}</div>
2635
+ <div class="attn">${Et(t.to,"and")}</div>
2701
2636
  with subject
2702
2637
  <div class="attn">${t.subject}</div>
2703
2638
  </div>
2704
- `)(t);case wa.INPUT_LABELS_ADDED:return Ea(t);case wa.TICKET_OPENED:{const e=t,i=!this.ticket||e.ticket.uuid===this.ticket;let n=null;const o=this.getTicketForEvent(e);return i&&o&&"open"===o.status&&(n=this.handleClose),$a(e,n,!this.ticket)}case wa.TICKET_NOTE_ADDED:return((t,e)=>O`<div style="display:flex;align-items:flex-start">
2639
+ `)(t);case jr.INPUT_LABELS_ADDED:return Wr(t);case jr.TICKET_OPENED:{const e=t,i=!this.ticket||e.ticket.uuid===this.ticket;let n=null;const o=this.getTicketForEvent(e);return i&&o&&"open"===o.status&&(n=this.handleClose),Jr(e,n,!this.ticket)}case jr.TICKET_NOTE_ADDED:return((t,e)=>P`<div style="display:flex;align-items:flex-start">
2705
2640
  <div style="display:flex;flex-direction:column">
2706
2641
  <div class="description">${t.note}</div>
2707
2642
  <div class="note-summary">
2708
2643
  <div style="flex-grow:1"></div>
2709
- <div class="time">${ne(new Date(t.created_on))}</div>
2644
+ <div class="time">${Ct(new Date(t.created_on))}</div>
2710
2645
  </div>
2711
2646
  </div>
2712
2647
  <div style="margin-left:0.8em;margin-top:0.3em;font-size:0.8em">
2713
- ${Ca(t.created_by,e)}
2648
+ ${Hr(t.created_by,e)}
2714
2649
  </div>
2715
- </div>`)(t,this.agent);case wa.TICKET_ASSIGNED:return(t=>{const e=new Date(t.created_on);return O`
2650
+ </div>`)(t,this.agent);case jr.TICKET_ASSIGNED:return(t=>{const e=new Date(t.created_on);return P`
2716
2651
  <div class="assigned active">
2717
2652
  <div style="text-align:center">
2718
- ${t.assignee?t.assignee.id===t.created_by.id?O`${xa(t.created_by)} took this ticket`:O`${xa(t.created_by)} assigned this ticket to
2719
- <div class="attn">${xa(t.assignee)}</div>`:O`${xa(t.created_by)} unassigned this ticket`}
2653
+ ${t.assignee?t.assignee.id===t.created_by.id?P`${Vr(t.created_by)} took this ticket`:P`${Vr(t.created_by)} assigned this ticket to
2654
+ <div class="attn">${Vr(t.assignee)}</div>`:P`${Vr(t.created_by)} unassigned this ticket`}
2720
2655
  </div>
2721
2656
  <div class="subtext" style="justify-content:center">
2722
- ${ne(e,{hideRecentText:!0,suffix:" ago"})}
2657
+ ${Ct(e,{hideRecentText:!0,suffix:" ago"})}
2723
2658
  </div>
2724
2659
  </div>
2725
- `})(t);case wa.TICKET_REOPENED:return Ma(t,"reopened",!this.ticket);case wa.TICKET_CLOSED:return Ma(t,"closed",!this.ticket);case wa.ERROR:case wa.FAILURE:return(t=>O`
2660
+ `})(t);case jr.TICKET_REOPENED:return Yr(t,"reopened",!this.ticket);case jr.TICKET_CLOSED:return Yr(t,"closed",!this.ticket);case jr.ERROR:case jr.FAILURE:return(t=>P`
2726
2661
  <temba-icon
2727
2662
  name="alert-triangle"
2728
2663
  style="fill:var(--color-error)"
2729
2664
  ></temba-icon>
2730
2665
  <div class="description">
2731
2666
  ${t.text}
2732
- ${t.type===wa.FAILURE?O`<div>Run ended prematurely, check the flow design.</div>`:null}
2667
+ ${t.type===jr.FAILURE?P`<div>Run ended prematurely, check the flow design.</div>`:null}
2733
2668
  </div>
2734
- `)(t);case wa.CONTACT_GROUPS_CHANGED:return(t=>{const e=t.groups_added||t.groups_removed,i=!!t.groups_added;return O`
2669
+ `)(t);case jr.CONTACT_GROUPS_CHANGED:return(t=>{const e=t.groups_added||t.groups_removed,i=!!t.groups_added;return P`
2735
2670
  <temba-icon
2736
2671
  name="users"
2737
- class="${Gt({added:i,removed:!i})}"
2672
+ class="${gt({added:i,removed:!i})}"
2738
2673
  ></temba-icon>
2739
2674
  <div class="description">
2740
2675
  ${i?"Added to":"Removed from"}
2741
- ${se(e,(t=>O`<span
2676
+ ${$t(e,(t=>P`<span
2742
2677
  class="linked"
2743
2678
  onclick="goto(event)"
2744
2679
  href="/contact/filter/${t.uuid}"
2745
2680
  >${t.name}</span
2746
2681
  >`))}
2747
- ${t.type===wa.FAILURE?O`<div>Run ended prematurely, check the flow design.</div>`:null}
2682
+ ${t.type===jr.FAILURE?P`<div>Run ended prematurely, check the flow design.</div>`:null}
2748
2683
  </div>
2749
- `})(t);case wa.WEBHOOK_CALLED:return(t=>O`
2684
+ `})(t);case jr.WEBHOOK_CALLED:return(t=>P`
2750
2685
  <div
2751
2686
  class="${"success"===t.status?"":"failed"}"
2752
2687
  style="display: flex"
2753
2688
  >
2754
2689
  <temba-icon name="external-link"></temba-icon>
2755
2690
  <div class="description">
2756
- ${"success"===t.status?O`Successfully called ${t.url}`:O`Failed to call ${t.url}`}
2691
+ ${"success"===t.status?P`Successfully called ${t.url}`:P`Failed to call ${t.url}`}
2757
2692
  </div>
2758
2693
  </div>
2759
- `)(t);case wa.AIRTIME_TRANSFERRED:return(t=>0===parseFloat(t.actual_amount)?O`<temba-icon
2694
+ `)(t);case jr.AIRTIME_TRANSFERRED:return(t=>0===parseFloat(t.actual_amount)?P`<temba-icon
2760
2695
  name="alert-triangle"
2761
2696
  style="fill:var(--color-error)"
2762
2697
  ></temba-icon>
2763
- <div class="description error">Airtime transfer failed</div>`:O`<temba-icon name="dollar-sign"></temba-icon>
2698
+ <div class="description error">Airtime transfer failed</div>`:P`<temba-icon name="dollar-sign"></temba-icon>
2764
2699
  <div class="description">
2765
2700
  Transferred
2766
2701
  <div class="attn">${t.actual_amount} ${t.currency}</div>
2767
2702
  of airtime
2768
- </div>`)(t);case wa.CALL_STARTED:return O`<temba-icon name="phone"></temba-icon>
2769
- <div class="description">Call Started</div>`;case wa.CAMPAIGN_FIRED:return(t=>O`<temba-icon name="campaign"></temba-icon>
2703
+ </div>`)(t);case jr.CALL_STARTED:return P`<temba-icon name="phone"></temba-icon>
2704
+ <div class="description">Call Started</div>`;case jr.CAMPAIGN_FIRED:return(t=>P`<temba-icon name="campaign"></temba-icon>
2770
2705
  <div class="description">
2771
2706
  Campaign
2772
2707
  <span
@@ -2784,11 +2719,11 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
2784
2719
  ${t.campaign_event.offset_display}
2785
2720
  ${t.campaign_event.relative_to.name}</span
2786
2721
  >
2787
- </div>`)(t);case wa.CHANNEL_EVENT:return(t=>{let e="",i="phone";return"mt_miss"===t.channel_event_type?(e="Missed outgoing call",i="phone-missed"):"mo_miss"===t.channel_event_type?(e="Missed incoming call",i="phone-missed"):"new_conversation"===t.channel_event_type?(e="Started Conversation",i="zap"):"welcome_message"===t.channel_event_type?(e="Welcome Message Sent",i="zap"):"referral"===t.channel_event_type?(e="Referred",i="zap"):"follow"===t.channel_event_type?(e="Followed",i="zap"):"stop_contact"===t.channel_event_type?(e="Stopped",i="x-octagon"):"mt_call"===t.channel_event_type?e="Outgoing Phone Call":"mo_call"==t.channel_event_type&&(e="Incoming Phone call"),O`<temba-icon name="${i}"></temba-icon>
2788
- <div class="description">${e}</div>`})(t);case wa.CONTACT_LANGUAGE_CHANGED:return(t=>O`<temba-icon name="contact"></temba-icon>
2722
+ </div>`)(t);case jr.CHANNEL_EVENT:return(t=>{let e="",i="phone";return"mt_miss"===t.channel_event_type?(e="Missed outgoing call",i="phone-missed"):"mo_miss"===t.channel_event_type?(e="Missed incoming call",i="phone-missed"):"new_conversation"===t.channel_event_type?(e="Started Conversation",i="zap"):"welcome_message"===t.channel_event_type?(e="Welcome Message Sent",i="zap"):"referral"===t.channel_event_type?(e="Referred",i="zap"):"follow"===t.channel_event_type?(e="Followed",i="zap"):"stop_contact"===t.channel_event_type?(e="Stopped",i="x-octagon"):"mt_call"===t.channel_event_type?e="Outgoing Phone Call":"mo_call"==t.channel_event_type&&(e="Incoming Phone call"),P`<temba-icon name="${i}"></temba-icon>
2723
+ <div class="description">${e}</div>`})(t);case jr.CONTACT_LANGUAGE_CHANGED:return(t=>P`<temba-icon name="contact"></temba-icon>
2789
2724
  <div class="description">
2790
2725
  Language updated to <span class="attn">${t.language}</span>
2791
- </div>`)(t)}return O`<temba-icon name="alert-triangle" style="fill:var(--color-error)"></temba-icon> <div class="description">${t.type}</div>`}handleClose(t){this.httpComplete=te("/api/v2/ticket_actions.json",{tickets:[t],action:"close"}).then((()=>{this.refreshTickets(),this.refresh(),this.fireCustomEvent(ue.ContentChanged,{ticket:{uuid:t,status:"closed"}})})).catch((t=>{console.error(t)}))}checkForAgentAssignmentEvent(t){this.httpComplete=Xt(`/api/v2/tickets.json?uuid=${this.ticket}`).then((e=>{if(1===e.length){const i=e[0];i.assignee&&i.assignee.email===t?this.fireCustomEvent(ue.ContentChanged,{ticket:{uuid:this.ticket,assigned:"self"}}):this.fireCustomEvent(ue.ContentChanged,{ticket:{uuid:this.ticket,assigned:i.assignee?i.assignee:null}})}}))}getEventHandlers(){return[{event:"scroll",method:oe(this.handleScroll,50)}]}isPurged(t){return!this.ticketEvents[t.uuid]}renderEventContainer(t){const e=this.getStickyId(t),i=!!e,n=O` <div class="${this.ticket?"active-ticket":""} event ${t.type} ${i?"has-sticky":""}" data-sticky-id="${e}"> ${this.renderEvent(t)} </div> ${this.debug?O`<pre>${JSON.stringify(t,null,2)}</pre>`:null} `;return e?O`<div class="sticky">${n}</div>`:n}render(){const t=this.eventGroups.length>0&&this.tickets?this.tickets.map((t=>{if(t&&"open"===t.status){if(1e3*new Date(t.opened_on).getTime()<this.nextBefore||this.isPurged(t)){const e={type:wa.TICKET_OPENED,ticket:{uuid:t.uuid,topic:t.topic,body:t.body,ticketer:t.ticketer},created_on:t.opened_on},i=$a(e,this.handleClose,!this.ticket);return O`<div class="event ticket_opened"> ${i} </div>`}}})):null;return O` ${this.ticket?O`<div class="sticky-bin">${t}</div>`:null} ${this.fetching?O`<temba-loading units="5" size="10"></temba-loading>`:O`<div style="height:0"></div>`} <div class="events" @scroll="${this.handleScroll}"> ${this.eventGroups.map(((t,e)=>{const i=ka(t.events[0],this.ticket),n=this.eventGroups.length-e-1,o=Gt({grouping:!0,[i]:!0,expanded:t.open});return O`<div class="${o}"> ${"verbose"===i?O`<div class="event-count" @click="${this.handleEventGroupShow}" data-group-index="${n}"> ${t.open?O`<temba-icon @click="${this.handleEventGroupHide}" data-group-index="${n}" name="x" clickable></temba-icon>`:O`${t.events.length} ${1===t.events.length?O`event`:O`events`} `} </div>`:null} <div class="items"> ${t.events.map((t=>{if(t.type===wa.TICKET_ASSIGNED&&t.note){const e={...t};return e.type=wa.TICKET_NOTE_ADDED,O`${this.renderEventContainer(e)}${this.renderEventContainer(t)}`}return this.renderEventContainer(t)}))} </div> </div>`}))} </div> <div class="new-messages-container"> <div @click="${()=>{this.scrollToBottom(!0)}}" class="new-messages ${Gt({expanded:this.showMessageAlert})}"> New Messages </div> </div> `}}t([it({type:Object})],Aa.prototype,"contact",void 0),t([it({type:String})],Aa.prototype,"uuid",void 0),t([it({type:String})],Aa.prototype,"agent",void 0),t([it({type:Array})],Aa.prototype,"eventGroups",void 0),t([it({type:Boolean})],Aa.prototype,"refreshing",void 0),t([it({type:Boolean})],Aa.prototype,"fetching",void 0),t([it({type:Boolean})],Aa.prototype,"complete",void 0),t([it({type:String})],Aa.prototype,"endpoint",void 0),t([it({type:Boolean})],Aa.prototype,"debug",void 0),t([it({type:Boolean})],Aa.prototype,"showMessageAlert",void 0),t([it({attribute:!1,type:Object})],Aa.prototype,"mostRecentEvent",void 0),t([it({type:String})],Aa.prototype,"ticket",void 0),t([it({type:String})],Aa.prototype,"endDate",void 0),t([it({type:Array})],Aa.prototype,"tickets",void 0);class La extends tt{constructor(){super(),this.items=[],this.cursorIndex=-1,this.tabIndex=1,this.valueKey="id",this.loading=!1,this.paused=!1,this.refreshKey="0",this.reverseRefresh=!0,this.nextPage=null,this.pages=0,this.pending=[],this.refreshInterval=null,this.store=document.querySelector("temba-store"),this.handleSelection.bind(this)}static get styles(){return r`
2726
+ </div>`)(t)}return P`<temba-icon name="alert-triangle" style="fill:var(--color-error)"></temba-icon> <div class="description">${t.type}</div>`}handleClose(t){this.httpComplete=wt("/api/v2/ticket_actions.json",{tickets:[t],action:"close"}).then((()=>{this.refreshTickets(),this.refresh(),this.fireCustomEvent(zt.ContentChanged,{ticket:{uuid:t,status:"closed"}})})).catch((t=>{console.error(t)}))}checkForAgentAssignmentEvent(t){this.httpComplete=_t(`/api/v2/tickets.json?uuid=${this.ticket}`).then((e=>{if(1===e.length){const i=e[0];i.assignee&&i.assignee.email===t?this.fireCustomEvent(zt.ContentChanged,{ticket:{uuid:this.ticket,assigned:"self"}}):this.fireCustomEvent(zt.ContentChanged,{ticket:{uuid:this.ticket,assigned:i.assignee?i.assignee:null}})}}))}getEventHandlers(){return[{event:"scroll",method:Tt(this.handleScroll,50)}]}isPurged(t){return!this.ticketEvents[t.uuid]}renderEventContainer(t){const e=this.getStickyId(t),i=!!e,n=P` <div class="${this.ticket?"active-ticket":""} event ${t.type} ${i?"has-sticky":""}" data-sticky-id="${e}"> ${this.renderEvent(t)} </div> ${this.debug?P`<pre>${JSON.stringify(t,null,2)}</pre>`:null} `;return e?P`<div class="sticky">${n}</div>`:n}render(){const t=this.eventGroups.length>0&&this.tickets?this.tickets.map((t=>{if(t&&"open"===t.status){if(1e3*new Date(t.opened_on).getTime()<this.nextBefore||this.isPurged(t)){const e={type:jr.TICKET_OPENED,ticket:{uuid:t.uuid,topic:t.topic,body:t.body,ticketer:t.ticketer},created_on:t.opened_on},i=Jr(e,this.handleClose,!this.ticket);return P`<div class="event ticket_opened"> ${i} </div>`}}})):null;return P` ${this.ticket?P`<div class="sticky-bin">${t}</div>`:null} ${this.fetching?P`<temba-loading units="5" size="10"></temba-loading>`:P`<div style="height:0"></div>`} <div class="events" @scroll="${this.handleScroll}"> ${this.eventGroups.map(((t,e)=>{const i=Ur(t.events[0],this.ticket),n=this.eventGroups.length-e-1,o=gt({grouping:!0,[i]:!0,expanded:t.open});return P`<div class="${o}"> ${"verbose"===i?P`<div class="event-count" @click="${this.handleEventGroupShow}" data-group-index="${n}"> ${t.open?P`<temba-icon @click="${this.handleEventGroupHide}" data-group-index="${n}" name="x" clickable></temba-icon>`:P`${t.events.length} ${1===t.events.length?P`event`:P`events`} `} </div>`:null} <div class="items"> ${t.events.map((t=>{if(t.type===jr.TICKET_ASSIGNED&&t.note){const e={...t};return e.type=jr.TICKET_NOTE_ADDED,P`${this.renderEventContainer(e)}${this.renderEventContainer(t)}`}return this.renderEventContainer(t)}))} </div> </div>`}))} </div> <div class="new-messages-container"> <div @click="${()=>{this.scrollToBottom(!0)}}" class="new-messages ${gt({expanded:this.showMessageAlert})}"> New Messages </div> </div> `}}t([it({type:Object})],Qr.prototype,"contact",void 0),t([it({type:String})],Qr.prototype,"uuid",void 0),t([it({type:String})],Qr.prototype,"agent",void 0),t([it({type:Array})],Qr.prototype,"eventGroups",void 0),t([it({type:Boolean})],Qr.prototype,"refreshing",void 0),t([it({type:Boolean})],Qr.prototype,"fetching",void 0),t([it({type:Boolean})],Qr.prototype,"complete",void 0),t([it({type:String})],Qr.prototype,"endpoint",void 0),t([it({type:Boolean})],Qr.prototype,"debug",void 0),t([it({type:Boolean})],Qr.prototype,"showMessageAlert",void 0),t([it({attribute:!1,type:Object})],Qr.prototype,"mostRecentEvent",void 0),t([it({type:String})],Qr.prototype,"ticket",void 0),t([it({type:String})],Qr.prototype,"endDate",void 0),t([it({type:Array})],Qr.prototype,"tickets",void 0);class ta extends tt{constructor(){super(),this.items=[],this.cursorIndex=-1,this.tabIndex=1,this.valueKey="id",this.loading=!1,this.paused=!1,this.refreshKey="0",this.reverseRefresh=!0,this.nextPage=null,this.pages=0,this.pending=[],this.refreshInterval=null,this.store=document.querySelector("temba-store"),this.handleSelection.bind(this)}static get styles(){return s`
2792
2727
  :host {
2793
2728
  }
2794
2729
 
@@ -2797,7 +2732,7 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
2797
2732
  width: 100%;
2798
2733
  flex-grow: 1;
2799
2734
  }
2800
- `}reset(){this.selected=null,this.nextPage=null,this.cursorIndex=-1,this.mostRecentItem=null,this.items=[]}connectedCallback(){super.connectedCallback(),this.refreshInterval=setInterval((()=>{this.paused||(this.refreshKey="default_"+(new Date).getTime())}),1e4)}disconnectedCallback(){clearInterval(this.refreshInterval)}updated(t){super.updated(t),t.has("endpoint")&&this.endpoint&&(this.preserve||(this.reset(),this.loading=!0),this.httpComplete=this.fetchItems()),t.has("refreshKey")&&!t.has("endpoint")&&this.refreshTop(),t.has("mostRecentItem")&&this.mostRecentItem&&this.fireCustomEvent(ue.Refreshed),t.has("cursorIndex")&&this.cursorIndex>-1&&(this.selected=this.items[this.cursorIndex],this.handleSelected(this.selected))}handleSelected(t){const e=new Event("change",{bubbles:!0});this.dispatchEvent(e)}getValue(t){if(!t)return null;const e=this.valueKey.split(".");let i=t;for(;e.length>0;){i=i[e.shift()]}return i}setSelection(t){const e=this.items.findIndex((e=>this.getValue(e)===t));this.cursorIndex=e,this.selected=this.items[e];const i=new Event("change",{bubbles:!0});this.dispatchEvent(i)}getItemIndex(t){return this.items.findIndex((e=>this.getValue(e)===t))}removeItem(t){const e=this.getItemIndex(t);this.items.splice(e,1),this.items=[...this.items],this.cursorIndex=Math.max(0,Math.min(this.items.length-1,this.cursorIndex-1)),this.requestUpdate("cursorIndex"),this.requestUpdate("items")}getSelection(){return this.selected}refresh(){this.refreshKey="requested_"+(new Date).getTime()}setEndpoint(t,e=null){this.endpoint=t,this.nextSelection=e}getRefreshEndpoint(){return this.endpoint}async refreshTop(){if(!this.getRefreshEndpoint())return;for(;this.pending.length>0;){this.pending.pop().abort()}const t=new AbortController;this.pending.push(t);const e=this.items[this.cursorIndex];try{const i=await Yt(this.getRefreshEndpoint(),t),n=[...this.items];if(i.results){i.results.forEach((t=>{this.sanitizeOption&&this.sanitizeOption(t);const e=this.getValue(t),i=n.findIndex((t=>this.getValue(t)===e));i>-1&&n.splice(i,1)}));let t=i.results;this.reverseRefresh&&(t=i.results.reverse());const o=[...t,...n],r=o[0];if(this.mostRecentItem&&JSON.stringify(this.mostRecentItem)===JSON.stringify(r)||(this.mostRecentItem=r),e){const t=o[this.cursorIndex],i=this.getValue(e);if(i!==this.getValue(t)){const t=o.findIndex((t=>this.getValue(t)===i));this.cursorIndex=t,window.setTimeout((()=>{const t=this.shadowRoot.querySelector("temba-options");if(t){t.shadowRoot.querySelector(".option.focused").scrollIntoView({block:"end",inline:"nearest"})}}),0)}}this.items=o}}catch(t){console.error(t)}}async fetchItems(){for(;this.pending.length>0;){this.pending.pop().abort()}let t=this.endpoint,e=this.pages||1,i=0,n=null,o=[];for(;e>0&&t;){const r=new AbortController;this.pending.push(r);try{const s=await Yt(t,r);this.sanitizeOption&&s.results.forEach(this.sanitizeOption),s.results&&(o=o.concat(s.results)),n=s.next,t=n,e--,i++}catch(t){return this.reset(),void console.log("error, resetting")}this.nextPage=n}this.pages=i;const r=o[0];this.mostRecentItem&&JSON.stringify(this.mostRecentItem)===JSON.stringify(r)||(this.mostRecentItem=r);const s=o[this.cursorIndex];if(!this.nextSelection&&this.selected&&s&&this.getValue(s)!==this.getValue(this.selected)){const t=o.findIndex((t=>this.getValue(t)===this.getValue(this.selected)));t>-1?this.cursorIndex=t:0===this.cursorIndex?this.requestUpdate("cursorIndex"):this.cursorIndex=0}return this.items=o,this.loading=!1,this.pending=[],this.nextSelection?(this.setSelection(this.nextSelection),this.nextSelection=!1):-1===this.cursorIndex&&(this.cursorIndex=0),this.value&&(this.setSelection(this.value),this.value=null),Promise.resolve()}handleScrollThreshold(){this.nextPage&&!this.loading&&(this.loading=!0,Yt(this.nextPage).then((t=>{this.sanitizeOption&&t.results.forEach(this.sanitizeOption),this.items=[...this.items,...t.results],this.nextPage=t.next,this.pages++,this.loading=!1})))}renderHeader(){return null}renderFooter(){return null}getListStyle(){return""}handleSelection(t){const{selected:e,index:i}=t.detail;this.selected=e,this.cursorIndex=i,t.stopPropagation(),t.preventDefault()}render(){return O`
2735
+ `}reset(){this.selected=null,this.nextPage=null,this.cursorIndex=-1,this.mostRecentItem=null,this.items=[]}connectedCallback(){super.connectedCallback(),this.refreshInterval=setInterval((()=>{this.paused||(this.refreshKey="default_"+(new Date).getTime())}),1e4)}disconnectedCallback(){clearInterval(this.refreshInterval)}updated(t){super.updated(t),t.has("endpoint")&&this.endpoint&&(this.preserve||(this.reset(),this.loading=!0),this.httpComplete=this.fetchItems()),t.has("refreshKey")&&!t.has("endpoint")&&this.refreshTop(),t.has("mostRecentItem")&&this.mostRecentItem&&this.fireCustomEvent(zt.Refreshed),t.has("cursorIndex")&&this.cursorIndex>-1&&(this.selected=this.items[this.cursorIndex],this.handleSelected(this.selected))}handleSelected(t){const e=new Event("change",{bubbles:!0});this.dispatchEvent(e)}getValue(t){if(!t)return null;const e=this.valueKey.split(".");let i=t;for(;e.length>0;){i=i[e.shift()]}return i}setSelection(t){const e=this.items.findIndex((e=>this.getValue(e)===t));this.cursorIndex=e,this.selected=this.items[e];const i=new Event("change",{bubbles:!0});this.dispatchEvent(i)}getItemIndex(t){return this.items.findIndex((e=>this.getValue(e)===t))}removeItem(t){const e=this.getItemIndex(t);this.items.splice(e,1),this.items=[...this.items],this.cursorIndex=Math.max(0,Math.min(this.items.length-1,this.cursorIndex-1)),this.requestUpdate("cursorIndex"),this.requestUpdate("items")}getSelection(){return this.selected}refresh(){this.refreshKey="requested_"+(new Date).getTime()}setEndpoint(t,e=null){this.endpoint=t,this.nextSelection=e}getRefreshEndpoint(){return this.endpoint}async refreshTop(){if(!this.getRefreshEndpoint())return;for(;this.pending.length>0;){this.pending.pop().abort()}const t=new AbortController;this.pending.push(t);const e=this.items[this.cursorIndex];try{const i=await vt(this.getRefreshEndpoint(),t),n=[...this.items];if(i.results){i.results.forEach((t=>{this.sanitizeOption&&this.sanitizeOption(t);const e=this.getValue(t),i=n.findIndex((t=>this.getValue(t)===e));i>-1&&n.splice(i,1)}));let t=i.results;this.reverseRefresh&&(t=i.results.reverse());const o=[...t,...n],s=o[0];if(this.mostRecentItem&&JSON.stringify(this.mostRecentItem)===JSON.stringify(s)||(this.mostRecentItem=s),e){const t=o[this.cursorIndex],i=this.getValue(e);if(i!==this.getValue(t)){const t=o.findIndex((t=>this.getValue(t)===i));this.cursorIndex=t,window.setTimeout((()=>{const t=this.shadowRoot.querySelector("temba-options");if(t){t.shadowRoot.querySelector(".option.focused").scrollIntoView({block:"end",inline:"nearest"})}}),0)}}this.items=o}}catch(t){console.error(t)}}async fetchItems(){for(;this.pending.length>0;){this.pending.pop().abort()}let t=this.endpoint,e=this.pages||1,i=0,n=null,o=[];for(;e>0&&t;){const s=new AbortController;this.pending.push(s);try{const r=await vt(t,s);this.sanitizeOption&&r.results.forEach(this.sanitizeOption),r.results&&(o=o.concat(r.results)),n=r.next,t=n,e--,i++}catch(t){return this.reset(),void console.log("error, resetting")}this.nextPage=n}this.pages=i;const s=o[0];this.mostRecentItem&&JSON.stringify(this.mostRecentItem)===JSON.stringify(s)||(this.mostRecentItem=s);const r=o[this.cursorIndex];if(!this.nextSelection&&this.selected&&r&&this.getValue(r)!==this.getValue(this.selected)){const t=o.findIndex((t=>this.getValue(t)===this.getValue(this.selected)));t>-1?this.cursorIndex=t:0===this.cursorIndex?this.requestUpdate("cursorIndex"):this.cursorIndex=0}return this.items=o,this.loading=!1,this.pending=[],this.nextSelection?(this.setSelection(this.nextSelection),this.nextSelection=!1):-1===this.cursorIndex&&(this.cursorIndex=0),this.value&&(this.setSelection(this.value),this.value=null),Promise.resolve()}handleScrollThreshold(){this.nextPage&&!this.loading&&(this.loading=!0,vt(this.nextPage).then((t=>{this.sanitizeOption&&t.results.forEach(this.sanitizeOption),this.items=[...this.items,...t.results],this.nextPage=t.next,this.pages++,this.loading=!1})))}renderHeader(){return null}renderFooter(){return null}getListStyle(){return""}handleSelection(t){const{selected:e,index:i}=t.detail;this.selected=e,this.cursorIndex=i,t.stopPropagation(),t.preventDefault()}render(){return P`
2801
2736
  ${this.renderHeader()}
2802
2737
  <temba-options
2803
2738
  style="${this.getListStyle()}"
@@ -2816,7 +2751,7 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
2816
2751
  <slot></slot>
2817
2752
  </temba-options>
2818
2753
  ${this.renderFooter()}
2819
- `}}t([it({type:Array,attribute:!1})],La.prototype,"items",void 0),t([it({type:Object,attribute:!1})],La.prototype,"selected",void 0),t([it({type:Number})],La.prototype,"cursorIndex",void 0),t([it({type:String})],La.prototype,"endpoint",void 0),t([it({type:String})],La.prototype,"nextSelection",void 0),t([it({type:Number})],La.prototype,"tabIndex",void 0),t([it({type:String})],La.prototype,"valueKey",void 0),t([it({type:String})],La.prototype,"value",void 0),t([it({type:Boolean})],La.prototype,"loading",void 0),t([it({type:Boolean})],La.prototype,"collapsed",void 0),t([it({type:Boolean})],La.prototype,"hideShadow",void 0),t([it({type:Boolean})],La.prototype,"paused",void 0),t([it({attribute:!1})],La.prototype,"getNextRefresh",void 0),t([it({attribute:!1})],La.prototype,"sanitizeOption",void 0),t([it({attribute:!1})],La.prototype,"renderOption",void 0),t([it({attribute:!1})],La.prototype,"renderOptionDetail",void 0),t([it({attribute:!1,type:Object})],La.prototype,"mostRecentItem",void 0),t([it({type:String})],La.prototype,"refreshKey",void 0);class Oa extends La{constructor(){super(),this.agent="",this.valueKey="ticket.uuid",this.renderOption=t=>O`
2754
+ `}}t([it({type:Array,attribute:!1})],ta.prototype,"items",void 0),t([it({type:Object,attribute:!1})],ta.prototype,"selected",void 0),t([it({type:Number})],ta.prototype,"cursorIndex",void 0),t([it({type:String})],ta.prototype,"endpoint",void 0),t([it({type:String})],ta.prototype,"nextSelection",void 0),t([it({type:Number})],ta.prototype,"tabIndex",void 0),t([it({type:String})],ta.prototype,"valueKey",void 0),t([it({type:String})],ta.prototype,"value",void 0),t([it({type:Boolean})],ta.prototype,"loading",void 0),t([it({type:Boolean})],ta.prototype,"collapsed",void 0),t([it({type:Boolean})],ta.prototype,"hideShadow",void 0),t([it({type:Boolean})],ta.prototype,"paused",void 0),t([it({attribute:!1})],ta.prototype,"getNextRefresh",void 0),t([it({attribute:!1})],ta.prototype,"sanitizeOption",void 0),t([it({attribute:!1})],ta.prototype,"renderOption",void 0),t([it({attribute:!1})],ta.prototype,"renderOptionDetail",void 0),t([it({attribute:!1,type:Object})],ta.prototype,"mostRecentItem",void 0),t([it({type:String})],ta.prototype,"refreshKey",void 0);class ea extends ta{constructor(){super(),this.agent="",this.valueKey="ticket.uuid",this.renderOption=t=>P`
2820
2755
  <div
2821
2756
  style="align-items:center; margin-top: 0.1em; margin-bottom: 0.1em"
2822
2757
  >
@@ -2829,14 +2764,14 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
2829
2764
  >
2830
2765
  ${t.name}
2831
2766
  </div>
2832
- ${t.ticket.closed_on?null:t.last_msg?O`
2767
+ ${t.ticket.closed_on?null:t.last_msg?P`
2833
2768
  <div
2834
2769
  style="font-size: 0.9em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;"
2835
2770
  >
2836
- ${"I"===t.last_msg.direction?O`<div
2771
+ ${"I"===t.last_msg.direction?P`<div
2837
2772
  style="border-radius:9999px; background:var(--color-primary-dark);width:6px;height:6px;display:inline-block;margin:0px 2px;margin-bottom:1px;"
2838
2773
  ></div>`:null}
2839
- ${t.last_msg.text?t.last_msg.text:t.last_msg.attachments?O`<div style="display:inline-block">
2774
+ ${t.last_msg.text?t.last_msg.text:t.last_msg.attachments?P`<div style="display:inline-block">
2840
2775
  <div style="display:flex; margin-left:0.2em">
2841
2776
  <temba-icon name="paperclip"></temba-icon>
2842
2777
  <div style="flex-grow:1;margin-left:0.2em">
@@ -2851,15 +2786,15 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
2851
2786
  style="font-size:0.8em;display:flex;flex-direction:column;align-items:flex-end;max-width:60px;min-width:30px;border:0px solid green;text-align:right"
2852
2787
  >
2853
2788
  <div style="padding:4px;padding-bottom:2px">
2854
- ${ne(new Date(t.ticket.closed_on||t.ticket.last_activity_on))}
2789
+ ${Ct(new Date(t.ticket.closed_on||t.ticket.last_activity_on))}
2855
2790
  </div>
2856
2791
  <div style="font-size:0.7em;">
2857
- ${!t.ticket.closed_on&&t.ticket.assignee?O`${Ca(t.ticket.assignee,this.agent)}`:null}
2792
+ ${!t.ticket.closed_on&&t.ticket.assignee?P`${Hr(t.ticket.assignee,this.agent)}`:null}
2858
2793
  </div>
2859
2794
  </div>
2860
2795
  </div>
2861
2796
  </div>
2862
- `}getRefreshEndpoint(){if(this.items.length>0){const t=this.items[0].ticket.last_activity_on;return this.endpoint+"?after="+1e3*new Date(t).getTime()}return this.endpoint}}t([it({type:String})],Oa.prototype,"agent",void 0);class Pa extends tt{constructor(){super(...arguments),this.flow=null,this.fields=[],this.expandFields=!1,this.expandBody=!1,this.showGroups=!1,this.showFlows=!1,this.ticket=null}static get styles(){return r`
2797
+ `}getRefreshEndpoint(){if(this.items.length>0){const t=this.items[0].ticket.last_activity_on;return this.endpoint+"?after="+1e3*new Date(t).getTime()}return this.endpoint}}t([it({type:String})],ea.prototype,"agent",void 0);class ia extends tt{constructor(){super(...arguments),this.flow=null,this.fields=[],this.expandFields=!1,this.expandBody=!1,this.showGroups=!1,this.showFlows=!1,this.ticket=null}static get styles(){return s`
2863
2798
  :host {
2864
2799
  background: #f9f9f9;
2865
2800
  display: block;
@@ -3005,37 +2940,37 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
3005
2940
  display: block;
3006
2941
  --button-y: 0;
3007
2942
  }
3008
- `}updated(t){if(super.updated(t),t.has("contact")){const t=document.querySelector("temba-store");this.contact&&this.contact.fields&&(this.fields=Object.keys(this.contact.fields).filter((e=>!!this.contact.fields[e]&&t.getContactField(e).pinned)),this.contact.groups.forEach((e=>{e.is_dynamic=t.isDynamicGroup(e.uuid)})),this.contact.groups.sort(((t,e)=>t.is_dynamic?-1:e.is_dynamic?1:t.name.localeCompare(e.name))))}var e;t.has("endpoint")&&(this.flow=null,this.expandFields=!1,(e=this.endpoint,new Promise(((t,i)=>{Kt(e).then((e=>{e&&1===e.length?t(e[0]):i("No contact found")}))}))).then((t=>{this.contact=t})))}handleFlowChanged(t){this.flow=t.detail.selected}handleToggleFields(){this.expandFields=!this.expandFields}handleExpandBody(){this.expandBody=!0}handleHideBody(){this.expandBody=!1}render(){const t=document.querySelector("temba-store");let e=this.ticket?this.ticket.body:null;const i=!!e&&e.length>250;var n,o;if(!this.expandBody&&this.ticket&&this.ticket.body.length>250&&(n=this.ticket.body,o=250,e=n.length>o?n.substring(0,o)+"...":n),this.contact)return O`<div class="contact">
3009
- ${this.ticket?O`<div class="name">${this.name||this.contact.name}</div>`:null}
3010
- ${this.showGroups&&!this.ticket?O`<div class="groups">
3011
- ${this.contact.groups.map((t=>O`
2943
+ `}updated(t){if(super.updated(t),t.has("contact")){const t=document.querySelector("temba-store");this.contact&&this.contact.fields&&(this.fields=Object.keys(this.contact.fields).filter((e=>!!this.contact.fields[e]&&t.getContactField(e).pinned)),this.contact.groups.forEach((e=>{e.is_dynamic=t.isDynamicGroup(e.uuid)})),this.contact.groups.sort(((t,e)=>t.is_dynamic?-1:e.is_dynamic?1:t.name.localeCompare(e.name))))}var e;t.has("endpoint")&&(this.flow=null,this.expandFields=!1,(e=this.endpoint,new Promise(((t,i)=>{yt(e).then((e=>{e&&1===e.length?t(e[0]):i("No contact found")}))}))).then((t=>{this.contact=t})))}handleFlowChanged(t){this.flow=t.detail.selected}handleToggleFields(){this.expandFields=!this.expandFields}handleExpandBody(){this.expandBody=!0}handleHideBody(){this.expandBody=!1}render(){const t=document.querySelector("temba-store");let e=this.ticket?this.ticket.body:null;const i=!!e&&e.length>250;var n,o;if(!this.expandBody&&this.ticket&&this.ticket.body.length>250&&(n=this.ticket.body,o=250,e=n.length>o?n.substring(0,o)+"...":n),this.contact)return P`<div class="contact">
2944
+ ${this.ticket?P`<div class="name">${this.name||this.contact.name}</div>`:null}
2945
+ ${this.showGroups&&!this.ticket?P`<div class="groups">
2946
+ ${this.contact.groups.map((t=>P`
3012
2947
  <div
3013
2948
  onclick="goto(event)"
3014
2949
  href="/contact/filter/${t.uuid}/"
3015
2950
  class="group-label"
3016
2951
  style="cursor:pointer"
3017
2952
  >
3018
- ${t.is_dynamic?O`<temba-icon name="atom"></temba-icon>`:null}${t.name}
2953
+ ${t.is_dynamic?P`<temba-icon name="atom"></temba-icon>`:null}${t.name}
3019
2954
  </div>
3020
2955
  `))}
3021
- </div>`:O``}
2956
+ </div>`:P``}
3022
2957
 
3023
2958
  <div class="wrapper">
3024
- ${e?O`<div class="body-wrapper">
2959
+ ${e?P`<div class="body-wrapper">
3025
2960
  <div class="body">${e}</div>
3026
2961
  <div class="field-links">
3027
- ${i?this.expandBody?O`<a href="#" @click="${this.handleHideBody}"
2962
+ ${i?this.expandBody?P`<a href="#" @click="${this.handleHideBody}"
3028
2963
  >less</a
3029
- >`:O`<a href="#" @click="${this.handleExpandBody}"
2964
+ >`:P`<a href="#" @click="${this.handleExpandBody}"
3030
2965
  >more</a
3031
2966
  >`:null}
3032
2967
  </div>
3033
2968
  </div>`:null}
3034
- ${this.fields.length>0?O` <div
2969
+ ${this.fields.length>0?P` <div
3035
2970
  class="fields-wrapper ${this.expandFields?"expanded":""}"
3036
2971
  >
3037
2972
  <div class="fields">
3038
- ${this.fields.slice(0,this.expandFields?255:3).map((e=>{let i=this.contact.fields[e];if(i)return(t=>"[object Date]"===toString.call(t)||("function"==typeof t.replace&&t.replace(/^\s+|\s+$/gm,""),Ut.test(t)))(i)&&(i=ne(new Date(i))),O`<div class="field">
2973
+ ${this.fields.slice(0,this.expandFields?255:3).map((e=>{let i=this.contact.fields[e];if(i)return(t=>"[object Date]"===toString.call(t)||("function"==typeof t.replace&&t.replace(/^\s+|\s+$/gm,""),pt.test(t)))(i)&&(i=Ct(new Date(i))),P`<div class="field">
3039
2974
  <div class="name">
3040
2975
  ${t.getContactField(e).label}
3041
2976
  </div>
@@ -3046,7 +2981,7 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
3046
2981
  <div style="display:flex;">
3047
2982
  <div style="flex-grow:1"></div>
3048
2983
  <div style="margin-right:1em;margin-top:-0.5em">
3049
- ${this.fields.length>3?O`<temba-icon
2984
+ ${this.fields.length>3?P`<temba-icon
3050
2985
  name="chevrons-${this.expandFields?"up":"down"}"
3051
2986
  @click=${this.handleToggleFields}
3052
2987
  animateChange="spin"
@@ -3057,7 +2992,7 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
3057
2992
  </div>`:null}
3058
2993
  <div style="flex-grow:1"></div>
3059
2994
  </div>
3060
- </div>`}}t([it({type:String})],Pa.prototype,"name",void 0),t([it({type:String})],Pa.prototype,"uuid",void 0),t([it({type:Object})],Pa.prototype,"contact",void 0),t([it({attribute:!1})],Pa.prototype,"flow",void 0),t([it({type:Array})],Pa.prototype,"fields",void 0),t([it({type:String})],Pa.prototype,"endpoint",void 0),t([it({type:Boolean})],Pa.prototype,"expandFields",void 0),t([it({type:Boolean})],Pa.prototype,"expandBody",void 0),t([it({type:Boolean})],Pa.prototype,"showGroups",void 0),t([it({type:Boolean})],Pa.prototype,"showFlows",void 0),t([it({type:Object})],Pa.prototype,"ticket",void 0);class Ia extends X{constructor(){super(...arguments),this.level="info"}static get styles(){return r`
2995
+ </div>`}}t([it({type:String})],ia.prototype,"name",void 0),t([it({type:String})],ia.prototype,"uuid",void 0),t([it({type:Object})],ia.prototype,"contact",void 0),t([it({attribute:!1})],ia.prototype,"flow",void 0),t([it({type:Array})],ia.prototype,"fields",void 0),t([it({type:String})],ia.prototype,"endpoint",void 0),t([it({type:Boolean})],ia.prototype,"expandFields",void 0),t([it({type:Boolean})],ia.prototype,"expandBody",void 0),t([it({type:Boolean})],ia.prototype,"showGroups",void 0),t([it({type:Boolean})],ia.prototype,"showFlows",void 0),t([it({type:Object})],ia.prototype,"ticket",void 0);class na extends X{constructor(){super(...arguments),this.level="info"}static get styles(){return s`
3061
2996
  :host {
3062
2997
  display: block;
3063
2998
  }
@@ -3087,9 +3022,9 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
3087
3022
  border: 1px solid var(--color-error);
3088
3023
  border-left: 10px solid var(--color-error);
3089
3024
  }
3090
- `}render(){return O`
3025
+ `}render(){return P`
3091
3026
  <div class="temba-alert temba-${this.level}"><slot></slot></div>
3092
- `}}t([it({type:String})],Ia.prototype,"level",void 0);class za extends ot{constructor(){super(...arguments),this.placeholder="",this.name="",this.query="",this.inactiveThreshold=1e3,this.inactiveDays=90,this.initialized=!1,this.exclusions={}}static get styles(){return r`
3027
+ `}}t([it({type:String})],na.prototype,"level",void 0);class oa extends ot{constructor(){super(...arguments),this.placeholder="",this.name="",this.query="",this.inactiveThreshold=1e3,this.inactiveDays=90,this.initialized=!1,this.exclusions={}}static get styles(){return s`
3093
3028
  :host {
3094
3029
  color: var(--color-text);
3095
3030
  }
@@ -3220,7 +3155,7 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
3220
3155
  margin-top: 0.5em;
3221
3156
  margin-left: 0.6em;
3222
3157
  }
3223
- `}updated(t){super.updated(t),(t.has("query")||t.has("endpoint"))&&(this.fetching=!!this.query&&!!this.endpoint,this.fetching&&(this.initialized=!0,this.summary=null,this.lastQuery&&window.clearTimeout(this.lastQuery),this.query.trim().length>0&&(this.lastQuery=window.setTimeout((()=>{this.fetchSummary(this.query)}),1e3))))}fetchSummary(t){this.endpoint&&te(this.endpoint,{include:{query:t},exclude:this.exclusions}).then((t=>{this.fetching=!1,200===t.status?(this.summary=t.json,this.summary.error?this.errors=[this.summary.error]:this.errors=[],this.requestUpdate("errors"),this.fireCustomEvent(ue.ContentChanged,this.summary)):(this.summary=t.json,this.summary.error&&(this.errors=[this.summary.error]),this.requestUpdate("errors"),this.fireCustomEvent(ue.ContentChanged,this.summary))}))}handleQueryChange(t){const e=t.target;this.query=e.inputElement.value}handleSlotChanged(t){if("TEMBA-CHECKBOX"===t.target.tagName){const e=t.target;let i=e.checked;i?("not_seen_since_days"===e.name&&(i=90),this.exclusions[e.name]=i):delete this.exclusions[e.name]}this.requestUpdate("query")}render(){let t;if(this.summary){const e=Object.keys(this.summary.fields||[]).map((t=>({uuid:t,...this.summary.fields[t]})));if(!this.summary.error){const i=this.summary.total,n=this.summary.query.indexOf("last_seen_on")>-1;t=O`
3158
+ `}updated(t){super.updated(t),(t.has("query")||t.has("endpoint"))&&(this.fetching=!!this.query&&!!this.endpoint,this.fetching&&(this.initialized=!0,this.summary=null,this.lastQuery&&window.clearTimeout(this.lastQuery),this.query.trim().length>0&&(this.lastQuery=window.setTimeout((()=>{this.fetchSummary(this.query)}),1e3))))}fetchSummary(t){this.endpoint&&wt(this.endpoint,{include:{query:t},exclude:this.exclusions}).then((t=>{this.fetching=!1,200===t.status?(this.summary=t.json,this.summary.error?this.errors=[this.summary.error]:this.errors=[],this.requestUpdate("errors"),this.fireCustomEvent(zt.ContentChanged,this.summary)):(this.summary=t.json,this.summary.error&&(this.errors=[this.summary.error]),this.requestUpdate("errors"),this.fireCustomEvent(zt.ContentChanged,this.summary))}))}handleQueryChange(t){const e=t.target;this.query=e.inputElement.value}handleSlotChanged(t){if("TEMBA-CHECKBOX"===t.target.tagName){const e=t.target;let i=e.checked;i?("not_seen_since_days"===e.name&&(i=90),this.exclusions[e.name]=i):delete this.exclusions[e.name]}this.requestUpdate("query")}render(){let t;if(this.summary){const e=Object.keys(this.summary.fields||[]).map((t=>({uuid:t,...this.summary.fields[t]})));if(!this.summary.error){const i=this.summary.total,n=this.summary.query.indexOf("last_seen_on")>-1;t=P`
3224
3159
  <table cellspacing="0" cellpadding="0">
3225
3160
  <tr class="header">
3226
3161
  <td colspan="2">
@@ -3234,18 +3169,18 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
3234
3169
  </a>
3235
3170
  contact${1!==i?"s":""}
3236
3171
  </td>
3237
- ${e.map((t=>O` <td class="field-header">${t.label}</td> `))}
3172
+ ${e.map((t=>P` <td class="field-header">${t.label}</td> `))}
3238
3173
  <td></td>
3239
3174
  <td class="field-header date">
3240
3175
  ${n?"Last Seen":"Created"}
3241
3176
  </td>
3242
3177
  </tr>
3243
3178
 
3244
- ${this.summary.sample.map((t=>O`
3179
+ ${this.summary.sample.map((t=>P`
3245
3180
  <tr class="contact">
3246
3181
  <td class="urn">${t.primary_urn_formatted}</td>
3247
3182
  <td class="name">${t.name}</td>
3248
- ${e.map((e=>O`
3183
+ ${e.map((e=>P`
3249
3184
  <td class="field">
3250
3185
  ${(t.fields[e.uuid]||{text:""}).text}
3251
3186
  </td>
@@ -3256,7 +3191,7 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
3256
3191
  </td>
3257
3192
  </tr>
3258
3193
  `))}
3259
- ${this.summary.total>this.summary.sample.length?O`<tr class="table-footer">
3194
+ ${this.summary.total>this.summary.sample.length?P`<tr class="table-footer">
3260
3195
  <td class="query-details" colspan=${e.length+3}></td>
3261
3196
  <td class="more">
3262
3197
  <a
@@ -3268,7 +3203,7 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
3268
3203
  </td>
3269
3204
  </tr>`:null}
3270
3205
  </table>
3271
- `}}return O`
3206
+ `}}return P`
3272
3207
  <div class="query">
3273
3208
  <temba-textinput
3274
3209
  .label=${this.label}
@@ -3289,12 +3224,12 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
3289
3224
  <slot @change=${this.handleSlotChanged}></slot>
3290
3225
 
3291
3226
  <div
3292
- class="results ${Gt({fetching:this.fetching,initialized:this.initialized||this.fetching})}"
3227
+ class="results ${gt({fetching:this.fetching,initialized:this.initialized||this.fetching})}"
3293
3228
  >
3294
3229
  <temba-loading units="6" size="8"></temba-loading>
3295
3230
  <div class="summary ${this.expanded?"expanded":""}">${t}</div>
3296
3231
  </div>
3297
- `}}t([it({type:Boolean})],za.prototype,"fetching",void 0),t([it({type:Boolean})],za.prototype,"expanded",void 0),t([it({type:String})],za.prototype,"endpoint",void 0),t([it({type:String})],za.prototype,"placeholder",void 0),t([it({type:String})],za.prototype,"name",void 0),t([it({type:String})],za.prototype,"query",void 0),t([it({type:Number})],za.prototype,"inactiveThreshold",void 0),t([it({type:Number})],za.prototype,"inactiveDays",void 0),t([it({type:Object,attribute:!1})],za.prototype,"summary",void 0),t([it({type:Object,attribute:!1})],za.prototype,"flow",void 0);class Na extends X{constructor(){super(),this.size=1,this.animationDuration=200,this.src="",this.steps=2,this.easing="cubic-bezier(0.68, -0.55, 0.265, 1.55)"}static get styles(){return r`
3232
+ `}}t([it({type:Boolean})],oa.prototype,"fetching",void 0),t([it({type:Boolean})],oa.prototype,"expanded",void 0),t([it({type:String})],oa.prototype,"endpoint",void 0),t([it({type:String})],oa.prototype,"placeholder",void 0),t([it({type:String})],oa.prototype,"name",void 0),t([it({type:String})],oa.prototype,"query",void 0),t([it({type:Number})],oa.prototype,"inactiveThreshold",void 0),t([it({type:Number})],oa.prototype,"inactiveDays",void 0),t([it({type:Object,attribute:!1})],oa.prototype,"summary",void 0),t([it({type:Object,attribute:!1})],oa.prototype,"flow",void 0);class sa extends X{constructor(){super(),this.size=1,this.animationDuration=200,this.src="",this.steps=2,this.easing="cubic-bezier(0.68, -0.55, 0.265, 1.55)"}static get styles(){return s`
3298
3233
  :host {
3299
3234
  margin: auto;
3300
3235
  }
@@ -3369,22 +3304,22 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
3369
3304
  margin: calc(-1 * var(--icon-circle-size));
3370
3305
  background: var(--icon-background);
3371
3306
  }
3372
- `}firstUpdated(t){super.firstUpdated(t),t.has("animateChange")&&(t.has("animationDuration")||(this.animationDuration=this.steps*this.animationDuration),"spin"===this.animateChange&&(this.steps=3,this.animationDuration=400,this.easing="linear"))}handleClicked(){this.animateClick&&(this.animationStep=1)}updated(t){super.updated(t),t.has("animationStep")&&(this.lastName&&this.animationStep>=this.steps/2&&(this.lastName=null,this.requestUpdate()),setTimeout((()=>{this.animationStep>0&&this.animationStep<this.steps?this.animationStep++:this.animationStep=0}),this.animationDuration/this.steps)),t.has("name")&&this.animateChange&&(this.lastName=t.get("name"),this.lastName&&this.animateChange&&(this.animationStep=1))}render(){return O`
3307
+ `}firstUpdated(t){super.firstUpdated(t),t.has("animateChange")&&(t.has("animationDuration")||(this.animationDuration=this.steps*this.animationDuration),"spin"===this.animateChange&&(this.steps=3,this.animationDuration=400,this.easing="linear"))}handleClicked(){this.animateClick&&(this.animationStep=1)}updated(t){super.updated(t),t.has("animationStep")&&(this.lastName&&this.animationStep>=this.steps/2&&(this.lastName=null,this.requestUpdate()),setTimeout((()=>{this.animationStep>0&&this.animationStep<this.steps?this.animationStep++:this.animationStep=0}),this.animationDuration/this.steps)),t.has("name")&&this.animateChange&&(this.lastName=t.get("name"),this.lastName&&this.animateChange&&(this.animationStep=1))}render(){return P`
3373
3308
  <div
3374
3309
  @click=${this.handleClicked}
3375
- class="wrapper ${Gt({clickable:this.clickable,circled:this.circled,animate:!!this.animateChange||!!this.animateClick})}"
3310
+ class="wrapper ${gt({clickable:this.clickable,circled:this.circled,animate:!!this.animateChange||!!this.animateClick})}"
3376
3311
  >
3377
3312
  <svg
3378
3313
  style="height:${this.size}em;width:${this.size}em;transition:transform ${this.animationDuration/this.steps}ms
3379
3314
  ${this.easing}"
3380
- class="${Gt({sheet:""===this.src,[this.animateChange]:!!this.animateChange,[this.animateChange+"-"+this.animationStep]:this.animationStep>0,[this.animateClick]:!!this.animateClick,[this.animateClick+"-"+this.animationStep]:this.animationStep>0})}"
3315
+ class="${gt({sheet:""===this.src,[this.animateChange]:!!this.animateChange,[this.animateChange+"-"+this.animationStep]:this.animationStep>0,[this.animateClick]:!!this.animateClick,[this.animateClick+"-"+this.animationStep]:this.animationStep>0})}"
3381
3316
  >
3382
3317
  <use
3383
3318
  href="${this.src?this.src:`${this.prefix||window.static_url||"/static/"}icons/symbol-defs.svg?v=15#icon-${this.lastName||this.name||this.id}`}"
3384
3319
  />
3385
3320
  </svg>
3386
3321
  </div>
3387
- `}}var Ra;t([it({type:String})],Na.prototype,"name",void 0),t([it({type:String})],Na.prototype,"prefix",void 0),t([it({type:String})],Na.prototype,"id",void 0),t([it({type:Number})],Na.prototype,"size",void 0),t([it({type:Boolean})],Na.prototype,"clickable",void 0),t([it({type:Boolean})],Na.prototype,"circled",void 0),t([it({type:String})],Na.prototype,"animateChange",void 0),t([it({type:String})],Na.prototype,"animateClick",void 0),t([it({type:Number})],Na.prototype,"animationDuration",void 0),t([it({type:String})],Na.prototype,"src",void 0),t([it({type:Number,attribute:!1})],Na.prototype,"steps",void 0),t([it({type:Number,attribute:!1})],Na.prototype,"animationStep",void 0),t([it({type:String})],Na.prototype,"easing",void 0),function(t){t.Group="group",t.Contact="contact",t.Urn="urn"}(Ra||(Ra={}));const Ba={color:"var(--color-text-dark)",padding:"0px 6px",fontSize:"12px"};class Fa extends tt{constructor(){super(...arguments),this.groups=!1,this.contacts=!1,this.urns=!1,this.value=[],this.placeholder="Select recipients",this.disabled=!1}static get styles(){return r`
3322
+ `}}var ra;t([it({type:String})],sa.prototype,"name",void 0),t([it({type:String})],sa.prototype,"prefix",void 0),t([it({type:String})],sa.prototype,"id",void 0),t([it({type:Number})],sa.prototype,"size",void 0),t([it({type:Boolean})],sa.prototype,"clickable",void 0),t([it({type:Boolean})],sa.prototype,"circled",void 0),t([it({type:String})],sa.prototype,"animateChange",void 0),t([it({type:String})],sa.prototype,"animateClick",void 0),t([it({type:Number})],sa.prototype,"animationDuration",void 0),t([it({type:String})],sa.prototype,"src",void 0),t([it({type:Number,attribute:!1})],sa.prototype,"steps",void 0),t([it({type:Number,attribute:!1})],sa.prototype,"animationStep",void 0),t([it({type:String})],sa.prototype,"easing",void 0),function(t){t.Group="group",t.Contact="contact",t.Urn="urn"}(ra||(ra={}));const aa={color:"var(--color-text-dark)",padding:"0px 6px",fontSize:"12px"};class la extends tt{constructor(){super(...arguments),this.groups=!1,this.contacts=!1,this.urns=!1,this.value=[],this.placeholder="Select recipients",this.disabled=!1}static get styles(){return s`
3388
3323
  temba-select:focus {
3389
3324
  outline: none;
3390
3325
  box-shadow: none;
@@ -3392,7 +3327,7 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
3392
3327
 
3393
3328
  :host {
3394
3329
  }
3395
- `}renderOption(t){return O`
3330
+ `}renderOption(t){return P`
3396
3331
  <div style="display:flex;">
3397
3332
  <div style="margin-right: 8px">${this.getIcon(t)}</div>
3398
3333
  <div style="flex: 1">${t.name}</div>
@@ -3402,9 +3337,9 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
3402
3337
  ${this.getPostName(t)}
3403
3338
  </div>
3404
3339
  </div>
3405
- `}getPostName(t){const e={...Ba};return t.urn&&t.type===Ra.Contact&&t.urn!==t.name?O` <div style=${dt(e)}>${t.urn}</div> `:t.type===Ra.Group?O`
3406
- <div style=${dt(e)}>${t.count.toLocaleString()}</div>
3407
- `:null}renderSelection(t){return O`
3340
+ `}getPostName(t){const e={...aa};return t.urn&&t.type===ra.Contact&&t.urn!==t.name?P` <div style=${ut(e)}>${t.urn}</div> `:t.type===ra.Group?P`
3341
+ <div style=${ut(e)}>${t.count.toLocaleString()}</div>
3342
+ `:null}renderSelection(t){return P`
3408
3343
  <div
3409
3344
  style="flex:1 1 auto; display: flex; align-items: stretch; color: var(--color-text-dark); font-size: 12px;"
3410
3345
  >
@@ -3423,7 +3358,7 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
3423
3358
  ${this.getPostName(t)}
3424
3359
  </div>
3425
3360
  </div>
3426
- `}getIcon(t){return t.type===Ra.Group?O` <temba-icon name="users" /> `:t.type===Ra.Contact?O` <temba-icon name="user" /> `:void 0}getEndpoint(){const t=this.endpoint;let e="&types=";return this.groups&&(e+="g"),this.contacts&&(e+="c"),this.urns&&(e+="u"),t+e}createArbitraryOption(t){if(this.urns){const e=parseFloat(t);if(!isNaN(e)&&isFinite(e))return{id:"tel:"+t,name:t,type:"urn"}}}getValues(){return this.shadowRoot.querySelector("temba-select").values}render(){return O`
3361
+ `}getIcon(t){return t.type===ra.Group?P` <temba-icon name="users" /> `:t.type===ra.Contact?P` <temba-icon name="user" /> `:void 0}getEndpoint(){const t=this.endpoint;let e="&types=";return this.groups&&(e+="g"),this.contacts&&(e+="c"),this.urns&&(e+="u"),t+e}createArbitraryOption(t){if(this.urns){const e=parseFloat(t);if(!isNaN(e)&&isFinite(e))return{id:"tel:"+t,name:t,type:"urn"}}}getValues(){return this.shadowRoot.querySelector("temba-select").values}render(){return P`
3427
3362
  <temba-select
3428
3363
  name=${this.name}
3429
3364
  endpoint=${this.getEndpoint()}
@@ -3443,7 +3378,7 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
3443
3378
  searchOnFocus
3444
3379
  multi
3445
3380
  ></temba-select>
3446
- `}}t([it()],Fa.prototype,"endpoint",void 0),t([it()],Fa.prototype,"name",void 0),t([it({type:Boolean})],Fa.prototype,"groups",void 0),t([it({type:Boolean})],Fa.prototype,"contacts",void 0),t([it({type:Boolean})],Fa.prototype,"urns",void 0),t([it({type:Array})],Fa.prototype,"value",void 0),t([it({type:Array})],Fa.prototype,"errors",void 0),t([it()],Fa.prototype,"placeholder",void 0),t([it({type:Boolean})],Fa.prototype,"disabled",void 0),t([it({type:String,attribute:"help_text"})],Fa.prototype,"helpText",void 0),t([it({type:Boolean,attribute:"help_always"})],Fa.prototype,"helpAlways",void 0),t([it({type:Boolean,attribute:"widget_only"})],Fa.prototype,"widgetOnly",void 0),t([it({type:Boolean,attribute:"hide_label"})],Fa.prototype,"hideLabel",void 0),t([it({type:String})],Fa.prototype,"label",void 0);const qa=(t,e)=>t.top+t.height/2-e.height/2,ja=(t,e)=>t.left+t.width/2-e.width/2;class Za extends tt{constructor(){super(...arguments),this.visible=!1,this.position="auto",this.lastEnter=0,this.failSafe=0}static get styles(){return r`
3381
+ `}}t([it()],la.prototype,"endpoint",void 0),t([it()],la.prototype,"name",void 0),t([it({type:Boolean})],la.prototype,"groups",void 0),t([it({type:Boolean})],la.prototype,"contacts",void 0),t([it({type:Boolean})],la.prototype,"urns",void 0),t([it({type:Array})],la.prototype,"value",void 0),t([it({type:Array})],la.prototype,"errors",void 0),t([it()],la.prototype,"placeholder",void 0),t([it({type:Boolean})],la.prototype,"disabled",void 0),t([it({type:String,attribute:"help_text"})],la.prototype,"helpText",void 0),t([it({type:Boolean,attribute:"help_always"})],la.prototype,"helpAlways",void 0),t([it({type:Boolean,attribute:"widget_only"})],la.prototype,"widgetOnly",void 0),t([it({type:Boolean,attribute:"hide_label"})],la.prototype,"hideLabel",void 0),t([it({type:String})],la.prototype,"label",void 0);const ca=(t,e)=>t.top+t.height/2-e.height/2,ha=(t,e)=>t.left+t.width/2-e.width/2;class ua extends tt{constructor(){super(...arguments),this.visible=!1,this.position="auto",this.lastEnter=0,this.failSafe=0}static get styles(){return s`
3447
3382
  .tip {
3448
3383
  transition: opacity 200ms ease-in-out;
3449
3384
  margin: 0px;
@@ -3495,7 +3430,7 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
3495
3430
  .▲ {
3496
3431
  text-shadow: 0px -1px 1px rgba(0, 0, 0, 0.1);
3497
3432
  }
3498
- `}updated(t){(t.has("visible")||t.has("text"))&&this.visible&&this.calculatePosition(),t.has("text")&&this.hideOnChange&&(this.visible=!1)}calculatePosition(){if(this.visible){const t=this.getDiv(".tip").getBoundingClientRect(),e=this.getDiv(".slot").getBoundingClientRect();let i=this.position;"auto"===i&&(i="left"),this.arrowLeft=0,this.arrowTop=0,"left"===i?(this.left=e.left-t.width-16,this.top=qa(e,t),this.arrowTop=t.height/2,this.arrowLeft=t.width-1,this.arrow="▶"):"right"===i?(this.left=e.right+12,this.top=qa(e,t),this.arrowTop=t.height/2,this.arrowLeft=-8,this.arrow="◀"):"top"===i?(this.top=e.top-t.height-12,this.left=ja(e,t),this.arrowTop=t.height+2,this.arrowLeft=t.width/2-4,this.arrow="▼"):"bottom"===i&&(this.top=e.bottom+10,this.left=ja(e,t),this.arrowTop=-2,this.arrowLeft=t.width/2-3,this.arrow="▲")}}handleMouseEnter(){this.lastEnter=window.setTimeout((()=>{this.visible=!0,this.failSafe=window.setTimeout((()=>{this.visible=!1}),2e3)}),600)}handleMouseLeave(){window.clearTimeout(this.lastEnter),window.clearTimeout(this.failSafe),this.visible=!1}render(){const t={top:this.top?`${this.top}px`:"0px",left:this.left?`${this.left}px`:"0px"},e={top:this.arrowTop?`${this.arrowTop}px`:"0px",left:this.arrowLeft?`${this.arrowLeft}px`:"0px"};this.width&&(t.width=`${this.width}px`);const i=Gt({tip:!0,show:this.visible,top:this.poppedTop,"hide-on-change":this.hideOnChange});return O`
3433
+ `}updated(t){(t.has("visible")||t.has("text"))&&this.visible&&this.calculatePosition(),t.has("text")&&this.hideOnChange&&(this.visible=!1)}calculatePosition(){if(this.visible){const t=this.getDiv(".tip").getBoundingClientRect(),e=this.getDiv(".slot").getBoundingClientRect();let i=this.position;"auto"===i&&(i="left"),this.arrowLeft=0,this.arrowTop=0,"left"===i?(this.left=e.left-t.width-16,this.top=ca(e,t),this.arrowTop=t.height/2,this.arrowLeft=t.width-1,this.arrow="▶"):"right"===i?(this.left=e.right+12,this.top=ca(e,t),this.arrowTop=t.height/2,this.arrowLeft=-8,this.arrow="◀"):"top"===i?(this.top=e.top-t.height-12,this.left=ha(e,t),this.arrowTop=t.height+2,this.arrowLeft=t.width/2-4,this.arrow="▼"):"bottom"===i&&(this.top=e.bottom+10,this.left=ha(e,t),this.arrowTop=-2,this.arrowLeft=t.width/2-3,this.arrow="▲")}}handleMouseEnter(){this.lastEnter=window.setTimeout((()=>{this.visible=!0,this.failSafe=window.setTimeout((()=>{this.visible=!1}),2e3)}),600)}handleMouseLeave(){window.clearTimeout(this.lastEnter),window.clearTimeout(this.failSafe),this.visible=!1}render(){const t={top:this.top?`${this.top}px`:"0px",left:this.left?`${this.left}px`:"0px"},e={top:this.arrowTop?`${this.arrowTop}px`:"0px",left:this.arrowLeft?`${this.arrowLeft}px`:"0px"};this.width&&(t.width=`${this.width}px`);const i=gt({tip:!0,show:this.visible,top:this.poppedTop,"hide-on-change":this.hideOnChange});return P`
3499
3434
  <div
3500
3435
  class="slot"
3501
3436
  @click=${this.handleMouseLeave}
@@ -3504,41 +3439,41 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
3504
3439
  >
3505
3440
  <slot></slot>
3506
3441
  </div>
3507
- <div class="${i}" style=${dt(t)}>
3442
+ <div class="${i}" style=${ut(t)}>
3508
3443
  ${this.text}
3509
- <div class="arrow ${this.arrow}" style=${dt(e)}>
3444
+ <div class="arrow ${this.arrow}" style=${ut(e)}>
3510
3445
  ${this.arrow}
3511
3446
  </div>
3512
3447
  </div>
3513
- `}}t([it({type:String})],Za.prototype,"text",void 0),t([it({type:Boolean})],Za.prototype,"visible",void 0),t([it({type:String})],Za.prototype,"position",void 0),t([it({type:Boolean})],Za.prototype,"hideOnChange",void 0),t([it({type:Number,attribute:!1})],Za.prototype,"top",void 0),t([it({type:Number,attribute:!1})],Za.prototype,"left",void 0),t([it({type:Number,attribute:!1})],Za.prototype,"width",void 0),t([it({type:Boolean,attribute:!1})],Za.prototype,"poppedTop",void 0);const Ha=(t,e)=>{const i=t||[],n=i.findIndex((t=>t.id==e||t.vanity_id==e));if(n>-1){return{item:i[n],index:n}}return{item:null,index:-1}};class Ua extends tt{constructor(){super(),this.wraps=!1,this.selection=[],this.pending=[],this.state={},this.renderMenuItem=(t,e=null)=>{if("divider"===t.type)return O`<div class="divider"></div>`;if("space"===t.type)return O`<div class="space"></div>`;if("section"===t.type||t.inline)return O`<div class="sub-section">${t.name}</div>`;if("modax-button"===t.type)return O`<temba-button
3448
+ `}}t([it({type:String})],ua.prototype,"text",void 0),t([it({type:Boolean})],ua.prototype,"visible",void 0),t([it({type:String})],ua.prototype,"position",void 0),t([it({type:Boolean})],ua.prototype,"hideOnChange",void 0),t([it({type:Number,attribute:!1})],ua.prototype,"top",void 0),t([it({type:Number,attribute:!1})],ua.prototype,"left",void 0),t([it({type:Number,attribute:!1})],ua.prototype,"width",void 0),t([it({type:Boolean,attribute:!1})],ua.prototype,"poppedTop",void 0);const da=(t,e)=>{const i=t||[],n=i.findIndex((t=>t.id==e||t.vanity_id==e));if(n>-1){return{item:i[n],index:n}}return{item:null,index:-1}};class pa extends tt{constructor(){super(),this.wraps=!1,this.selection=[],this.pending=[],this.state={},this.renderMenuItem=(t,e=null)=>{if("divider"===t.type)return P`<div class="divider"></div>`;if("space"===t.type)return P`<div class="space"></div>`;if("section"===t.type||t.inline)return P`<div class="sub-section">${t.name}</div>`;if("modax-button"===t.type)return P`<temba-button
3514
3449
  name=${t.name}
3515
3450
  @click=${e=>{this.handleItemClicked(e,t)}}
3516
- />`;const i=this.isSelected(t),n=i&&this.selection.length>t.level+1,o=t.icon?O`<temba-icon
3451
+ />`;const i=this.isSelected(t),n=i&&this.selection.length>t.level+1,o=t.icon?P`<temba-icon
3517
3452
  size="${0===t.level?"1.5":"1"}"
3518
3453
  name="${t.icon}"
3519
3454
  ></temba-icon
3520
- >${t.bubble?O`<div
3455
+ >${t.bubble?P`<div
3521
3456
  style="background-color: ${t.bubble}"
3522
3457
  class="bubble"
3523
- ></div>`:null}`:null,r=t.collapsed_icon?O`<temba-icon
3458
+ ></div>`:null}`:null,s=t.collapsed_icon?P`<temba-icon
3524
3459
  size="${0===t.level?"1.5":"1"}"
3525
3460
  name="${t.collapsed_icon}"
3526
3461
  class="collapse-icon"
3527
- ></temba-icon>`:null,s=Gt({["menu-"+t.id]:!0,"child-selected":n,selected:i,item:!0,inline:t.inline,expanding:this.expanding&&this.expanding===t.id,expanded:this.isExpanded(t),iconless:!o&&!r});return O` <div
3462
+ ></temba-icon>`:null,r=gt({["menu-"+t.id]:!0,"child-selected":n,selected:i,item:!0,inline:t.inline,expanding:this.expanding&&this.expanding===t.id,expanded:this.isExpanded(t),iconless:!o&&!s});return P` <div
3528
3463
  class="item-top ${i?"selected":null} "
3529
3464
  ></div>
3530
3465
 
3531
3466
  <div
3532
3467
  id="menu-${t.id}"
3533
- class="${s}"
3468
+ class="${r}"
3534
3469
  @click=${i=>{this.handleItemClicked(i,t,e)}}
3535
3470
  >
3536
- ${0===t.level?O`<temba-tip
3471
+ ${0===t.level?P`<temba-tip
3537
3472
  style="display:flex;"
3538
3473
  text="${t.name}"
3539
3474
  position="right"
3540
3475
  >${o}</temba-tip
3541
- >`:O`${o}${r}`}
3476
+ >`:P`${o}${s}`}
3542
3477
 
3543
3478
  <div class="details" style="flex-grow:1;display:flex">
3544
3479
  <div
@@ -3547,18 +3482,18 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
3547
3482
  >
3548
3483
  ${t.name}
3549
3484
  </div>
3550
- ${t.level>0?t.inline?O`<temba-icon
3485
+ ${t.level>0?t.inline?P`<temba-icon
3551
3486
  name="chevron-${i||n?"up":"down"}"
3552
- ></temba-icon>`:O`${t.count||0==t.count?O`
3487
+ ></temba-icon>`:P`${t.count||0==t.count?P`
3553
3488
  <div class="count">
3554
3489
  ${t.count.toLocaleString()}
3555
3490
  </div>
3556
- `:O`<div class="count"></div>`}`:null}
3491
+ `:P`<div class="count"></div>`}`:null}
3557
3492
  </div>
3558
3493
  <div class="right"></div>
3559
3494
  </div>
3560
3495
 
3561
- <div class="item-bottom ${i?"selected":null}"></div>`}}static get styles(){return r`
3496
+ <div class="item-bottom ${i?"selected":null}"></div>`}}static get styles(){return s`
3562
3497
  :host {
3563
3498
  width: 100%;
3564
3499
  display: block;
@@ -3982,12 +3917,12 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
3982
3917
  slot[name='header'].show-header {
3983
3918
  display: block;
3984
3919
  }
3985
- `}setBubble(t,e){const i=Ha(this.root.items,t);return!(!i||!i.item)&&(i.item.bubble=e,this.requestUpdate("root"),!0)}getMenuItemState(t){let e={};return t&&(e=this.state[t],e||(e={},this.state[t]=e)),e}updated(t){t.has("value")&&this.setSelection((this.value||"").split("/")),t.has("submenu")&&!t.has("value")&&this.setSelection([this.submenu]),t.has("endpoint")&&(this.root={level:-1,endpoint:this.endpoint},this.wait||this.loadItems(this.root),this.fireCustomEvent(ue.Ready))}reset(){this.loadItems(this.root)}refresh(t=null){t||(t=[...this.selection]);const e=this.getMenuItemForSelection(t);e&&(e.endpoint?this.loadItems(e,!1):(t.pop(),this.refresh(t)))}fireNoPath(t){const e=this.getMenuItem();if(e){const i={item:e.id,selection:"/"+this.selection.join("/"),endpoint:e.endpoint,path:t+"/"+this.pending.join("/")+document.location.search},n=this.selection.join("/");n.replace(i.path,""),this.selection=n.split("/"),this.fireCustomEvent(ue.NoPath,i),this.pending=[],this.requestUpdate("root")}}loadItems(t,e=!0){t&&t.endpoint&&(t.loading=!0,this.httpComplete=Kt(t.endpoint).then((i=>{if(i.forEach((e=>{e.level=t.level+1,e.items&&e.items.forEach((e=>{e.level=t.level+2}))})),t.items=i,t.loading=!1,this.requestUpdate("root"),this.scrollSelectedIntoView(),this.pending&&this.pending.length>0){const t=this.pending.shift();if(t&&i.length>0){const e=Ha(i,t);e.item?this.handleItemClicked(null,e.item):this.fireNoPath(t)}}else if(e&&i.length>0&&this.selection.length>=1&&!t.inline)for(const t of i)if(!t.type){this.handleItemClicked(null,t);break}})))}handleItemClicked(t,e,i=null){if(i&&i.inline&&this.handleItemClicked(null,i),this.collapsed&&(this.collapsed=!1),t&&(t.preventDefault(),t.stopPropagation()),"modax-button"!=e.type)if(e.trigger)new Function(e.trigger)();else if(e.level,e.level>=this.selection.length?this.selection.push(e.vanity_id||e.id):this.selection.splice(e.level,this.selection.length-e.level,e.vanity_id||e.id),e.endpoint)this.loadItems(e,!0),this.dispatchEvent(new Event("change"));else{if(this.pending&&this.pending.length>0){const t=this.pending.shift(),e=this.getMenuItem();if(t&&e&&e.items&&e.items.length>0){const i=Ha(e.items,t).item;i?this.handleItemClicked(null,i):this.fireNoPath(t)}else this.fireNoPath(t)}else this.dispatchEvent(new Event("change"));this.requestUpdate("root")}else this.fireCustomEvent(ue.ButtonClicked,{title:e.name,href:e.href,on_submit:e.on_submit})}scrollSelectedIntoView(){window.setTimeout((()=>{this.shadowRoot.querySelectorAll(".selected").forEach((t=>{t.scrollIntoView({block:"end",behavior:"smooth"})}))}),0)}clickItem(t){const e=[...this.selection];e.splice(e.length-1,1,t);const i=this.getMenuItemForSelection(e);return!!i&&(this.handleItemClicked(null,i),this.scrollSelectedIntoView(),!0)}getMenuItem(){return this.getMenuItemForSelection([...this.selection])}getMenuItemForSelection(t){const e=[...t];let i=this.root.items,n=null;for(;e.length>0;){const t=e.splice(0,1)[0];if(!i)break;if(n=Ha(i,t).item,!n)break;i=n.items}return n}getSelection(){return this.selection}setSelection(t){this.pending=[...t],this.selection=[],this.wait&&(this.wait=!1,this.loadItems(this.root))}setSelectionPath(t){const e=t.split("/").filter((t=>!!t));this.clickItem(e[e.length-1])||(this.wait=!0,this.setSelection(e))}handleExpand(){this.collapsed=!1}handleCollapse(){this.collapsed=!0}async setFocusedItem(t){const e=t.split("/").filter((t=>!!t));if(e.length>0){if(!Ha(this.root.items,e[0]).item)return}const i=[];let n=this.root;for(;e.length>0;){const t=e.shift();t&&(n.items||(this.loadItems(n,!1),await this.httpComplete),n=Ha(n.items,t).item,n?i.push(t):e.splice(0,e.length))}this.selection=i,this.requestUpdate("root")}isSelected(t){if(t.level<this.selection.length){return this.selection[t.level]==(t.vanity_id||t.id)}return!1}isExpanded(t){return!!this.selection.find((e=>e===t.vanity_id||t.id))}render(){if(!this.root||!this.root.items)return O`<temba-loading
3920
+ `}setBubble(t,e){const i=da(this.root.items,t);return!(!i||!i.item)&&(i.item.bubble=e,this.requestUpdate("root"),!0)}getMenuItemState(t){let e={};return t&&(e=this.state[t],e||(e={},this.state[t]=e)),e}updated(t){t.has("value")&&this.setSelection((this.value||"").split("/")),t.has("submenu")&&!t.has("value")&&this.setSelection([this.submenu]),t.has("endpoint")&&(this.root={level:-1,endpoint:this.endpoint},this.wait||this.loadItems(this.root),this.fireCustomEvent(zt.Ready))}reset(){this.loadItems(this.root)}refresh(t=null){t||(t=[...this.selection]);const e=this.getMenuItemForSelection(t);e&&(e.endpoint?this.loadItems(e,!1):(t.pop(),this.refresh(t)))}fireNoPath(t){const e=this.getMenuItem();if(e){const i={item:e.id,selection:"/"+this.selection.join("/"),endpoint:e.endpoint,path:t+"/"+this.pending.join("/")+document.location.search},n=this.selection.join("/");n.replace(i.path,""),this.selection=n.split("/"),this.fireCustomEvent(zt.NoPath,i),this.pending=[],this.requestUpdate("root")}}loadItems(t,e=!0){t&&t.endpoint&&(t.loading=!0,this.httpComplete=yt(t.endpoint).then((i=>{if(i.forEach((e=>{e.level=t.level+1,e.items&&e.items.forEach((e=>{e.level=t.level+2}))})),t.items=i,t.loading=!1,this.requestUpdate("root"),this.scrollSelectedIntoView(),this.pending&&this.pending.length>0){const t=this.pending.shift();if(t&&i.length>0){const e=da(i,t);e.item?this.handleItemClicked(null,e.item):this.fireNoPath(t)}}else if(e&&i.length>0&&this.selection.length>=1&&!t.inline)for(const t of i)if(!t.type){this.handleItemClicked(null,t);break}})))}handleItemClicked(t,e,i=null){if(i&&i.inline&&this.handleItemClicked(null,i),this.collapsed&&(this.collapsed=!1),t&&(t.preventDefault(),t.stopPropagation()),"modax-button"!=e.type)if(e.trigger)new Function(e.trigger)();else if(e.level,e.level>=this.selection.length?this.selection.push(e.vanity_id||e.id):this.selection.splice(e.level,this.selection.length-e.level,e.vanity_id||e.id),e.endpoint)this.loadItems(e,!0),this.dispatchEvent(new Event("change"));else{if(this.pending&&this.pending.length>0){const t=this.pending.shift(),e=this.getMenuItem();if(t&&e&&e.items&&e.items.length>0){const i=da(e.items,t).item;i?this.handleItemClicked(null,i):this.fireNoPath(t)}else this.fireNoPath(t)}else this.dispatchEvent(new Event("change"));this.requestUpdate("root")}else this.fireCustomEvent(zt.ButtonClicked,{title:e.name,href:e.href,on_submit:e.on_submit})}scrollSelectedIntoView(){window.setTimeout((()=>{this.shadowRoot.querySelectorAll(".selected").forEach((t=>{t.scrollIntoView({block:"end",behavior:"smooth"})}))}),0)}clickItem(t){const e=[...this.selection];e.splice(e.length-1,1,t);const i=this.getMenuItemForSelection(e);return!!i&&(this.handleItemClicked(null,i),this.scrollSelectedIntoView(),!0)}getMenuItem(){return this.getMenuItemForSelection([...this.selection])}getMenuItemForSelection(t){const e=[...t];let i=this.root.items,n=null;for(;e.length>0;){const t=e.splice(0,1)[0];if(!i)break;if(n=da(i,t).item,!n)break;i=n.items}return n}getSelection(){return this.selection}setSelection(t){this.pending=[...t],this.selection=[],this.wait&&(this.wait=!1,this.loadItems(this.root))}setSelectionPath(t){const e=t.split("/").filter((t=>!!t));this.clickItem(e[e.length-1])||(this.wait=!0,this.setSelection(e))}handleExpand(){this.collapsed=!1}handleCollapse(){this.collapsed=!0}async setFocusedItem(t){const e=t.split("/").filter((t=>!!t));if(e.length>0){if(!da(this.root.items,e[0]).item)return}const i=[];let n=this.root;for(;e.length>0;){const t=e.shift();t&&(n.items||(this.loadItems(n,!1),await this.httpComplete),n=da(n.items,t).item,n?i.push(t):e.splice(0,e.length))}this.selection=i,this.requestUpdate("root")}isSelected(t){if(t.level<this.selection.length){return this.selection[t.level]==(t.vanity_id||t.id)}return!1}isExpanded(t){return!!this.selection.find((e=>e===t.vanity_id||t.id))}render(){if(!this.root||!this.root.items)return P`<temba-loading
3986
3921
  units="3"
3987
3922
  size="10"
3988
3923
  direction="column"
3989
3924
  style="margin:1em;margin-right:0em"
3990
- />`;let t=this.root.items||[];const e=[];e.push(O`<div class="level level-0 ${this.submenu?"hidden":""}">
3925
+ />`;let t=this.root.items||[];const e=[];e.push(P`<div class="level level-0 ${this.submenu?"hidden":""}">
3991
3926
  <div class="top">
3992
3927
  <div class="expand-icon" @click=${this.handleExpand}>
3993
3928
  <temba-icon
@@ -4003,33 +3938,33 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
4003
3938
  <div class="empty"></div>
4004
3939
  ${t.filter((t=>!!t.bottom)).map((t=>this.renderMenuItem(t)))}
4005
3940
  <div class="bottom"></div>
4006
- </div>`),this.selection.forEach(((i,n)=>{const o=Ha(t,i).item;let r=!1;if(o){t=o.items;const e=this.getMenuItemState(o.id);e.collapsed?r="collapsed"===e.collapsed:this.selection.length>o.level+2&&(r=!1)}else t=null;t&&t.length>0&&!o.inline&&e.push(O`<div
4007
- class="${Gt({level:!0,["level-"+(n+1)]:!0,collapsed:r})}"
3941
+ </div>`),this.selection.forEach(((i,n)=>{const o=da(t,i).item;let s=!1;if(o){t=o.items;const e=this.getMenuItemState(o.id);e.collapsed?s="collapsed"===e.collapsed:this.selection.length>o.level+2&&(s=!1)}else t=null;t&&t.length>0&&!o.inline&&e.push(P`<div
3942
+ class="${gt({level:!0,["level-"+(n+1)]:!0,collapsed:s})}"
4008
3943
  >
4009
- ${this.submenu?null:O`
3944
+ ${this.submenu?null:P`
4010
3945
  <slot
4011
- class="${Gt({"show-header":o.show_header})}"
3946
+ class="${gt({"show-header":o.show_header})}"
4012
3947
  name="header"
4013
3948
  ></slot>
4014
3949
  <div class="section-header">
4015
3950
  <div class="section">${o.name}</div>
4016
3951
 
4017
- ${0!=n||this.collapsed?null:O`<temba-icon
3952
+ ${0!=n||this.collapsed?null:P`<temba-icon
4018
3953
  name="menu-collapse"
4019
3954
  size="1.1"
4020
3955
  @click=${this.handleCollapse}
4021
3956
  ></temba-icon>`}
4022
3957
  </div>
4023
3958
  `}
4024
- ${t.map((t=>t.inline&&t.items?O`${this.renderMenuItem(t)}
3959
+ ${t.map((t=>t.inline&&t.items?P`${this.renderMenuItem(t)}
4025
3960
  <div class="inline-children">
4026
3961
  ${(t.items||[]).map((e=>this.renderMenuItem(e,t)))}
4027
3962
  </div>`:this.renderMenuItem(t)))}
4028
- </div>`)}));const i=O`<div
4029
- class="${Gt({root:!0,"fully-collapsed":this.collapsed})}"
3963
+ </div>`)}));const i=P`<div
3964
+ class="${gt({root:!0,"fully-collapsed":this.collapsed})}"
4030
3965
  >
4031
3966
  ${e}
4032
- </div>`;return O`${i}`}}t([it({type:Boolean})],Ua.prototype,"wraps",void 0),t([it({type:Boolean})],Ua.prototype,"wait",void 0),t([it({type:String})],Ua.prototype,"endpoint",void 0),t([it({type:String})],Ua.prototype,"expanding",void 0),t([it({type:String})],Ua.prototype,"value",void 0),t([it({type:String})],Ua.prototype,"submenu",void 0),t([it({type:Boolean})],Ua.prototype,"collapsed",void 0);class Va extends X{static get styles(){return r`
3967
+ </div>`;return P`${i}`}}t([it({type:Boolean})],pa.prototype,"wraps",void 0),t([it({type:Boolean})],pa.prototype,"wait",void 0),t([it({type:String})],pa.prototype,"endpoint",void 0),t([it({type:String})],pa.prototype,"expanding",void 0),t([it({type:String})],pa.prototype,"value",void 0),t([it({type:String})],pa.prototype,"submenu",void 0),t([it({type:Boolean})],pa.prototype,"collapsed",void 0);class ma extends X{static get styles(){return s`
4033
3968
  :host {
4034
3969
  color: var(--color-link-primary);
4035
3970
  display: inline-block;
@@ -4039,7 +3974,7 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
4039
3974
  cursor: pointer;
4040
3975
  text-decoration: underline;
4041
3976
  }
4042
- `}handleClick(t){window.goto(t)}render(){return O`<slot href="${this.href}" @click="${this.handleClick}"></slot>`}}t([it({type:String})],Va.prototype,"href",void 0);class Wa extends tt{constructor(){super(...arguments),this.open=!1,this.arrowSize=6,this.arrowOffset=2*this.arrowSize,this.offsetX=-10,this.offsetY=0}static get styles(){return r`
3977
+ `}handleClick(t){window.goto(t)}render(){return P`<slot href="${this.href}" @click="${this.handleClick}"></slot>`}}t([it({type:String})],ma.prototype,"href",void 0);class fa extends tt{constructor(){super(...arguments),this.open=!1,this.arrowSize=6,this.arrowOffset=2*this.arrowSize,this.offsetX=-10,this.offsetY=0}static get styles(){return s`
4043
3978
  .toggle {
4044
3979
  cursor: pointer;
4045
3980
  }
@@ -4081,7 +4016,7 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
4081
4016
  pointer-events: auto;
4082
4017
  transform: translateY(0);
4083
4018
  }
4084
- `}firstUpdated(t){super.firstUpdated(t);const e=this.shadowRoot.querySelector(".dropdown"),i=this.shadowRoot.querySelector(".arrow");i.style.borderWidth=this.arrowSize+"px",i.style.top="-"+this.arrowSize+"px",this.arrowOffset<0?i.style.right=Math.abs(this.arrowOffset)+"px":i.style.left=this.arrowOffset+"px",e.style.marginTop=this.offsetY+"px",e.offsetLeft+e.clientWidth>window.outerWidth?e.style.marginLeft="-"+(e.clientWidth-this.clientWidth-this.offsetX)+"px":e.style.marginLeft=this.offsetX+"px",e.addEventListener("blur",(()=>{window.setTimeout((()=>{this.open=!1}),200)}))}updated(t){super.updated(t),t.has("open")&&(this.open?this.classList.add("open"):this.classList.remove("open"))}handleOpen(){if(!this.open){this.open=!0;this.shadowRoot.querySelector(".dropdown").focus()}}render(){return O`
4019
+ `}firstUpdated(t){super.firstUpdated(t);const e=this.shadowRoot.querySelector(".dropdown"),i=this.shadowRoot.querySelector(".arrow");i.style.borderWidth=this.arrowSize+"px",i.style.top="-"+this.arrowSize+"px",this.arrowOffset<0?i.style.right=Math.abs(this.arrowOffset)+"px":i.style.left=this.arrowOffset+"px",e.style.marginTop=this.offsetY+"px",e.offsetLeft+e.clientWidth>window.outerWidth?e.style.marginLeft="-"+(e.clientWidth-this.clientWidth-this.offsetX)+"px":e.style.marginLeft=this.offsetX+"px",e.addEventListener("blur",(()=>{window.setTimeout((()=>{this.open=!1}),200)}))}updated(t){super.updated(t),t.has("open")&&(this.open?this.classList.add("open"):this.classList.remove("open"))}handleOpen(){if(!this.open){this.open=!0;this.shadowRoot.querySelector(".dropdown").focus()}}render(){return P`
4085
4020
  <div class=${this.open?"open":""}>
4086
4021
  <slot name="toggle" class="toggle" @click="${this.handleOpen}"></slot>
4087
4022
  <div class="dropdown" tabindex="0">
@@ -4089,7 +4024,7 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
4089
4024
  <slot name="dropdown"></slot>
4090
4025
  </div>
4091
4026
  </div>
4092
- `}}t([it({type:Boolean})],Wa.prototype,"open",void 0),t([it({type:Number})],Wa.prototype,"arrowSize",void 0),t([it({type:Number})],Wa.prototype,"arrowOffset",void 0),t([it({type:Number})],Wa.prototype,"offsetX",void 0),t([it({type:Number})],Wa.prototype,"offsetY",void 0);class Ga extends tt{constructor(){super(...arguments),this.collapses=!1,this.index=0}static get styles(){return r`
4027
+ `}}t([it({type:Boolean})],fa.prototype,"open",void 0),t([it({type:Number})],fa.prototype,"arrowSize",void 0),t([it({type:Number})],fa.prototype,"arrowOffset",void 0),t([it({type:Number})],fa.prototype,"offsetX",void 0),t([it({type:Number})],fa.prototype,"offsetY",void 0);class ga extends tt{constructor(){super(...arguments),this.collapses=!1,this.index=0}static get styles(){return s`
4093
4028
  :host {
4094
4029
  display: flex;
4095
4030
  flex-direction: column;
@@ -4131,6 +4066,8 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
4131
4066
  margin-right: 0.4em;
4132
4067
  overflow: hidden;
4133
4068
  transition: max-width 500ms ease-in-out;
4069
+ white-space: nowrap;
4070
+ text-overflow: ellipsis;
4134
4071
  }
4135
4072
 
4136
4073
  .tab .badge {
@@ -4193,22 +4130,22 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
4193
4130
  background: var(--color-alert);
4194
4131
  color: #fff;
4195
4132
  }
4196
- `}handleTabClick(t){this.index=parseInt(t.currentTarget.dataset.index),this.requestUpdate("index")}updated(t){if(super.updated(t),t.has("index")){if(this.children.length>this.index)for(let t=0;t<this.children.length;t++){const e=this.children[t];e.selected=t==this.index,e.selected?e.style.display="flex":e.style.display="none"}this.fireEvent(ue.ContextChanged)}}getTab(t){return this.children.item(t)}render(){const t=[];for(const e of this.children)t.push(e);return O`
4133
+ `}handleTabClick(t){this.index=parseInt(t.currentTarget.dataset.index),this.requestUpdate("index")}updated(t){if(super.updated(t),t.has("index")){if(this.children.length>this.index)for(let t=0;t<this.children.length;t++){const e=this.children[t];e.selected=t==this.index,e.selected?e.style.display="flex":e.style.display="none"}this.fireEvent(zt.ContextChanged)}}getTab(t){return this.children.item(t)}render(){const t=[];for(const e of this.children)t.push(e);return P`
4197
4134
  <div
4198
- class="tabs ${Gt({tabs:!0,collapses:this.collapses})}"
4135
+ class="tabs ${gt({tabs:!0,collapses:this.collapses})}"
4199
4136
  >
4200
- ${t.map(((t,e)=>O`
4137
+ ${t.map(((t,e)=>P`
4201
4138
  <div
4202
4139
  @click=${this.handleTabClick}
4203
4140
  data-index=${e}
4204
- class="${Gt({tab:!0,selected:e==this.index,hidden:t.hidden,notify:t.notify})}"
4141
+ class="${gt({tab:!0,selected:e==this.index,hidden:t.hidden,notify:t.notify})}"
4205
4142
  style="${t.selectionColor&&e==this.index?`color:${t.selectionColor};--icon-color:${t.selectionColor};`:""} ${t.selectionBackground&&e==this.index?`background-color:${t.selectionBackground};`:""}"
4206
4143
  >
4207
- ${t.icon?O`<temba-icon name=${t.icon} />`:null}
4144
+ ${t.icon?P`<temba-icon name=${t.icon} />`:null}
4208
4145
  <div class="name">${t.name}</div>
4209
- ${t.hasBadge()?O`
4146
+ ${t.hasBadge()?P`
4210
4147
  <div class="badge">
4211
- ${t.count>0?O`<div class="count">
4148
+ ${t.count>0?P`<div class="count">
4212
4149
  ${t.count.toLocaleString()}
4213
4150
  </div>`:null}
4214
4151
  </div>
@@ -4219,7 +4156,7 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
4219
4156
  <div class="pane ${0===this.index?"first":null}">
4220
4157
  <slot></slot>
4221
4158
  </div>
4222
- `}}t([it({type:Boolean})],Ga.prototype,"collapses",void 0),t([it({type:Number})],Ga.prototype,"index",void 0);class Ya extends tt{constructor(){super(...arguments),this.selected=!1,this.notify=!1,this.hidden=!1,this.count=0}static get styles(){return r`
4159
+ `}}t([it({type:Boolean})],ga.prototype,"collapses",void 0),t([it({type:Number})],ga.prototype,"index",void 0);class va extends tt{constructor(){super(...arguments),this.selected=!1,this.notify=!1,this.hidden=!1,this.count=0}static get styles(){return s`
4223
4160
  :host {
4224
4161
  display: flex;
4225
4162
  flex-direction: column;
@@ -4236,9 +4173,9 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
4236
4173
  // flex-direction: column;
4237
4174
  // flex-grow: 1;
4238
4175
  }
4239
- `}hasBadge(){return this.count>0}render(){return O`<slot
4240
- class="${Gt({selected:this.selected})}"
4241
- ></slot> `}}t([it({type:String})],Ya.prototype,"name",void 0),t([it({type:String})],Ya.prototype,"icon",void 0),t([it({type:String})],Ya.prototype,"selectionColor",void 0),t([it({type:String})],Ya.prototype,"selectionBackground",void 0),t([it({type:Boolean})],Ya.prototype,"selected",void 0),t([it({type:Boolean})],Ya.prototype,"notify",void 0),t([it({type:Boolean})],Ya.prototype,"hidden",void 0),t([it({type:Number})],Ya.prototype,"count",void 0);class Ka extends X{static get styles(){return r`
4176
+ `}hasBadge(){return this.count>0}render(){return P`<slot
4177
+ class="${gt({selected:this.selected})}"
4178
+ ></slot> `}}t([it({type:String})],va.prototype,"name",void 0),t([it({type:String})],va.prototype,"icon",void 0),t([it({type:String})],va.prototype,"selectionColor",void 0),t([it({type:String})],va.prototype,"selectionBackground",void 0),t([it({type:Boolean})],va.prototype,"selected",void 0),t([it({type:Boolean})],va.prototype,"notify",void 0),t([it({type:Boolean})],va.prototype,"hidden",void 0),t([it({type:Number})],va.prototype,"count",void 0);class ya extends X{static get styles(){return s`
4242
4179
  :host {
4243
4180
  display: inline-block;
4244
4181
  }
@@ -4311,17 +4248,17 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
4311
4248
  .shadow {
4312
4249
  box-shadow: 1px 1px 2px 1px rgba(0, 0, 0, 0.1);
4313
4250
  }
4314
- `}render(){const t={};return this.backgroundColor&&(t.background=this.backgroundColor),this.textColor&&(t.color=this.textColor,t["--icon-color"]=this.textColor),O`
4251
+ `}render(){const t={};return this.backgroundColor&&(t.background=this.backgroundColor),this.textColor&&(t.color=this.textColor,t["--icon-color"]=this.textColor),P`
4315
4252
  <div
4316
- class="label ${Gt({clickable:this.clickable,primary:this.primary,secondary:this.secondary,tertiary:this.tertiary,shadow:this.shadow,danger:this.danger})}"
4317
- style=${dt(t)}
4253
+ class="label ${gt({clickable:this.clickable,primary:this.primary,secondary:this.secondary,tertiary:this.tertiary,shadow:this.shadow,danger:this.danger})}"
4254
+ style=${ut(t)}
4318
4255
  >
4319
4256
  <div class="mask">
4320
- ${this.icon?O`<temba-icon name=${this.icon} />`:null}
4257
+ ${this.icon?P`<temba-icon name=${this.icon} />`:null}
4321
4258
  <slot></slot>
4322
4259
  </div>
4323
4260
  </div>
4324
- `}}t([it({type:Boolean})],Ka.prototype,"clickable",void 0),t([it({type:Boolean})],Ka.prototype,"primary",void 0),t([it({type:Boolean})],Ka.prototype,"secondary",void 0),t([it({type:Boolean})],Ka.prototype,"tertiary",void 0),t([it({type:Boolean})],Ka.prototype,"danger",void 0),t([it({type:Boolean})],Ka.prototype,"dark",void 0),t([it({type:Boolean})],Ka.prototype,"shadow",void 0),t([it({type:String})],Ka.prototype,"icon",void 0),t([it()],Ka.prototype,"backgroundColor",void 0),t([it()],Ka.prototype,"textColor",void 0);class Ja extends tt{constructor(){super(...arguments),this.size=20}static get styles(){return r`
4261
+ `}}t([it({type:Boolean})],ya.prototype,"clickable",void 0),t([it({type:Boolean})],ya.prototype,"primary",void 0),t([it({type:Boolean})],ya.prototype,"secondary",void 0),t([it({type:Boolean})],ya.prototype,"tertiary",void 0),t([it({type:Boolean})],ya.prototype,"danger",void 0),t([it({type:Boolean})],ya.prototype,"dark",void 0),t([it({type:Boolean})],ya.prototype,"shadow",void 0),t([it({type:String})],ya.prototype,"icon",void 0),t([it()],ya.prototype,"backgroundColor",void 0),t([it()],ya.prototype,"textColor",void 0);class ba extends tt{constructor(){super(...arguments),this.size=20}static get styles(){return s`
4325
4262
  :host {
4326
4263
  display: flex;
4327
4264
  align-items: center;
@@ -4330,13 +4267,13 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
4330
4267
  temba-urn {
4331
4268
  margin-right: 0.2em;
4332
4269
  }
4333
- `}render(){const t=this.urn?O`<temba-urn size=${this.size} urn=${this.urn}></temba-urn>`:null;return O`
4270
+ `}render(){const t=this.urn?P`<temba-urn size=${this.size} urn=${this.urn}></temba-urn>`:null;return P`
4334
4271
  ${t}
4335
4272
  <div class="name">
4336
4273
  ${this.name?this.name:this.urn?this.urn.split(":")[1]:""}
4337
4274
  </div>
4338
4275
  <slot></slot>
4339
- `}}t([it({type:String})],Ja.prototype,"name",void 0),t([it({type:String})],Ja.prototype,"urn",void 0),t([it({type:Number,attribute:"icon-size"})],Ja.prototype,"size",void 0);class Xa extends tt{constructor(){super(...arguments),this.size=20}static get styles(){return r`
4276
+ `}}t([it({type:String})],ba.prototype,"name",void 0),t([it({type:String})],ba.prototype,"urn",void 0),t([it({type:Number,attribute:"icon-size"})],ba.prototype,"size",void 0);class _a extends tt{constructor(){super(...arguments),this.size=20}static get styles(){return s`
4340
4277
  :host {
4341
4278
  display: flex;
4342
4279
  align-items: center;
@@ -4356,17 +4293,20 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
4356
4293
  box-shadow: none;
4357
4294
  margin-right: 0.5em;
4358
4295
  }
4359
- `}render(){const t=this.scheme||this.urn.split(":")[0];return O`
4296
+ `}render(){const t=this.scheme||this.urn.split(":")[0];return P`
4360
4297
  <img
4361
4298
  class="urn ${this.size<20?"small":""}"
4362
4299
  width="${this.size}em"
4363
4300
  height="${this.size}em"
4364
4301
  src="${this.prefix||window.static_url||"/static/"}img/schemes/${t}.svg"
4365
4302
  />
4366
- `}}t([it({type:String})],Xa.prototype,"urn",void 0),t([it({type:String})],Xa.prototype,"scheme",void 0),t([it({type:Number})],Xa.prototype,"size",void 0);class Qa extends va{static get styles(){return r`
4303
+ `}}t([it({type:String})],_a.prototype,"urn",void 0),t([it({type:String})],_a.prototype,"scheme",void 0),t([it({type:Number})],_a.prototype,"size",void 0);class xa extends Br{static get styles(){return s`
4367
4304
  :host {
4368
4305
  --curvature-widget: 0px;
4369
- border-radius: 6px;
4306
+ }
4307
+
4308
+ .fields {
4309
+ box-shadow: var(--widget-box-shadow);
4370
4310
  }
4371
4311
 
4372
4312
  .field {
@@ -4424,19 +4364,20 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
4424
4364
  align-items: center;
4425
4365
  margin-top: 0.5em;
4426
4366
  }
4427
- `}connectedCallback(){super.connectedCallback(),this.handleFieldChanged=this.handleFieldChanged.bind(this)}updated(t){super.updated(t),t.has("data")&&Object.keys(this.data.fields).length<=10&&(this.showAll=!0)}handleFieldChanged(t){const e=t.currentTarget,i=e.value;this.data.fields[e.key]=i,te("/api/v2/contacts.json?uuid="+this.data.uuid,{fields:{[e.key]:i}}).then((t=>{this.updateStoreContact(t.json)}))}handleToggle(t){const e=t.currentTarget;this.showAll=e.checked}render(){if(this.data){const t=Object.entries(this.data.fields).filter((t=>this.pinned&&this.store.getContactField(t[0]).pinned||!this.pinned&&!this.store.getContactField(t[0]).pinned)).sort(((t,e)=>{const[i]=t,[n]=e,o=this.store.getContactField(n).priority-this.store.getContactField(i).priority;return 0!==o?o:i.localeCompare(n)}));if(0==t.length)return O`<slot name="empty"></slot>`;const e=t.map((t=>{const[e,i]=t,n=this.store.getContactField(e);return O`<temba-contact-field
4367
+ `}connectedCallback(){super.connectedCallback(),this.handleFieldChanged=this.handleFieldChanged.bind(this)}updated(t){super.updated(t),t.has("data")&&Object.keys(this.data.fields).length<=10&&(this.showAll=!0)}handleFieldChanged(t){const e=t.currentTarget,i=e.value;this.data.fields[e.key]=i,wt("/api/v2/contacts.json?uuid="+this.data.uuid,{fields:{[e.key]:i}}).then((t=>{this.updateStoreContact(t.json)}))}handleToggle(t){const e=t.currentTarget;this.showAll=e.checked}render(){if(this.data){const t=Object.entries(this.data.fields).filter((t=>this.pinned&&this.store.getContactField(t[0]).pinned||!this.pinned&&!this.store.getContactField(t[0]).pinned)).sort(((t,e)=>{const[i]=t,[n]=e,o=this.store.getContactField(n).priority-this.store.getContactField(i).priority;return 0!==o?o:i.localeCompare(n)}));if(0==t.length)return P`<slot name="empty"></slot>`;const e=t.map((t=>{const[e,i]=t,n=this.store.getContactField(e);return P`<temba-contact-field
4428
4368
  class=${i?"set":"unset"}
4429
4369
  key=${n.key}
4430
4370
  name=${n.label}
4431
4371
  value=${i}
4432
4372
  type=${n.value_type}
4433
4373
  @change=${this.handleFieldChanged}
4434
- ></temba-contact-field>`}));return O`
4435
- <div class="${this.showAll||this.pinned?"show-all":""}">
4374
+ timezone=${this.timezone}
4375
+ ></temba-contact-field>`}));return P`
4376
+ <div class="fields ${this.showAll||this.pinned?"show-all":""}">
4436
4377
  ${e}
4437
4378
  </div>
4438
4379
 
4439
- ${!this.pinned&&Object.keys(this.data.fields).length>=10?O`<div class="footer">
4380
+ ${!this.pinned&&Object.keys(this.data.fields).length>=10?P`<div class="footer">
4440
4381
  <div style="flex-grow: 1"></div>
4441
4382
  <div>
4442
4383
  <temba-checkbox
@@ -4446,7 +4387,11 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
4446
4387
  />
4447
4388
  </div>
4448
4389
  </div>`:null}
4449
- `}return null}}t([it({type:Boolean})],Qa.prototype,"pinned",void 0),t([it({type:Boolean})],Qa.prototype,"system",void 0),t([it({type:Boolean})],Qa.prototype,"dirty",void 0),t([it({type:Boolean})],Qa.prototype,"showAll",void 0);class tl extends tt{constructor(){super(...arguments),this.icon=navigator.clipboard?"copy":"",this.iconClass=""}static get styles(){return r`
4390
+ `}return null}}t([it({type:Boolean})],xa.prototype,"pinned",void 0),t([it({type:Boolean})],xa.prototype,"system",void 0),t([it({type:Boolean})],xa.prototype,"dirty",void 0),t([it({type:Boolean})],xa.prototype,"showAll",void 0),t([it({type:String})],xa.prototype,"timezone",void 0);class wa extends tt{constructor(){super(...arguments),this.icon=navigator.clipboard?"copy":"",this.iconClass=""}static get styles(){return s`
4391
+ .wrapper {
4392
+ --widget-box-shadow: none;
4393
+ }
4394
+
4450
4395
  .prefix {
4451
4396
  background: rgba(0, 0, 0, 0.05);
4452
4397
  border-top-left-radius: var(--curvature-widget);
@@ -4533,44 +4478,58 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
4533
4478
  temba-icon[name='search'] {
4534
4479
  margin-right: 1em;
4535
4480
  }
4536
- `}connectedCallback(){super.connectedCallback(),this.handleInput=this.handleInput.bind(this),this.handleSubmit=this.handleSubmit.bind(this)}handleIconClick(t){const e=t.target.getAttribute("name"),i=this.shadowRoot.querySelector("temba-textinput");"copy"===e&&navigator.clipboard&&(this.iconClass="clicked",navigator.clipboard.writeText(i.getDisplayValue()).then((()=>{window.setTimeout((()=>{this.iconClass=""}),300)}))),"search"===e&&this.fireCustomEvent(ue.ButtonClicked,{key:this.key,value:this.value}),t.preventDefault(),t.stopPropagation()}handleSubmit(){const t=this.shadowRoot.querySelector("temba-textinput");t.value!==this.value&&(this.value=t.value,this.fireEvent("change")),this.icon=navigator.clipboard?"copy":""}handleChange(t){t.preventDefault(),t.stopPropagation()}handleInput(t){if("Enter"===t.key){t.currentTarget.blur()}}render(){return O`
4481
+
4482
+ temba-datepicker {
4483
+ --curvature: 0px;
4484
+ position: relative;
4485
+ }
4486
+ `}connectedCallback(){super.connectedCallback(),this.handleInput=this.handleInput.bind(this),this.handleSubmit=this.handleSubmit.bind(this)}handleIconClick(t){const e=t.target.getAttribute("name"),i=this.shadowRoot.querySelector("temba-textinput");"copy"===e&&navigator.clipboard&&(this.iconClass="clicked",navigator.clipboard.writeText(i.getDisplayValue()).then((()=>{window.setTimeout((()=>{this.iconClass=""}),300)}))),"search"===e&&this.fireCustomEvent(zt.ButtonClicked,{key:this.key,value:this.value}),t.preventDefault(),t.stopPropagation()}handleSubmit(){const t=this.shadowRoot.querySelector("temba-textinput, temba-datepicker");t.value!==this.value&&(this.value=t.value,this.fireEvent("change")),this.icon=navigator.clipboard?"copy":""}handleChange(t){t.preventDefault(),t.stopPropagation()}handleInput(t){if("Enter"===t.key){t.currentTarget.blur()}}render(){return P`
4537
4487
  <div class="wrapper ${this.value?"set":"unset"}">
4538
- <temba-textinput
4539
- value="${this.value?this.value:""}"
4540
- ?datetimepicker=${"datetime"===this.type}
4541
- @blur=${this.handleSubmit}
4542
- @keydown=${this.handleInput}
4543
- @change=${this.handleChange}
4544
- >
4545
- <div class="prefix" slot="prefix">
4546
- <div class="name">${this.name}</div>
4547
- ${"datetime"===this.type?O`<div style="position: relative; padding-top: .75em;">
4548
- <temba-icon name="calendar" animateclick="pulse" />
4549
- </div>`:null}
4550
- </div>
4488
+ ${"datetime"===this.type?P`
4489
+ <temba-datepicker
4490
+ timezone=${this.timezone}
4491
+ value="${this.value?this.value:""}"
4492
+ @change=${this.handleSubmit}
4493
+ time
4494
+ >
4495
+ <div class="prefix" slot="prefix">
4496
+ <div class="name">${this.name}</div>
4497
+ </div>
4498
+ </temba-datepicker>
4499
+ `:P`
4500
+ <temba-textinput
4501
+ value="${this.value?this.value:""}"
4502
+ @blur=${this.handleSubmit}
4503
+ @keydown=${this.handleInput}
4504
+ @change=${this.handleChange}
4505
+ >
4506
+ <div class="prefix" slot="prefix">
4507
+ <div class="name">${this.name}</div>
4508
+ </div>
4551
4509
 
4552
- <div class="postfix">
4553
- <div
4554
- class="popper ${this.iconClass}"
4555
- @click=${this.handleIconClick}
4556
- >
4557
- ${this.value?O`
4558
- <temba-icon
4559
- name="search"
4560
- animateclick="pulse"
4561
- ></temba-icon>
4510
+ <div class="postfix">
4511
+ <div
4512
+ class="popper ${this.iconClass}"
4513
+ @click=${this.handleIconClick}
4514
+ >
4515
+ ${this.value?P`
4516
+ <temba-icon
4517
+ name="search"
4518
+ animateclick="pulse"
4519
+ ></temba-icon>
4520
+ </div>
4521
+ `:null}
4522
+ <temba-icon
4523
+ name="${this.icon}"
4524
+ animatechange="spin"
4525
+ animateclick="pulse"
4526
+ ></temba-icon>
4527
+ </div>
4562
4528
  </div>
4563
- `:null}
4564
- <temba-icon
4565
- name="${this.icon}"
4566
- animatechange="spin"
4567
- animateclick="pulse"
4568
- ></temba-icon>
4569
- </div>
4570
- </div>
4571
- </temba-textinput>
4529
+ </temba-textinput>
4530
+ `}
4572
4531
  </div>
4573
- `}}t([it({type:String})],tl.prototype,"key",void 0),t([it({type:String})],tl.prototype,"value",void 0),t([it({type:String})],tl.prototype,"name",void 0),t([it({type:String})],tl.prototype,"type",void 0),t([it({type:String})],tl.prototype,"icon",void 0),t([it({type:String})],tl.prototype,"iconClass",void 0);const el={stopped:{name:"Stopped",icon:"x-octagon"},blocked:{name:"Blocked",icon:"slash"},archived:{name:"Archived",icon:"archive"}};const il={[he.CampaignEvent]:"campaign",[he.ScheduledBroadcast]:"message-square",[he.ScheduledTrigger]:"radio"};class nl extends ga{constructor(){super(...arguments),this.lang_weekly="Weekly",this.lang_daily="Daily",this.lang_once="Once",this.REPEAT_PERIOD={O:this.lang_once,D:this.lang_daily,W:this.lang_weekly}}static get styles(){return r`
4532
+ `}}t([it({type:String})],wa.prototype,"key",void 0),t([it({type:String})],wa.prototype,"value",void 0),t([it({type:String})],wa.prototype,"name",void 0),t([it({type:String})],wa.prototype,"type",void 0),t([it({type:String})],wa.prototype,"timezone",void 0),t([it({type:String})],wa.prototype,"icon",void 0),t([it({type:String})],wa.prototype,"iconClass",void 0);const ka={stopped:{name:"Stopped",icon:"x-octagon"},blocked:{name:"Blocked",icon:"slash"},archived:{name:"Archived",icon:"archive"}};const Sa={[Mt.CampaignEvent]:"campaign",[Mt.ScheduledBroadcast]:"message-square",[Mt.ScheduledTrigger]:"radio"};class Ca extends Rr{constructor(){super(...arguments),this.lang_weekly="Weekly",this.lang_daily="Daily",this.lang_once="Once",this.REPEAT_PERIOD={O:this.lang_once,D:this.lang_daily,W:this.lang_weekly}}static get styles(){return s`
4574
4533
  :host {
4575
4534
  }
4576
4535
 
@@ -4674,7 +4633,7 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
4674
4633
  .scheduled-by .name {
4675
4634
  flex-grow: 1;
4676
4635
  }
4677
- `}updated(t){super.updated(t),t.has("contact")&&(this.contact?this.url=`/contact/scheduled/${this.contact}/`:this.url=null)}renderEvent(t){return O`
4636
+ `}updated(t){super.updated(t),t.has("contact")&&(this.contact?this.url=`/contact/scheduled/${this.contact}/`:this.url=null)}renderEvent(t){return P`
4678
4637
  <div class="event ${t.type}">
4679
4638
  <div class="type">
4680
4639
  <temba-icon
@@ -4685,7 +4644,7 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
4685
4644
 
4686
4645
  <div class="details">
4687
4646
  <div>
4688
- ${t.flow?O`
4647
+ ${t.flow?P`
4689
4648
  <div
4690
4649
  class="flow linked"
4691
4650
  href="/flow/editor/${t.flow.uuid}/"
@@ -4694,20 +4653,20 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
4694
4653
  ${t.flow.name}
4695
4654
  </div>
4696
4655
  `:null}
4697
- ${t.message?O` <div class="message">${t.message}</div> `:null}
4656
+ ${t.message?P` <div class="message">${t.message}</div> `:null}
4698
4657
  </div>
4699
4658
 
4700
4659
  <div class="scheduled-by">
4701
- ${t.campaign?O`<div
4660
+ ${t.campaign?P`<div
4702
4661
  style="display:flex"
4703
4662
  href="/campaign/read/${t.campaign.uuid}/"
4704
4663
  onclick="goto(event, this)"
4705
4664
  >
4706
4665
  <temba-icon name="campaign"></temba-icon>
4707
4666
  <div class="name">${t.campaign.name}</div>
4708
- </div>`:O`
4709
- ${t.type===he.ScheduledTrigger?O`<temba-icon
4710
- name="${il[t.type]}"
4667
+ </div>`:P`
4668
+ ${t.type===Mt.ScheduledTrigger?P`<temba-icon
4669
+ name="${Sa[t.type]}"
4711
4670
  ></temba-icon>`:null}
4712
4671
  <div class="name">
4713
4672
  ${this.REPEAT_PERIOD[t.repeat_period]}
@@ -4727,9 +4686,9 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
4727
4686
  </div>
4728
4687
  </div>
4729
4688
  </div>
4730
- `}render(){if(this.data)return this.data.length>0?O`
4689
+ `}render(){if(this.data)return this.data.length>0?P`
4731
4690
  ${this.data.map((t=>this.renderEvent(t)))}
4732
- `:O`<slot name="empty"></slot>`}}t([it({type:String})],nl.prototype,"contact",void 0),t([it({type:Object,attribute:!1})],nl.prototype,"data",void 0),t([it({type:String})],nl.prototype,"lang_weekly",void 0),t([it({type:String})],nl.prototype,"lang_daily",void 0),t([it({type:String})],nl.prototype,"lang_once",void 0);class ol extends ga{static get styles(){return r`
4691
+ `:P`<slot name="empty"></slot>`}}t([it({type:String})],Ca.prototype,"contact",void 0),t([it({type:Object,attribute:!1})],Ca.prototype,"data",void 0),t([it({type:String})],Ca.prototype,"lang_weekly",void 0),t([it({type:String})],Ca.prototype,"lang_daily",void 0),t([it({type:String})],Ca.prototype,"lang_once",void 0);class Ta extends Rr{static get styles(){return s`
4733
4692
  :host {
4734
4693
  padding: 1em;
4735
4694
  }
@@ -4785,7 +4744,7 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
4785
4744
  background: #f9f9f9;
4786
4745
  color: #888;
4787
4746
  }
4788
- `}prepareData(t){return t&&t.length&&t.sort(((t,e)=>t.status==de.Open&&e.status==de.Closed?-1:e.status==de.Open&&t.status==de.Closed?1:t.status==de.Closed&&e.status==de.Closed?new Date(e.closed_on).getTime()-new Date(t.closed_on).getTime():new Date(e.opened_on).getTime()-new Date(t.opened_on).getTime())),t}updated(t){super.updated(t),t.has("contact")&&(this.contact?this.url=`/api/v2/tickets.json?contact=${this.contact}`:this.url=null)}renderTicket(t){const e=t.status===de.Open?t.opened_on:t.closed_on;return O`
4747
+ `}prepareData(t){return t&&t.length&&t.sort(((t,e)=>t.status==Pt.Open&&e.status==Pt.Closed?-1:e.status==Pt.Open&&t.status==Pt.Closed?1:t.status==Pt.Closed&&e.status==Pt.Closed?new Date(e.closed_on).getTime()-new Date(t.closed_on).getTime():new Date(e.opened_on).getTime()-new Date(t.opened_on).getTime())),t}updated(t){super.updated(t),t.has("contact")&&(this.contact?this.url=`/api/v2/tickets.json?contact=${this.contact}`:this.url=null)}renderTicket(t){const e=t.status===Pt.Open?t.opened_on:t.closed_on;return P`
4789
4748
  <div
4790
4749
  class="ticket ${t.status}"
4791
4750
  href="/ticket/all/open/${t.uuid}"
@@ -4800,11 +4759,11 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
4800
4759
  </temba-tip>
4801
4760
  </div>
4802
4761
 
4803
- ${t.status===de.Closed?O`<div class="status">
4762
+ ${t.status===Pt.Closed?P`<div class="status">
4804
4763
  <temba-icon name="check"></temba-icon>
4805
4764
  </div>`:null}
4806
4765
  </div>
4807
- `}render(){if(this.data&&this.data.length>0){const t=this.data.map((t=>this.renderTicket(t)));return O`${t}`}return O`<slot name="empty"></slot>`}}t([it({type:String})],ol.prototype,"contact",void 0),t([it({type:Object,attribute:!1})],ol.prototype,"data",void 0);class rl extends ot{constructor(){super(...arguments),this.range=!1,this.min=0,this.max=100,this.circleX=0,this.grabbed=!1}static get styles(){return r`
4766
+ `}render(){if(this.data&&this.data.length>0){const t=this.data.map((t=>this.renderTicket(t)));return P`${t}`}return P`<slot name="empty"></slot>`}}t([it({type:String})],Ta.prototype,"contact",void 0),t([it({type:Object,attribute:!1})],Ta.prototype,"data",void 0);class Ea extends ot{constructor(){super(...arguments),this.range=!1,this.min=0,this.max=100,this.circleX=0,this.grabbed=!1}static get styles(){return s`
4808
4767
  :host {
4809
4768
  display: block;
4810
4769
  }
@@ -4859,33 +4818,33 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
4859
4818
  color: #999;
4860
4819
  padding: 0em 1em;
4861
4820
  }
4862
- `}firstUpdated(t){super.firstUpdated(t),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this)}updated(t){t.has("value")&&this.updateCircle()}updateValue(t){const e=this.shadowRoot.querySelector(".track"),i=(t.pageX-e.offsetLeft)/e.offsetWidth,n=(this.max-this.min)*i+this.min;this.value=""+Math.max(this.min,Math.min(Math.round(n),this.max))}handleMouseMove(t){this.grabbed&&this.updateValue(t)}handleTrackDown(t){this.grabbed=!0,document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("mouseup",this.handleMouseUp),document.querySelector("html").classList.add("dragging"),this.updateValue(t),this.requestUpdate()}handleMouseUp(t){this.grabbed=!1,this.updateValue(t),this.requestUpdate(),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.querySelector("html").classList.remove("dragging")}updateCircle(){const t=this.shadowRoot.querySelector(".track"),e=this.shadowRoot.querySelector(".pre"),i=this.max-this.min;let n=parseInt(this.value);!n||n<this.min?n=this.min:n>this.max&&(n=this.max),this.value=""+n;const o=(n-this.min)/i,r=t.offsetWidth*o;this.circleX=r+(e?e.offsetWidth:0),this.requestUpdate()}render(){return O` <div class="${Gt({grabbed:this.grabbed})}">
4821
+ `}firstUpdated(t){super.firstUpdated(t),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this)}updated(t){t.has("value")&&this.updateCircle()}updateValue(t){const e=this.shadowRoot.querySelector(".track"),i=(t.pageX-e.offsetLeft)/e.offsetWidth,n=(this.max-this.min)*i+this.min;this.value=""+Math.max(this.min,Math.min(Math.round(n),this.max))}handleMouseMove(t){this.grabbed&&this.updateValue(t)}handleTrackDown(t){this.grabbed=!0,document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("mouseup",this.handleMouseUp),document.querySelector("html").classList.add("dragging"),this.updateValue(t),this.requestUpdate()}handleMouseUp(t){this.grabbed=!1,this.updateValue(t),this.requestUpdate(),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.querySelector("html").classList.remove("dragging")}updateCircle(){const t=this.shadowRoot.querySelector(".track"),e=this.shadowRoot.querySelector(".pre"),i=this.max-this.min;let n=parseInt(this.value);!n||n<this.min?n=this.min:n>this.max&&(n=this.max),this.value=""+n;const o=(n-this.min)/i,s=t.offsetWidth*o;this.circleX=s+(e?e.offsetWidth:0),this.requestUpdate()}render(){return P` <div class="${gt({grabbed:this.grabbed})}">
4863
4822
  <div
4864
- style=${dt({left:this.circleX+"px"})}
4823
+ style=${ut({left:this.circleX+"px"})}
4865
4824
  class="circle"
4866
4825
  @mousedown=${this.handleTrackDown}
4867
4826
  ></div>
4868
4827
  <div class="wrapper">
4869
- ${this.range?O`<div class="pre">${this.min}</div>`:null}
4828
+ ${this.range?P`<div class="pre">${this.min}</div>`:null}
4870
4829
  <div class="track" @mousedown=${this.handleTrackDown}></div>
4871
- ${this.range?O`<div class="post">${this.max}</div>`:null}
4830
+ ${this.range?P`<div class="post">${this.max}</div>`:null}
4872
4831
  </div>
4873
- </div>`}}t([it({type:Boolean})],rl.prototype,"range",void 0),t([it({type:Number})],rl.prototype,"min",void 0),t([it({type:Number})],rl.prototype,"max",void 0);class sl extends La{constructor(){super(),this.responses=!0,this.resultKeys={},this.reverseRefresh=!1,this.valueKey="uuid",this.hideShadow=!0,this.createRenderOption()}firstUpdated(t){super.firstUpdated(t)}updated(t){if(super.updated(t),(t.has("responses")||t.has("flow"))&&this.flow&&(this.endpoint=`/api/v2/runs.json?flow=${this.flow}${this.responses?"&responded=1":""}`),t.has("resultPreview")&&this.createRenderOption(),t.has("results")&&this.results){this.shadowRoot.querySelector("temba-select").setOptions(this.results),this.resultKeys=this.results.reduce(((t,e)=>({...t,[e.key]:e})),{})}}renderResultPreview(t){if(this.resultPreview){const e=t.values[this.resultPreview.key];if(e){if(!(this.resultPreview.categories.length>1))return e.value;if(e.category)return e.category}}return null}removeRun(t){this.items=this.items.filter((e=>e.id!==t)),this.cursorIndex=Math.min(this.cursorIndex,this.items.length),this.requestUpdate("cursorIndex")}getIcon(t){let e=null;return"completed"==t.exit_type?e=O`<temba-icon
4832
+ </div>`}}t([it({type:Boolean})],Ea.prototype,"range",void 0),t([it({type:Number})],Ea.prototype,"min",void 0),t([it({type:Number})],Ea.prototype,"max",void 0);class $a extends ta{constructor(){super(),this.responses=!0,this.resultKeys={},this.reverseRefresh=!1,this.valueKey="uuid",this.hideShadow=!0,this.createRenderOption()}firstUpdated(t){super.firstUpdated(t)}updated(t){if(super.updated(t),(t.has("responses")||t.has("flow"))&&this.flow&&(this.endpoint=`/api/v2/runs.json?flow=${this.flow}${this.responses?"&responded=1":""}`),t.has("resultPreview")&&this.createRenderOption(),t.has("results")&&this.results){this.shadowRoot.querySelector("temba-select").setOptions(this.results),this.resultKeys=this.results.reduce(((t,e)=>({...t,[e.key]:e})),{})}}renderResultPreview(t){if(this.resultPreview){const e=t.values[this.resultPreview.key];if(e){if(!(this.resultPreview.categories.length>1))return e.value;if(e.category)return e.category}}return null}removeRun(t){this.items=this.items.filter((e=>e.id!==t)),this.cursorIndex=Math.min(this.cursorIndex,this.items.length),this.requestUpdate("cursorIndex")}getIcon(t){let e=null;return"completed"==t.exit_type?e=P`<temba-icon
4874
4833
  name="check"
4875
4834
  style="--icon-color:#666;margin-left:0.5em"
4876
- />`:"interrupted"==t.exit_type?e=O`<temba-icon
4835
+ />`:"interrupted"==t.exit_type?e=P`<temba-icon
4877
4836
  name="x-octagon"
4878
4837
  style="--icon-color:${"rgb(223, 65, 159)"};margin-left:0.5em"
4879
- />`:"expired"==t.exit_type?e=O`<temba-icon
4838
+ />`:"expired"==t.exit_type?e=P`<temba-icon
4880
4839
  name="clock"
4881
4840
  style="--icon-color:${"rgb(223, 65, 159)"};margin-left:0.5em"
4882
- />`:t.exit_type||(e=t.responded?O`<temba-icon
4841
+ />`:t.exit_type||(e=t.responded?P`<temba-icon
4883
4842
  name="activity"
4884
4843
  style="--icon-color:var(--color-primary-dark);margin-left:0.5em"
4885
- />`:O`<temba-icon
4844
+ />`:P`<temba-icon
4886
4845
  name="hourglass"
4887
4846
  style="--icon-color:var(--color-primary-dark);margin-left:0.5em"
4888
- />`),e}createRenderOption(){this.renderOption=t=>{let e="";return t.exited_on||(e="font-weight:400;"),t.responded||(e+=""),O`
4847
+ />`),e}createRenderOption(){this.renderOption=t=>{let e="";return t.exited_on||(e="font-weight:400;"),t.responded||(e+=""),P`
4889
4848
  <div class="row" style="${e}display:flex;align-items:center">
4890
4849
  <div
4891
4850
  style="width: 12em;white-space:nowrap;overflow: hidden; text-overflow: ellipsis;"
@@ -4908,10 +4867,10 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
4908
4867
  </div>
4909
4868
  ${this.getIcon(t)}
4910
4869
  </div>
4911
- `}}getRefreshEndpoint(){if(this.items.length>0){const t=this.items[0].modified_on;return this.endpoint+"&after="+t}return this.endpoint}toggleResponded(){this.responses=this.shadowRoot.querySelector("#responded").checked}handleColumnChanged(t){t.target.values.length>0?this.resultPreview=t.target.values[0]:this.resultPreview=null}handleSelected(t){this.selectedRun=t}getListStyle(){return""}renderHeader(){return O`
4870
+ `}}getRefreshEndpoint(){if(this.items.length>0){const t=this.items[0].modified_on;return this.endpoint+"&after="+t}return this.endpoint}toggleResponded(){this.responses=this.shadowRoot.querySelector("#responded").checked}handleColumnChanged(t){t.target.values.length>0?this.resultPreview=t.target.values[0]:this.resultPreview=null}handleSelected(t){this.selectedRun=t}getListStyle(){return""}renderHeader(){return P`
4912
4871
  <div style="display:flex;width:100%;margin-bottom: 1em;">
4913
4872
  <div style="flex-grow:1">
4914
- ${this.results?O`
4873
+ ${this.results?P`
4915
4874
  <temba-select
4916
4875
  clearable
4917
4876
  placeholder="Result Preview"
@@ -4945,7 +4904,7 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
4945
4904
  >
4946
4905
  Last Updated
4947
4906
  </div>
4948
- `}renderFooter(){if(!this.selectedRun||!this.resultKeys)return null;const t=this.selectedRun.exit_type,e=Object.keys(this.selectedRun.values);return O` <div
4907
+ `}renderFooter(){if(!this.selectedRun||!this.resultKeys)return null;const t=this.selectedRun.exit_type,e=Object.keys(this.selectedRun.values);return P` <div
4949
4908
  style="margin-top: 1.5em; margin-bottom:0.5em;flex-grow:1;border-radius:var(--curvature); border: 1px solid var(--color-widget-border);"
4950
4909
  >
4951
4910
  <div style="display:flex;flex-direction:column;">
@@ -4963,16 +4922,16 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
4963
4922
  <div
4964
4923
  style="display:flex;margin-left:-0.2em;margin-top:0.25em;font-size: 0.65em"
4965
4924
  >
4966
- ${this.selectedRun.exit_type?O`
4925
+ ${this.selectedRun.exit_type?P`
4967
4926
  ${this.getIcon(this.selectedRun)}
4968
4927
  <div style="margin-left:0.5em;flex-grow:1">
4969
4928
  ${(([t,...e],i=navigator.language)=>void 0===t?"":t.toLocaleUpperCase(i)+e.join(""))(this.selectedRun.exit_type)}
4970
- ${"completed"==t?O` in
4929
+ ${"completed"==t?P` in
4971
4930
  ${this.store.getShortDuration(this.selectedRun.created_on,this.selectedRun.exited_on,!0)}`:null}
4972
- ${"interrupted"==t||"expired"==t?O` after
4931
+ ${"interrupted"==t||"expired"==t?P` after
4973
4932
  ${this.store.getShortDuration(this.selectedRun.created_on,this.selectedRun.exited_on,!0)}`:null}
4974
4933
  </div>
4975
- `:O`${this.getIcon(this.selectedRun)}
4934
+ `:P`${this.getIcon(this.selectedRun)}
4976
4935
  <div style="margin-left:0.5em;flex-grow:1">
4977
4936
  Active for
4978
4937
  ${this.store.getShortDuration(this.selectedRun.created_on,null,!0)}
@@ -4998,7 +4957,7 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
4998
4957
  ></temba-icon>
4999
4958
  </div>
5000
4959
 
5001
- ${e.length>0?O`
4960
+ ${e.length>0?P`
5002
4961
  <div
5003
4962
  style="padding:1em;overflow-y:auto;overflow-x:hidden;max-height:15vh;"
5004
4963
  >
@@ -5015,7 +4974,7 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
5015
4974
  <th style="text-align:left">Value</th>
5016
4975
  </tr>
5017
4976
 
5018
- ${Object.keys(this.selectedRun.values).map((t=>{const e=this.selectedRun.values[t],i=this.resultKeys[t];return i?O`<tr>
4977
+ ${Object.keys(this.selectedRun.values).map((t=>{const e=this.selectedRun.values[t],i=this.resultKeys[t];return i?P`<tr>
5019
4978
  <td>${e.name}</td>
5020
4979
  <td>
5021
4980
  ${i.categories.length>1?e.category:"--"}
@@ -5026,7 +4985,7 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
5026
4985
  </div>
5027
4986
  `:null}
5028
4987
  </div>
5029
- </div>`}}t([it({type:String})],sl.prototype,"flow",void 0),t([it({type:Object,attribute:!1})],sl.prototype,"results",void 0),t([it({type:Boolean})],sl.prototype,"responses",void 0),t([it({type:Object})],sl.prototype,"resultPreview",void 0),t([it({type:Object})],sl.prototype,"selectedRun",void 0);class al extends ga{constructor(){super(...arguments),this.endpoint="/api/v2/flows.json?uuid="}prepareData(t){return t&&t.length>0&&(t=t[0]),t}updated(t){super.updated(t),t.has("flow")&&(this.flow?this.url=`${this.endpoint}${this.flow}`:this.url=null)}render(){if(this.data)return O`<div></div>`}}t([it({type:String})],al.prototype,"flow",void 0),t([it({type:Object,attribute:!1})],al.prototype,"data",void 0),t([it({type:String})],al.prototype,"endpoint",void 0);class ll extends va{constructor(){super(...arguments),this.size=20}static get styles(){return r`
4988
+ </div>`}}t([it({type:String})],$a.prototype,"flow",void 0),t([it({type:Object,attribute:!1})],$a.prototype,"results",void 0),t([it({type:Boolean})],$a.prototype,"responses",void 0),t([it({type:Object})],$a.prototype,"resultPreview",void 0),t([it({type:Object})],$a.prototype,"selectedRun",void 0);class La extends Rr{constructor(){super(...arguments),this.endpoint="/api/v2/flows.json?uuid="}prepareData(t){return t&&t.length>0&&(t=t[0]),t}updated(t){super.updated(t),t.has("flow")&&(this.flow?this.url=`${this.endpoint}${this.flow}`:this.url=null)}render(){if(this.data)return P`<div></div>`}}t([it({type:String})],La.prototype,"flow",void 0),t([it({type:Object,attribute:!1})],La.prototype,"data",void 0),t([it({type:String})],La.prototype,"endpoint",void 0);class Aa extends Br{constructor(){super(...arguments),this.size=20}static get styles(){return s`
5030
4989
  :host {
5031
4990
  display: flex;
5032
4991
  }
@@ -5035,11 +4994,141 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
5035
4994
  margin-right: 0.2em;
5036
4995
  margin-top: 2px;
5037
4996
  }
5038
- `}render(){if(this.data)return O` <temba-contact-name
4997
+ `}render(){if(this.data)return P` <temba-contact-name
5039
4998
  name=${this.data.name||this.data.anon_display}
5040
4999
  urn=${this.data.urns.length>0?this.data.urns[0]:null}
5041
5000
  />
5042
- <slot></slot>`}}function cl(t,e){window.customElements.get(t)||window.customElements.define(t,e)}t([it({type:Number,attribute:"icon-size"})],ll.prototype,"size",void 0),cl("temba-anchor",Va),cl("temba-alert",Ia),cl("temba-store",ur),cl("temba-textinput",Ht),cl("temba-completion",ea),cl("temba-checkbox",rt),cl("temba-select",ta),cl("temba-options",pr),cl("temba-loading",sa),cl("temba-button",oa),cl("temba-omnibox",Fa),cl("temba-tip",Za),cl("temba-contact-name",Ja),cl("temba-contact-name-fetch",ll),cl("temba-contact-field",tl),cl("temba-contact-fields",Qa),cl("temba-urn",Xa),cl("temba-field",ra),cl("temba-dialog",na),cl("temba-modax",ia),cl("temba-charcount",fa),cl("temba-contact-history",Aa),cl("temba-contact-chat",ya),cl("temba-contact-details",Pa),cl("temba-ticket-list",Oa),cl("temba-list",La),cl("temba-run-list",sl),cl("temba-flow-details",al),cl("temba-label",Ka),cl("temba-menu",Ua),cl("temba-contact-search",za),cl("temba-icon",Na),cl("temba-dropdown",Wa),cl("temba-tabs",Ga),cl("temba-tab",Ya),cl("temba-contact-badges",class extends va{static get styles(){return r`
5001
+ <slot></slot>`}}t([it({type:Number,attribute:"icon-size"})],Aa.prototype,"size",void 0);class Oa extends ot{constructor(){super(),this.timezone="",this.timezoneFriendly="",this.datetime=null,this.time=!1}static get styles(){return s`
5002
+ :host {
5003
+ display: block;
5004
+ }
5005
+
5006
+ .container {
5007
+ border-radius: var(--curvature);
5008
+ border: 1px solid var(--color-widget-border);
5009
+ display: flex;
5010
+ cursor: pointer;
5011
+ box-shadow: var(--widget-box-shadow);
5012
+ }
5013
+
5014
+ .input-wrapper {
5015
+ padding: var(--temba-textinput-padding);
5016
+ flex-grow: 1;
5017
+ }
5018
+
5019
+ .tz {
5020
+ margin-left: 0.5em;
5021
+ font-size: 0.8em;
5022
+ flex-direction: column;
5023
+ align-self: stretch;
5024
+ color: #888;
5025
+ display: flex;
5026
+ align-items: flex-start;
5027
+ flex-direction: column;
5028
+ padding: 0em 1em;
5029
+ font-weight: 400;
5030
+ cursor: pointer;
5031
+ margin: auto;
5032
+ }
5033
+
5034
+ .tz .label {
5035
+ font-size: 0.8em;
5036
+ color: #aaa;
5037
+ white-space: nowrap;
5038
+ text-overflow: ellipsis;
5039
+ }
5040
+
5041
+ .tz .zone {
5042
+ white-space: nowrap;
5043
+ text-overflow: ellipsis;
5044
+ }
5045
+
5046
+ .tz-wrapper {
5047
+ background: #efefef;
5048
+ border-top-right-radius: var(--curvature);
5049
+ border-bottom-right-radius: var(--curvature);
5050
+ display: flex;
5051
+ flex-direction: row;
5052
+ align-items: center;
5053
+ }
5054
+
5055
+ .container:focus-within {
5056
+ border-color: var(--color-focus);
5057
+ background: var(--color-widget-bg-focused);
5058
+ box-shadow: var(--widget-box-shadow-focused);
5059
+ }
5060
+
5061
+ input {
5062
+ color: var(--color-widget-text);
5063
+ border: 0px;
5064
+ font-family: var(--font-family);
5065
+ font-weight: 300;
5066
+ outline: none;
5067
+ width: 100%;
5068
+ font-size: 13px;
5069
+ padding: 0px;
5070
+ margin: 0px;
5071
+ line-height: 1em;
5072
+ }
5073
+
5074
+ input.unset {
5075
+ color: #ddd;
5076
+ }
5077
+
5078
+ input.unset:focus {
5079
+ color: var(--color-widget-text);
5080
+ }
5081
+
5082
+ input:focus {
5083
+ outline: none;
5084
+ }
5085
+
5086
+ ::-webkit-calendar-picker-indicator {
5087
+ background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="15" viewBox="0 0 24 24"><path fill="%23bbbbbb" d="M20 3h-1V1h-2v2H7V1H5v2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 18H4V8h16v13z"/></svg>');
5088
+ cursor: pointer;
5089
+ margin: 0;
5090
+ padding: 0;
5091
+ }
5092
+
5093
+ ::-webkit-calendar-picker-indicator:hover {
5094
+ background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="15" viewBox="0 0 24 24"><path fill="%23777777" d="M20 3h-1V1h-2v2H7V1H5v2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 18H4V8h16v13z"/></svg>');
5095
+ cursor: pointer;
5096
+ margin: 0;
5097
+ padding: 0;
5098
+ }
5099
+ `}serializeValue(t){return t}firstUpdated(t){if(t.has("value"))if(this.time){if(this.timezone=this.timezone||Intl.DateTimeFormat().resolvedOptions().timeZone,this.timezoneFriendly=this.timezone.replace("_"," ").replace("/",", "),this.value){let t=Mo.fromSQL(this.value).setZone(this.timezone);t.invalid&&(t=Mo.fromISO(this.value).setZone(this.timezone)),this.datetime=t,this.setValue(this.datetime.toUTC().toISO())}}else this.setValue(this.value)}updated(t){super.updated(t),t.has("timezone")&&this.time&&(this.timezone=this.timezone||Intl.DateTimeFormat().resolvedOptions().timeZone,this.timezoneFriendly=this.timezone.replace("_"," ").replace("/",", "),this.requestUpdate("value"))}handleChange(t){t.preventDefault(),t.stopPropagation()}handleBlur(t){this.time?(this.datetime=Mo.fromISO(t.target.value,{zone:this.timezone}),this.setValue(this.datetime.toUTC().toISO())):this.setValue(t.target.value),this.fireEvent("change")}handleClicked(){this.shadowRoot.querySelector("input").focus()}render(){const t=gt({unset:!this.value});let e=null;return this.time&&this.datetime&&!this.datetime.invalid?e=this.datetime.toFormat("yyyy-LL-dd'T'HH:mm"):this.time||(e=this.value),P`
5100
+ <temba-field
5101
+ name=${this.name}
5102
+ .label="${this.label}"
5103
+ .helpText="${this.helpText}"
5104
+ .errors=${this.errors}
5105
+ .widgetOnly=${this.widgetOnly}
5106
+ .hideLabel=${this.hideLabel}
5107
+ .disabled=${this.disabled}
5108
+ >
5109
+ <div class="container" @click=${this.handleClicked}>
5110
+ <slot name="prefix"></slot>
5111
+ <div class="input-wrapper">
5112
+ <input
5113
+ class=${t}
5114
+ name=${this.label}
5115
+ value=${e}
5116
+ type="${this.time?"datetime-local":"date"}"
5117
+ @change=${this.handleChange}
5118
+ @blur=${this.handleBlur}
5119
+ />
5120
+ </div>
5121
+ ${this.time?P`
5122
+ <div class="tz-wrapper">
5123
+ <div class="tz">
5124
+ <div class="label">Time Zone</div>
5125
+ <div class="zone">${this.timezoneFriendly}</div>
5126
+ </div>
5127
+ </div>
5128
+ `:null}
5129
+ </div>
5130
+ </temba-field>
5131
+ `}}function Ma(t,e){window.customElements.get(t)||window.customElements.define(t,e)}t([it({type:String})],Oa.prototype,"timezone",void 0),t([it({type:String})],Oa.prototype,"timezoneFriendly",void 0),t([it({type:Object})],Oa.prototype,"datetime",void 0),t([it({type:Boolean})],Oa.prototype,"time",void 0),Ma("temba-anchor",ma),Ma("temba-alert",na),Ma("temba-store",zo),Ma("temba-textinput",dt),Ma("temba-datepicker",Oa),Ma("temba-completion",kr),Ma("temba-checkbox",st),Ma("temba-select",wr),Ma("temba-options",Io),Ma("temba-loading",$r),Ma("temba-button",Tr),Ma("temba-omnibox",la),Ma("temba-tip",ua),Ma("temba-contact-name",ba),Ma("temba-contact-name-fetch",Aa),Ma("temba-contact-field",wa),Ma("temba-contact-fields",xa),Ma("temba-urn",_a),Ma("temba-field",Er),Ma("temba-dialog",Cr),Ma("temba-modax",Sr),Ma("temba-charcount",Nr),Ma("temba-contact-history",Qr),Ma("temba-contact-chat",qr),Ma("temba-contact-details",ia),Ma("temba-ticket-list",ea),Ma("temba-list",ta),Ma("temba-run-list",$a),Ma("temba-flow-details",La),Ma("temba-label",ya),Ma("temba-menu",pa),Ma("temba-contact-search",oa),Ma("temba-icon",sa),Ma("temba-dropdown",fa),Ma("temba-tabs",ga),Ma("temba-tab",va),Ma("temba-contact-badges",class extends Br{static get styles(){return s`
5043
5132
  temba-label {
5044
5133
  margin: 0.3em;
5045
5134
  }
@@ -5048,9 +5137,9 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
5048
5137
  display: flex;
5049
5138
  flex-wrap: wrap;
5050
5139
  }
5051
- `}render(){if(this.data){const t=el[this.data.status];return O`
5140
+ `}render(){if(this.data){const t=ka[this.data.status];return P`
5052
5141
  <div class="badges">
5053
- ${t&&"active"!==this.data.status?O`
5142
+ ${t&&"active"!==this.data.status?P`
5054
5143
  <temba-label
5055
5144
  icon="${t.icon}"
5056
5145
  onclick="goto(event)"
@@ -5062,7 +5151,7 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
5062
5151
  ${t.name}
5063
5152
  </temba-label>
5064
5153
  `:null}
5065
- ${this.data.flow?O`
5154
+ ${this.data.flow?P`
5066
5155
  <temba-label
5067
5156
  icon="flow"
5068
5157
  onclick="goto(event)"
@@ -5074,7 +5163,7 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
5074
5163
  ${this.data.flow.name}
5075
5164
  </temba-label>
5076
5165
  `:null}
5077
- ${this.data.language?O`
5166
+ ${this.data.language?P`
5078
5167
  <temba-label
5079
5168
  icon="globe"
5080
5169
  onclick="goto(event)"
@@ -5086,7 +5175,7 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
5086
5175
  ${this.store.getLanguageName(this.data.language)}
5087
5176
  </temba-label>
5088
5177
  `:null}
5089
- ${this.data.groups.map((t=>O`
5178
+ ${this.data.groups.map((t=>P`
5090
5179
  <temba-label
5091
5180
  class="group"
5092
5181
  onclick="goto(event)"
@@ -5099,7 +5188,7 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
5099
5188
  </temba-label>
5100
5189
  `))}
5101
5190
  </div>
5102
- `}return null}}),cl("temba-contact-pending",nl),cl("temba-contact-tickets",ol),cl("temba-slider",rl);class hl extends X{constructor(){super(),this.path=[]}static get styles(){return r`
5191
+ `}return null}}),Ma("temba-contact-pending",Ca),Ma("temba-contact-tickets",Ta),Ma("temba-slider",Ea);class Pa extends X{constructor(){super(),this.path=[]}static get styles(){return s`
5103
5192
  :host {
5104
5193
  line-height: normal;
5105
5194
  }
@@ -5218,7 +5307,7 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
5218
5307
  display: inline-block;
5219
5308
  margin-right: 0px;
5220
5309
  }
5221
- `}updated(t){if(t.has("osmId")){const t=[];for(const e of this.path)if(t.push(e),e.osm_id===this.osmId)return this.path=[...t],void this.hideAliasDialog();this.fetchFeature()}}fetchFeature(){Wt(this.getEndpoint()+"boundaries/"+this.osmId+"/").then((t=>{this.path=t.json,this.hideAliasDialog()}))}handleMapClicked(t){this.hovered=null,t&&t.osm_id===this.osmId||(this.osmId=t.osm_id)}handlePlaceClicked(t){this.osmId=t.osm_id}handleSearchSelection(t){const e=t.detail.selected;this.showAliasDialog(e);this.shadowRoot.querySelector("temba-select").clear()}isMatch(t,e){return`${t.name} ${t.aliases}`.toLowerCase().indexOf(e)>-1}renderFeature(t,e){const i=this.path[this.path.length-1],n=(t.has_children||0===t.level)&&t!==i,o=O`
5310
+ `}updated(t){if(t.has("osmId")){const t=[];for(const e of this.path)if(t.push(e),e.osm_id===this.osmId)return this.path=[...t],void this.hideAliasDialog();this.fetchFeature()}}fetchFeature(){ft(this.getEndpoint()+"boundaries/"+this.osmId+"/").then((t=>{this.path=t.json,this.hideAliasDialog()}))}handleMapClicked(t){this.hovered=null,t&&t.osm_id===this.osmId||(this.osmId=t.osm_id)}handlePlaceClicked(t){this.osmId=t.osm_id}handleSearchSelection(t){const e=t.detail.selected;this.showAliasDialog(e);this.shadowRoot.querySelector("temba-select").clear()}isMatch(t,e){return`${t.name} ${t.aliases}`.toLowerCase().indexOf(e)>-1}renderFeature(t,e){const i=this.path[this.path.length-1],n=(t.has_children||0===t.level)&&t!==i,o=P`
5222
5311
  <div class="feature">
5223
5312
  <div
5224
5313
  @mouseover=${()=>{t.level>0&&(this.hovered=t)}}
@@ -5233,7 +5322,7 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
5233
5322
  </div>
5234
5323
 
5235
5324
  <div class="aliases">
5236
- ${t.aliases.split("\n").map((e=>e.trim().length>0?O`
5325
+ ${t.aliases.split("\n").map((e=>e.trim().length>0?P`
5237
5326
  <temba-label
5238
5327
  class="alias"
5239
5328
  @click=${()=>{this.showAliasDialog(t)}}
@@ -5242,7 +5331,7 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
5242
5331
  >${e}</temba-label
5243
5332
  >
5244
5333
  `:null))}
5245
- ${t.level>0?O`
5334
+ ${t.level>0?P`
5246
5335
  <div
5247
5336
  class="edit clickable showonhover"
5248
5337
  @click=${e=>{this.showAliasDialog(t),e.preventDefault(),e.stopPropagation()}}
@@ -5253,14 +5342,14 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
5253
5342
  </div>
5254
5343
  </div>
5255
5344
  </div>
5256
- `,r=(t.children||[]).map((t=>e.length>0&&e[0].osm_id===t.osm_id?this.renderFeature(e[0],e.slice(1)):0===e.length||0===e[0].children.length?this.renderFeature(t,e):null));return O` ${o} ${r} `}showAliasDialog(t){this.editFeatureAliases=t.aliases,this.editFeature=t;const e=this.shadowRoot.getElementById("alias-dialog");e&&e.setAttribute("open","")}hideAliasDialog(){const t=this.shadowRoot.getElementById("alias-dialog");this.editFeature=null,this.editFeatureAliases=null,t&&t.removeAttribute("open"),this.requestUpdate()}getEndpoint(){return this.endpoint+(this.endpoint.endsWith("/")?"":"/")}handleDialogClick(t){const e=t.detail.button;if("Save"===e.name){const t=this.shadowRoot.getElementById(this.editFeature.osm_id).inputElement.value,e={osm_id:this.editFeature.osm_id,aliases:t};te(this.getEndpoint()+"boundaries/"+this.editFeature.osm_id+"/",e).then((()=>{this.fetchFeature()}))}"Cancel"===e.name&&this.hideAliasDialog()}getOptions(t){return t.json.filter((t=>t.level>0))}getOptionsComplete(t){return 0===t.length}renderOptionDetail(t){const e={marginTop:"3px",marginRight:"3px"},i=t.aliases.split("\n").map((t=>t.trim().length>0?O`
5257
- <temba-label style=${dt(e)} class="alias" dark
5345
+ `,s=(t.children||[]).map((t=>e.length>0&&e[0].osm_id===t.osm_id?this.renderFeature(e[0],e.slice(1)):0===e.length||0===e[0].children.length?this.renderFeature(t,e):null));return P` ${o} ${s} `}showAliasDialog(t){this.editFeatureAliases=t.aliases,this.editFeature=t;const e=this.shadowRoot.getElementById("alias-dialog");e&&e.setAttribute("open","")}hideAliasDialog(){const t=this.shadowRoot.getElementById("alias-dialog");this.editFeature=null,this.editFeatureAliases=null,t&&t.removeAttribute("open"),this.requestUpdate()}getEndpoint(){return this.endpoint+(this.endpoint.endsWith("/")?"":"/")}handleDialogClick(t){const e=t.detail.button;if("Save"===e.name){const t=this.shadowRoot.getElementById(this.editFeature.osm_id).inputElement.value,e={osm_id:this.editFeature.osm_id,aliases:t};wt(this.getEndpoint()+"boundaries/"+this.editFeature.osm_id+"/",e).then((()=>{this.fetchFeature()}))}"Cancel"===e.name&&this.hideAliasDialog()}getOptions(t){return t.json.filter((t=>t.level>0))}getOptionsComplete(t){return 0===t.length}renderOptionDetail(t){const e={marginTop:"3px",marginRight:"3px"},i=t.aliases.split("\n").map((t=>t.trim().length>0?P`
5346
+ <temba-label style=${ut(e)} class="alias" dark
5258
5347
  >${t}</temba-label
5259
5348
  >
5260
- `:null));return O`
5349
+ `:null));return P`
5261
5350
  <div class="path">${t.path.replace(/>/gi,"‣")}</div>
5262
5351
  <div class="aliases">${i}</div>
5263
- `}render(){if(0===this.path.length)return O``;const t=this.path[this.path.length-1],e=0===t.children.length?this.path[this.path.length-2]:t,i=this.editFeature?this.editFeature.osm_id:null,n=this.editFeature?this.editFeature.name:null;return O`
5352
+ `}render(){if(0===this.path.length)return P``;const t=this.path[this.path.length-1],e=0===t.children.length?this.path[this.path.length-2]:t,i=this.editFeature?this.editFeature.osm_id:null,n=this.editFeature?this.editFeature.name:null;return P`
5264
5353
  <div id="left-column">
5265
5354
  <div class="search">
5266
5355
  <temba-select
@@ -5307,7 +5396,7 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
5307
5396
  ></temba-textinput>
5308
5397
  </div>
5309
5398
  </temba-dialog>
5310
- `}}t([it({type:Array,attribute:!1})],hl.prototype,"path",void 0),t([it()],hl.prototype,"endpoint",void 0),t([it()],hl.prototype,"osmId",void 0),t([it({type:Object})],hl.prototype,"hovered",void 0),t([it({type:Object})],hl.prototype,"editFeature",void 0),t([it({type:String,attribute:!1})],hl.prototype,"editFeatureAliases",void 0);"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var dl,ul,pl=(dl=function(t,e){!function(t){var e="1.5.1+build.2e3e0ffb",i=Object.freeze;function n(t){var e,i,n,o;for(i=1,n=arguments.length;i<n;i++)for(e in o=arguments[i])t[e]=o[e];return t}Object.freeze=function(t){return t};var o=Object.create||function(){function t(){}return function(e){return t.prototype=e,new t}}();function r(t,e){var i=Array.prototype.slice;if(t.bind)return t.bind.apply(t,i.call(arguments,1));var n=i.call(arguments,2);return function(){return t.apply(e,n.length?n.concat(i.call(arguments)):arguments)}}var s=0;function a(t){return t._leaflet_id=t._leaflet_id||++s,t._leaflet_id}function l(t,e,i){var n,o,r,s;return s=function(){n=!1,o&&(r.apply(i,o),o=!1)},r=function(){n?o=arguments:(t.apply(i,arguments),setTimeout(s,e),n=!0)},r}function c(t,e,i){var n=e[1],o=e[0],r=n-o;return t===n&&i?t:((t-o)%r+r)%r+o}function h(){return!1}function d(t,e){return e=void 0===e?6:e,+(Math.round(t+"e+"+e)+"e-"+e)}function u(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function p(t){return u(t).split(/\s+/)}function m(t,e){for(var i in t.hasOwnProperty("options")||(t.options=t.options?o(t.options):{}),e)t.options[i]=e[i];return t.options}function f(t,e,i){var n=[];for(var o in t)n.push(encodeURIComponent(i?o.toUpperCase():o)+"="+encodeURIComponent(t[o]));return(e&&-1!==e.indexOf("?")?"&":"?")+n.join("&")}var g=/\{ *([\w_-]+) *\}/g;function v(t,e){return t.replace(g,(function(t,i){var n=e[i];if(void 0===n)throw new Error("No value provided for variable "+t);return"function"==typeof n&&(n=n(e)),n}))}var y=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function b(t,e){for(var i=0;i<t.length;i++)if(t[i]===e)return i;return-1}var _="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function x(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var w=0;function k(t){var e=+new Date,i=Math.max(0,16-(e-w));return w=e+i,window.setTimeout(t,i)}var C=window.requestAnimationFrame||x("RequestAnimationFrame")||k,S=window.cancelAnimationFrame||x("CancelAnimationFrame")||x("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function E(t,e,i){if(!i||C!==k)return C.call(window,r(t,e));t.call(e)}function T(t){t&&S.call(window,t)}var M=(Object.freeze||Object)({freeze:i,extend:n,create:o,bind:r,lastId:s,stamp:a,throttle:l,wrapNum:c,falseFn:h,formatNum:d,trim:u,splitWords:p,setOptions:m,getParamString:f,template:v,isArray:y,indexOf:b,emptyImageUrl:_,requestFn:C,cancelFn:S,requestAnimFrame:E,cancelAnimFrame:T});function $(){}function D(t){if("undefined"!=typeof L&&L&&L.Mixin){t=y(t)?t:[t];for(var e=0;e<t.length;e++)t[e]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",(new Error).stack)}}$.extend=function(t){var e=function(){this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},i=e.__super__=this.prototype,r=o(i);for(var s in r.constructor=e,e.prototype=r,this)this.hasOwnProperty(s)&&"prototype"!==s&&"__super__"!==s&&(e[s]=this[s]);return t.statics&&(n(e,t.statics),delete t.statics),t.includes&&(D(t.includes),n.apply(null,[r].concat(t.includes)),delete t.includes),r.options&&(t.options=n(o(r.options),t.options)),n(r,t),r._initHooks=[],r.callInitHooks=function(){if(!this._initHooksCalled){i.callInitHooks&&i.callInitHooks.call(this),this._initHooksCalled=!0;for(var t=0,e=r._initHooks.length;t<e;t++)r._initHooks[t].call(this)}},e},$.include=function(t){return n(this.prototype,t),this},$.mergeOptions=function(t){return n(this.prototype.options,t),this},$.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),i="function"==typeof t?t:function(){this[t].apply(this,e)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i),this};var A={on:function(t,e,i){if("object"==typeof t)for(var n in t)this._on(n,t[n],e);else for(var o=0,r=(t=p(t)).length;o<r;o++)this._on(t[o],e,i);return this},off:function(t,e,i){if(t)if("object"==typeof t)for(var n in t)this._off(n,t[n],e);else for(var o=0,r=(t=p(t)).length;o<r;o++)this._off(t[o],e,i);else delete this._events;return this},_on:function(t,e,i){this._events=this._events||{};var n=this._events[t];n||(n=[],this._events[t]=n),i===this&&(i=void 0);for(var o={fn:e,ctx:i},r=n,s=0,a=r.length;s<a;s++)if(r[s].fn===e&&r[s].ctx===i)return;r.push(o)},_off:function(t,e,i){var n,o,r;if(this._events&&(n=this._events[t]))if(e){if(i===this&&(i=void 0),n)for(o=0,r=n.length;o<r;o++){var s=n[o];if(s.ctx===i&&s.fn===e)return s.fn=h,this._firingCount&&(this._events[t]=n=n.slice()),void n.splice(o,1)}}else{for(o=0,r=n.length;o<r;o++)n[o].fn=h;delete this._events[t]}},fire:function(t,e,i){if(!this.listens(t,i))return this;var o=n({},e,{type:t,target:this,sourceTarget:e&&e.sourceTarget||this});if(this._events){var r=this._events[t];if(r){this._firingCount=this._firingCount+1||1;for(var s=0,a=r.length;s<a;s++){var l=r[s];l.fn.call(l.ctx||this,o)}this._firingCount--}}return i&&this._propagateEvent(o),this},listens:function(t,e){var i=this._events&&this._events[t];if(i&&i.length)return!0;if(e)for(var n in this._eventParents)if(this._eventParents[n].listens(t,e))return!0;return!1},once:function(t,e,i){if("object"==typeof t){for(var n in t)this.once(n,t[n],e);return this}var o=r((function(){this.off(t,e,i).off(t,o,i)}),this);return this.on(t,e,i).on(t,o,i)},addEventParent:function(t){return this._eventParents=this._eventParents||{},this._eventParents[a(t)]=t,this},removeEventParent:function(t){return this._eventParents&&delete this._eventParents[a(t)],this},_propagateEvent:function(t){for(var e in this._eventParents)this._eventParents[e].fire(t.type,n({layer:t.target,propagatedFrom:t.target},t),!0)}};A.addEventListener=A.on,A.removeEventListener=A.clearAllEventListeners=A.off,A.addOneTimeEventListener=A.once,A.fireEvent=A.fire,A.hasEventListeners=A.listens;var O=$.extend(A);function P(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e}var I=Math.trunc||function(t){return t>0?Math.floor(t):Math.ceil(t)};function z(t,e,i){return t instanceof P?t:y(t)?new P(t[0],t[1]):null==t?t:"object"==typeof t&&"x"in t&&"y"in t?new P(t.x,t.y):new P(t,e,i)}function N(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;n<o;n++)this.extend(i[n])}function R(t,e){return!t||t instanceof N?t:new N(t,e)}function B(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;n<o;n++)this.extend(i[n])}function F(t,e){return t instanceof B?t:new B(t,e)}function q(t,e,i){if(isNaN(t)||isNaN(e))throw new Error("Invalid LatLng object: ("+t+", "+e+")");this.lat=+t,this.lng=+e,void 0!==i&&(this.alt=+i)}function j(t,e,i){return t instanceof q?t:y(t)&&"object"!=typeof t[0]?3===t.length?new q(t[0],t[1],t[2]):2===t.length?new q(t[0],t[1]):null:null==t?t:"object"==typeof t&&"lat"in t?new q(t.lat,"lng"in t?t.lng:t.lon,t.alt):void 0===e?null:new q(t,e,i)}P.prototype={clone:function(){return new P(this.x,this.y)},add:function(t){return this.clone()._add(z(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(z(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new P(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new P(this.x/t.x,this.y/t.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=I(this.x),this.y=I(this.y),this},distanceTo:function(t){var e=(t=z(t)).x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return(t=z(t)).x===this.x&&t.y===this.y},contains:function(t){return t=z(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+d(this.x)+", "+d(this.y)+")"}},N.prototype={extend:function(t){return t=z(t),this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(t.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(t.y,this.max.y)):(this.min=t.clone(),this.max=t.clone()),this},getCenter:function(t){return new P((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return new P(this.min.x,this.max.y)},getTopRight:function(){return new P(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,i;return(t="number"==typeof t[0]||t instanceof P?z(t):R(t))instanceof N?(e=t.min,i=t.max):e=i=t,e.x>=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=R(t);var e=this.min,i=this.max,n=t.min,o=t.max,r=o.x>=e.x&&n.x<=i.x,s=o.y>=e.y&&n.y<=i.y;return r&&s},overlaps:function(t){t=R(t);var e=this.min,i=this.max,n=t.min,o=t.max,r=o.x>e.x&&n.x<i.x,s=o.y>e.y&&n.y<i.y;return r&&s},isValid:function(){return!(!this.min||!this.max)}},B.prototype={extend:function(t){var e,i,n=this._southWest,o=this._northEast;if(t instanceof q)e=t,i=t;else{if(!(t instanceof B))return t?this.extend(j(t)||F(t)):this;if(e=t._southWest,i=t._northEast,!e||!i)return this}return n||o?(n.lat=Math.min(e.lat,n.lat),n.lng=Math.min(e.lng,n.lng),o.lat=Math.max(i.lat,o.lat),o.lng=Math.max(i.lng,o.lng)):(this._southWest=new q(e.lat,e.lng),this._northEast=new q(i.lat,i.lng)),this},pad:function(t){var e=this._southWest,i=this._northEast,n=Math.abs(e.lat-i.lat)*t,o=Math.abs(e.lng-i.lng)*t;return new B(new q(e.lat-n,e.lng-o),new q(i.lat+n,i.lng+o))},getCenter:function(){return new q((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new q(this.getNorth(),this.getWest())},getSouthEast:function(){return new q(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(t){t="number"==typeof t[0]||t instanceof q||"lat"in t?j(t):F(t);var e,i,n=this._southWest,o=this._northEast;return t instanceof B?(e=t.getSouthWest(),i=t.getNorthEast()):e=i=t,e.lat>=n.lat&&i.lat<=o.lat&&e.lng>=n.lng&&i.lng<=o.lng},intersects:function(t){t=F(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),r=o.lat>=e.lat&&n.lat<=i.lat,s=o.lng>=e.lng&&n.lng<=i.lng;return r&&s},overlaps:function(t){t=F(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),r=o.lat>e.lat&&n.lat<i.lat,s=o.lng>e.lng&&n.lng<i.lng;return r&&s},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t,e){return!!t&&(t=F(t),this._southWest.equals(t.getSouthWest(),e)&&this._northEast.equals(t.getNorthEast(),e))},isValid:function(){return!(!this._southWest||!this._northEast)}},q.prototype={equals:function(t,e){return!!t&&(t=j(t),Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng))<=(void 0===e?1e-9:e))},toString:function(t){return"LatLng("+d(this.lat,t)+", "+d(this.lng,t)+")"},distanceTo:function(t){return H.distance(this,j(t))},wrap:function(){return H.wrapLatLng(this)},toBounds:function(t){var e=180*t/40075017,i=e/Math.cos(Math.PI/180*this.lat);return F([this.lat-e,this.lng-i],[this.lat+e,this.lng+i])},clone:function(){return new q(this.lat,this.lng,this.alt)}};var Z={latLngToPoint:function(t,e){var i=this.projection.project(t),n=this.scale(e);return this.transformation._transform(i,n)},pointToLatLng:function(t,e){var i=this.scale(e),n=this.transformation.untransform(t,i);return this.projection.unproject(n)},project:function(t){return this.projection.project(t)},unproject:function(t){return this.projection.unproject(t)},scale:function(t){return 256*Math.pow(2,t)},zoom:function(t){return Math.log(t/256)/Math.LN2},getProjectedBounds:function(t){if(this.infinite)return null;var e=this.projection.bounds,i=this.scale(t);return new N(this.transformation.transform(e.min,i),this.transformation.transform(e.max,i))},infinite:!1,wrapLatLng:function(t){var e=this.wrapLng?c(t.lng,this.wrapLng,!0):t.lng;return new q(this.wrapLat?c(t.lat,this.wrapLat,!0):t.lat,e,t.alt)},wrapLatLngBounds:function(t){var e=t.getCenter(),i=this.wrapLatLng(e),n=e.lat-i.lat,o=e.lng-i.lng;if(0===n&&0===o)return t;var r=t.getSouthWest(),s=t.getNorthEast();return new B(new q(r.lat-n,r.lng-o),new q(s.lat-n,s.lng-o))}},H=n({},Z,{wrapLng:[-180,180],R:6371e3,distance:function(t,e){var i=Math.PI/180,n=t.lat*i,o=e.lat*i,r=Math.sin((e.lat-t.lat)*i/2),s=Math.sin((e.lng-t.lng)*i/2),a=r*r+Math.cos(n)*Math.cos(o)*s*s,l=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a));return this.R*l}}),U=6378137,V={R:U,MAX_LATITUDE:85.0511287798,project:function(t){var e=Math.PI/180,i=this.MAX_LATITUDE,n=Math.max(Math.min(i,t.lat),-i),o=Math.sin(n*e);return new P(this.R*t.lng*e,this.R*Math.log((1+o)/(1-o))/2)},unproject:function(t){var e=180/Math.PI;return new q((2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*e,t.x*e/this.R)},bounds:function(){var t=U*Math.PI;return new N([-t,-t],[t,t])}()};function W(t,e,i,n){if(y(t))return this._a=t[0],this._b=t[1],this._c=t[2],void(this._d=t[3]);this._a=t,this._b=e,this._c=i,this._d=n}function G(t,e,i,n){return new W(t,e,i,n)}W.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return e=e||1,t.x=e*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return e=e||1,new P((t.x/e-this._b)/this._a,(t.y/e-this._d)/this._c)}};var Y=n({},H,{code:"EPSG:3857",projection:V,transformation:function(){var t=.5/(Math.PI*V.R);return G(t,.5,-t,.5)}()}),K=n({},Y,{code:"EPSG:900913"});function J(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function X(t,e){var i,n,o,r,s,a,l="";for(i=0,o=t.length;i<o;i++){for(n=0,r=(s=t[i]).length;n<r;n++)l+=(n?"L":"M")+(a=s[n]).x+" "+a.y;l+=e?$t?"z":"x":""}return l||"M0 0"}var Q=document.documentElement.style,tt="ActiveXObject"in window,et=tt&&!document.addEventListener,it="msLaunchUri"in navigator&&!("documentMode"in document),nt=At("webkit"),ot=At("android"),rt=At("android 2")||At("android 3"),st=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),at=ot&&At("Google")&&st<537&&!("AudioNode"in window),lt=!!window.opera,ct=At("chrome"),ht=At("gecko")&&!nt&&!lt&&!tt,dt=!ct&&At("safari"),ut=At("phantom"),pt="OTransition"in Q,mt=0===navigator.platform.indexOf("Win"),ft=tt&&"transition"in Q,gt="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!rt,vt="MozPerspective"in Q,yt=!window.L_DISABLE_3D&&(ft||gt||vt)&&!pt&&!ut,bt="undefined"!=typeof orientation||At("mobile"),_t=bt&&nt,xt=bt&&gt,wt=!window.PointerEvent&&window.MSPointerEvent,kt=!(!window.PointerEvent&&!wt),Ct=!window.L_NO_TOUCH&&(kt||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch),St=bt&&lt,Et=bt&&ht,Tt=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,Mt=!!document.createElement("canvas").getContext,$t=!(!document.createElementNS||!J("svg").createSVGRect),Dt=!$t&&function(){try{var t=document.createElement("div");t.innerHTML='<v:shape adj="1"/>';var e=t.firstChild;return e.style.behavior="url(#default#VML)",e&&"object"==typeof e.adj}catch(t){return!1}}();function At(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var Lt=(Object.freeze||Object)({ie:tt,ielt9:et,edge:it,webkit:nt,android:ot,android23:rt,androidStock:at,opera:lt,chrome:ct,gecko:ht,safari:dt,phantom:ut,opera12:pt,win:mt,ie3d:ft,webkit3d:gt,gecko3d:vt,any3d:yt,mobile:bt,mobileWebkit:_t,mobileWebkit3d:xt,msPointer:wt,pointer:kt,touch:Ct,mobileOpera:St,mobileGecko:Et,retina:Tt,canvas:Mt,svg:$t,vml:Dt}),Ot=wt?"MSPointerDown":"pointerdown",Pt=wt?"MSPointerMove":"pointermove",It=wt?"MSPointerUp":"pointerup",zt=wt?"MSPointerCancel":"pointercancel",Nt=["INPUT","SELECT","OPTION"],Rt={},Bt=!1,Ft=0;function qt(t,e,i,n){return"touchstart"===e?Zt(t,i,n):"touchmove"===e?Gt(t,i,n):"touchend"===e&&Yt(t,i,n),this}function jt(t,e,i){var n=t["_leaflet_"+e+i];return"touchstart"===e?t.removeEventListener(Ot,n,!1):"touchmove"===e?t.removeEventListener(Pt,n,!1):"touchend"===e&&(t.removeEventListener(It,n,!1),t.removeEventListener(zt,n,!1)),this}function Zt(t,e,i){var n=r((function(t){if("mouse"!==t.pointerType&&t.MSPOINTER_TYPE_MOUSE&&t.pointerType!==t.MSPOINTER_TYPE_MOUSE){if(!(Nt.indexOf(t.target.tagName)<0))return;Ze(t)}Wt(t,e)}));t["_leaflet_touchstart"+i]=n,t.addEventListener(Ot,n,!1),Bt||(document.documentElement.addEventListener(Ot,Ht,!0),document.documentElement.addEventListener(Pt,Ut,!0),document.documentElement.addEventListener(It,Vt,!0),document.documentElement.addEventListener(zt,Vt,!0),Bt=!0)}function Ht(t){Rt[t.pointerId]=t,Ft++}function Ut(t){Rt[t.pointerId]&&(Rt[t.pointerId]=t)}function Vt(t){delete Rt[t.pointerId],Ft--}function Wt(t,e){for(var i in t.touches=[],Rt)t.touches.push(Rt[i]);t.changedTouches=[t],e(t)}function Gt(t,e,i){var n=function(t){(t.pointerType!==t.MSPOINTER_TYPE_MOUSE&&"mouse"!==t.pointerType||0!==t.buttons)&&Wt(t,e)};t["_leaflet_touchmove"+i]=n,t.addEventListener(Pt,n,!1)}function Yt(t,e,i){var n=function(t){Wt(t,e)};t["_leaflet_touchend"+i]=n,t.addEventListener(It,n,!1),t.addEventListener(zt,n,!1)}var Kt=wt?"MSPointerDown":kt?"pointerdown":"touchstart",Jt=wt?"MSPointerUp":kt?"pointerup":"touchend",Xt="_leaflet_";function Qt(t,e,i){var n,o,r=!1,s=250;function a(t){var e;if(kt){if(!it||"mouse"===t.pointerType)return;e=Ft}else e=t.touches.length;if(!(e>1)){var i=Date.now(),a=i-(n||i);o=t.touches?t.touches[0]:t,r=a>0&&a<=s,n=i}}function l(t){if(r&&!o.cancelBubble){if(kt){if(!it||"mouse"===t.pointerType)return;var i,s,a={};for(s in o)i=o[s],a[s]=i&&i.bind?i.bind(o):i;o=a}o.type="dblclick",o.button=0,e(o),n=null}}return t[Xt+Kt+i]=a,t[Xt+Jt+i]=l,t[Xt+"dblclick"+i]=e,t.addEventListener(Kt,a,!1),t.addEventListener(Jt,l,!1),t.addEventListener("dblclick",e,!1),this}function te(t,e){var i=t[Xt+Kt+e],n=t[Xt+Jt+e],o=t[Xt+"dblclick"+e];return t.removeEventListener(Kt,i,!1),t.removeEventListener(Jt,n,!1),it||t.removeEventListener("dblclick",o,!1),this}var ee,ie,ne,oe,re,se=ke(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),ae=ke(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),le="webkitTransition"===ae||"OTransition"===ae?ae+"End":"transitionend";function ce(t){return"string"==typeof t?document.getElementById(t):t}function he(t,e){var i=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!i||"auto"===i)&&document.defaultView){var n=document.defaultView.getComputedStyle(t,null);i=n?n[e]:null}return"auto"===i?null:i}function de(t,e,i){var n=document.createElement(t);return n.className=e||"",i&&i.appendChild(n),n}function ue(t){var e=t.parentNode;e&&e.removeChild(t)}function pe(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function me(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function fe(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function ge(t,e){if(void 0!==t.classList)return t.classList.contains(e);var i=_e(t);return i.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(i)}function ve(t,e){if(void 0!==t.classList)for(var i=p(e),n=0,o=i.length;n<o;n++)t.classList.add(i[n]);else if(!ge(t,e)){var r=_e(t);be(t,(r?r+" ":"")+e)}}function ye(t,e){void 0!==t.classList?t.classList.remove(e):be(t,u((" "+_e(t)+" ").replace(" "+e+" "," ")))}function be(t,e){void 0===t.className.baseVal?t.className=e:t.className.baseVal=e}function _e(t){return t.correspondingElement&&(t=t.correspondingElement),void 0===t.className.baseVal?t.className:t.className.baseVal}function xe(t,e){"opacity"in t.style?t.style.opacity=e:"filter"in t.style&&we(t,e)}function we(t,e){var i=!1,n="DXImageTransform.Microsoft.Alpha";try{i=t.filters.item(n)}catch(t){if(1===e)return}e=Math.round(100*e),i?(i.Enabled=100!==e,i.Opacity=e):t.style.filter+=" progid:"+n+"(opacity="+e+")"}function ke(t){for(var e=document.documentElement.style,i=0;i<t.length;i++)if(t[i]in e)return t[i];return!1}function Ce(t,e,i){var n=e||new P(0,0);t.style[se]=(ft?"translate("+n.x+"px,"+n.y+"px)":"translate3d("+n.x+"px,"+n.y+"px,0)")+(i?" scale("+i+")":"")}function Se(t,e){t._leaflet_pos=e,yt?Ce(t,e):(t.style.left=e.x+"px",t.style.top=e.y+"px")}function Ee(t){return t._leaflet_pos||new P(0,0)}if("onselectstart"in document)ee=function(){Ie(window,"selectstart",Ze)},ie=function(){Ne(window,"selectstart",Ze)};else{var Te=ke(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);ee=function(){if(Te){var t=document.documentElement.style;ne=t[Te],t[Te]="none"}},ie=function(){Te&&(document.documentElement.style[Te]=ne,ne=void 0)}}function Me(){Ie(window,"dragstart",Ze)}function $e(){Ne(window,"dragstart",Ze)}function De(t){for(;-1===t.tabIndex;)t=t.parentNode;t.style&&(Ae(),oe=t,re=t.style.outline,t.style.outline="none",Ie(window,"keydown",Ae))}function Ae(){oe&&(oe.style.outline=re,oe=void 0,re=void 0,Ne(window,"keydown",Ae))}function Le(t){do{t=t.parentNode}while(!(t.offsetWidth&&t.offsetHeight||t===document.body));return t}function Oe(t){var e=t.getBoundingClientRect();return{x:e.width/t.offsetWidth||1,y:e.height/t.offsetHeight||1,boundingClientRect:e}}var Pe=(Object.freeze||Object)({TRANSFORM:se,TRANSITION:ae,TRANSITION_END:le,get:ce,getStyle:he,create:de,remove:ue,empty:pe,toFront:me,toBack:fe,hasClass:ge,addClass:ve,removeClass:ye,setClass:be,getClass:_e,setOpacity:xe,testProp:ke,setTransform:Ce,setPosition:Se,getPosition:Ee,disableTextSelection:ee,enableTextSelection:ie,disableImageDrag:Me,enableImageDrag:$e,preventOutline:De,restoreOutline:Ae,getSizedParentNode:Le,getScale:Oe});function Ie(t,e,i,n){if("object"==typeof e)for(var o in e)Re(t,o,e[o],i);else for(var r=0,s=(e=p(e)).length;r<s;r++)Re(t,e[r],i,n);return this}var ze="_leaflet_events";function Ne(t,e,i,n){if("object"==typeof e)for(var o in e)Be(t,o,e[o],i);else if(e)for(var r=0,s=(e=p(e)).length;r<s;r++)Be(t,e[r],i,n);else{for(var a in t[ze])Be(t,a,t[ze][a]);delete t[ze]}return this}function Re(t,e,i,n){var o=e+a(i)+(n?"_"+a(n):"");if(t[ze]&&t[ze][o])return this;var r=function(e){return i.call(n||t,e||window.event)},s=r;kt&&0===e.indexOf("touch")?qt(t,e,r,o):!Ct||"dblclick"!==e||!Qt||kt&&ct?"addEventListener"in t?"mousewheel"===e?t.addEventListener("onwheel"in t?"wheel":"mousewheel",r,!1):"mouseenter"===e||"mouseleave"===e?(r=function(e){e=e||window.event,Xe(t,e)&&s(e)},t.addEventListener("mouseenter"===e?"mouseover":"mouseout",r,!1)):("click"===e&&ot&&(r=function(t){Qe(t,s)}),t.addEventListener(e,r,!1)):"attachEvent"in t&&t.attachEvent("on"+e,r):Qt(t,r,o),t[ze]=t[ze]||{},t[ze][o]=r}function Be(t,e,i,n){var o=e+a(i)+(n?"_"+a(n):""),r=t[ze]&&t[ze][o];if(!r)return this;kt&&0===e.indexOf("touch")?jt(t,e,o):!Ct||"dblclick"!==e||!te||kt&&ct?"removeEventListener"in t?"mousewheel"===e?t.removeEventListener("onwheel"in t?"wheel":"mousewheel",r,!1):t.removeEventListener("mouseenter"===e?"mouseover":"mouseleave"===e?"mouseout":e,r,!1):"detachEvent"in t&&t.detachEvent("on"+e,r):te(t,o),t[ze][o]=null}function Fe(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,Je(t),this}function qe(t){return Re(t,"mousewheel",Fe),this}function je(t){return Ie(t,"mousedown touchstart dblclick",Fe),Re(t,"click",Ke),this}function Ze(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function He(t){return Ze(t),Fe(t),this}function Ue(t,e){if(!e)return new P(t.clientX,t.clientY);var i=Oe(e),n=i.boundingClientRect;return new P((t.clientX-n.left)/i.x-e.clientLeft,(t.clientY-n.top)/i.y-e.clientTop)}var Ve=mt&&ct?2*window.devicePixelRatio:ht?window.devicePixelRatio:1;function We(t){return it?t.wheelDeltaY/2:t.deltaY&&0===t.deltaMode?-t.deltaY/Ve:t.deltaY&&1===t.deltaMode?20*-t.deltaY:t.deltaY&&2===t.deltaMode?60*-t.deltaY:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?20*-t.detail:t.detail?t.detail/-32765*60:0}var Ge,Ye={};function Ke(t){Ye[t.type]=!0}function Je(t){var e=Ye[t.type];return Ye[t.type]=!1,e}function Xe(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch(t){return!1}return i!==t}function Qe(t,e){var i=t.timeStamp||t.originalEvent&&t.originalEvent.timeStamp,n=Ge&&i-Ge;n&&n>100&&n<500||t.target._simulatedClick&&!t._simulated?He(t):(Ge=i,e(t))}var ti=(Object.freeze||Object)({on:Ie,off:Ne,stopPropagation:Fe,disableScrollPropagation:qe,disableClickPropagation:je,preventDefault:Ze,stop:He,getMousePosition:Ue,getWheelDelta:We,fakeStop:Ke,skipped:Je,isExternalTarget:Xe,addListener:Ie,removeListener:Ne}),ei=O.extend({run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=Ee(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=E(this._animate,this),this._step()},_step:function(t){var e=+new Date-this._startTime,i=1e3*this._duration;e<i?this._runFrame(this._easeOut(e/i),t):(this._runFrame(1),this._complete())},_runFrame:function(t,e){var i=this._startPos.add(this._offset.multiplyBy(t));e&&i._round(),Se(this._el,i),this.fire("step")},_complete:function(){T(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),ii=O.extend({options:{crs:Y,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(t,e){e=m(this,e),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(t),this._initLayout(),this._onResize=r(this._onResize,this),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),void 0!==e.zoom&&(this._zoom=this._limitZoom(e.zoom)),e.center&&void 0!==e.zoom&&this.setView(j(e.center),e.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=ae&&yt&&!St&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),Ie(this._proxy,le,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(t,e,i){return e=void 0===e?this._zoom:this._limitZoom(e),t=this._limitCenter(j(t),e,this.options.maxBounds),i=i||{},this._stop(),this._loaded&&!i.reset&&!0!==i&&(void 0!==i.animate&&(i.zoom=n({animate:i.animate},i.zoom),i.pan=n({animate:i.animate,duration:i.duration},i.pan)),this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,i.zoom):this._tryAnimatedPan(t,i.pan))?(clearTimeout(this._sizeTimer),this):(this._resetView(t,e),this)},setZoom:function(t,e){return this._loaded?this.setView(this.getCenter(),t,{zoom:e}):(this._zoom=t,this)},zoomIn:function(t,e){return t=t||(yt?this.options.zoomDelta:1),this.setZoom(this._zoom+t,e)},zoomOut:function(t,e){return t=t||(yt?this.options.zoomDelta:1),this.setZoom(this._zoom-t,e)},setZoomAround:function(t,e,i){var n=this.getZoomScale(e),o=this.getSize().divideBy(2),r=(t instanceof P?t:this.latLngToContainerPoint(t)).subtract(o).multiplyBy(1-1/n),s=this.containerPointToLatLng(o.add(r));return this.setView(s,e,{zoom:i})},_getBoundsCenterZoom:function(t,e){e=e||{},t=t.getBounds?t.getBounds():F(t);var i=z(e.paddingTopLeft||e.padding||[0,0]),n=z(e.paddingBottomRight||e.padding||[0,0]),o=this.getBoundsZoom(t,!1,i.add(n));if((o="number"==typeof e.maxZoom?Math.min(e.maxZoom,o):o)===1/0)return{center:t.getCenter(),zoom:o};var r=n.subtract(i).divideBy(2),s=this.project(t.getSouthWest(),o),a=this.project(t.getNorthEast(),o);return{center:this.unproject(s.add(a).divideBy(2).add(r),o),zoom:o}},fitBounds:function(t,e){if(!(t=F(t)).isValid())throw new Error("Bounds are not valid.");var i=this._getBoundsCenterZoom(t,e);return this.setView(i.center,i.zoom,e)},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,e){return this.setView(t,this._zoom,{pan:e})},panBy:function(t,e){if(e=e||{},!(t=z(t).round()).x&&!t.y)return this.fire("moveend");if(!0!==e.animate&&!this.getSize().contains(t))return this._resetView(this.unproject(this.project(this.getCenter()).add(t)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new ei,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),!1!==e.animate){ve(this._mapPane,"leaflet-pan-anim");var i=this._getMapPanePos().subtract(t).round();this._panAnim.run(this._mapPane,i,e.duration||.25,e.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this},flyTo:function(t,e,i){if(!1===(i=i||{}).animate||!yt)return this.setView(t,e,i);this._stop();var n=this.project(this.getCenter()),o=this.project(t),r=this.getSize(),s=this._zoom;t=j(t),e=void 0===e?s:e;var a=Math.max(r.x,r.y),l=a*this.getZoomScale(s,e),c=o.distanceTo(n)||1,h=1.42,d=h*h;function u(t){var e=(l*l-a*a+(t?-1:1)*d*d*c*c)/(2*(t?l:a)*d*c),i=Math.sqrt(e*e+1)-e;return i<1e-9?-18:Math.log(i)}function p(t){return(Math.exp(t)-Math.exp(-t))/2}function m(t){return(Math.exp(t)+Math.exp(-t))/2}function f(t){return p(t)/m(t)}var g=u(0);function v(t){return a*(m(g)/m(g+h*t))}function y(t){return a*(m(g)*f(g+h*t)-p(g))/d}function b(t){return 1-Math.pow(1-t,1.5)}var _=Date.now(),x=(u(1)-g)/h,w=i.duration?1e3*i.duration:1e3*x*.8;function k(){var i=(Date.now()-_)/w,r=b(i)*x;i<=1?(this._flyToFrame=E(k,this),this._move(this.unproject(n.add(o.subtract(n).multiplyBy(y(r)/c)),s),this.getScaleZoom(a/v(r),s),{flyTo:!0})):this._move(t,e)._moveEnd(!0)}return this._moveStart(!0,i.noMoveStart),k.call(this),this},flyToBounds:function(t,e){var i=this._getBoundsCenterZoom(t,e);return this.flyTo(i.center,i.zoom,e)},setMaxBounds:function(t){return(t=F(t)).isValid()?(this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this.options.maxBounds=t,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this.off("moveend",this._panInsideMaxBounds))},setMinZoom:function(t){var e=this.options.minZoom;return this.options.minZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(t):this},setMaxZoom:function(t){var e=this.options.maxZoom;return this.options.maxZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var i=this.getCenter(),n=this._limitCenter(i,this._zoom,F(t));return i.equals(n)||this.panTo(n,e),this._enforcingBounds=!1,this},panInside:function(t,e){var i=z((e=e||{}).paddingTopLeft||e.padding||[0,0]),n=z(e.paddingBottomRight||e.padding||[0,0]),o=this.getCenter(),r=this.project(o),s=this.project(t),a=this.getPixelBounds(),l=a.getSize().divideBy(2),c=R([a.min.add(i),a.max.subtract(n)]);if(!c.contains(s)){this._enforcingBounds=!0;var h=r.subtract(s),d=z(s.x+h.x,s.y+h.y);(s.x<c.min.x||s.x>c.max.x)&&(d.x=r.x-h.x,h.x>0?d.x+=l.x-i.x:d.x-=l.x-n.x),(s.y<c.min.y||s.y>c.max.y)&&(d.y=r.y-h.y,h.y>0?d.y+=l.y-i.y:d.y-=l.y-n.y),this.panTo(this.unproject(d),e),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=n({animate:!1,pan:!0},!0===t?{animate:!0}:t);var e=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var i=this.getSize(),o=e.divideBy(2).round(),s=i.divideBy(2).round(),a=o.subtract(s);return a.x||a.y?(t.animate&&t.pan?this.panBy(a):(t.pan&&this._rawPanBy(a),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(r(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:i})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=n({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=r(this._handleGeolocationResponse,this),i=r(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,i,t):navigator.geolocation.getCurrentPosition(e,i,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){var e=t.code,i=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+i+"."})},_handleGeolocationResponse:function(t){var e=new q(t.coords.latitude,t.coords.longitude),i=e.toBounds(2*t.coords.accuracy),n=this._locateOptions;if(n.setView){var o=this.getBoundsZoom(i);this.setView(e,n.maxZoom?Math.min(o,n.maxZoom):o)}var r={latlng:e,bounds:i,timestamp:t.timestamp};for(var s in t.coords)"number"==typeof t.coords[s]&&(r[s]=t.coords[s]);this.fire("locationfound",r)},addHandler:function(t,e){if(!e)return this;var i=this[t]=new e(this);return this._handlers.push(i),this.options[t]&&i.enable(),this},remove:function(){if(this._initEvents(!0),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(t){this._container._leaflet_id=void 0,this._containerId=void 0}var t;for(t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),ue(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(T(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)ue(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){var i=de("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),e||this._mapPane);return t&&(this._panes[t]=i),i},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new B(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,i){t=F(t),i=z(i||[0,0]);var n=this.getZoom()||0,o=this.getMinZoom(),r=this.getMaxZoom(),s=t.getNorthWest(),a=t.getSouthEast(),l=this.getSize().subtract(i),c=R(this.project(a,n),this.project(s,n)).getSize(),h=yt?this.options.zoomSnap:1,d=l.x/c.x,u=l.y/c.y,p=e?Math.max(d,u):Math.min(d,u);return n=this.getScaleZoom(p,n),h&&(n=Math.round(n/(h/100))*(h/100),n=e?Math.ceil(n/h)*h:Math.floor(n/h)*h),Math.max(o,Math.min(r,n))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new P(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){var i=this._getTopLeftPoint(t,e);return new N(i,i.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var i=this.options.crs;return e=void 0===e?this._zoom:e,i.scale(t)/i.scale(e)},getScaleZoom:function(t,e){var i=this.options.crs;e=void 0===e?this._zoom:e;var n=i.zoom(t*i.scale(e));return isNaN(n)?1/0:n},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(j(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(z(t),e)},layerPointToLatLng:function(t){var e=z(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){return this.project(j(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(j(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(F(t))},distance:function(t,e){return this.options.crs.distance(j(t),j(e))},containerPointToLayerPoint:function(t){return z(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return z(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(z(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(j(t)))},mouseEventToContainerPoint:function(t){return Ue(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=ce(t);if(!e)throw new Error("Map container not found.");if(e._leaflet_id)throw new Error("Map container is already initialized.");Ie(e,"scroll",this._onScroll,this),this._containerId=a(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&yt,ve(t,"leaflet-container"+(Ct?" leaflet-touch":"")+(Tt?" leaflet-retina":"")+(et?" leaflet-oldie":"")+(dt?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=he(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Se(this._mapPane,new P(0,0)),this.createPane("tilePane"),this.createPane("shadowPane"),this.createPane("overlayPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(ve(t.markerPane,"leaflet-zoom-hide"),ve(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e){Se(this._mapPane,new P(0,0));var i=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var n=this._zoom!==e;this._moveStart(n,!1)._move(t,e)._moveEnd(n),this.fire("viewreset"),i&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,i){void 0===e&&(e=this._zoom);var n=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),(n||i&&i.pinch)&&this.fire("zoom",i),this.fire("move",i)},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return T(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){Se(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={},this._targets[a(this._container)]=this;var e=t?Ne:Ie;e(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),yt&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){T(this._resizeRequest),this._resizeRequest=E((function(){this.invalidateSize({debounceMoveend:!0})}),this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var i,n=[],o="mouseout"===e||"mouseover"===e,r=t.target||t.srcElement,s=!1;r;){if((i=this._targets[a(r)])&&("click"===e||"preclick"===e)&&!t._simulated&&this._draggableMoved(i)){s=!0;break}if(i&&i.listens(e,!0)){if(o&&!Xe(r,t))break;if(n.push(i),o)break}if(r===this._container)break;r=r.parentNode}return n.length||s||o||!Xe(r,t)||(n=[this]),n},_handleDOMEvent:function(t){if(this._loaded&&!Je(t)){var e=t.type;"mousedown"!==e&&"keypress"!==e&&"keyup"!==e&&"keydown"!==e||De(t.target||t.srcElement),this._fireDOMEvent(t,e)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,i){if("click"===t.type){var o=n({},t);o.type="preclick",this._fireDOMEvent(o,o.type,i)}if(!t._stopped&&(i=(i||[]).concat(this._findEventTargets(t,e))).length){var r=i[0];"contextmenu"===e&&r.listens(e,!0)&&Ze(t);var s={originalEvent:t};if("keypress"!==t.type&&"keydown"!==t.type&&"keyup"!==t.type){var a=r.getLatLng&&(!r._radius||r._radius<=10);s.containerPoint=a?this.latLngToContainerPoint(r.getLatLng()):this.mouseEventToContainerPoint(t),s.layerPoint=this.containerPointToLayerPoint(s.containerPoint),s.latlng=a?r.getLatLng():this.layerPointToLatLng(s.layerPoint)}for(var l=0;l<i.length;l++)if(i[l].fire(e,s,!0),s.originalEvent._stopped||!1===i[l].options.bubblingMouseEvents&&-1!==b(this._mouseEvents,e))return}},_draggableMoved:function(t){return(t=t.dragging&&t.dragging.enabled()?t:this).dragging&&t.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var t=0,e=this._handlers.length;t<e;t++)this._handlers[t].disable()},whenReady:function(t,e){return this._loaded?t.call(e||this,{target:this}):this.on("load",t,e),this},_getMapPanePos:function(){return Ee(this._mapPane)||new P(0,0)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(t,e){return(t&&void 0!==e?this._getNewPixelOrigin(t,e):this.getPixelOrigin()).subtract(this._getMapPanePos())},_getNewPixelOrigin:function(t,e){var i=this.getSize()._divideBy(2);return this.project(t,e)._subtract(i)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(t,e,i){var n=this._getNewPixelOrigin(i,e);return this.project(t,e)._subtract(n)},_latLngBoundsToNewLayerBounds:function(t,e,i){var n=this._getNewPixelOrigin(i,e);return R([this.project(t.getSouthWest(),e)._subtract(n),this.project(t.getNorthWest(),e)._subtract(n),this.project(t.getSouthEast(),e)._subtract(n),this.project(t.getNorthEast(),e)._subtract(n)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,e,i){if(!i)return t;var n=this.project(t,e),o=this.getSize().divideBy(2),r=new N(n.subtract(o),n.add(o)),s=this._getBoundsOffset(r,i,e);return s.round().equals([0,0])?t:this.unproject(n.add(s),e)},_limitOffset:function(t,e){if(!e)return t;var i=this.getPixelBounds(),n=new N(i.min.add(t),i.max.add(t));return t.add(this._getBoundsOffset(n,e))},_getBoundsOffset:function(t,e,i){var n=R(this.project(e.getNorthEast(),i),this.project(e.getSouthWest(),i)),o=n.min.subtract(t.min),r=n.max.subtract(t.max);return new P(this._rebound(o.x,-r.x),this._rebound(o.y,-r.y))},_rebound:function(t,e){return t+e>0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom(),n=yt?this.options.zoomSnap:1;return n&&(t=Math.round(t/n)*n),Math.max(e,Math.min(i,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){ye(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var i=this._getCenterOffset(t)._trunc();return!(!0!==(e&&e.animate)&&!this.getSize().contains(i)||(this.panBy(i,e),0))},_createAnimProxy:function(){var t=this._proxy=de("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",(function(t){var e=se,i=this._proxy.style[e];Ce(this._proxy,this.project(t.center,t.zoom),this.getZoomScale(t.zoom,1)),i===this._proxy.style[e]&&this._animatingZoom&&this._onZoomTransitionEnd()}),this),this.on("load moveend",(function(){var t=this.getCenter(),e=this.getZoom();Ce(this._proxy,this.project(t,e),this.getZoomScale(e,1))}),this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){ue(this._proxy),delete this._proxy},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,i){if(this._animatingZoom)return!0;if(i=i||{},!this._zoomAnimated||!1===i.animate||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(e),o=this._getCenterOffset(t)._divideBy(1-1/n);return!(!0!==i.animate&&!this.getSize().contains(o)||(E((function(){this._moveStart(!0,!1)._animateZoom(t,e,!0)}),this),0))},_animateZoom:function(t,e,i,n){this._mapPane&&(i&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,ve(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:n}),setTimeout(r(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&ye(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom),E((function(){this._moveEnd(!0)}),this))}});function ni(t,e){return new ii(t,e)}var oi=$.extend({options:{position:"topright"},initialize:function(t){m(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),n=t._controlCorners[i];return ve(e,"leaflet-control"),-1!==i.indexOf("bottom")?n.insertBefore(e,n.firstChild):n.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(ue(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),ri=function(t){return new oi(t)};ii.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var t=this._controlCorners={},e="leaflet-",i=this._controlContainer=de("div",e+"control-container",this._container);function n(n,o){var r=e+n+" "+e+o;t[n+o]=de("div",r,i)}n("top","left"),n("top","right"),n("bottom","left"),n("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)ue(this._controlCorners[t]);ue(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var si=oi.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,i,n){return i<n?-1:n<i?1:0}},initialize:function(t,e,i){for(var n in m(this,i),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,t)this._addLayer(t[n],n);for(n in e)this._addLayer(e[n],n,!0)},onAdd:function(t){this._initLayout(),this._update(),this._map=t,t.on("zoomend",this._checkDisabledLayers,this);for(var e=0;e<this._layers.length;e++)this._layers[e].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(t){return oi.prototype.addTo.call(this,t),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(t,e){return this._addLayer(t,e),this._map?this._update():this},addOverlay:function(t,e){return this._addLayer(t,e,!0),this._map?this._update():this},removeLayer:function(t){t.off("add remove",this._onLayerChange,this);var e=this._getLayer(a(t));return e&&this._layers.splice(this._layers.indexOf(e),1),this._map?this._update():this},expand:function(){ve(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var t=this._map.getSize().y-(this._container.offsetTop+50);return t<this._section.clientHeight?(ve(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=t+"px"):ye(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return ye(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=de("div",t),i=this.options.collapsed;e.setAttribute("aria-haspopup",!0),je(e),qe(e);var n=this._section=de("section",t+"-list");i&&(this._map.on("click",this.collapse,this),ot||Ie(e,{mouseenter:this.expand,mouseleave:this.collapse},this));var o=this._layersLink=de("a",t+"-toggle",e);o.href="#",o.title="Layers",Ct?(Ie(o,"click",He),Ie(o,"click",this.expand,this)):Ie(o,"focus",this.expand,this),i||this.expand(),this._baseLayersList=de("div",t+"-base",n),this._separator=de("div",t+"-separator",n),this._overlaysList=de("div",t+"-overlays",n),e.appendChild(n)},_getLayer:function(t){for(var e=0;e<this._layers.length;e++)if(this._layers[e]&&a(this._layers[e].layer)===t)return this._layers[e]},_addLayer:function(t,e,i){this._map&&t.on("add remove",this._onLayerChange,this),this._layers.push({layer:t,name:e,overlay:i}),this.options.sortLayers&&this._layers.sort(r((function(t,e){return this.options.sortFunction(t.layer,e.layer,t.name,e.name)}),this)),this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;pe(this._baseLayersList),pe(this._overlaysList),this._layerControlInputs=[];var t,e,i,n,o=0;for(i=0;i<this._layers.length;i++)n=this._layers[i],this._addItem(n),e=e||n.overlay,t=t||!n.overlay,o+=n.overlay?0:1;return this.options.hideSingleBase&&(t=t&&o>1,this._baseLayersList.style.display=t?"":"none"),this._separator.style.display=e&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var e=this._getLayer(a(t.target)),i=e.overlay?"add"===t.type?"overlayadd":"overlayremove":"add"===t.type?"baselayerchange":null;i&&this._map.fire(i,e)},_createRadioElement:function(t,e){var i='<input type="radio" class="leaflet-control-layers-selector" name="'+t+'"'+(e?' checked="checked"':"")+"/>",n=document.createElement("div");return n.innerHTML=i,n.firstChild},_addItem:function(t){var e,i=document.createElement("label"),n=this._map.hasLayer(t.layer);t.overlay?((e=document.createElement("input")).type="checkbox",e.className="leaflet-control-layers-selector",e.defaultChecked=n):e=this._createRadioElement("leaflet-base-layers_"+a(this),n),this._layerControlInputs.push(e),e.layerId=a(t.layer),Ie(e,"click",this._onInputClick,this);var o=document.createElement("span");o.innerHTML=" "+t.name;var r=document.createElement("div");return i.appendChild(r),r.appendChild(e),r.appendChild(o),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(i),this._checkDisabledLayers(),i},_onInputClick:function(){var t,e,i=this._layerControlInputs,n=[],o=[];this._handlingClick=!0;for(var r=i.length-1;r>=0;r--)t=i[r],e=this._getLayer(t.layerId).layer,t.checked?n.push(e):t.checked||o.push(e);for(r=0;r<o.length;r++)this._map.hasLayer(o[r])&&this._map.removeLayer(o[r]);for(r=0;r<n.length;r++)this._map.hasLayer(n[r])||this._map.addLayer(n[r]);this._handlingClick=!1,this._refocusOnMap()},_checkDisabledLayers:function(){for(var t,e,i=this._layerControlInputs,n=this._map.getZoom(),o=i.length-1;o>=0;o--)t=i[o],e=this._getLayer(t.layerId).layer,t.disabled=void 0!==e.options.minZoom&&n<e.options.minZoom||void 0!==e.options.maxZoom&&n>e.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expand:function(){return this.expand()},_collapse:function(){return this.collapse()}}),ai=function(t,e,i){return new si(t,e,i)},li=oi.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"&#x2212;",zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=de("div",e+" leaflet-bar"),n=this.options;return this._zoomInButton=this._createButton(n.zoomInText,n.zoomInTitle,e+"-in",i,this._zoomIn),this._zoomOutButton=this._createButton(n.zoomOutText,n.zoomOutTitle,e+"-out",i,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(t.shiftKey?3:1))},_zoomOut:function(t){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,i,n,o){var r=de("a",i,n);return r.innerHTML=t,r.href="#",r.title=e,r.setAttribute("role","button"),r.setAttribute("aria-label",e),je(r),Ie(r,"click",He),Ie(r,"click",o,this),Ie(r,"click",this._refocusOnMap,this),r},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";ye(this._zoomInButton,e),ye(this._zoomOutButton,e),(this._disabled||t._zoom===t.getMinZoom())&&ve(this._zoomOutButton,e),(this._disabled||t._zoom===t.getMaxZoom())&&ve(this._zoomInButton,e)}});ii.mergeOptions({zoomControl:!0}),ii.addInitHook((function(){this.options.zoomControl&&(this.zoomControl=new li,this.addControl(this.zoomControl))}));var ci=function(t){return new li(t)},hi=oi.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",i=de("div",e),n=this.options;return this._addScales(n,e+"-line",i),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=de("div",e,i)),t.imperial&&(this._iScale=de("div",e,i))},_update:function(){var t=this._map,e=t.getSize().y/2,i=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(i)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t),i=e<1e3?e+" m":e/1e3+" km";this._updateScale(this._mScale,i,e/t)},_updateImperial:function(t){var e,i,n,o=3.2808399*t;o>5280?(e=o/5280,i=this._getRoundNum(e),this._updateScale(this._iScale,i+" mi",i/e)):(n=this._getRoundNum(o),this._updateScale(this._iScale,n+" ft",n/o))},_updateScale:function(t,e,i){t.style.width=Math.round(this.options.maxWidth*i)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),i=t/e;return e*(i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:1)}}),di=function(t){return new hi(t)},ui=oi.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JS library for interactive maps">Leaflet</a>'},initialize:function(t){m(this,t),this._attributions={}},onAdd:function(t){for(var e in t.attributionControl=this,this._container=de("div","leaflet-control-attribution"),je(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),this._container},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var i=[];this.options.prefix&&i.push(this.options.prefix),t.length&&i.push(t.join(", ")),this._container.innerHTML=i.join(" | ")}}});ii.mergeOptions({attributionControl:!0}),ii.addInitHook((function(){this.options.attributionControl&&(new ui).addTo(this)}));var pi=function(t){return new ui(t)};oi.Layers=si,oi.Zoom=li,oi.Scale=hi,oi.Attribution=ui,ri.layers=ai,ri.zoom=ci,ri.scale=di,ri.attribution=pi;var mi=$.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});mi.addTo=function(t,e){return t.addHandler(e,this),this};var fi,gi={Events:A},vi=Ct?"touchstart mousedown":"mousedown",yi={mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},bi={mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"},_i=O.extend({options:{clickTolerance:3},initialize:function(t,e,i,n){m(this,n),this._element=t,this._dragStartTarget=e||t,this._preventOutline=i},enable:function(){this._enabled||(Ie(this._dragStartTarget,vi,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(_i._dragging===this&&this.finishDrag(),Ne(this._dragStartTarget,vi,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(!t._simulated&&this._enabled&&(this._moved=!1,!ge(this._element,"leaflet-zoom-anim")&&!(_i._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(_i._dragging=this,this._preventOutline&&De(this._element),Me(),ee(),this._moving)))){this.fire("down");var e=t.touches?t.touches[0]:t,i=Le(this._element);this._startPoint=new P(e.clientX,e.clientY),this._parentScale=Oe(i),Ie(document,bi[t.type],this._onMove,this),Ie(document,yi[t.type],this._onUp,this)}},_onMove:function(t){if(!t._simulated&&this._enabled)if(t.touches&&t.touches.length>1)this._moved=!0;else{var e=t.touches&&1===t.touches.length?t.touches[0]:t,i=new P(e.clientX,e.clientY)._subtract(this._startPoint);(i.x||i.y)&&(Math.abs(i.x)+Math.abs(i.y)<this.options.clickTolerance||(i.x/=this._parentScale.x,i.y/=this._parentScale.y,Ze(t),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=Ee(this._element).subtract(i),ve(document.body,"leaflet-dragging"),this._lastTarget=t.target||t.srcElement,window.SVGElementInstance&&this._lastTarget instanceof SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),ve(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(i),this._moving=!0,T(this._animRequest),this._lastEvent=t,this._animRequest=E(this._updatePosition,this,!0)))}},_updatePosition:function(){var t={originalEvent:this._lastEvent};this.fire("predrag",t),Se(this._element,this._newPos),this.fire("drag",t)},_onUp:function(t){!t._simulated&&this._enabled&&this.finishDrag()},finishDrag:function(){for(var t in ye(document.body,"leaflet-dragging"),this._lastTarget&&(ye(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),bi)Ne(document,bi[t],this._onMove,this),Ne(document,yi[t],this._onUp,this);$e(),ie(),this._moved&&this._moving&&(T(this._animRequest),this.fire("dragend",{distance:this._newPos.distanceTo(this._startPos)})),this._moving=!1,_i._dragging=!1}});function xi(t,e){if(!e||!t.length)return t.slice();var i=e*e;return t=Ci(t=Ei(t,i),i)}function wi(t,e,i){return Math.sqrt(Ai(t,e,i,!0))}function ki(t,e,i){return Ai(t,e,i)}function Ci(t,e){var i=t.length,n=new(typeof Uint8Array!=void 0+""?Uint8Array:Array)(i);n[0]=n[i-1]=1,Si(t,n,e,0,i-1);var o,r=[];for(o=0;o<i;o++)n[o]&&r.push(t[o]);return r}function Si(t,e,i,n,o){var r,s,a,l=0;for(s=n+1;s<=o-1;s++)(a=Ai(t[s],t[n],t[o],!0))>l&&(r=s,l=a);l>i&&(e[r]=1,Si(t,e,i,n,r),Si(t,e,i,r,o))}function Ei(t,e){for(var i=[t[0]],n=1,o=0,r=t.length;n<r;n++)Di(t[n],t[o])>e&&(i.push(t[n]),o=n);return o<r-1&&i.push(t[r-1]),i}function Ti(t,e,i,n,o){var r,s,a,l=n?fi:$i(t,i),c=$i(e,i);for(fi=c;;){if(!(l|c))return[t,e];if(l&c)return!1;a=$i(s=Mi(t,e,r=l||c,i,o),i),r===l?(t=s,l=a):(e=s,c=a)}}function Mi(t,e,i,n,o){var r,s,a=e.x-t.x,l=e.y-t.y,c=n.min,h=n.max;return 8&i?(r=t.x+a*(h.y-t.y)/l,s=h.y):4&i?(r=t.x+a*(c.y-t.y)/l,s=c.y):2&i?(r=h.x,s=t.y+l*(h.x-t.x)/a):1&i&&(r=c.x,s=t.y+l*(c.x-t.x)/a),new P(r,s,o)}function $i(t,e){var i=0;return t.x<e.min.x?i|=1:t.x>e.max.x&&(i|=2),t.y<e.min.y?i|=4:t.y>e.max.y&&(i|=8),i}function Di(t,e){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n}function Ai(t,e,i,n){var o,r=e.x,s=e.y,a=i.x-r,l=i.y-s,c=a*a+l*l;return c>0&&((o=((t.x-r)*a+(t.y-s)*l)/c)>1?(r=i.x,s=i.y):o>0&&(r+=a*o,s+=l*o)),a=t.x-r,l=t.y-s,n?a*a+l*l:new P(r,s)}function Li(t){return!y(t[0])||"object"!=typeof t[0][0]&&void 0!==t[0][0]}function Oi(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Li(t)}var Pi=(Object.freeze||Object)({simplify:xi,pointToSegmentDistance:wi,closestPointOnSegment:ki,clipSegment:Ti,_getEdgeIntersection:Mi,_getBitCode:$i,_sqClosestPointOnSegment:Ai,isFlat:Li,_flat:Oi});function Ii(t,e,i){var n,o,r,s,a,l,c,h,d,u=[1,4,2,8];for(o=0,c=t.length;o<c;o++)t[o]._code=$i(t[o],e);for(s=0;s<4;s++){for(h=u[s],n=[],o=0,r=(c=t.length)-1;o<c;r=o++)a=t[o],l=t[r],a._code&h?l._code&h||((d=Mi(l,a,h,e,i))._code=$i(d,e),n.push(d)):(l._code&h&&((d=Mi(l,a,h,e,i))._code=$i(d,e),n.push(d)),n.push(a));t=n}return t}var zi=(Object.freeze||Object)({clipPolygon:Ii}),Ni={project:function(t){return new P(t.lng,t.lat)},unproject:function(t){return new q(t.y,t.x)},bounds:new N([-180,-90],[180,90])},Ri={R:6378137,R_MINOR:6356752.314245179,bounds:new N([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(t){var e=Math.PI/180,i=this.R,n=t.lat*e,o=this.R_MINOR/i,r=Math.sqrt(1-o*o),s=r*Math.sin(n),a=Math.tan(Math.PI/4-n/2)/Math.pow((1-s)/(1+s),r/2);return n=-i*Math.log(Math.max(a,1e-10)),new P(t.lng*e*i,n)},unproject:function(t){for(var e,i=180/Math.PI,n=this.R,o=this.R_MINOR/n,r=Math.sqrt(1-o*o),s=Math.exp(-t.y/n),a=Math.PI/2-2*Math.atan(s),l=0,c=.1;l<15&&Math.abs(c)>1e-7;l++)e=r*Math.sin(a),e=Math.pow((1-e)/(1+e),r/2),a+=c=Math.PI/2-2*Math.atan(s*e)-a;return new q(a*i,t.x*i/n)}},Bi=(Object.freeze||Object)({LonLat:Ni,Mercator:Ri,SphericalMercator:V}),Fi=n({},H,{code:"EPSG:3395",projection:Ri,transformation:function(){var t=.5/(Math.PI*Ri.R);return G(t,.5,-t,.5)}()}),qi=n({},H,{code:"EPSG:4326",projection:Ni,transformation:G(1/180,1,-1/180,.5)}),ji=n({},Z,{projection:Ni,transformation:G(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,e){var i=e.lng-t.lng,n=e.lat-t.lat;return Math.sqrt(i*i+n*n)},infinite:!0});Z.Earth=H,Z.EPSG3395=Fi,Z.EPSG3857=Y,Z.EPSG900913=K,Z.EPSG4326=qi,Z.Simple=ji;var Zi=O.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[a(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[a(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e=t.target;if(e.hasLayer(this)){if(this._map=e,this._zoomAnimated=e._zoomAnimated,this.getEvents){var i=this.getEvents();e.on(i,this),this.once("remove",(function(){e.off(i,this)}),this)}this.onAdd(e),this.getAttribution&&e.attributionControl&&e.attributionControl.addAttribution(this.getAttribution()),this.fire("add"),e.fire("layeradd",{layer:this})}}});ii.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var e=a(t);return this._layers[e]||(this._layers[e]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t)),this},removeLayer:function(t){var e=a(t);return this._layers[e]?(this._loaded&&t.onRemove(this),t.getAttribution&&this.attributionControl&&this.attributionControl.removeAttribution(t.getAttribution()),delete this._layers[e],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return!!t&&a(t)in this._layers},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},_addLayers:function(t){for(var e=0,i=(t=t?y(t)?t:[t]:[]).length;e<i;e++)this.addLayer(t[e])},_addZoomLimit:function(t){!isNaN(t.options.maxZoom)&&isNaN(t.options.minZoom)||(this._zoomBoundLayers[a(t)]=t,this._updateZoomLevels())},_removeZoomLimit:function(t){var e=a(t);this._zoomBoundLayers[e]&&(delete this._zoomBoundLayers[e],this._updateZoomLevels())},_updateZoomLevels:function(){var t=1/0,e=-1/0,i=this._getZoomSpan();for(var n in this._zoomBoundLayers){var o=this._zoomBoundLayers[n].options;t=void 0===o.minZoom?t:Math.min(t,o.minZoom),e=void 0===o.maxZoom?e:Math.max(e,o.maxZoom)}this._layersMaxZoom=e===-1/0?void 0:e,this._layersMinZoom=t===1/0?void 0:t,i!==this._getZoomSpan()&&this.fire("zoomlevelschange"),void 0===this.options.maxZoom&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var Hi=Zi.extend({initialize:function(t,e){var i,n;if(m(this,e),this._layers={},t)for(i=0,n=t.length;i<n;i++)this.addLayer(t[i])},addLayer:function(t){var e=this.getLayerId(t);return this._layers[e]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var e=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[e]&&this._map.removeLayer(this._layers[e]),delete this._layers[e],this},hasLayer:function(t){return!!t&&(t in this._layers||this.getLayerId(t)in this._layers)},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(t){var e,i,n=Array.prototype.slice.call(arguments,1);for(e in this._layers)(i=this._layers[e])[t]&&i[t].apply(i,n);return this},onAdd:function(t){this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t)},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=[];return this.eachLayer(t.push,t),t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:function(t){return a(t)}}),Ui=function(t,e){return new Hi(t,e)},Vi=Hi.extend({addLayer:function(t){return this.hasLayer(t)?this:(t.addEventParent(this),Hi.prototype.addLayer.call(this,t),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return this.hasLayer(t)?(t in this._layers&&(t=this._layers[t]),t.removeEventParent(this),Hi.prototype.removeLayer.call(this,t),this.fire("layerremove",{layer:t})):this},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new B;for(var e in this._layers){var i=this._layers[e];t.extend(i.getBounds?i.getBounds():i.getLatLng())}return t}}),Wi=function(t){return new Vi(t)},Gi=$.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0]},initialize:function(t){m(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,e){var i=this._getIconUrl(t);if(!i){if("icon"===t)throw new Error("iconUrl not set in Icon options (see the docs).");return null}var n=this._createImg(i,e&&"IMG"===e.tagName?e:null);return this._setIconStyles(n,t),n},_setIconStyles:function(t,e){var i=this.options,n=i[e+"Size"];"number"==typeof n&&(n=[n,n]);var o=z(n),r=z("shadow"===e&&i.shadowAnchor||i.iconAnchor||o&&o.divideBy(2,!0));t.className="leaflet-marker-"+e+" "+(i.className||""),r&&(t.style.marginLeft=-r.x+"px",t.style.marginTop=-r.y+"px"),o&&(t.style.width=o.x+"px",t.style.height=o.y+"px")},_createImg:function(t,e){return(e=e||document.createElement("img")).src=t,e},_getIconUrl:function(t){return Tt&&this.options[t+"RetinaUrl"]||this.options[t+"Url"]}});function Yi(t){return new Gi(t)}var Ki=Gi.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(t){return Ki.imagePath||(Ki.imagePath=this._detectIconPath()),(this.options.imagePath||Ki.imagePath)+Gi.prototype._getIconUrl.call(this,t)},_detectIconPath:function(){var t=de("div","leaflet-default-icon-path",document.body),e=he(t,"background-image")||he(t,"backgroundImage");return document.body.removeChild(t),e=null===e||0!==e.indexOf("url")?"":e.replace(/^url\(["']?/,"").replace(/marker-icon\.png["']?\)$/,"")}}),Ji=mi.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new _i(t,t,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),ve(t,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&ye(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(t){var e=this._marker,i=e._map,n=this._marker.options.autoPanSpeed,o=this._marker.options.autoPanPadding,r=Ee(e._icon),s=i.getPixelBounds(),a=i.getPixelOrigin(),l=R(s.min._subtract(a).add(o),s.max._subtract(a).subtract(o));if(!l.contains(r)){var c=z((Math.max(l.max.x,r.x)-l.max.x)/(s.max.x-l.max.x)-(Math.min(l.min.x,r.x)-l.min.x)/(s.min.x-l.min.x),(Math.max(l.max.y,r.y)-l.max.y)/(s.max.y-l.max.y)-(Math.min(l.min.y,r.y)-l.min.y)/(s.min.y-l.min.y)).multiplyBy(n);i.panBy(c,{animate:!1}),this._draggable._newPos._add(c),this._draggable._startPos._add(c),Se(e._icon,this._draggable._newPos),this._onDrag(t),this._panRequest=E(this._adjustPan.bind(this,t))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup().fire("movestart").fire("dragstart")},_onPreDrag:function(t){this._marker.options.autoPan&&(T(this._panRequest),this._panRequest=E(this._adjustPan.bind(this,t)))},_onDrag:function(t){var e=this._marker,i=e._shadow,n=Ee(e._icon),o=e._map.layerPointToLatLng(n);i&&Se(i,n),e._latlng=o,t.latlng=o,t.oldLatLng=this._oldLatLng,e.fire("move",t).fire("drag",t)},_onDragEnd:function(t){T(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",t)}}),Xi=Zi.extend({options:{icon:new Ki,interactive:!0,keyboard:!0,title:"",alt:"",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(t,e){m(this,e),this._latlng=j(t)},onAdd:function(t){this._zoomAnimated=this._zoomAnimated&&t.options.markerZoomAnimation,this._zoomAnimated&&t.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(t){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&t.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(t){var e=this._latlng;return this._latlng=j(t),this.update(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update()},getIcon:function(){return this.options.icon},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,e="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),i=t.icon.createIcon(this._icon),n=!1;i!==this._icon&&(this._icon&&this._removeIcon(),n=!0,t.title&&(i.title=t.title),"IMG"===i.tagName&&(i.alt=t.alt||"")),ve(i,e),t.keyboard&&(i.tabIndex="0"),this._icon=i,t.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex});var o=t.icon.createShadow(this._shadow),r=!1;o!==this._shadow&&(this._removeShadow(),r=!0),o&&(ve(o,e),o.alt=""),this._shadow=o,t.opacity<1&&this._updateOpacity(),n&&this.getPane().appendChild(this._icon),this._initInteraction(),o&&r&&this.getPane(t.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),ue(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&ue(this._shadow),this._shadow=null},_setPos:function(t){Se(this._icon,t),this._shadow&&Se(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon.style.zIndex=this._zIndex+t},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPos(e)},_initInteraction:function(){if(this.options.interactive&&(ve(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),Ji)){var t=this.options.draggable;this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Ji(this),t&&this.dragging.enable()}},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var t=this.options.opacity;this._icon&&xe(this._icon,t),this._shadow&&xe(this._shadow,t)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function Qi(t,e){return new Xi(t,e)}var tn=Zi.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(t){this._renderer=t.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(t){return m(this,t),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&t.hasOwnProperty("weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+this._renderer.options.tolerance}}),en=tn.extend({options:{fill:!0,radius:10},initialize:function(t,e){m(this,e),this._latlng=j(t),this._radius=this.options.radius},setLatLng:function(t){return this._latlng=j(t),this.redraw(),this.fire("move",{latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(t){return this.options.radius=this._radius=t,this.redraw()},getRadius:function(){return this._radius},setStyle:function(t){var e=t&&t.radius||this._radius;return tn.prototype.setStyle.call(this,t),this.setRadius(e),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var t=this._radius,e=this._radiusY||t,i=this._clickTolerance(),n=[t+i,e+i];this._pxBounds=new N(this._point.subtract(n),this._point.add(n))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(t){return t.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function nn(t,e){return new en(t,e)}var on=en.extend({initialize:function(t,e,i){if("number"==typeof e&&(e=n({},i,{radius:e})),m(this,e),this._latlng=j(t),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(t){return this._mRadius=t,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var t=[this._radius,this._radiusY||this._radius];return new B(this._map.layerPointToLatLng(this._point.subtract(t)),this._map.layerPointToLatLng(this._point.add(t)))},setStyle:tn.prototype.setStyle,_project:function(){var t=this._latlng.lng,e=this._latlng.lat,i=this._map,n=i.options.crs;if(n.distance===H.distance){var o=Math.PI/180,r=this._mRadius/H.R/o,s=i.project([e+r,t]),a=i.project([e-r,t]),l=s.add(a).divideBy(2),c=i.unproject(l).lat,h=Math.acos((Math.cos(r*o)-Math.sin(e*o)*Math.sin(c*o))/(Math.cos(e*o)*Math.cos(c*o)))/o;(isNaN(h)||0===h)&&(h=r/Math.cos(Math.PI/180*e)),this._point=l.subtract(i.getPixelOrigin()),this._radius=isNaN(h)?0:l.x-i.project([c,t-h]).x,this._radiusY=l.y-s.y}else{var d=n.unproject(n.project(this._latlng).subtract([this._mRadius,0]));this._point=i.latLngToLayerPoint(this._latlng),this._radius=this._point.x-i.latLngToLayerPoint(d).x}this._updateBounds()}});function rn(t,e,i){return new on(t,e,i)}var sn=tn.extend({options:{smoothFactor:1,noClip:!1},initialize:function(t,e){m(this,e),this._setLatLngs(t)},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._setLatLngs(t),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(t){for(var e,i,n=1/0,o=null,r=Ai,s=0,a=this._parts.length;s<a;s++)for(var l=this._parts[s],c=1,h=l.length;c<h;c++){var d=r(t,e=l[c-1],i=l[c],!0);d<n&&(n=d,o=r(t,e,i))}return o&&(o.distance=Math.sqrt(n)),o},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var t,e,i,n,o,r,s,a=this._rings[0],l=a.length;if(!l)return null;for(t=0,e=0;t<l-1;t++)e+=a[t].distanceTo(a[t+1])/2;if(0===e)return this._map.layerPointToLatLng(a[0]);for(t=0,n=0;t<l-1;t++)if(o=a[t],r=a[t+1],(n+=i=o.distanceTo(r))>e)return s=(n-e)/i,this._map.layerPointToLatLng([r.x-s*(r.x-o.x),r.y-s*(r.y-o.y)])},getBounds:function(){return this._bounds},addLatLng:function(t,e){return e=e||this._defaultShape(),t=j(t),e.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new B,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return Li(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var e=[],i=Li(t),n=0,o=t.length;n<o;n++)i?(e[n]=j(t[n]),this._bounds.extend(e[n])):e[n]=this._convertLatLngs(t[n]);return e},_project:function(){var t=new N;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,t),this._bounds.isValid()&&t.isValid()&&(this._rawPxBounds=t,this._updateBounds())},_updateBounds:function(){var t=this._clickTolerance(),e=new P(t,t);this._pxBounds=new N([this._rawPxBounds.min.subtract(e),this._rawPxBounds.max.add(e)])},_projectLatlngs:function(t,e,i){var n,o,r=t[0]instanceof q,s=t.length;if(r){for(o=[],n=0;n<s;n++)o[n]=this._map.latLngToLayerPoint(t[n]),i.extend(o[n]);e.push(o)}else for(n=0;n<s;n++)this._projectLatlngs(t[n],e,i)},_clipPoints:function(){var t=this._renderer._bounds;if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else{var e,i,n,o,r,s,a,l=this._parts;for(e=0,n=0,o=this._rings.length;e<o;e++)for(i=0,r=(a=this._rings[e]).length;i<r-1;i++)(s=Ti(a[i],a[i+1],t,i,!0))&&(l[n]=l[n]||[],l[n].push(s[0]),s[1]===a[i+1]&&i!==r-2||(l[n].push(s[1]),n++))}},_simplifyPoints:function(){for(var t=this._parts,e=this.options.smoothFactor,i=0,n=t.length;i<n;i++)t[i]=xi(t[i],e)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(t,e){var i,n,o,r,s,a,l=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(i=0,r=this._parts.length;i<r;i++)for(n=0,o=(s=(a=this._parts[i]).length)-1;n<s;o=n++)if((e||0!==n)&&wi(t,a[o],a[n])<=l)return!0;return!1}});function an(t,e){return new sn(t,e)}sn._flat=Oi;var ln=sn.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var t,e,i,n,o,r,s,a,l,c=this._rings[0],h=c.length;if(!h)return null;for(r=s=a=0,t=0,e=h-1;t<h;e=t++)i=c[t],n=c[e],o=i.y*n.x-n.y*i.x,s+=(i.x+n.x)*o,a+=(i.y+n.y)*o,r+=3*o;return l=0===r?c[0]:[s/r,a/r],this._map.layerPointToLatLng(l)},_convertLatLngs:function(t){var e=sn.prototype._convertLatLngs.call(this,t),i=e.length;return i>=2&&e[0]instanceof q&&e[0].equals(e[i-1])&&e.pop(),e},_setLatLngs:function(t){sn.prototype._setLatLngs.call(this,t),Li(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Li(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,i=new P(e,e);if(t=new N(t.min.subtract(i),t.max.add(i)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var n,o=0,r=this._rings.length;o<r;o++)(n=Ii(this._rings[o],t,!0)).length&&this._parts.push(n)},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(t){var e,i,n,o,r,s,a,l,c=!1;if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(o=0,a=this._parts.length;o<a;o++)for(r=0,s=(l=(e=this._parts[o]).length)-1;r<l;s=r++)i=e[r],n=e[s],i.y>t.y!=n.y>t.y&&t.x<(n.x-i.x)*(t.y-i.y)/(n.y-i.y)+i.x&&(c=!c);return c||sn.prototype._containsPoint.call(this,t,!0)}});function cn(t,e){return new ln(t,e)}var hn=Vi.extend({initialize:function(t,e){m(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,n,o=y(t)?t:t.features;if(o){for(e=0,i=o.length;e<i;e++)((n=o[e]).geometries||n.geometry||n.features||n.coordinates)&&this.addData(n);return this}var r=this.options;if(r.filter&&!r.filter(t))return this;var s=dn(t,r);return s?(s.feature=vn(t),s.defaultOptions=s.options,this.resetStyle(s),r.onEachFeature&&r.onEachFeature(t,s),this.addLayer(s)):this},resetStyle:function(t){return t.options=n({},t.defaultOptions),this._setLayerStyle(t,this.options.style),this},setStyle:function(t){return this.eachLayer((function(e){this._setLayerStyle(e,t)}),this)},_setLayerStyle:function(t,e){t.setStyle&&("function"==typeof e&&(e=e(t.feature)),t.setStyle(e))}});function dn(t,e){var i,n,o,r,s="Feature"===t.type?t.geometry:t,a=s?s.coordinates:null,l=[],c=e&&e.pointToLayer,h=e&&e.coordsToLatLng||un;if(!a&&!s)return null;switch(s.type){case"Point":return i=h(a),c?c(t,i):new Xi(i);case"MultiPoint":for(o=0,r=a.length;o<r;o++)i=h(a[o]),l.push(c?c(t,i):new Xi(i));return new Vi(l);case"LineString":case"MultiLineString":return n=pn(a,"LineString"===s.type?0:1,h),new sn(n,e);case"Polygon":case"MultiPolygon":return n=pn(a,"Polygon"===s.type?1:2,h),new ln(n,e);case"GeometryCollection":for(o=0,r=s.geometries.length;o<r;o++){var d=dn({geometry:s.geometries[o],type:"Feature",properties:t.properties},e);d&&l.push(d)}return new Vi(l);default:throw new Error("Invalid GeoJSON object.")}}function un(t){return new q(t[1],t[0],t[2])}function pn(t,e,i){for(var n,o=[],r=0,s=t.length;r<s;r++)n=e?pn(t[r],e-1,i):(i||un)(t[r]),o.push(n);return o}function mn(t,e){return e="number"==typeof e?e:6,void 0!==t.alt?[d(t.lng,e),d(t.lat,e),d(t.alt,e)]:[d(t.lng,e),d(t.lat,e)]}function fn(t,e,i,n){for(var o=[],r=0,s=t.length;r<s;r++)o.push(e?fn(t[r],e-1,i,n):mn(t[r],n));return!e&&i&&o.push(o[0]),o}function gn(t,e){return t.feature?n({},t.feature,{geometry:e}):vn(e)}function vn(t){return"Feature"===t.type||"FeatureCollection"===t.type?t:{type:"Feature",properties:{},geometry:t}}var yn={toGeoJSON:function(t){return gn(this,{type:"Point",coordinates:mn(this.getLatLng(),t)})}};function bn(t,e){return new hn(t,e)}Xi.include(yn),on.include(yn),en.include(yn),sn.include({toGeoJSON:function(t){var e=!Li(this._latlngs);return gn(this,{type:(e?"Multi":"")+"LineString",coordinates:fn(this._latlngs,e?1:0,!1,t)})}}),ln.include({toGeoJSON:function(t){var e=!Li(this._latlngs),i=e&&!Li(this._latlngs[0]),n=fn(this._latlngs,i?2:e?1:0,!0,t);return e||(n=[n]),gn(this,{type:(i?"Multi":"")+"Polygon",coordinates:n})}}),Hi.include({toMultiPoint:function(t){var e=[];return this.eachLayer((function(i){e.push(i.toGeoJSON(t).geometry.coordinates)})),gn(this,{type:"MultiPoint",coordinates:e})},toGeoJSON:function(t){var e=this.feature&&this.feature.geometry&&this.feature.geometry.type;if("MultiPoint"===e)return this.toMultiPoint(t);var i="GeometryCollection"===e,n=[];return this.eachLayer((function(e){if(e.toGeoJSON){var o=e.toGeoJSON(t);if(i)n.push(o.geometry);else{var r=vn(o);"FeatureCollection"===r.type?n.push.apply(n,r.features):n.push(r)}}})),i?gn(this,{geometries:n,type:"GeometryCollection"}):{type:"FeatureCollection",features:n}}});var _n=bn,xn=Zi.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,e,i){this._url=t,this._bounds=F(e),m(this,i)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(ve(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){ue(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&me(this._image),this},bringToBack:function(){return this._map&&fe(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=F(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t="IMG"===this._url.tagName,e=this._image=t?this._url:de("img");ve(e,"leaflet-image-layer"),this._zoomAnimated&&ve(e,"leaflet-zoom-animated"),this.options.className&&ve(e,this.options.className),e.onselectstart=h,e.onmousemove=h,e.onload=r(this.fire,this,"load"),e.onerror=r(this._overlayOnError,this,"error"),(this.options.crossOrigin||""===this.options.crossOrigin)&&(e.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t?this._url=e.src:(e.src=this._url,e.alt=this.options.alt)},_animateZoom:function(t){var e=this._map.getZoomScale(t.zoom),i=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;Ce(this._image,i,e)},_reset:function(){var t=this._image,e=new N(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),i=e.getSize();Se(t,e.min),t.style.width=i.x+"px",t.style.height=i.y+"px"},_updateOpacity:function(){xe(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)}}),wn=function(t,e,i){return new xn(t,e,i)},kn=xn.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0},_initImage:function(){var t="VIDEO"===this._url.tagName,e=this._image=t?this._url:de("video");if(ve(e,"leaflet-image-layer"),this._zoomAnimated&&ve(e,"leaflet-zoom-animated"),e.onselectstart=h,e.onmousemove=h,e.onloadeddata=r(this.fire,this,"load"),t){for(var i=e.getElementsByTagName("source"),n=[],o=0;o<i.length;o++)n.push(i[o].src);this._url=i.length>0?n:[e.src]}else{y(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&e.style.hasOwnProperty("objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop;for(var s=0;s<this._url.length;s++){var a=de("source");a.src=this._url[s],e.appendChild(a)}}}});function Cn(t,e,i){return new kn(t,e,i)}var Sn=xn.extend({_initImage:function(){var t=this._image=this._url;ve(t,"leaflet-image-layer"),this._zoomAnimated&&ve(t,"leaflet-zoom-animated"),t.onselectstart=h,t.onmousemove=h}});function En(t,e,i){return new Sn(t,e,i)}var Tn=Zi.extend({options:{offset:[0,7],className:"",pane:"popupPane"},initialize:function(t,e){m(this,t),this._source=e},onAdd:function(t){this._zoomAnimated=t._zoomAnimated,this._container||this._initLayout(),t._fadeAnimated&&xe(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),t._fadeAnimated&&xe(this._container,1),this.bringToFront()},onRemove:function(t){t._fadeAnimated?(xe(this._container,0),this._removeTimeout=setTimeout(r(ue,void 0,this._container),200)):ue(this._container)},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=j(t),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(t){return this._content=t,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var t={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&me(this._container),this},bringToBack:function(){return this._map&&fe(this._container),this},_prepareOpen:function(t,e,i){if(e instanceof Zi||(i=e,e=t),e instanceof Vi)for(var n in t._layers){e=t._layers[n];break}if(!i)if(e.getCenter)i=e.getCenter();else{if(!e.getLatLng)throw new Error("Unable to get source layer LatLng.");i=e.getLatLng()}return this._source=e,this.update(),i},_updateContent:function(){if(this._content){var t=this._contentNode,e="function"==typeof this._content?this._content(this._source||this):this._content;if("string"==typeof e)t.innerHTML=e;else{for(;t.hasChildNodes();)t.removeChild(t.firstChild);t.appendChild(e)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),e=z(this.options.offset),i=this._getAnchor();this._zoomAnimated?Se(this._container,t.add(i)):e=e.add(t).add(i);var n=this._containerBottom=-e.y,o=this._containerLeft=-Math.round(this._containerWidth/2)+e.x;this._container.style.bottom=n+"px",this._container.style.left=o+"px"}},_getAnchor:function(){return[0,0]}}),Mn=Tn.extend({options:{maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(t){return t.openPopup(this),this},onAdd:function(t){Tn.prototype.onAdd.call(this,t),t.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof tn||this._source.on("preclick",Fe))},onRemove:function(t){Tn.prototype.onRemove.call(this,t),t.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof tn||this._source.off("preclick",Fe))},getEvents:function(){var t=Tn.prototype.getEvents.call(this);return(void 0!==this.options.closeOnClick?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(t.preclick=this._close),this.options.keepInView&&(t.moveend=this._adjustPan),t},_close:function(){this._map&&this._map.closePopup(this)},_initLayout:function(){var t="leaflet-popup",e=this._container=de("div",t+" "+(this.options.className||"")+" leaflet-zoom-animated"),i=this._wrapper=de("div",t+"-content-wrapper",e);if(this._contentNode=de("div",t+"-content",i),je(i),qe(this._contentNode),Ie(i,"contextmenu",Fe),this._tipContainer=de("div",t+"-tip-container",e),this._tip=de("div",t+"-tip",this._tipContainer),this.options.closeButton){var n=this._closeButton=de("a",t+"-close-button",e);n.href="#close",n.innerHTML="&#215;",Ie(n,"click",this._onCloseButtonClick,this)}},_updateLayout:function(){var t=this._contentNode,e=t.style;e.width="",e.whiteSpace="nowrap";var i=t.offsetWidth;i=Math.min(i,this.options.maxWidth),i=Math.max(i,this.options.minWidth),e.width=i+1+"px",e.whiteSpace="",e.height="";var n=t.offsetHeight,o=this.options.maxHeight,r="leaflet-popup-scrolled";o&&n>o?(e.height=o+"px",ve(t,r)):ye(t,r),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),i=this._getAnchor();Se(this._container,e.add(i))},_adjustPan:function(){if(this.options.autoPan){this._map._panAnim&&this._map._panAnim.stop();var t=this._map,e=parseInt(he(this._container,"marginBottom"),10)||0,i=this._container.offsetHeight+e,n=this._containerWidth,o=new P(this._containerLeft,-i-this._containerBottom);o._add(Ee(this._container));var r=t.layerPointToContainerPoint(o),s=z(this.options.autoPanPadding),a=z(this.options.autoPanPaddingTopLeft||s),l=z(this.options.autoPanPaddingBottomRight||s),c=t.getSize(),h=0,d=0;r.x+n+l.x>c.x&&(h=r.x+n-c.x+l.x),r.x-h-a.x<0&&(h=r.x-a.x),r.y+i+l.y>c.y&&(d=r.y+i-c.y+l.y),r.y-d-a.y<0&&(d=r.y-a.y),(h||d)&&t.fire("autopanstart").panBy([h,d])}},_onCloseButtonClick:function(t){this._close(),He(t)},_getAnchor:function(){return z(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),$n=function(t,e){return new Mn(t,e)};ii.mergeOptions({closePopupOnClick:!0}),ii.include({openPopup:function(t,e,i){return t instanceof Mn||(t=new Mn(i).setContent(t)),e&&t.setLatLng(e),this.hasLayer(t)?this:(this._popup&&this._popup.options.autoClose&&this.closePopup(),this._popup=t,this.addLayer(t))},closePopup:function(t){return t&&t!==this._popup||(t=this._popup,this._popup=null),t&&this.removeLayer(t),this}}),Zi.include({bindPopup:function(t,e){return t instanceof Mn?(m(t,e),this._popup=t,t._source=this):(this._popup&&!e||(this._popup=new Mn(e,this)),this._popup.setContent(t)),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t,e){return this._popup&&this._map&&(e=this._popup._prepareOpen(this,t,e),this._map.openPopup(this._popup,e)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(t){return this._popup&&(this._popup._map?this.closePopup():this.openPopup(t)),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){var e=t.layer||t.target;this._popup&&this._map&&(He(t),e instanceof tn?this.openPopup(t.layer||t.target,t.latlng):this._map.hasLayer(this._popup)&&this._popup._source===e?this.closePopup():this.openPopup(e,t.latlng))},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}});var Dn=Tn.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,interactive:!1,opacity:.9},onAdd:function(t){Tn.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&this._source.fire("tooltipopen",{tooltip:this},!0)},onRemove:function(t){Tn.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&this._source.fire("tooltipclose",{tooltip:this},!0)},getEvents:function(){var t=Tn.prototype.getEvents.call(this);return Ct&&!this.options.permanent&&(t.preclick=this._close),t},_close:function(){this._map&&this._map.closeTooltip(this)},_initLayout:function(){var t="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=de("div",t)},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e=this._map,i=this._container,n=e.latLngToContainerPoint(e.getCenter()),o=e.layerPointToContainerPoint(t),r=this.options.direction,s=i.offsetWidth,a=i.offsetHeight,l=z(this.options.offset),c=this._getAnchor();"top"===r?t=t.add(z(-s/2+l.x,-a+l.y+c.y,!0)):"bottom"===r?t=t.subtract(z(s/2-l.x,-l.y,!0)):"center"===r?t=t.subtract(z(s/2+l.x,a/2-c.y+l.y,!0)):"right"===r||"auto"===r&&o.x<n.x?(r="right",t=t.add(z(l.x+c.x,c.y-a/2+l.y,!0))):(r="left",t=t.subtract(z(s+c.x-l.x,a/2-c.y-l.y,!0))),ye(i,"leaflet-tooltip-right"),ye(i,"leaflet-tooltip-left"),ye(i,"leaflet-tooltip-top"),ye(i,"leaflet-tooltip-bottom"),ve(i,"leaflet-tooltip-"+r),Se(i,t)},_updatePosition:function(){var t=this._map.latLngToLayerPoint(this._latlng);this._setPosition(t)},setOpacity:function(t){this.options.opacity=t,this._container&&xe(this._container,t)},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPosition(e)},_getAnchor:function(){return z(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),An=function(t,e){return new Dn(t,e)};ii.include({openTooltip:function(t,e,i){return t instanceof Dn||(t=new Dn(i).setContent(t)),e&&t.setLatLng(e),this.hasLayer(t)?this:this.addLayer(t)},closeTooltip:function(t){return t&&this.removeLayer(t),this}}),Zi.include({bindTooltip:function(t,e){return t instanceof Dn?(m(t,e),this._tooltip=t,t._source=this):(this._tooltip&&!e||(this._tooltip=new Dn(e,this)),this._tooltip.setContent(t)),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(t){if(t||!this._tooltipHandlersAdded){var e=t?"off":"on",i={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?i.add=this._openTooltip:(i.mouseover=this._openTooltip,i.mouseout=this.closeTooltip,this._tooltip.options.sticky&&(i.mousemove=this._moveTooltip),Ct&&(i.click=this._openTooltip)),this[e](i),this._tooltipHandlersAdded=!t}},openTooltip:function(t,e){return this._tooltip&&this._map&&(e=this._tooltip._prepareOpen(this,t,e),this._map.openTooltip(this._tooltip,e),this._tooltip.options.interactive&&this._tooltip._container&&(ve(this._tooltip._container,"leaflet-clickable"),this.addInteractiveTarget(this._tooltip._container))),this},closeTooltip:function(){return this._tooltip&&(this._tooltip._close(),this._tooltip.options.interactive&&this._tooltip._container&&(ye(this._tooltip._container,"leaflet-clickable"),this.removeInteractiveTarget(this._tooltip._container))),this},toggleTooltip:function(t){return this._tooltip&&(this._tooltip._map?this.closeTooltip():this.openTooltip(t)),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(t){return this._tooltip&&this._tooltip.setContent(t),this},getTooltip:function(){return this._tooltip},_openTooltip:function(t){var e=t.layer||t.target;this._tooltip&&this._map&&this.openTooltip(e,this._tooltip.options.sticky?t.latlng:void 0)},_moveTooltip:function(t){var e,i,n=t.latlng;this._tooltip.options.sticky&&t.originalEvent&&(e=this._map.mouseEventToContainerPoint(t.originalEvent),i=this._map.containerPointToLayerPoint(e),n=this._map.layerPointToLatLng(i)),this._tooltip.setLatLng(n)}});var Ln=Gi.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(t){var e=t&&"DIV"===t.tagName?t:document.createElement("div"),i=this.options;if(i.html instanceof Element?(pe(e),e.appendChild(i.html)):e.innerHTML=!1!==i.html?i.html:"",i.bgPos){var n=z(i.bgPos);e.style.backgroundPosition=-n.x+"px "+-n.y+"px"}return this._setIconStyles(e,"icon"),e},createShadow:function(){return null}});function On(t){return new Ln(t)}Gi.Default=Ki;var Pn=Zi.extend({options:{tileSize:256,opacity:1,updateWhenIdle:bt,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(t){m(this,t)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView(),this._update()},beforeAdd:function(t){t._addZoomLimit(this)},onRemove:function(t){this._removeAllTiles(),ue(this._container),t._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(me(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(fe(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){return this._map&&(this._removeAllTiles(),this._update()),this},getEvents:function(){var t={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=l(this._onMoveEnd,this.options.updateInterval,this)),t.move=this._onMove),this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},createTile:function(){return document.createElement("div")},getTileSize:function(){var t=this.options.tileSize;return t instanceof P?t:new P(t,t)},_updateZIndex:function(){this._container&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t){for(var e,i=this.getPane().children,n=-t(-1/0,1/0),o=0,r=i.length;o<r;o++)e=i[o].style.zIndex,i[o]!==this._container&&e&&(n=t(n,+e));isFinite(n)&&(this.options.zIndex=n+t(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!et){xe(this._container,this.options.opacity);var t=+new Date,e=!1,i=!1;for(var n in this._tiles){var o=this._tiles[n];if(o.current&&o.loaded){var r=Math.min(1,(t-o.loaded)/200);xe(o.el,r),r<1?e=!0:(o.active?i=!0:this._onOpaqueTile(o),o.active=!0)}}i&&!this._noPrune&&this._pruneTiles(),e&&(T(this._fadeFrame),this._fadeFrame=E(this._updateOpacity,this))}},_onOpaqueTile:h,_initContainer:function(){this._container||(this._container=de("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var t=this._tileZoom,e=this.options.maxZoom;if(void 0!==t){for(var i in this._levels)this._levels[i].el.children.length||i===t?(this._levels[i].el.style.zIndex=e-Math.abs(t-i),this._onUpdateLevel(i)):(ue(this._levels[i].el),this._removeTilesAtZoom(i),this._onRemoveLevel(i),delete this._levels[i]);var n=this._levels[t],o=this._map;return n||((n=this._levels[t]={}).el=de("div","leaflet-tile-container leaflet-zoom-animated",this._container),n.el.style.zIndex=e,n.origin=o.project(o.unproject(o.getPixelOrigin()),t).round(),n.zoom=t,this._setZoomTransform(n,o.getCenter(),o.getZoom()),h(n.el.offsetWidth),this._onCreateLevel(n)),this._level=n,n}},_onUpdateLevel:h,_onRemoveLevel:h,_onCreateLevel:h,_pruneTiles:function(){if(this._map){var t,e,i=this._map.getZoom();if(i>this.options.maxZoom||i<this.options.minZoom)this._removeAllTiles();else{for(t in this._tiles)(e=this._tiles[t]).retain=e.current;for(t in this._tiles)if((e=this._tiles[t]).current&&!e.active){var n=e.coords;this._retainParent(n.x,n.y,n.z,n.z-5)||this._retainChildren(n.x,n.y,n.z,n.z+2)}for(t in this._tiles)this._tiles[t].retain||this._removeTile(t)}}},_removeTilesAtZoom:function(t){for(var e in this._tiles)this._tiles[e].coords.z===t&&this._removeTile(e)},_removeAllTiles:function(){for(var t in this._tiles)this._removeTile(t)},_invalidateAll:function(){for(var t in this._levels)ue(this._levels[t].el),this._onRemoveLevel(t),delete this._levels[t];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(t,e,i,n){var o=Math.floor(t/2),r=Math.floor(e/2),s=i-1,a=new P(+o,+r);a.z=+s;var l=this._tileCoordsToKey(a),c=this._tiles[l];return c&&c.active?(c.retain=!0,!0):(c&&c.loaded&&(c.retain=!0),s>n&&this._retainParent(o,r,s,n))},_retainChildren:function(t,e,i,n){for(var o=2*t;o<2*t+2;o++)for(var r=2*e;r<2*e+2;r++){var s=new P(o,r);s.z=i+1;var a=this._tileCoordsToKey(s),l=this._tiles[a];l&&l.active?l.retain=!0:(l&&l.loaded&&(l.retain=!0),i+1<n&&this._retainChildren(o,r,i+1,n))}},_resetView:function(t){var e=t&&(t.pinch||t.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),e,e)},_animateZoom:function(t){this._setView(t.center,t.zoom,!0,t.noUpdate)},_clampZoom:function(t){var e=this.options;return void 0!==e.minNativeZoom&&t<e.minNativeZoom?e.minNativeZoom:void 0!==e.maxNativeZoom&&e.maxNativeZoom<t?e.maxNativeZoom:t},_setView:function(t,e,i,n){var o=this._clampZoom(Math.round(e));(void 0!==this.options.maxZoom&&o>this.options.maxZoom||void 0!==this.options.minZoom&&o<this.options.minZoom)&&(o=void 0);var r=this.options.updateWhenZooming&&o!==this._tileZoom;n&&!r||(this._tileZoom=o,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),void 0!==o&&this._update(t),i||this._pruneTiles(),this._noPrune=!!i),this._setZoomTransforms(t,e)},_setZoomTransforms:function(t,e){for(var i in this._levels)this._setZoomTransform(this._levels[i],t,e)},_setZoomTransform:function(t,e,i){var n=this._map.getZoomScale(i,t.zoom),o=t.origin.multiplyBy(n).subtract(this._map._getNewPixelOrigin(e,i)).round();yt?Ce(t.el,o,n):Se(t.el,o)},_resetGrid:function(){var t=this._map,e=t.options.crs,i=this._tileSize=this.getTileSize(),n=this._tileZoom,o=this._map.getPixelWorldBounds(this._tileZoom);o&&(this._globalTileRange=this._pxBoundsToTileRange(o)),this._wrapX=e.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,e.wrapLng[0]],n).x/i.x),Math.ceil(t.project([0,e.wrapLng[1]],n).x/i.y)],this._wrapY=e.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([e.wrapLat[0],0],n).y/i.x),Math.ceil(t.project([e.wrapLat[1],0],n).y/i.y)]},_onMoveEnd:function(){this._map&&!this._map._animatingZoom&&this._update()},_getTiledPixelBounds:function(t){var e=this._map,i=e._animatingZoom?Math.max(e._animateToZoom,e.getZoom()):e.getZoom(),n=e.getZoomScale(i,this._tileZoom),o=e.project(t,this._tileZoom).floor(),r=e.getSize().divideBy(2*n);return new N(o.subtract(r),o.add(r))},_update:function(t){var e=this._map;if(e){var i=this._clampZoom(e.getZoom());if(void 0===t&&(t=e.getCenter()),void 0!==this._tileZoom){var n=this._getTiledPixelBounds(t),o=this._pxBoundsToTileRange(n),r=o.getCenter(),s=[],a=this.options.keepBuffer,l=new N(o.getBottomLeft().subtract([a,-a]),o.getTopRight().add([a,-a]));if(!(isFinite(o.min.x)&&isFinite(o.min.y)&&isFinite(o.max.x)&&isFinite(o.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var c in this._tiles){var h=this._tiles[c].coords;h.z===this._tileZoom&&l.contains(new P(h.x,h.y))||(this._tiles[c].current=!1)}if(Math.abs(i-this._tileZoom)>1)this._setView(t,i);else{for(var d=o.min.y;d<=o.max.y;d++)for(var u=o.min.x;u<=o.max.x;u++){var p=new P(u,d);if(p.z=this._tileZoom,this._isValidTile(p)){var m=this._tiles[this._tileCoordsToKey(p)];m?m.current=!0:s.push(p)}}if(s.sort((function(t,e){return t.distanceTo(r)-e.distanceTo(r)})),0!==s.length){this._loading||(this._loading=!0,this.fire("loading"));var f=document.createDocumentFragment();for(u=0;u<s.length;u++)this._addTile(s[u],f);this._level.el.appendChild(f)}}}}},_isValidTile:function(t){var e=this._map.options.crs;if(!e.infinite){var i=this._globalTileRange;if(!e.wrapLng&&(t.x<i.min.x||t.x>i.max.x)||!e.wrapLat&&(t.y<i.min.y||t.y>i.max.y))return!1}if(!this.options.bounds)return!0;var n=this._tileCoordsToBounds(t);return F(this.options.bounds).overlaps(n)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,i=this.getTileSize(),n=t.scaleBy(i),o=n.add(i);return[e.unproject(n,t.z),e.unproject(o,t.z)]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),i=new B(e[0],e[1]);return this.options.noWrap||(i=this._map.wrapLatLngBounds(i)),i},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var e=t.split(":"),i=new P(+e[0],+e[1]);return i.z=+e[2],i},_removeTile:function(t){var e=this._tiles[t];e&&(ue(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){ve(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=h,t.onmousemove=h,et&&this.options.opacity<1&&xe(t,this.options.opacity),ot&&!rt&&(t.style.WebkitBackfaceVisibility="hidden")},_addTile:function(t,e){var i=this._getTilePos(t),n=this._tileCoordsToKey(t),o=this.createTile(this._wrapCoords(t),r(this._tileReady,this,t));this._initTile(o),this.createTile.length<2&&E(r(this._tileReady,this,t,null,o)),Se(o,i),this._tiles[n]={el:o,coords:t,current:!0},e.appendChild(o),this.fire("tileloadstart",{tile:o,coords:t})},_tileReady:function(t,e,i){e&&this.fire("tileerror",{error:e,tile:i,coords:t});var n=this._tileCoordsToKey(t);(i=this._tiles[n])&&(i.loaded=+new Date,this._map._fadeAnimated?(xe(i.el,0),T(this._fadeFrame),this._fadeFrame=E(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),e||(ve(i.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),et||!this._map._fadeAnimated?E(this._pruneTiles,this):setTimeout(r(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new P(this._wrapX?c(t.x,this._wrapX):t.x,this._wrapY?c(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new N(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});function In(t){return new Pn(t)}var zn=Pn.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1},initialize:function(t,e){this._url=t,(e=m(this,e)).detectRetina&&Tt&&e.maxZoom>0&&(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom++):(e.zoomOffset++,e.maxZoom--),e.minZoom=Math.max(0,e.minZoom)),"string"==typeof e.subdomains&&(e.subdomains=e.subdomains.split("")),ot||this.on("tileunload",this._onTileRemove)},setUrl:function(t,e){return this._url===t&&void 0===e&&(e=!0),this._url=t,e||this.redraw(),this},createTile:function(t,e){var i=document.createElement("img");return Ie(i,"load",r(this._tileOnLoad,this,e,i)),Ie(i,"error",r(this._tileOnError,this,e,i)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(i.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),i.alt="",i.setAttribute("role","presentation"),i.src=this.getTileUrl(t),i},getTileUrl:function(t){var e={r:Tt?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var i=this._globalTileRange.max.y-t.y;this.options.tms&&(e.y=i),e["-y"]=i}return v(this._url,n(e,this.options))},_tileOnLoad:function(t,e){et?setTimeout(r(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,i){var n=this.options.errorTileUrl;n&&e.getAttribute("src")!==n&&(e.src=n),t(i,e)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,e=this.options.maxZoom;return this.options.zoomReverse&&(t=e-t),t+this.options.zoomOffset},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_abortLoading:function(){var t,e;for(t in this._tiles)this._tiles[t].coords.z!==this._tileZoom&&((e=this._tiles[t].el).onload=h,e.onerror=h,e.complete||(e.src=_,ue(e),delete this._tiles[t]))},_removeTile:function(t){var e=this._tiles[t];if(e)return at||e.el.setAttribute("src",_),Pn.prototype._removeTile.call(this,t)},_tileReady:function(t,e,i){if(this._map&&(!i||i.getAttribute("src")!==_))return Pn.prototype._tileReady.call(this,t,e,i)}});function Nn(t,e){return new zn(t,e)}var Rn=zn.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,e){this._url=t;var i=n({},this.defaultWmsParams);for(var o in e)o in this.options||(i[o]=e[o]);var r=(e=m(this,e)).detectRetina&&Tt?2:1,s=this.getTileSize();i.width=s.x*r,i.height=s.y*r,this.wmsParams=i},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var e=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[e]=this._crs.code,zn.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),i=this._crs,n=R(i.project(e[0]),i.project(e[1])),o=n.min,r=n.max,s=(this._wmsVersion>=1.3&&this._crs===qi?[o.y,o.x,r.y,r.x]:[o.x,o.y,r.x,r.y]).join(","),a=zn.prototype.getTileUrl.call(this,t);return a+f(this.wmsParams,a,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+s},setParams:function(t,e){return n(this.wmsParams,t),e||this.redraw(),this}});function Bn(t,e){return new Rn(t,e)}zn.WMS=Rn,Nn.wms=Bn;var Fn=Zi.extend({options:{padding:.1,tolerance:0},initialize:function(t){m(this,t),a(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),this._zoomAnimated&&ve(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,e){var i=this._map.getZoomScale(e,this._zoom),n=Ee(this._container),o=this._map.getSize().multiplyBy(.5+this.options.padding),r=this._map.project(this._center,e),s=this._map.project(t,e).subtract(r),a=o.multiplyBy(-i).add(n).add(o).subtract(s);yt?Ce(this._container,a,i):Se(this._container,a)},_reset:function(){for(var t in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,e=this._map.getSize(),i=this._map.containerPointToLayerPoint(e.multiplyBy(-t)).round();this._bounds=new N(i,i.add(e.multiplyBy(1+2*t)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),qn=Fn.extend({getEvents:function(){var t=Fn.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Fn.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");Ie(t,"mousemove",l(this._onMouseMove,32,this),this),Ie(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Ie(t,"mouseout",this._handleMouseOut,this),this._ctx=t.getContext("2d")},_destroyContainer:function(){T(this._redrawRequest),delete this._ctx,ue(this._container),Ne(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var t in this._redrawBounds=null,this._layers)this._layers[t]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){Fn.prototype._update.call(this);var t=this._bounds,e=this._container,i=t.getSize(),n=Tt?2:1;Se(e,t.min),e.width=n*i.x,e.height=n*i.y,e.style.width=i.x+"px",e.style.height=i.y+"px",Tt&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){Fn.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[a(t)]=t;var e=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=e),this._drawLast=e,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=t._order,i=e.next,n=e.prev;i?i.prev=n:this._drawLast=n,n?n.next=i:this._drawFirst=i,delete t._order,delete this._layers[a(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if("string"==typeof t.options.dashArray){var e,i,n=t.options.dashArray.split(/[, ]+/),o=[];for(i=0;i<n.length;i++){if(e=Number(n[i]),isNaN(e))return;o.push(e)}t.options._dashArray=o}else t.options._dashArray=t.options.dashArray},_requestRedraw:function(t){this._map&&(this._extendRedrawBounds(t),this._redrawRequest=this._redrawRequest||E(this._redraw,this))},_extendRedrawBounds:function(t){if(t._pxBounds){var e=(t.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new N,this._redrawBounds.extend(t._pxBounds.min.subtract([e,e])),this._redrawBounds.extend(t._pxBounds.max.add([e,e]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var t=this._redrawBounds;if(t){var e=t.getSize();this._ctx.clearRect(t.min.x,t.min.y,e.x,e.y)}else this._ctx.clearRect(0,0,this._container.width,this._container.height)},_draw:function(){var t,e=this._redrawBounds;if(this._ctx.save(),e){var i=e.getSize();this._ctx.beginPath(),this._ctx.rect(e.min.x,e.min.y,i.x,i.y),this._ctx.clip()}this._drawing=!0;for(var n=this._drawFirst;n;n=n.next)t=n.layer,(!e||t._pxBounds&&t._pxBounds.intersects(e))&&t._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(t,e){if(this._drawing){var i,n,o,r,s=t._parts,a=s.length,l=this._ctx;if(a){for(l.beginPath(),i=0;i<a;i++){for(n=0,o=s[i].length;n<o;n++)r=s[i][n],l[n?"lineTo":"moveTo"](r.x,r.y);e&&l.closePath()}this._fillStroke(l,t)}}},_updateCircle:function(t){if(this._drawing&&!t._empty()){var e=t._point,i=this._ctx,n=Math.max(Math.round(t._radius),1),o=(Math.max(Math.round(t._radiusY),1)||n)/n;1!==o&&(i.save(),i.scale(1,o)),i.beginPath(),i.arc(e.x,e.y/o,n,0,2*Math.PI,!1),1!==o&&i.restore(),this._fillStroke(i,t)}},_fillStroke:function(t,e){var i=e.options;i.fill&&(t.globalAlpha=i.fillOpacity,t.fillStyle=i.fillColor||i.color,t.fill(i.fillRule||"evenodd")),i.stroke&&0!==i.weight&&(t.setLineDash&&t.setLineDash(e.options&&e.options._dashArray||[]),t.globalAlpha=i.opacity,t.lineWidth=i.weight,t.strokeStyle=i.color,t.lineCap=i.lineCap,t.lineJoin=i.lineJoin,t.stroke())},_onClick:function(t){for(var e,i,n=this._map.mouseEventToLayerPoint(t),o=this._drawFirst;o;o=o.next)(e=o.layer).options.interactive&&e._containsPoint(n)&&!this._map._draggableMoved(e)&&(i=e);i&&(Ke(t),this._fireEvent([i],t))},_onMouseMove:function(t){if(this._map&&!this._map.dragging.moving()&&!this._map._animatingZoom){var e=this._map.mouseEventToLayerPoint(t);this._handleMouseHover(t,e)}},_handleMouseOut:function(t){var e=this._hoveredLayer;e&&(ye(this._container,"leaflet-interactive"),this._fireEvent([e],t,"mouseout"),this._hoveredLayer=null)},_handleMouseHover:function(t,e){for(var i,n,o=this._drawFirst;o;o=o.next)(i=o.layer).options.interactive&&i._containsPoint(e)&&(n=i);n!==this._hoveredLayer&&(this._handleMouseOut(t),n&&(ve(this._container,"leaflet-interactive"),this._fireEvent([n],t,"mouseover"),this._hoveredLayer=n)),this._hoveredLayer&&this._fireEvent([this._hoveredLayer],t)},_fireEvent:function(t,e,i){this._map._fireDOMEvent(e,i||e.type,t)},_bringToFront:function(t){var e=t._order;if(e){var i=e.next,n=e.prev;i&&(i.prev=n,n?n.next=i:i&&(this._drawFirst=i),e.prev=this._drawLast,this._drawLast.next=e,e.next=null,this._drawLast=e,this._requestRedraw(t))}},_bringToBack:function(t){var e=t._order;if(e){var i=e.next,n=e.prev;n&&(n.next=i,i?i.prev=n:n&&(this._drawLast=n),e.prev=null,e.next=this._drawFirst,this._drawFirst.prev=e,this._drawFirst=e,this._requestRedraw(t))}}});function jn(t){return Mt?new qn(t):null}var Zn=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return document.createElement("<lvml:"+t+' class="lvml">')}}catch(t){return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),Hn={_initContainer:function(){this._container=de("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Fn.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=Zn("shape");ve(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=Zn("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[a(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;ue(e),t.removeInteractiveTarget(e),delete this._layers[a(t)]},_updateStyle:function(t){var e=t._stroke,i=t._fill,n=t.options,o=t._container;o.stroked=!!n.stroke,o.filled=!!n.fill,n.stroke?(e||(e=t._stroke=Zn("stroke")),o.appendChild(e),e.weight=n.weight+"px",e.color=n.color,e.opacity=n.opacity,n.dashArray?e.dashStyle=y(n.dashArray)?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):e.dashStyle="",e.endcap=n.lineCap.replace("butt","flat"),e.joinstyle=n.lineJoin):e&&(o.removeChild(e),t._stroke=null),n.fill?(i||(i=t._fill=Zn("fill")),o.appendChild(i),i.color=n.fillColor||n.color,i.opacity=n.fillOpacity):i&&(o.removeChild(i),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),i=Math.round(t._radius),n=Math.round(t._radiusY||i);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+i+","+n+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){me(t._container)},_bringToBack:function(t){fe(t._container)}},Un=Dt?Zn:J,Vn=Fn.extend({getEvents:function(){var t=Fn.prototype.getEvents.call(this);return t.zoomstart=this._onZoomStart,t},_initContainer:function(){this._container=Un("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Un("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ue(this._container),Ne(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_onZoomStart:function(){this._update()},_update:function(){if(!this._map._animatingZoom||!this._bounds){Fn.prototype._update.call(this);var t=this._bounds,e=t.getSize(),i=this._container;this._svgSize&&this._svgSize.equals(e)||(this._svgSize=e,i.setAttribute("width",e.x),i.setAttribute("height",e.y)),Se(i,t.min),i.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update")}},_initPath:function(t){var e=t._path=Un("path");t.options.className&&ve(e,t.options.className),t.options.interactive&&ve(e,"leaflet-interactive"),this._updateStyle(t),this._layers[a(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){ue(t._path),t.removeInteractiveTarget(t._path),delete this._layers[a(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,i=t.options;e&&(i.stroke?(e.setAttribute("stroke",i.color),e.setAttribute("stroke-opacity",i.opacity),e.setAttribute("stroke-width",i.weight),e.setAttribute("stroke-linecap",i.lineCap),e.setAttribute("stroke-linejoin",i.lineJoin),i.dashArray?e.setAttribute("stroke-dasharray",i.dashArray):e.removeAttribute("stroke-dasharray"),i.dashOffset?e.setAttribute("stroke-dashoffset",i.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),i.fill?(e.setAttribute("fill",i.fillColor||i.color),e.setAttribute("fill-opacity",i.fillOpacity),e.setAttribute("fill-rule",i.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,X(t._parts,e))},_updateCircle:function(t){var e=t._point,i=Math.max(Math.round(t._radius),1),n="a"+i+","+(Math.max(Math.round(t._radiusY),1)||i)+" 0 1,0 ",o=t._empty()?"M0 0":"M"+(e.x-i)+","+e.y+n+2*i+",0 "+n+2*-i+",0 ";this._setPath(t,o)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){me(t._path)},_bringToBack:function(t){fe(t._path)}});function Wn(t){return $t||Dt?new Vn(t):null}Dt&&Vn.include(Hn),ii.include({getRenderer:function(t){var e=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return e||(e=this._renderer=this._createRenderer()),this.hasLayer(e)||this.addLayer(e),e},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var e=this._paneRenderers[t];return void 0===e&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e},_createRenderer:function(t){return this.options.preferCanvas&&jn(t)||Wn(t)}});var Gn=ln.extend({initialize:function(t,e){ln.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=F(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});function Yn(t,e){return new Gn(t,e)}Vn.create=Un,Vn.pointsToPath=X,hn.geometryToLayer=dn,hn.coordsToLatLng=un,hn.coordsToLatLngs=pn,hn.latLngToCoords=mn,hn.latLngsToCoords=fn,hn.getFeature=gn,hn.asFeature=vn,ii.mergeOptions({boxZoom:!0});var Kn=mi.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){Ie(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Ne(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ue(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),ee(),Me(),this._startPoint=this._map.mouseEventToContainerPoint(t),Ie(document,{contextmenu:He,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=de("div","leaflet-zoom-box",this._container),ve(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=new N(this._point,this._startPoint),i=e.getSize();Se(this._box,e.min),this._box.style.width=i.x+"px",this._box.style.height=i.y+"px"},_finish:function(){this._moved&&(ue(this._box),ye(this._container,"leaflet-crosshair")),ie(),$e(),Ne(document,{contextmenu:He,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if((1===t.which||1===t.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(r(this._resetState,this),0);var e=new B(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(e).fire("boxzoomend",{boxZoomBounds:e})}},_onKeyDown:function(t){27===t.keyCode&&this._finish()}});ii.addInitHook("addHandler","boxZoom",Kn),ii.mergeOptions({doubleClickZoom:!0});var Jn=mi.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,i=e.getZoom(),n=e.options.zoomDelta,o=t.originalEvent.shiftKey?i-n:i+n;"center"===e.options.doubleClickZoom?e.setZoom(o):e.setZoomAround(t.containerPoint,o)}});ii.addInitHook("addHandler","doubleClickZoom",Jn),ii.mergeOptions({dragging:!0,inertia:!rt,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Xn=mi.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new _i(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}ve(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){ye(this._map._container,"leaflet-grab"),ye(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var e=F(this._map.options.maxBounds);this._offsetLimit=R(this._map.latLngToContainerPoint(e.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(e.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var e=this._lastTime=+new Date,i=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(i),this._times.push(e),this._prunePositions(e)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit;t.x<e.min.x&&(t.x=this._viscousLimit(t.x,e.min.x)),t.y<e.min.y&&(t.y=this._viscousLimit(t.y,e.min.y)),t.x>e.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-e+i)%t+e-i,r=(n+e+i)%t-e-i,s=Math.abs(o+i)<Math.abs(r+i)?o:r;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=s},_onDragEnd:function(t){var e=this._map,i=e.options,n=!i.inertia||this._times.length<2;if(e.fire("dragend",t),n)e.fire("moveend");else{this._prunePositions(+new Date);var o=this._lastPos.subtract(this._positions[0]),r=(this._lastTime-this._times[0])/1e3,s=i.easeLinearity,a=o.multiplyBy(s/r),l=a.distanceTo([0,0]),c=Math.min(i.inertiaMaxSpeed,l),h=a.multiplyBy(c/l),d=c/(i.inertiaDeceleration*s),u=h.multiplyBy(-d/2).round();u.x||u.y?(u=e._limitOffset(u,e.options.maxBounds),E((function(){e.panBy(u,{duration:d,easeLinearity:s,noMoveStart:!0,animate:!0})}))):e.fire("moveend")}}});ii.addInitHook("addHandler","dragging",Xn),ii.mergeOptions({keyboard:!0,keyboardPanDelta:80});var Qn=mi.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(t){this._map=t,this._setPanDelta(t.options.keyboardPanDelta),this._setZoomDelta(t.options.zoomDelta)},addHooks:function(){var t=this._map._container;t.tabIndex<=0&&(t.tabIndex="0"),Ie(t,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),Ne(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var t=document.body,e=document.documentElement,i=t.scrollTop||e.scrollTop,n=t.scrollLeft||e.scrollLeft;this._map._container.focus(),window.scrollTo(n,i)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(t){var e,i,n=this._panKeys={},o=this.keyCodes;for(e=0,i=o.left.length;e<i;e++)n[o.left[e]]=[-1*t,0];for(e=0,i=o.right.length;e<i;e++)n[o.right[e]]=[t,0];for(e=0,i=o.down.length;e<i;e++)n[o.down[e]]=[0,t];for(e=0,i=o.up.length;e<i;e++)n[o.up[e]]=[0,-1*t]},_setZoomDelta:function(t){var e,i,n=this._zoomKeys={},o=this.keyCodes;for(e=0,i=o.zoomIn.length;e<i;e++)n[o.zoomIn[e]]=t;for(e=0,i=o.zoomOut.length;e<i;e++)n[o.zoomOut[e]]=-t},_addHooks:function(){Ie(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){Ne(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e,i=t.keyCode,n=this._map;if(i in this._panKeys)n._panAnim&&n._panAnim._inProgress||(e=this._panKeys[i],t.shiftKey&&(e=z(e).multiplyBy(3)),n.panBy(e),n.options.maxBounds&&n.panInsideBounds(n.options.maxBounds));else if(i in this._zoomKeys)n.setZoom(n.getZoom()+(t.shiftKey?3:1)*this._zoomKeys[i]);else{if(27!==i||!n._popup||!n._popup.options.closeOnEscapeKey)return;n.closePopup()}He(t)}}});ii.addInitHook("addHandler","keyboard",Qn),ii.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var to=mi.extend({addHooks:function(){Ie(this._map._container,"mousewheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){Ne(this._map._container,"mousewheel",this._onWheelScroll,this)},_onWheelScroll:function(t){var e=We(t),i=this._map.options.wheelDebounceTime;this._delta+=e,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var n=Math.max(i-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(r(this._performZoom,this),n),He(t)},_performZoom:function(){var t=this._map,e=t.getZoom(),i=this._map.options.zoomSnap||0;t._stop();var n=this._delta/(4*this._map.options.wheelPxPerZoomLevel),o=4*Math.log(2/(1+Math.exp(-Math.abs(n))))/Math.LN2,r=i?Math.ceil(o/i)*i:o,s=t._limitZoom(e+(this._delta>0?r:-r))-e;this._delta=0,this._startTime=null,s&&("center"===t.options.scrollWheelZoom?t.setZoom(e+s):t.setZoomAround(this._lastMousePos,e+s))}});ii.addInitHook("addHandler","scrollWheelZoom",to),ii.mergeOptions({tap:!0,tapTolerance:15});var eo=mi.extend({addHooks:function(){Ie(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Ne(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(t.touches){if(Ze(t),this._fireClick=!0,t.touches.length>1)return this._fireClick=!1,void clearTimeout(this._holdTimeout);var e=t.touches[0],i=e.target;this._startPos=this._newPos=new P(e.clientX,e.clientY),i.tagName&&"a"===i.tagName.toLowerCase()&&ve(i,"leaflet-active"),this._holdTimeout=setTimeout(r((function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",e))}),this),1e3),this._simulateEvent("mousedown",e),Ie(document,{touchmove:this._onMove,touchend:this._onUp},this)}},_onUp:function(t){if(clearTimeout(this._holdTimeout),Ne(document,{touchmove:this._onMove,touchend:this._onUp},this),this._fireClick&&t&&t.changedTouches){var e=t.changedTouches[0],i=e.target;i&&i.tagName&&"a"===i.tagName.toLowerCase()&&ye(i,"leaflet-active"),this._simulateEvent("mouseup",e),this._isTapValid()&&this._simulateEvent("click",e)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(t){var e=t.touches[0];this._newPos=new P(e.clientX,e.clientY),this._simulateEvent("mousemove",e)},_simulateEvent:function(t,e){var i=document.createEvent("MouseEvents");i._simulated=!0,e.target._simulatedClick=!0,i.initMouseEvent(t,!0,!0,window,1,e.screenX,e.screenY,e.clientX,e.clientY,!1,!1,!1,!1,0,null),e.target.dispatchEvent(i)}});Ct&&!kt&&ii.addInitHook("addHandler","tap",eo),ii.mergeOptions({touchZoom:Ct&&!rt,bounceAtZoomLimits:!0});var io=mi.extend({addHooks:function(){ve(this._map._container,"leaflet-touch-zoom"),Ie(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){ye(this._map._container,"leaflet-touch-zoom"),Ne(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var e=this._map;if(t.touches&&2===t.touches.length&&!e._animatingZoom&&!this._zooming){var i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=e.getSize()._divideBy(2),this._startLatLng=e.containerPointToLatLng(this._centerPoint),"center"!==e.options.touchZoom&&(this._pinchStartLatLng=e.containerPointToLatLng(i.add(n)._divideBy(2))),this._startDist=i.distanceTo(n),this._startZoom=e.getZoom(),this._moved=!1,this._zooming=!0,e._stop(),Ie(document,"touchmove",this._onTouchMove,this),Ie(document,"touchend",this._onTouchEnd,this),Ze(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var e=this._map,i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]),o=i.distanceTo(n)/this._startDist;if(this._zoom=e.getScaleZoom(o,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoom<e.getMinZoom()&&o<1||this._zoom>e.getMaxZoom()&&o>1)&&(this._zoom=e._limitZoom(this._zoom)),"center"===e.options.touchZoom){if(this._center=this._startLatLng,1===o)return}else{var s=i._add(n)._divideBy(2)._subtract(this._centerPoint);if(1===o&&0===s.x&&0===s.y)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(s),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),T(this._animRequest);var a=r(e._move,e,this._center,this._zoom,{pinch:!0,round:!1});this._animRequest=E(a,this,!0),Ze(t)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,T(this._animRequest),Ne(document,"touchmove",this._onTouchMove),Ne(document,"touchend",this._onTouchEnd),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))):this._zooming=!1}});ii.addInitHook("addHandler","touchZoom",io),ii.BoxZoom=Kn,ii.DoubleClickZoom=Jn,ii.Drag=Xn,ii.Keyboard=Qn,ii.ScrollWheelZoom=to,ii.Tap=eo,ii.TouchZoom=io,Object.freeze=i,t.version=e,t.Control=oi,t.control=ri,t.Browser=Lt,t.Evented=O,t.Mixin=gi,t.Util=M,t.Class=$,t.Handler=mi,t.extend=n,t.bind=r,t.stamp=a,t.setOptions=m,t.DomEvent=ti,t.DomUtil=Pe,t.PosAnimation=ei,t.Draggable=_i,t.LineUtil=Pi,t.PolyUtil=zi,t.Point=P,t.point=z,t.Bounds=N,t.bounds=R,t.Transformation=W,t.transformation=G,t.Projection=Bi,t.LatLng=q,t.latLng=j,t.LatLngBounds=B,t.latLngBounds=F,t.CRS=Z,t.GeoJSON=hn,t.geoJSON=bn,t.geoJson=_n,t.Layer=Zi,t.LayerGroup=Hi,t.layerGroup=Ui,t.FeatureGroup=Vi,t.featureGroup=Wi,t.ImageOverlay=xn,t.imageOverlay=wn,t.VideoOverlay=kn,t.videoOverlay=Cn,t.SVGOverlay=Sn,t.svgOverlay=En,t.DivOverlay=Tn,t.Popup=Mn,t.popup=$n,t.Tooltip=Dn,t.tooltip=An,t.Icon=Gi,t.icon=Yi,t.DivIcon=Ln,t.divIcon=On,t.Marker=Xi,t.marker=Qi,t.TileLayer=zn,t.tileLayer=Nn,t.GridLayer=Pn,t.gridLayer=In,t.SVG=Vn,t.svg=Wn,t.Renderer=Fn,t.Canvas=qn,t.canvas=jn,t.Path=tn,t.CircleMarker=en,t.circleMarker=nn,t.Circle=on,t.circle=rn,t.Polyline=sn,t.polyline=an,t.Polygon=ln,t.polygon=cn,t.Rectangle=Gn,t.rectangle=Yn,t.Map=ii,t.map=ni;var no=window.L;t.noConflict=function(){return window.L=no,this},window.L=t}(e)},dl(ul={exports:{}},ul.exports),ul.exports);const ml={weight:1,opacity:1,color:"white",fillOpacity:.7,fillColor:"#2387ca"},fl={weight:3,color:"white",fillOpacity:1,fillColor:"#2387ca"},gl=()=>ml;class vl extends X{constructor(){super(),this.osmId="",this.endpoint="",this.hovered=null,this.path=[],this.renderedMap=null,this.states=null,this.paths={},this.lastHovered=null}static get styles(){return r`
5399
+ `}}t([it({type:Array,attribute:!1})],Pa.prototype,"path",void 0),t([it()],Pa.prototype,"endpoint",void 0),t([it()],Pa.prototype,"osmId",void 0),t([it({type:Object})],Pa.prototype,"hovered",void 0),t([it({type:Object})],Pa.prototype,"editFeature",void 0),t([it({type:String,attribute:!1})],Pa.prototype,"editFeatureAliases",void 0);"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var za,Ia,Da=(za=function(t,e){!function(t){var e="1.5.1+build.2e3e0ffb",i=Object.freeze;function n(t){var e,i,n,o;for(i=1,n=arguments.length;i<n;i++)for(e in o=arguments[i])t[e]=o[e];return t}Object.freeze=function(t){return t};var o=Object.create||function(){function t(){}return function(e){return t.prototype=e,new t}}();function s(t,e){var i=Array.prototype.slice;if(t.bind)return t.bind.apply(t,i.call(arguments,1));var n=i.call(arguments,2);return function(){return t.apply(e,n.length?n.concat(i.call(arguments)):arguments)}}var r=0;function a(t){return t._leaflet_id=t._leaflet_id||++r,t._leaflet_id}function l(t,e,i){var n,o,s,r;return r=function(){n=!1,o&&(s.apply(i,o),o=!1)},s=function(){n?o=arguments:(t.apply(i,arguments),setTimeout(r,e),n=!0)},s}function c(t,e,i){var n=e[1],o=e[0],s=n-o;return t===n&&i?t:((t-o)%s+s)%s+o}function h(){return!1}function u(t,e){return e=void 0===e?6:e,+(Math.round(t+"e+"+e)+"e-"+e)}function d(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function p(t){return d(t).split(/\s+/)}function m(t,e){for(var i in t.hasOwnProperty("options")||(t.options=t.options?o(t.options):{}),e)t.options[i]=e[i];return t.options}function f(t,e,i){var n=[];for(var o in t)n.push(encodeURIComponent(i?o.toUpperCase():o)+"="+encodeURIComponent(t[o]));return(e&&-1!==e.indexOf("?")?"&":"?")+n.join("&")}var g=/\{ *([\w_-]+) *\}/g;function v(t,e){return t.replace(g,(function(t,i){var n=e[i];if(void 0===n)throw new Error("No value provided for variable "+t);return"function"==typeof n&&(n=n(e)),n}))}var y=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function b(t,e){for(var i=0;i<t.length;i++)if(t[i]===e)return i;return-1}var _="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function x(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var w=0;function k(t){var e=+new Date,i=Math.max(0,16-(e-w));return w=e+i,window.setTimeout(t,i)}var S=window.requestAnimationFrame||x("RequestAnimationFrame")||k,C=window.cancelAnimationFrame||x("CancelAnimationFrame")||x("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function T(t,e,i){if(!i||S!==k)return S.call(window,s(t,e));t.call(e)}function E(t){t&&C.call(window,t)}var $=(Object.freeze||Object)({freeze:i,extend:n,create:o,bind:s,lastId:r,stamp:a,throttle:l,wrapNum:c,falseFn:h,formatNum:u,trim:d,splitWords:p,setOptions:m,getParamString:f,template:v,isArray:y,indexOf:b,emptyImageUrl:_,requestFn:S,cancelFn:C,requestAnimFrame:T,cancelAnimFrame:E});function A(){}function O(t){if("undefined"!=typeof L&&L&&L.Mixin){t=y(t)?t:[t];for(var e=0;e<t.length;e++)t[e]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",(new Error).stack)}}A.extend=function(t){var e=function(){this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},i=e.__super__=this.prototype,s=o(i);for(var r in s.constructor=e,e.prototype=s,this)this.hasOwnProperty(r)&&"prototype"!==r&&"__super__"!==r&&(e[r]=this[r]);return t.statics&&(n(e,t.statics),delete t.statics),t.includes&&(O(t.includes),n.apply(null,[s].concat(t.includes)),delete t.includes),s.options&&(t.options=n(o(s.options),t.options)),n(s,t),s._initHooks=[],s.callInitHooks=function(){if(!this._initHooksCalled){i.callInitHooks&&i.callInitHooks.call(this),this._initHooksCalled=!0;for(var t=0,e=s._initHooks.length;t<e;t++)s._initHooks[t].call(this)}},e},A.include=function(t){return n(this.prototype,t),this},A.mergeOptions=function(t){return n(this.prototype.options,t),this},A.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),i="function"==typeof t?t:function(){this[t].apply(this,e)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i),this};var M={on:function(t,e,i){if("object"==typeof t)for(var n in t)this._on(n,t[n],e);else for(var o=0,s=(t=p(t)).length;o<s;o++)this._on(t[o],e,i);return this},off:function(t,e,i){if(t)if("object"==typeof t)for(var n in t)this._off(n,t[n],e);else for(var o=0,s=(t=p(t)).length;o<s;o++)this._off(t[o],e,i);else delete this._events;return this},_on:function(t,e,i){this._events=this._events||{};var n=this._events[t];n||(n=[],this._events[t]=n),i===this&&(i=void 0);for(var o={fn:e,ctx:i},s=n,r=0,a=s.length;r<a;r++)if(s[r].fn===e&&s[r].ctx===i)return;s.push(o)},_off:function(t,e,i){var n,o,s;if(this._events&&(n=this._events[t]))if(e){if(i===this&&(i=void 0),n)for(o=0,s=n.length;o<s;o++){var r=n[o];if(r.ctx===i&&r.fn===e)return r.fn=h,this._firingCount&&(this._events[t]=n=n.slice()),void n.splice(o,1)}}else{for(o=0,s=n.length;o<s;o++)n[o].fn=h;delete this._events[t]}},fire:function(t,e,i){if(!this.listens(t,i))return this;var o=n({},e,{type:t,target:this,sourceTarget:e&&e.sourceTarget||this});if(this._events){var s=this._events[t];if(s){this._firingCount=this._firingCount+1||1;for(var r=0,a=s.length;r<a;r++){var l=s[r];l.fn.call(l.ctx||this,o)}this._firingCount--}}return i&&this._propagateEvent(o),this},listens:function(t,e){var i=this._events&&this._events[t];if(i&&i.length)return!0;if(e)for(var n in this._eventParents)if(this._eventParents[n].listens(t,e))return!0;return!1},once:function(t,e,i){if("object"==typeof t){for(var n in t)this.once(n,t[n],e);return this}var o=s((function(){this.off(t,e,i).off(t,o,i)}),this);return this.on(t,e,i).on(t,o,i)},addEventParent:function(t){return this._eventParents=this._eventParents||{},this._eventParents[a(t)]=t,this},removeEventParent:function(t){return this._eventParents&&delete this._eventParents[a(t)],this},_propagateEvent:function(t){for(var e in this._eventParents)this._eventParents[e].fire(t.type,n({layer:t.target,propagatedFrom:t.target},t),!0)}};M.addEventListener=M.on,M.removeEventListener=M.clearAllEventListeners=M.off,M.addOneTimeEventListener=M.once,M.fireEvent=M.fire,M.hasEventListeners=M.listens;var P=A.extend(M);function z(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e}var I=Math.trunc||function(t){return t>0?Math.floor(t):Math.ceil(t)};function D(t,e,i){return t instanceof z?t:y(t)?new z(t[0],t[1]):null==t?t:"object"==typeof t&&"x"in t&&"y"in t?new z(t.x,t.y):new z(t,e,i)}function N(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;n<o;n++)this.extend(i[n])}function R(t,e){return!t||t instanceof N?t:new N(t,e)}function B(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;n<o;n++)this.extend(i[n])}function q(t,e){return t instanceof B?t:new B(t,e)}function Z(t,e,i){if(isNaN(t)||isNaN(e))throw new Error("Invalid LatLng object: ("+t+", "+e+")");this.lat=+t,this.lng=+e,void 0!==i&&(this.alt=+i)}function F(t,e,i){return t instanceof Z?t:y(t)&&"object"!=typeof t[0]?3===t.length?new Z(t[0],t[1],t[2]):2===t.length?new Z(t[0],t[1]):null:null==t?t:"object"==typeof t&&"lat"in t?new Z(t.lat,"lng"in t?t.lng:t.lon,t.alt):void 0===e?null:new Z(t,e,i)}z.prototype={clone:function(){return new z(this.x,this.y)},add:function(t){return this.clone()._add(D(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(D(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new z(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new z(this.x/t.x,this.y/t.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=I(this.x),this.y=I(this.y),this},distanceTo:function(t){var e=(t=D(t)).x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return(t=D(t)).x===this.x&&t.y===this.y},contains:function(t){return t=D(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+u(this.x)+", "+u(this.y)+")"}},N.prototype={extend:function(t){return t=D(t),this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(t.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(t.y,this.max.y)):(this.min=t.clone(),this.max=t.clone()),this},getCenter:function(t){return new z((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return new z(this.min.x,this.max.y)},getTopRight:function(){return new z(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,i;return(t="number"==typeof t[0]||t instanceof z?D(t):R(t))instanceof N?(e=t.min,i=t.max):e=i=t,e.x>=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=R(t);var e=this.min,i=this.max,n=t.min,o=t.max,s=o.x>=e.x&&n.x<=i.x,r=o.y>=e.y&&n.y<=i.y;return s&&r},overlaps:function(t){t=R(t);var e=this.min,i=this.max,n=t.min,o=t.max,s=o.x>e.x&&n.x<i.x,r=o.y>e.y&&n.y<i.y;return s&&r},isValid:function(){return!(!this.min||!this.max)}},B.prototype={extend:function(t){var e,i,n=this._southWest,o=this._northEast;if(t instanceof Z)e=t,i=t;else{if(!(t instanceof B))return t?this.extend(F(t)||q(t)):this;if(e=t._southWest,i=t._northEast,!e||!i)return this}return n||o?(n.lat=Math.min(e.lat,n.lat),n.lng=Math.min(e.lng,n.lng),o.lat=Math.max(i.lat,o.lat),o.lng=Math.max(i.lng,o.lng)):(this._southWest=new Z(e.lat,e.lng),this._northEast=new Z(i.lat,i.lng)),this},pad:function(t){var e=this._southWest,i=this._northEast,n=Math.abs(e.lat-i.lat)*t,o=Math.abs(e.lng-i.lng)*t;return new B(new Z(e.lat-n,e.lng-o),new Z(i.lat+n,i.lng+o))},getCenter:function(){return new Z((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new Z(this.getNorth(),this.getWest())},getSouthEast:function(){return new Z(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(t){t="number"==typeof t[0]||t instanceof Z||"lat"in t?F(t):q(t);var e,i,n=this._southWest,o=this._northEast;return t instanceof B?(e=t.getSouthWest(),i=t.getNorthEast()):e=i=t,e.lat>=n.lat&&i.lat<=o.lat&&e.lng>=n.lng&&i.lng<=o.lng},intersects:function(t){t=q(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>=e.lat&&n.lat<=i.lat,r=o.lng>=e.lng&&n.lng<=i.lng;return s&&r},overlaps:function(t){t=q(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>e.lat&&n.lat<i.lat,r=o.lng>e.lng&&n.lng<i.lng;return s&&r},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t,e){return!!t&&(t=q(t),this._southWest.equals(t.getSouthWest(),e)&&this._northEast.equals(t.getNorthEast(),e))},isValid:function(){return!(!this._southWest||!this._northEast)}},Z.prototype={equals:function(t,e){return!!t&&(t=F(t),Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng))<=(void 0===e?1e-9:e))},toString:function(t){return"LatLng("+u(this.lat,t)+", "+u(this.lng,t)+")"},distanceTo:function(t){return j.distance(this,F(t))},wrap:function(){return j.wrapLatLng(this)},toBounds:function(t){var e=180*t/40075017,i=e/Math.cos(Math.PI/180*this.lat);return q([this.lat-e,this.lng-i],[this.lat+e,this.lng+i])},clone:function(){return new Z(this.lat,this.lng,this.alt)}};var V={latLngToPoint:function(t,e){var i=this.projection.project(t),n=this.scale(e);return this.transformation._transform(i,n)},pointToLatLng:function(t,e){var i=this.scale(e),n=this.transformation.untransform(t,i);return this.projection.unproject(n)},project:function(t){return this.projection.project(t)},unproject:function(t){return this.projection.unproject(t)},scale:function(t){return 256*Math.pow(2,t)},zoom:function(t){return Math.log(t/256)/Math.LN2},getProjectedBounds:function(t){if(this.infinite)return null;var e=this.projection.bounds,i=this.scale(t);return new N(this.transformation.transform(e.min,i),this.transformation.transform(e.max,i))},infinite:!1,wrapLatLng:function(t){var e=this.wrapLng?c(t.lng,this.wrapLng,!0):t.lng;return new Z(this.wrapLat?c(t.lat,this.wrapLat,!0):t.lat,e,t.alt)},wrapLatLngBounds:function(t){var e=t.getCenter(),i=this.wrapLatLng(e),n=e.lat-i.lat,o=e.lng-i.lng;if(0===n&&0===o)return t;var s=t.getSouthWest(),r=t.getNorthEast();return new B(new Z(s.lat-n,s.lng-o),new Z(r.lat-n,r.lng-o))}},j=n({},V,{wrapLng:[-180,180],R:6371e3,distance:function(t,e){var i=Math.PI/180,n=t.lat*i,o=e.lat*i,s=Math.sin((e.lat-t.lat)*i/2),r=Math.sin((e.lng-t.lng)*i/2),a=s*s+Math.cos(n)*Math.cos(o)*r*r,l=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a));return this.R*l}}),U=6378137,H={R:U,MAX_LATITUDE:85.0511287798,project:function(t){var e=Math.PI/180,i=this.MAX_LATITUDE,n=Math.max(Math.min(i,t.lat),-i),o=Math.sin(n*e);return new z(this.R*t.lng*e,this.R*Math.log((1+o)/(1-o))/2)},unproject:function(t){var e=180/Math.PI;return new Z((2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*e,t.x*e/this.R)},bounds:function(){var t=U*Math.PI;return new N([-t,-t],[t,t])}()};function G(t,e,i,n){if(y(t))return this._a=t[0],this._b=t[1],this._c=t[2],void(this._d=t[3]);this._a=t,this._b=e,this._c=i,this._d=n}function W(t,e,i,n){return new G(t,e,i,n)}G.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return e=e||1,t.x=e*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return e=e||1,new z((t.x/e-this._b)/this._a,(t.y/e-this._d)/this._c)}};var K=n({},j,{code:"EPSG:3857",projection:H,transformation:function(){var t=.5/(Math.PI*H.R);return W(t,.5,-t,.5)}()}),Y=n({},K,{code:"EPSG:900913"});function J(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function X(t,e){var i,n,o,s,r,a,l="";for(i=0,o=t.length;i<o;i++){for(n=0,s=(r=t[i]).length;n<s;n++)l+=(n?"L":"M")+(a=r[n]).x+" "+a.y;l+=e?Lt?"z":"x":""}return l||"M0 0"}var Q=document.documentElement.style,tt="ActiveXObject"in window,et=tt&&!document.addEventListener,it="msLaunchUri"in navigator&&!("documentMode"in document),nt=Ot("webkit"),ot=Ot("android"),st=Ot("android 2")||Ot("android 3"),rt=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),at=ot&&Ot("Google")&&rt<537&&!("AudioNode"in window),lt=!!window.opera,ct=Ot("chrome"),ht=Ot("gecko")&&!nt&&!lt&&!tt,ut=!ct&&Ot("safari"),dt=Ot("phantom"),pt="OTransition"in Q,mt=0===navigator.platform.indexOf("Win"),ft=tt&&"transition"in Q,gt="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!st,vt="MozPerspective"in Q,yt=!window.L_DISABLE_3D&&(ft||gt||vt)&&!pt&&!dt,bt="undefined"!=typeof orientation||Ot("mobile"),_t=bt&&nt,xt=bt&&gt,wt=!window.PointerEvent&&window.MSPointerEvent,kt=!(!window.PointerEvent&&!wt),St=!window.L_NO_TOUCH&&(kt||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch),Ct=bt&&lt,Tt=bt&&ht,Et=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,$t=!!document.createElement("canvas").getContext,Lt=!(!document.createElementNS||!J("svg").createSVGRect),At=!Lt&&function(){try{var t=document.createElement("div");t.innerHTML='<v:shape adj="1"/>';var e=t.firstChild;return e.style.behavior="url(#default#VML)",e&&"object"==typeof e.adj}catch(t){return!1}}();function Ot(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var Mt=(Object.freeze||Object)({ie:tt,ielt9:et,edge:it,webkit:nt,android:ot,android23:st,androidStock:at,opera:lt,chrome:ct,gecko:ht,safari:ut,phantom:dt,opera12:pt,win:mt,ie3d:ft,webkit3d:gt,gecko3d:vt,any3d:yt,mobile:bt,mobileWebkit:_t,mobileWebkit3d:xt,msPointer:wt,pointer:kt,touch:St,mobileOpera:Ct,mobileGecko:Tt,retina:Et,canvas:$t,svg:Lt,vml:At}),Pt=wt?"MSPointerDown":"pointerdown",zt=wt?"MSPointerMove":"pointermove",It=wt?"MSPointerUp":"pointerup",Dt=wt?"MSPointerCancel":"pointercancel",Nt=["INPUT","SELECT","OPTION"],Rt={},Bt=!1,qt=0;function Zt(t,e,i,n){return"touchstart"===e?Vt(t,i,n):"touchmove"===e?Wt(t,i,n):"touchend"===e&&Kt(t,i,n),this}function Ft(t,e,i){var n=t["_leaflet_"+e+i];return"touchstart"===e?t.removeEventListener(Pt,n,!1):"touchmove"===e?t.removeEventListener(zt,n,!1):"touchend"===e&&(t.removeEventListener(It,n,!1),t.removeEventListener(Dt,n,!1)),this}function Vt(t,e,i){var n=s((function(t){if("mouse"!==t.pointerType&&t.MSPOINTER_TYPE_MOUSE&&t.pointerType!==t.MSPOINTER_TYPE_MOUSE){if(!(Nt.indexOf(t.target.tagName)<0))return;Ve(t)}Gt(t,e)}));t["_leaflet_touchstart"+i]=n,t.addEventListener(Pt,n,!1),Bt||(document.documentElement.addEventListener(Pt,jt,!0),document.documentElement.addEventListener(zt,Ut,!0),document.documentElement.addEventListener(It,Ht,!0),document.documentElement.addEventListener(Dt,Ht,!0),Bt=!0)}function jt(t){Rt[t.pointerId]=t,qt++}function Ut(t){Rt[t.pointerId]&&(Rt[t.pointerId]=t)}function Ht(t){delete Rt[t.pointerId],qt--}function Gt(t,e){for(var i in t.touches=[],Rt)t.touches.push(Rt[i]);t.changedTouches=[t],e(t)}function Wt(t,e,i){var n=function(t){(t.pointerType!==t.MSPOINTER_TYPE_MOUSE&&"mouse"!==t.pointerType||0!==t.buttons)&&Gt(t,e)};t["_leaflet_touchmove"+i]=n,t.addEventListener(zt,n,!1)}function Kt(t,e,i){var n=function(t){Gt(t,e)};t["_leaflet_touchend"+i]=n,t.addEventListener(It,n,!1),t.addEventListener(Dt,n,!1)}var Yt=wt?"MSPointerDown":kt?"pointerdown":"touchstart",Jt=wt?"MSPointerUp":kt?"pointerup":"touchend",Xt="_leaflet_";function Qt(t,e,i){var n,o,s=!1,r=250;function a(t){var e;if(kt){if(!it||"mouse"===t.pointerType)return;e=qt}else e=t.touches.length;if(!(e>1)){var i=Date.now(),a=i-(n||i);o=t.touches?t.touches[0]:t,s=a>0&&a<=r,n=i}}function l(t){if(s&&!o.cancelBubble){if(kt){if(!it||"mouse"===t.pointerType)return;var i,r,a={};for(r in o)i=o[r],a[r]=i&&i.bind?i.bind(o):i;o=a}o.type="dblclick",o.button=0,e(o),n=null}}return t[Xt+Yt+i]=a,t[Xt+Jt+i]=l,t[Xt+"dblclick"+i]=e,t.addEventListener(Yt,a,!1),t.addEventListener(Jt,l,!1),t.addEventListener("dblclick",e,!1),this}function te(t,e){var i=t[Xt+Yt+e],n=t[Xt+Jt+e],o=t[Xt+"dblclick"+e];return t.removeEventListener(Yt,i,!1),t.removeEventListener(Jt,n,!1),it||t.removeEventListener("dblclick",o,!1),this}var ee,ie,ne,oe,se,re=ke(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),ae=ke(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),le="webkitTransition"===ae||"OTransition"===ae?ae+"End":"transitionend";function ce(t){return"string"==typeof t?document.getElementById(t):t}function he(t,e){var i=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!i||"auto"===i)&&document.defaultView){var n=document.defaultView.getComputedStyle(t,null);i=n?n[e]:null}return"auto"===i?null:i}function ue(t,e,i){var n=document.createElement(t);return n.className=e||"",i&&i.appendChild(n),n}function de(t){var e=t.parentNode;e&&e.removeChild(t)}function pe(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function me(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function fe(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function ge(t,e){if(void 0!==t.classList)return t.classList.contains(e);var i=_e(t);return i.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(i)}function ve(t,e){if(void 0!==t.classList)for(var i=p(e),n=0,o=i.length;n<o;n++)t.classList.add(i[n]);else if(!ge(t,e)){var s=_e(t);be(t,(s?s+" ":"")+e)}}function ye(t,e){void 0!==t.classList?t.classList.remove(e):be(t,d((" "+_e(t)+" ").replace(" "+e+" "," ")))}function be(t,e){void 0===t.className.baseVal?t.className=e:t.className.baseVal=e}function _e(t){return t.correspondingElement&&(t=t.correspondingElement),void 0===t.className.baseVal?t.className:t.className.baseVal}function xe(t,e){"opacity"in t.style?t.style.opacity=e:"filter"in t.style&&we(t,e)}function we(t,e){var i=!1,n="DXImageTransform.Microsoft.Alpha";try{i=t.filters.item(n)}catch(t){if(1===e)return}e=Math.round(100*e),i?(i.Enabled=100!==e,i.Opacity=e):t.style.filter+=" progid:"+n+"(opacity="+e+")"}function ke(t){for(var e=document.documentElement.style,i=0;i<t.length;i++)if(t[i]in e)return t[i];return!1}function Se(t,e,i){var n=e||new z(0,0);t.style[re]=(ft?"translate("+n.x+"px,"+n.y+"px)":"translate3d("+n.x+"px,"+n.y+"px,0)")+(i?" scale("+i+")":"")}function Ce(t,e){t._leaflet_pos=e,yt?Se(t,e):(t.style.left=e.x+"px",t.style.top=e.y+"px")}function Te(t){return t._leaflet_pos||new z(0,0)}if("onselectstart"in document)ee=function(){Ie(window,"selectstart",Ve)},ie=function(){Ne(window,"selectstart",Ve)};else{var Ee=ke(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);ee=function(){if(Ee){var t=document.documentElement.style;ne=t[Ee],t[Ee]="none"}},ie=function(){Ee&&(document.documentElement.style[Ee]=ne,ne=void 0)}}function $e(){Ie(window,"dragstart",Ve)}function Le(){Ne(window,"dragstart",Ve)}function Ae(t){for(;-1===t.tabIndex;)t=t.parentNode;t.style&&(Oe(),oe=t,se=t.style.outline,t.style.outline="none",Ie(window,"keydown",Oe))}function Oe(){oe&&(oe.style.outline=se,oe=void 0,se=void 0,Ne(window,"keydown",Oe))}function Me(t){do{t=t.parentNode}while(!(t.offsetWidth&&t.offsetHeight||t===document.body));return t}function Pe(t){var e=t.getBoundingClientRect();return{x:e.width/t.offsetWidth||1,y:e.height/t.offsetHeight||1,boundingClientRect:e}}var ze=(Object.freeze||Object)({TRANSFORM:re,TRANSITION:ae,TRANSITION_END:le,get:ce,getStyle:he,create:ue,remove:de,empty:pe,toFront:me,toBack:fe,hasClass:ge,addClass:ve,removeClass:ye,setClass:be,getClass:_e,setOpacity:xe,testProp:ke,setTransform:Se,setPosition:Ce,getPosition:Te,disableTextSelection:ee,enableTextSelection:ie,disableImageDrag:$e,enableImageDrag:Le,preventOutline:Ae,restoreOutline:Oe,getSizedParentNode:Me,getScale:Pe});function Ie(t,e,i,n){if("object"==typeof e)for(var o in e)Re(t,o,e[o],i);else for(var s=0,r=(e=p(e)).length;s<r;s++)Re(t,e[s],i,n);return this}var De="_leaflet_events";function Ne(t,e,i,n){if("object"==typeof e)for(var o in e)Be(t,o,e[o],i);else if(e)for(var s=0,r=(e=p(e)).length;s<r;s++)Be(t,e[s],i,n);else{for(var a in t[De])Be(t,a,t[De][a]);delete t[De]}return this}function Re(t,e,i,n){var o=e+a(i)+(n?"_"+a(n):"");if(t[De]&&t[De][o])return this;var s=function(e){return i.call(n||t,e||window.event)},r=s;kt&&0===e.indexOf("touch")?Zt(t,e,s,o):!St||"dblclick"!==e||!Qt||kt&&ct?"addEventListener"in t?"mousewheel"===e?t.addEventListener("onwheel"in t?"wheel":"mousewheel",s,!1):"mouseenter"===e||"mouseleave"===e?(s=function(e){e=e||window.event,Xe(t,e)&&r(e)},t.addEventListener("mouseenter"===e?"mouseover":"mouseout",s,!1)):("click"===e&&ot&&(s=function(t){Qe(t,r)}),t.addEventListener(e,s,!1)):"attachEvent"in t&&t.attachEvent("on"+e,s):Qt(t,s,o),t[De]=t[De]||{},t[De][o]=s}function Be(t,e,i,n){var o=e+a(i)+(n?"_"+a(n):""),s=t[De]&&t[De][o];if(!s)return this;kt&&0===e.indexOf("touch")?Ft(t,e,o):!St||"dblclick"!==e||!te||kt&&ct?"removeEventListener"in t?"mousewheel"===e?t.removeEventListener("onwheel"in t?"wheel":"mousewheel",s,!1):t.removeEventListener("mouseenter"===e?"mouseover":"mouseleave"===e?"mouseout":e,s,!1):"detachEvent"in t&&t.detachEvent("on"+e,s):te(t,o),t[De][o]=null}function qe(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,Je(t),this}function Ze(t){return Re(t,"mousewheel",qe),this}function Fe(t){return Ie(t,"mousedown touchstart dblclick",qe),Re(t,"click",Ye),this}function Ve(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function je(t){return Ve(t),qe(t),this}function Ue(t,e){if(!e)return new z(t.clientX,t.clientY);var i=Pe(e),n=i.boundingClientRect;return new z((t.clientX-n.left)/i.x-e.clientLeft,(t.clientY-n.top)/i.y-e.clientTop)}var He=mt&&ct?2*window.devicePixelRatio:ht?window.devicePixelRatio:1;function Ge(t){return it?t.wheelDeltaY/2:t.deltaY&&0===t.deltaMode?-t.deltaY/He:t.deltaY&&1===t.deltaMode?20*-t.deltaY:t.deltaY&&2===t.deltaMode?60*-t.deltaY:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?20*-t.detail:t.detail?t.detail/-32765*60:0}var We,Ke={};function Ye(t){Ke[t.type]=!0}function Je(t){var e=Ke[t.type];return Ke[t.type]=!1,e}function Xe(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch(t){return!1}return i!==t}function Qe(t,e){var i=t.timeStamp||t.originalEvent&&t.originalEvent.timeStamp,n=We&&i-We;n&&n>100&&n<500||t.target._simulatedClick&&!t._simulated?je(t):(We=i,e(t))}var ti=(Object.freeze||Object)({on:Ie,off:Ne,stopPropagation:qe,disableScrollPropagation:Ze,disableClickPropagation:Fe,preventDefault:Ve,stop:je,getMousePosition:Ue,getWheelDelta:Ge,fakeStop:Ye,skipped:Je,isExternalTarget:Xe,addListener:Ie,removeListener:Ne}),ei=P.extend({run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=Te(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=T(this._animate,this),this._step()},_step:function(t){var e=+new Date-this._startTime,i=1e3*this._duration;e<i?this._runFrame(this._easeOut(e/i),t):(this._runFrame(1),this._complete())},_runFrame:function(t,e){var i=this._startPos.add(this._offset.multiplyBy(t));e&&i._round(),Ce(this._el,i),this.fire("step")},_complete:function(){E(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),ii=P.extend({options:{crs:K,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(t,e){e=m(this,e),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(t),this._initLayout(),this._onResize=s(this._onResize,this),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),void 0!==e.zoom&&(this._zoom=this._limitZoom(e.zoom)),e.center&&void 0!==e.zoom&&this.setView(F(e.center),e.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=ae&&yt&&!Ct&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),Ie(this._proxy,le,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(t,e,i){return e=void 0===e?this._zoom:this._limitZoom(e),t=this._limitCenter(F(t),e,this.options.maxBounds),i=i||{},this._stop(),this._loaded&&!i.reset&&!0!==i&&(void 0!==i.animate&&(i.zoom=n({animate:i.animate},i.zoom),i.pan=n({animate:i.animate,duration:i.duration},i.pan)),this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,i.zoom):this._tryAnimatedPan(t,i.pan))?(clearTimeout(this._sizeTimer),this):(this._resetView(t,e),this)},setZoom:function(t,e){return this._loaded?this.setView(this.getCenter(),t,{zoom:e}):(this._zoom=t,this)},zoomIn:function(t,e){return t=t||(yt?this.options.zoomDelta:1),this.setZoom(this._zoom+t,e)},zoomOut:function(t,e){return t=t||(yt?this.options.zoomDelta:1),this.setZoom(this._zoom-t,e)},setZoomAround:function(t,e,i){var n=this.getZoomScale(e),o=this.getSize().divideBy(2),s=(t instanceof z?t:this.latLngToContainerPoint(t)).subtract(o).multiplyBy(1-1/n),r=this.containerPointToLatLng(o.add(s));return this.setView(r,e,{zoom:i})},_getBoundsCenterZoom:function(t,e){e=e||{},t=t.getBounds?t.getBounds():q(t);var i=D(e.paddingTopLeft||e.padding||[0,0]),n=D(e.paddingBottomRight||e.padding||[0,0]),o=this.getBoundsZoom(t,!1,i.add(n));if((o="number"==typeof e.maxZoom?Math.min(e.maxZoom,o):o)===1/0)return{center:t.getCenter(),zoom:o};var s=n.subtract(i).divideBy(2),r=this.project(t.getSouthWest(),o),a=this.project(t.getNorthEast(),o);return{center:this.unproject(r.add(a).divideBy(2).add(s),o),zoom:o}},fitBounds:function(t,e){if(!(t=q(t)).isValid())throw new Error("Bounds are not valid.");var i=this._getBoundsCenterZoom(t,e);return this.setView(i.center,i.zoom,e)},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,e){return this.setView(t,this._zoom,{pan:e})},panBy:function(t,e){if(e=e||{},!(t=D(t).round()).x&&!t.y)return this.fire("moveend");if(!0!==e.animate&&!this.getSize().contains(t))return this._resetView(this.unproject(this.project(this.getCenter()).add(t)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new ei,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),!1!==e.animate){ve(this._mapPane,"leaflet-pan-anim");var i=this._getMapPanePos().subtract(t).round();this._panAnim.run(this._mapPane,i,e.duration||.25,e.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this},flyTo:function(t,e,i){if(!1===(i=i||{}).animate||!yt)return this.setView(t,e,i);this._stop();var n=this.project(this.getCenter()),o=this.project(t),s=this.getSize(),r=this._zoom;t=F(t),e=void 0===e?r:e;var a=Math.max(s.x,s.y),l=a*this.getZoomScale(r,e),c=o.distanceTo(n)||1,h=1.42,u=h*h;function d(t){var e=(l*l-a*a+(t?-1:1)*u*u*c*c)/(2*(t?l:a)*u*c),i=Math.sqrt(e*e+1)-e;return i<1e-9?-18:Math.log(i)}function p(t){return(Math.exp(t)-Math.exp(-t))/2}function m(t){return(Math.exp(t)+Math.exp(-t))/2}function f(t){return p(t)/m(t)}var g=d(0);function v(t){return a*(m(g)/m(g+h*t))}function y(t){return a*(m(g)*f(g+h*t)-p(g))/u}function b(t){return 1-Math.pow(1-t,1.5)}var _=Date.now(),x=(d(1)-g)/h,w=i.duration?1e3*i.duration:1e3*x*.8;function k(){var i=(Date.now()-_)/w,s=b(i)*x;i<=1?(this._flyToFrame=T(k,this),this._move(this.unproject(n.add(o.subtract(n).multiplyBy(y(s)/c)),r),this.getScaleZoom(a/v(s),r),{flyTo:!0})):this._move(t,e)._moveEnd(!0)}return this._moveStart(!0,i.noMoveStart),k.call(this),this},flyToBounds:function(t,e){var i=this._getBoundsCenterZoom(t,e);return this.flyTo(i.center,i.zoom,e)},setMaxBounds:function(t){return(t=q(t)).isValid()?(this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this.options.maxBounds=t,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this.off("moveend",this._panInsideMaxBounds))},setMinZoom:function(t){var e=this.options.minZoom;return this.options.minZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(t):this},setMaxZoom:function(t){var e=this.options.maxZoom;return this.options.maxZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var i=this.getCenter(),n=this._limitCenter(i,this._zoom,q(t));return i.equals(n)||this.panTo(n,e),this._enforcingBounds=!1,this},panInside:function(t,e){var i=D((e=e||{}).paddingTopLeft||e.padding||[0,0]),n=D(e.paddingBottomRight||e.padding||[0,0]),o=this.getCenter(),s=this.project(o),r=this.project(t),a=this.getPixelBounds(),l=a.getSize().divideBy(2),c=R([a.min.add(i),a.max.subtract(n)]);if(!c.contains(r)){this._enforcingBounds=!0;var h=s.subtract(r),u=D(r.x+h.x,r.y+h.y);(r.x<c.min.x||r.x>c.max.x)&&(u.x=s.x-h.x,h.x>0?u.x+=l.x-i.x:u.x-=l.x-n.x),(r.y<c.min.y||r.y>c.max.y)&&(u.y=s.y-h.y,h.y>0?u.y+=l.y-i.y:u.y-=l.y-n.y),this.panTo(this.unproject(u),e),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=n({animate:!1,pan:!0},!0===t?{animate:!0}:t);var e=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var i=this.getSize(),o=e.divideBy(2).round(),r=i.divideBy(2).round(),a=o.subtract(r);return a.x||a.y?(t.animate&&t.pan?this.panBy(a):(t.pan&&this._rawPanBy(a),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(s(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:i})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=n({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=s(this._handleGeolocationResponse,this),i=s(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,i,t):navigator.geolocation.getCurrentPosition(e,i,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){var e=t.code,i=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+i+"."})},_handleGeolocationResponse:function(t){var e=new Z(t.coords.latitude,t.coords.longitude),i=e.toBounds(2*t.coords.accuracy),n=this._locateOptions;if(n.setView){var o=this.getBoundsZoom(i);this.setView(e,n.maxZoom?Math.min(o,n.maxZoom):o)}var s={latlng:e,bounds:i,timestamp:t.timestamp};for(var r in t.coords)"number"==typeof t.coords[r]&&(s[r]=t.coords[r]);this.fire("locationfound",s)},addHandler:function(t,e){if(!e)return this;var i=this[t]=new e(this);return this._handlers.push(i),this.options[t]&&i.enable(),this},remove:function(){if(this._initEvents(!0),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(t){this._container._leaflet_id=void 0,this._containerId=void 0}var t;for(t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),de(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(E(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)de(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){var i=ue("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),e||this._mapPane);return t&&(this._panes[t]=i),i},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new B(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,i){t=q(t),i=D(i||[0,0]);var n=this.getZoom()||0,o=this.getMinZoom(),s=this.getMaxZoom(),r=t.getNorthWest(),a=t.getSouthEast(),l=this.getSize().subtract(i),c=R(this.project(a,n),this.project(r,n)).getSize(),h=yt?this.options.zoomSnap:1,u=l.x/c.x,d=l.y/c.y,p=e?Math.max(u,d):Math.min(u,d);return n=this.getScaleZoom(p,n),h&&(n=Math.round(n/(h/100))*(h/100),n=e?Math.ceil(n/h)*h:Math.floor(n/h)*h),Math.max(o,Math.min(s,n))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new z(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){var i=this._getTopLeftPoint(t,e);return new N(i,i.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var i=this.options.crs;return e=void 0===e?this._zoom:e,i.scale(t)/i.scale(e)},getScaleZoom:function(t,e){var i=this.options.crs;e=void 0===e?this._zoom:e;var n=i.zoom(t*i.scale(e));return isNaN(n)?1/0:n},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(F(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(D(t),e)},layerPointToLatLng:function(t){var e=D(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){return this.project(F(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(F(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(q(t))},distance:function(t,e){return this.options.crs.distance(F(t),F(e))},containerPointToLayerPoint:function(t){return D(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return D(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(D(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(F(t)))},mouseEventToContainerPoint:function(t){return Ue(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=ce(t);if(!e)throw new Error("Map container not found.");if(e._leaflet_id)throw new Error("Map container is already initialized.");Ie(e,"scroll",this._onScroll,this),this._containerId=a(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&yt,ve(t,"leaflet-container"+(St?" leaflet-touch":"")+(Et?" leaflet-retina":"")+(et?" leaflet-oldie":"")+(ut?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=he(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Ce(this._mapPane,new z(0,0)),this.createPane("tilePane"),this.createPane("shadowPane"),this.createPane("overlayPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(ve(t.markerPane,"leaflet-zoom-hide"),ve(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e){Ce(this._mapPane,new z(0,0));var i=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var n=this._zoom!==e;this._moveStart(n,!1)._move(t,e)._moveEnd(n),this.fire("viewreset"),i&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,i){void 0===e&&(e=this._zoom);var n=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),(n||i&&i.pinch)&&this.fire("zoom",i),this.fire("move",i)},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return E(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){Ce(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={},this._targets[a(this._container)]=this;var e=t?Ne:Ie;e(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),yt&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){E(this._resizeRequest),this._resizeRequest=T((function(){this.invalidateSize({debounceMoveend:!0})}),this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var i,n=[],o="mouseout"===e||"mouseover"===e,s=t.target||t.srcElement,r=!1;s;){if((i=this._targets[a(s)])&&("click"===e||"preclick"===e)&&!t._simulated&&this._draggableMoved(i)){r=!0;break}if(i&&i.listens(e,!0)){if(o&&!Xe(s,t))break;if(n.push(i),o)break}if(s===this._container)break;s=s.parentNode}return n.length||r||o||!Xe(s,t)||(n=[this]),n},_handleDOMEvent:function(t){if(this._loaded&&!Je(t)){var e=t.type;"mousedown"!==e&&"keypress"!==e&&"keyup"!==e&&"keydown"!==e||Ae(t.target||t.srcElement),this._fireDOMEvent(t,e)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,i){if("click"===t.type){var o=n({},t);o.type="preclick",this._fireDOMEvent(o,o.type,i)}if(!t._stopped&&(i=(i||[]).concat(this._findEventTargets(t,e))).length){var s=i[0];"contextmenu"===e&&s.listens(e,!0)&&Ve(t);var r={originalEvent:t};if("keypress"!==t.type&&"keydown"!==t.type&&"keyup"!==t.type){var a=s.getLatLng&&(!s._radius||s._radius<=10);r.containerPoint=a?this.latLngToContainerPoint(s.getLatLng()):this.mouseEventToContainerPoint(t),r.layerPoint=this.containerPointToLayerPoint(r.containerPoint),r.latlng=a?s.getLatLng():this.layerPointToLatLng(r.layerPoint)}for(var l=0;l<i.length;l++)if(i[l].fire(e,r,!0),r.originalEvent._stopped||!1===i[l].options.bubblingMouseEvents&&-1!==b(this._mouseEvents,e))return}},_draggableMoved:function(t){return(t=t.dragging&&t.dragging.enabled()?t:this).dragging&&t.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var t=0,e=this._handlers.length;t<e;t++)this._handlers[t].disable()},whenReady:function(t,e){return this._loaded?t.call(e||this,{target:this}):this.on("load",t,e),this},_getMapPanePos:function(){return Te(this._mapPane)||new z(0,0)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(t,e){return(t&&void 0!==e?this._getNewPixelOrigin(t,e):this.getPixelOrigin()).subtract(this._getMapPanePos())},_getNewPixelOrigin:function(t,e){var i=this.getSize()._divideBy(2);return this.project(t,e)._subtract(i)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(t,e,i){var n=this._getNewPixelOrigin(i,e);return this.project(t,e)._subtract(n)},_latLngBoundsToNewLayerBounds:function(t,e,i){var n=this._getNewPixelOrigin(i,e);return R([this.project(t.getSouthWest(),e)._subtract(n),this.project(t.getNorthWest(),e)._subtract(n),this.project(t.getSouthEast(),e)._subtract(n),this.project(t.getNorthEast(),e)._subtract(n)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,e,i){if(!i)return t;var n=this.project(t,e),o=this.getSize().divideBy(2),s=new N(n.subtract(o),n.add(o)),r=this._getBoundsOffset(s,i,e);return r.round().equals([0,0])?t:this.unproject(n.add(r),e)},_limitOffset:function(t,e){if(!e)return t;var i=this.getPixelBounds(),n=new N(i.min.add(t),i.max.add(t));return t.add(this._getBoundsOffset(n,e))},_getBoundsOffset:function(t,e,i){var n=R(this.project(e.getNorthEast(),i),this.project(e.getSouthWest(),i)),o=n.min.subtract(t.min),s=n.max.subtract(t.max);return new z(this._rebound(o.x,-s.x),this._rebound(o.y,-s.y))},_rebound:function(t,e){return t+e>0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom(),n=yt?this.options.zoomSnap:1;return n&&(t=Math.round(t/n)*n),Math.max(e,Math.min(i,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){ye(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var i=this._getCenterOffset(t)._trunc();return!(!0!==(e&&e.animate)&&!this.getSize().contains(i)||(this.panBy(i,e),0))},_createAnimProxy:function(){var t=this._proxy=ue("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",(function(t){var e=re,i=this._proxy.style[e];Se(this._proxy,this.project(t.center,t.zoom),this.getZoomScale(t.zoom,1)),i===this._proxy.style[e]&&this._animatingZoom&&this._onZoomTransitionEnd()}),this),this.on("load moveend",(function(){var t=this.getCenter(),e=this.getZoom();Se(this._proxy,this.project(t,e),this.getZoomScale(e,1))}),this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){de(this._proxy),delete this._proxy},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,i){if(this._animatingZoom)return!0;if(i=i||{},!this._zoomAnimated||!1===i.animate||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(e),o=this._getCenterOffset(t)._divideBy(1-1/n);return!(!0!==i.animate&&!this.getSize().contains(o)||(T((function(){this._moveStart(!0,!1)._animateZoom(t,e,!0)}),this),0))},_animateZoom:function(t,e,i,n){this._mapPane&&(i&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,ve(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:n}),setTimeout(s(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&ye(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom),T((function(){this._moveEnd(!0)}),this))}});function ni(t,e){return new ii(t,e)}var oi=A.extend({options:{position:"topright"},initialize:function(t){m(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),n=t._controlCorners[i];return ve(e,"leaflet-control"),-1!==i.indexOf("bottom")?n.insertBefore(e,n.firstChild):n.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(de(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),si=function(t){return new oi(t)};ii.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var t=this._controlCorners={},e="leaflet-",i=this._controlContainer=ue("div",e+"control-container",this._container);function n(n,o){var s=e+n+" "+e+o;t[n+o]=ue("div",s,i)}n("top","left"),n("top","right"),n("bottom","left"),n("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)de(this._controlCorners[t]);de(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var ri=oi.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,i,n){return i<n?-1:n<i?1:0}},initialize:function(t,e,i){for(var n in m(this,i),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,t)this._addLayer(t[n],n);for(n in e)this._addLayer(e[n],n,!0)},onAdd:function(t){this._initLayout(),this._update(),this._map=t,t.on("zoomend",this._checkDisabledLayers,this);for(var e=0;e<this._layers.length;e++)this._layers[e].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(t){return oi.prototype.addTo.call(this,t),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(t,e){return this._addLayer(t,e),this._map?this._update():this},addOverlay:function(t,e){return this._addLayer(t,e,!0),this._map?this._update():this},removeLayer:function(t){t.off("add remove",this._onLayerChange,this);var e=this._getLayer(a(t));return e&&this._layers.splice(this._layers.indexOf(e),1),this._map?this._update():this},expand:function(){ve(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var t=this._map.getSize().y-(this._container.offsetTop+50);return t<this._section.clientHeight?(ve(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=t+"px"):ye(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return ye(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=ue("div",t),i=this.options.collapsed;e.setAttribute("aria-haspopup",!0),Fe(e),Ze(e);var n=this._section=ue("section",t+"-list");i&&(this._map.on("click",this.collapse,this),ot||Ie(e,{mouseenter:this.expand,mouseleave:this.collapse},this));var o=this._layersLink=ue("a",t+"-toggle",e);o.href="#",o.title="Layers",St?(Ie(o,"click",je),Ie(o,"click",this.expand,this)):Ie(o,"focus",this.expand,this),i||this.expand(),this._baseLayersList=ue("div",t+"-base",n),this._separator=ue("div",t+"-separator",n),this._overlaysList=ue("div",t+"-overlays",n),e.appendChild(n)},_getLayer:function(t){for(var e=0;e<this._layers.length;e++)if(this._layers[e]&&a(this._layers[e].layer)===t)return this._layers[e]},_addLayer:function(t,e,i){this._map&&t.on("add remove",this._onLayerChange,this),this._layers.push({layer:t,name:e,overlay:i}),this.options.sortLayers&&this._layers.sort(s((function(t,e){return this.options.sortFunction(t.layer,e.layer,t.name,e.name)}),this)),this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;pe(this._baseLayersList),pe(this._overlaysList),this._layerControlInputs=[];var t,e,i,n,o=0;for(i=0;i<this._layers.length;i++)n=this._layers[i],this._addItem(n),e=e||n.overlay,t=t||!n.overlay,o+=n.overlay?0:1;return this.options.hideSingleBase&&(t=t&&o>1,this._baseLayersList.style.display=t?"":"none"),this._separator.style.display=e&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var e=this._getLayer(a(t.target)),i=e.overlay?"add"===t.type?"overlayadd":"overlayremove":"add"===t.type?"baselayerchange":null;i&&this._map.fire(i,e)},_createRadioElement:function(t,e){var i='<input type="radio" class="leaflet-control-layers-selector" name="'+t+'"'+(e?' checked="checked"':"")+"/>",n=document.createElement("div");return n.innerHTML=i,n.firstChild},_addItem:function(t){var e,i=document.createElement("label"),n=this._map.hasLayer(t.layer);t.overlay?((e=document.createElement("input")).type="checkbox",e.className="leaflet-control-layers-selector",e.defaultChecked=n):e=this._createRadioElement("leaflet-base-layers_"+a(this),n),this._layerControlInputs.push(e),e.layerId=a(t.layer),Ie(e,"click",this._onInputClick,this);var o=document.createElement("span");o.innerHTML=" "+t.name;var s=document.createElement("div");return i.appendChild(s),s.appendChild(e),s.appendChild(o),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(i),this._checkDisabledLayers(),i},_onInputClick:function(){var t,e,i=this._layerControlInputs,n=[],o=[];this._handlingClick=!0;for(var s=i.length-1;s>=0;s--)t=i[s],e=this._getLayer(t.layerId).layer,t.checked?n.push(e):t.checked||o.push(e);for(s=0;s<o.length;s++)this._map.hasLayer(o[s])&&this._map.removeLayer(o[s]);for(s=0;s<n.length;s++)this._map.hasLayer(n[s])||this._map.addLayer(n[s]);this._handlingClick=!1,this._refocusOnMap()},_checkDisabledLayers:function(){for(var t,e,i=this._layerControlInputs,n=this._map.getZoom(),o=i.length-1;o>=0;o--)t=i[o],e=this._getLayer(t.layerId).layer,t.disabled=void 0!==e.options.minZoom&&n<e.options.minZoom||void 0!==e.options.maxZoom&&n>e.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expand:function(){return this.expand()},_collapse:function(){return this.collapse()}}),ai=function(t,e,i){return new ri(t,e,i)},li=oi.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"&#x2212;",zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=ue("div",e+" leaflet-bar"),n=this.options;return this._zoomInButton=this._createButton(n.zoomInText,n.zoomInTitle,e+"-in",i,this._zoomIn),this._zoomOutButton=this._createButton(n.zoomOutText,n.zoomOutTitle,e+"-out",i,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(t.shiftKey?3:1))},_zoomOut:function(t){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,i,n,o){var s=ue("a",i,n);return s.innerHTML=t,s.href="#",s.title=e,s.setAttribute("role","button"),s.setAttribute("aria-label",e),Fe(s),Ie(s,"click",je),Ie(s,"click",o,this),Ie(s,"click",this._refocusOnMap,this),s},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";ye(this._zoomInButton,e),ye(this._zoomOutButton,e),(this._disabled||t._zoom===t.getMinZoom())&&ve(this._zoomOutButton,e),(this._disabled||t._zoom===t.getMaxZoom())&&ve(this._zoomInButton,e)}});ii.mergeOptions({zoomControl:!0}),ii.addInitHook((function(){this.options.zoomControl&&(this.zoomControl=new li,this.addControl(this.zoomControl))}));var ci=function(t){return new li(t)},hi=oi.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",i=ue("div",e),n=this.options;return this._addScales(n,e+"-line",i),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=ue("div",e,i)),t.imperial&&(this._iScale=ue("div",e,i))},_update:function(){var t=this._map,e=t.getSize().y/2,i=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(i)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t),i=e<1e3?e+" m":e/1e3+" km";this._updateScale(this._mScale,i,e/t)},_updateImperial:function(t){var e,i,n,o=3.2808399*t;o>5280?(e=o/5280,i=this._getRoundNum(e),this._updateScale(this._iScale,i+" mi",i/e)):(n=this._getRoundNum(o),this._updateScale(this._iScale,n+" ft",n/o))},_updateScale:function(t,e,i){t.style.width=Math.round(this.options.maxWidth*i)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),i=t/e;return e*(i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:1)}}),ui=function(t){return new hi(t)},di=oi.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JS library for interactive maps">Leaflet</a>'},initialize:function(t){m(this,t),this._attributions={}},onAdd:function(t){for(var e in t.attributionControl=this,this._container=ue("div","leaflet-control-attribution"),Fe(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),this._container},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var i=[];this.options.prefix&&i.push(this.options.prefix),t.length&&i.push(t.join(", ")),this._container.innerHTML=i.join(" | ")}}});ii.mergeOptions({attributionControl:!0}),ii.addInitHook((function(){this.options.attributionControl&&(new di).addTo(this)}));var pi=function(t){return new di(t)};oi.Layers=ri,oi.Zoom=li,oi.Scale=hi,oi.Attribution=di,si.layers=ai,si.zoom=ci,si.scale=ui,si.attribution=pi;var mi=A.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});mi.addTo=function(t,e){return t.addHandler(e,this),this};var fi,gi={Events:M},vi=St?"touchstart mousedown":"mousedown",yi={mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},bi={mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"},_i=P.extend({options:{clickTolerance:3},initialize:function(t,e,i,n){m(this,n),this._element=t,this._dragStartTarget=e||t,this._preventOutline=i},enable:function(){this._enabled||(Ie(this._dragStartTarget,vi,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(_i._dragging===this&&this.finishDrag(),Ne(this._dragStartTarget,vi,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(!t._simulated&&this._enabled&&(this._moved=!1,!ge(this._element,"leaflet-zoom-anim")&&!(_i._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(_i._dragging=this,this._preventOutline&&Ae(this._element),$e(),ee(),this._moving)))){this.fire("down");var e=t.touches?t.touches[0]:t,i=Me(this._element);this._startPoint=new z(e.clientX,e.clientY),this._parentScale=Pe(i),Ie(document,bi[t.type],this._onMove,this),Ie(document,yi[t.type],this._onUp,this)}},_onMove:function(t){if(!t._simulated&&this._enabled)if(t.touches&&t.touches.length>1)this._moved=!0;else{var e=t.touches&&1===t.touches.length?t.touches[0]:t,i=new z(e.clientX,e.clientY)._subtract(this._startPoint);(i.x||i.y)&&(Math.abs(i.x)+Math.abs(i.y)<this.options.clickTolerance||(i.x/=this._parentScale.x,i.y/=this._parentScale.y,Ve(t),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=Te(this._element).subtract(i),ve(document.body,"leaflet-dragging"),this._lastTarget=t.target||t.srcElement,window.SVGElementInstance&&this._lastTarget instanceof SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),ve(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(i),this._moving=!0,E(this._animRequest),this._lastEvent=t,this._animRequest=T(this._updatePosition,this,!0)))}},_updatePosition:function(){var t={originalEvent:this._lastEvent};this.fire("predrag",t),Ce(this._element,this._newPos),this.fire("drag",t)},_onUp:function(t){!t._simulated&&this._enabled&&this.finishDrag()},finishDrag:function(){for(var t in ye(document.body,"leaflet-dragging"),this._lastTarget&&(ye(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),bi)Ne(document,bi[t],this._onMove,this),Ne(document,yi[t],this._onUp,this);Le(),ie(),this._moved&&this._moving&&(E(this._animRequest),this.fire("dragend",{distance:this._newPos.distanceTo(this._startPos)})),this._moving=!1,_i._dragging=!1}});function xi(t,e){if(!e||!t.length)return t.slice();var i=e*e;return t=Si(t=Ti(t,i),i)}function wi(t,e,i){return Math.sqrt(Oi(t,e,i,!0))}function ki(t,e,i){return Oi(t,e,i)}function Si(t,e){var i=t.length,n=new(typeof Uint8Array!=void 0+""?Uint8Array:Array)(i);n[0]=n[i-1]=1,Ci(t,n,e,0,i-1);var o,s=[];for(o=0;o<i;o++)n[o]&&s.push(t[o]);return s}function Ci(t,e,i,n,o){var s,r,a,l=0;for(r=n+1;r<=o-1;r++)(a=Oi(t[r],t[n],t[o],!0))>l&&(s=r,l=a);l>i&&(e[s]=1,Ci(t,e,i,n,s),Ci(t,e,i,s,o))}function Ti(t,e){for(var i=[t[0]],n=1,o=0,s=t.length;n<s;n++)Ai(t[n],t[o])>e&&(i.push(t[n]),o=n);return o<s-1&&i.push(t[s-1]),i}function Ei(t,e,i,n,o){var s,r,a,l=n?fi:Li(t,i),c=Li(e,i);for(fi=c;;){if(!(l|c))return[t,e];if(l&c)return!1;a=Li(r=$i(t,e,s=l||c,i,o),i),s===l?(t=r,l=a):(e=r,c=a)}}function $i(t,e,i,n,o){var s,r,a=e.x-t.x,l=e.y-t.y,c=n.min,h=n.max;return 8&i?(s=t.x+a*(h.y-t.y)/l,r=h.y):4&i?(s=t.x+a*(c.y-t.y)/l,r=c.y):2&i?(s=h.x,r=t.y+l*(h.x-t.x)/a):1&i&&(s=c.x,r=t.y+l*(c.x-t.x)/a),new z(s,r,o)}function Li(t,e){var i=0;return t.x<e.min.x?i|=1:t.x>e.max.x&&(i|=2),t.y<e.min.y?i|=4:t.y>e.max.y&&(i|=8),i}function Ai(t,e){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n}function Oi(t,e,i,n){var o,s=e.x,r=e.y,a=i.x-s,l=i.y-r,c=a*a+l*l;return c>0&&((o=((t.x-s)*a+(t.y-r)*l)/c)>1?(s=i.x,r=i.y):o>0&&(s+=a*o,r+=l*o)),a=t.x-s,l=t.y-r,n?a*a+l*l:new z(s,r)}function Mi(t){return!y(t[0])||"object"!=typeof t[0][0]&&void 0!==t[0][0]}function Pi(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Mi(t)}var zi=(Object.freeze||Object)({simplify:xi,pointToSegmentDistance:wi,closestPointOnSegment:ki,clipSegment:Ei,_getEdgeIntersection:$i,_getBitCode:Li,_sqClosestPointOnSegment:Oi,isFlat:Mi,_flat:Pi});function Ii(t,e,i){var n,o,s,r,a,l,c,h,u,d=[1,4,2,8];for(o=0,c=t.length;o<c;o++)t[o]._code=Li(t[o],e);for(r=0;r<4;r++){for(h=d[r],n=[],o=0,s=(c=t.length)-1;o<c;s=o++)a=t[o],l=t[s],a._code&h?l._code&h||((u=$i(l,a,h,e,i))._code=Li(u,e),n.push(u)):(l._code&h&&((u=$i(l,a,h,e,i))._code=Li(u,e),n.push(u)),n.push(a));t=n}return t}var Di=(Object.freeze||Object)({clipPolygon:Ii}),Ni={project:function(t){return new z(t.lng,t.lat)},unproject:function(t){return new Z(t.y,t.x)},bounds:new N([-180,-90],[180,90])},Ri={R:6378137,R_MINOR:6356752.314245179,bounds:new N([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(t){var e=Math.PI/180,i=this.R,n=t.lat*e,o=this.R_MINOR/i,s=Math.sqrt(1-o*o),r=s*Math.sin(n),a=Math.tan(Math.PI/4-n/2)/Math.pow((1-r)/(1+r),s/2);return n=-i*Math.log(Math.max(a,1e-10)),new z(t.lng*e*i,n)},unproject:function(t){for(var e,i=180/Math.PI,n=this.R,o=this.R_MINOR/n,s=Math.sqrt(1-o*o),r=Math.exp(-t.y/n),a=Math.PI/2-2*Math.atan(r),l=0,c=.1;l<15&&Math.abs(c)>1e-7;l++)e=s*Math.sin(a),e=Math.pow((1-e)/(1+e),s/2),a+=c=Math.PI/2-2*Math.atan(r*e)-a;return new Z(a*i,t.x*i/n)}},Bi=(Object.freeze||Object)({LonLat:Ni,Mercator:Ri,SphericalMercator:H}),qi=n({},j,{code:"EPSG:3395",projection:Ri,transformation:function(){var t=.5/(Math.PI*Ri.R);return W(t,.5,-t,.5)}()}),Zi=n({},j,{code:"EPSG:4326",projection:Ni,transformation:W(1/180,1,-1/180,.5)}),Fi=n({},V,{projection:Ni,transformation:W(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,e){var i=e.lng-t.lng,n=e.lat-t.lat;return Math.sqrt(i*i+n*n)},infinite:!0});V.Earth=j,V.EPSG3395=qi,V.EPSG3857=K,V.EPSG900913=Y,V.EPSG4326=Zi,V.Simple=Fi;var Vi=P.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[a(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[a(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e=t.target;if(e.hasLayer(this)){if(this._map=e,this._zoomAnimated=e._zoomAnimated,this.getEvents){var i=this.getEvents();e.on(i,this),this.once("remove",(function(){e.off(i,this)}),this)}this.onAdd(e),this.getAttribution&&e.attributionControl&&e.attributionControl.addAttribution(this.getAttribution()),this.fire("add"),e.fire("layeradd",{layer:this})}}});ii.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var e=a(t);return this._layers[e]||(this._layers[e]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t)),this},removeLayer:function(t){var e=a(t);return this._layers[e]?(this._loaded&&t.onRemove(this),t.getAttribution&&this.attributionControl&&this.attributionControl.removeAttribution(t.getAttribution()),delete this._layers[e],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return!!t&&a(t)in this._layers},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},_addLayers:function(t){for(var e=0,i=(t=t?y(t)?t:[t]:[]).length;e<i;e++)this.addLayer(t[e])},_addZoomLimit:function(t){!isNaN(t.options.maxZoom)&&isNaN(t.options.minZoom)||(this._zoomBoundLayers[a(t)]=t,this._updateZoomLevels())},_removeZoomLimit:function(t){var e=a(t);this._zoomBoundLayers[e]&&(delete this._zoomBoundLayers[e],this._updateZoomLevels())},_updateZoomLevels:function(){var t=1/0,e=-1/0,i=this._getZoomSpan();for(var n in this._zoomBoundLayers){var o=this._zoomBoundLayers[n].options;t=void 0===o.minZoom?t:Math.min(t,o.minZoom),e=void 0===o.maxZoom?e:Math.max(e,o.maxZoom)}this._layersMaxZoom=e===-1/0?void 0:e,this._layersMinZoom=t===1/0?void 0:t,i!==this._getZoomSpan()&&this.fire("zoomlevelschange"),void 0===this.options.maxZoom&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var ji=Vi.extend({initialize:function(t,e){var i,n;if(m(this,e),this._layers={},t)for(i=0,n=t.length;i<n;i++)this.addLayer(t[i])},addLayer:function(t){var e=this.getLayerId(t);return this._layers[e]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var e=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[e]&&this._map.removeLayer(this._layers[e]),delete this._layers[e],this},hasLayer:function(t){return!!t&&(t in this._layers||this.getLayerId(t)in this._layers)},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(t){var e,i,n=Array.prototype.slice.call(arguments,1);for(e in this._layers)(i=this._layers[e])[t]&&i[t].apply(i,n);return this},onAdd:function(t){this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t)},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=[];return this.eachLayer(t.push,t),t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:function(t){return a(t)}}),Ui=function(t,e){return new ji(t,e)},Hi=ji.extend({addLayer:function(t){return this.hasLayer(t)?this:(t.addEventParent(this),ji.prototype.addLayer.call(this,t),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return this.hasLayer(t)?(t in this._layers&&(t=this._layers[t]),t.removeEventParent(this),ji.prototype.removeLayer.call(this,t),this.fire("layerremove",{layer:t})):this},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new B;for(var e in this._layers){var i=this._layers[e];t.extend(i.getBounds?i.getBounds():i.getLatLng())}return t}}),Gi=function(t){return new Hi(t)},Wi=A.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0]},initialize:function(t){m(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,e){var i=this._getIconUrl(t);if(!i){if("icon"===t)throw new Error("iconUrl not set in Icon options (see the docs).");return null}var n=this._createImg(i,e&&"IMG"===e.tagName?e:null);return this._setIconStyles(n,t),n},_setIconStyles:function(t,e){var i=this.options,n=i[e+"Size"];"number"==typeof n&&(n=[n,n]);var o=D(n),s=D("shadow"===e&&i.shadowAnchor||i.iconAnchor||o&&o.divideBy(2,!0));t.className="leaflet-marker-"+e+" "+(i.className||""),s&&(t.style.marginLeft=-s.x+"px",t.style.marginTop=-s.y+"px"),o&&(t.style.width=o.x+"px",t.style.height=o.y+"px")},_createImg:function(t,e){return(e=e||document.createElement("img")).src=t,e},_getIconUrl:function(t){return Et&&this.options[t+"RetinaUrl"]||this.options[t+"Url"]}});function Ki(t){return new Wi(t)}var Yi=Wi.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(t){return Yi.imagePath||(Yi.imagePath=this._detectIconPath()),(this.options.imagePath||Yi.imagePath)+Wi.prototype._getIconUrl.call(this,t)},_detectIconPath:function(){var t=ue("div","leaflet-default-icon-path",document.body),e=he(t,"background-image")||he(t,"backgroundImage");return document.body.removeChild(t),e=null===e||0!==e.indexOf("url")?"":e.replace(/^url\(["']?/,"").replace(/marker-icon\.png["']?\)$/,"")}}),Ji=mi.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new _i(t,t,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),ve(t,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&ye(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(t){var e=this._marker,i=e._map,n=this._marker.options.autoPanSpeed,o=this._marker.options.autoPanPadding,s=Te(e._icon),r=i.getPixelBounds(),a=i.getPixelOrigin(),l=R(r.min._subtract(a).add(o),r.max._subtract(a).subtract(o));if(!l.contains(s)){var c=D((Math.max(l.max.x,s.x)-l.max.x)/(r.max.x-l.max.x)-(Math.min(l.min.x,s.x)-l.min.x)/(r.min.x-l.min.x),(Math.max(l.max.y,s.y)-l.max.y)/(r.max.y-l.max.y)-(Math.min(l.min.y,s.y)-l.min.y)/(r.min.y-l.min.y)).multiplyBy(n);i.panBy(c,{animate:!1}),this._draggable._newPos._add(c),this._draggable._startPos._add(c),Ce(e._icon,this._draggable._newPos),this._onDrag(t),this._panRequest=T(this._adjustPan.bind(this,t))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup().fire("movestart").fire("dragstart")},_onPreDrag:function(t){this._marker.options.autoPan&&(E(this._panRequest),this._panRequest=T(this._adjustPan.bind(this,t)))},_onDrag:function(t){var e=this._marker,i=e._shadow,n=Te(e._icon),o=e._map.layerPointToLatLng(n);i&&Ce(i,n),e._latlng=o,t.latlng=o,t.oldLatLng=this._oldLatLng,e.fire("move",t).fire("drag",t)},_onDragEnd:function(t){E(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",t)}}),Xi=Vi.extend({options:{icon:new Yi,interactive:!0,keyboard:!0,title:"",alt:"",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(t,e){m(this,e),this._latlng=F(t)},onAdd:function(t){this._zoomAnimated=this._zoomAnimated&&t.options.markerZoomAnimation,this._zoomAnimated&&t.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(t){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&t.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(t){var e=this._latlng;return this._latlng=F(t),this.update(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update()},getIcon:function(){return this.options.icon},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,e="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),i=t.icon.createIcon(this._icon),n=!1;i!==this._icon&&(this._icon&&this._removeIcon(),n=!0,t.title&&(i.title=t.title),"IMG"===i.tagName&&(i.alt=t.alt||"")),ve(i,e),t.keyboard&&(i.tabIndex="0"),this._icon=i,t.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex});var o=t.icon.createShadow(this._shadow),s=!1;o!==this._shadow&&(this._removeShadow(),s=!0),o&&(ve(o,e),o.alt=""),this._shadow=o,t.opacity<1&&this._updateOpacity(),n&&this.getPane().appendChild(this._icon),this._initInteraction(),o&&s&&this.getPane(t.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),de(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&de(this._shadow),this._shadow=null},_setPos:function(t){Ce(this._icon,t),this._shadow&&Ce(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon.style.zIndex=this._zIndex+t},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPos(e)},_initInteraction:function(){if(this.options.interactive&&(ve(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),Ji)){var t=this.options.draggable;this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Ji(this),t&&this.dragging.enable()}},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var t=this.options.opacity;this._icon&&xe(this._icon,t),this._shadow&&xe(this._shadow,t)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function Qi(t,e){return new Xi(t,e)}var tn=Vi.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(t){this._renderer=t.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(t){return m(this,t),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&t.hasOwnProperty("weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+this._renderer.options.tolerance}}),en=tn.extend({options:{fill:!0,radius:10},initialize:function(t,e){m(this,e),this._latlng=F(t),this._radius=this.options.radius},setLatLng:function(t){return this._latlng=F(t),this.redraw(),this.fire("move",{latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(t){return this.options.radius=this._radius=t,this.redraw()},getRadius:function(){return this._radius},setStyle:function(t){var e=t&&t.radius||this._radius;return tn.prototype.setStyle.call(this,t),this.setRadius(e),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var t=this._radius,e=this._radiusY||t,i=this._clickTolerance(),n=[t+i,e+i];this._pxBounds=new N(this._point.subtract(n),this._point.add(n))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(t){return t.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function nn(t,e){return new en(t,e)}var on=en.extend({initialize:function(t,e,i){if("number"==typeof e&&(e=n({},i,{radius:e})),m(this,e),this._latlng=F(t),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(t){return this._mRadius=t,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var t=[this._radius,this._radiusY||this._radius];return new B(this._map.layerPointToLatLng(this._point.subtract(t)),this._map.layerPointToLatLng(this._point.add(t)))},setStyle:tn.prototype.setStyle,_project:function(){var t=this._latlng.lng,e=this._latlng.lat,i=this._map,n=i.options.crs;if(n.distance===j.distance){var o=Math.PI/180,s=this._mRadius/j.R/o,r=i.project([e+s,t]),a=i.project([e-s,t]),l=r.add(a).divideBy(2),c=i.unproject(l).lat,h=Math.acos((Math.cos(s*o)-Math.sin(e*o)*Math.sin(c*o))/(Math.cos(e*o)*Math.cos(c*o)))/o;(isNaN(h)||0===h)&&(h=s/Math.cos(Math.PI/180*e)),this._point=l.subtract(i.getPixelOrigin()),this._radius=isNaN(h)?0:l.x-i.project([c,t-h]).x,this._radiusY=l.y-r.y}else{var u=n.unproject(n.project(this._latlng).subtract([this._mRadius,0]));this._point=i.latLngToLayerPoint(this._latlng),this._radius=this._point.x-i.latLngToLayerPoint(u).x}this._updateBounds()}});function sn(t,e,i){return new on(t,e,i)}var rn=tn.extend({options:{smoothFactor:1,noClip:!1},initialize:function(t,e){m(this,e),this._setLatLngs(t)},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._setLatLngs(t),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(t){for(var e,i,n=1/0,o=null,s=Oi,r=0,a=this._parts.length;r<a;r++)for(var l=this._parts[r],c=1,h=l.length;c<h;c++){var u=s(t,e=l[c-1],i=l[c],!0);u<n&&(n=u,o=s(t,e,i))}return o&&(o.distance=Math.sqrt(n)),o},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var t,e,i,n,o,s,r,a=this._rings[0],l=a.length;if(!l)return null;for(t=0,e=0;t<l-1;t++)e+=a[t].distanceTo(a[t+1])/2;if(0===e)return this._map.layerPointToLatLng(a[0]);for(t=0,n=0;t<l-1;t++)if(o=a[t],s=a[t+1],(n+=i=o.distanceTo(s))>e)return r=(n-e)/i,this._map.layerPointToLatLng([s.x-r*(s.x-o.x),s.y-r*(s.y-o.y)])},getBounds:function(){return this._bounds},addLatLng:function(t,e){return e=e||this._defaultShape(),t=F(t),e.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new B,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return Mi(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var e=[],i=Mi(t),n=0,o=t.length;n<o;n++)i?(e[n]=F(t[n]),this._bounds.extend(e[n])):e[n]=this._convertLatLngs(t[n]);return e},_project:function(){var t=new N;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,t),this._bounds.isValid()&&t.isValid()&&(this._rawPxBounds=t,this._updateBounds())},_updateBounds:function(){var t=this._clickTolerance(),e=new z(t,t);this._pxBounds=new N([this._rawPxBounds.min.subtract(e),this._rawPxBounds.max.add(e)])},_projectLatlngs:function(t,e,i){var n,o,s=t[0]instanceof Z,r=t.length;if(s){for(o=[],n=0;n<r;n++)o[n]=this._map.latLngToLayerPoint(t[n]),i.extend(o[n]);e.push(o)}else for(n=0;n<r;n++)this._projectLatlngs(t[n],e,i)},_clipPoints:function(){var t=this._renderer._bounds;if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else{var e,i,n,o,s,r,a,l=this._parts;for(e=0,n=0,o=this._rings.length;e<o;e++)for(i=0,s=(a=this._rings[e]).length;i<s-1;i++)(r=Ei(a[i],a[i+1],t,i,!0))&&(l[n]=l[n]||[],l[n].push(r[0]),r[1]===a[i+1]&&i!==s-2||(l[n].push(r[1]),n++))}},_simplifyPoints:function(){for(var t=this._parts,e=this.options.smoothFactor,i=0,n=t.length;i<n;i++)t[i]=xi(t[i],e)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(t,e){var i,n,o,s,r,a,l=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(i=0,s=this._parts.length;i<s;i++)for(n=0,o=(r=(a=this._parts[i]).length)-1;n<r;o=n++)if((e||0!==n)&&wi(t,a[o],a[n])<=l)return!0;return!1}});function an(t,e){return new rn(t,e)}rn._flat=Pi;var ln=rn.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var t,e,i,n,o,s,r,a,l,c=this._rings[0],h=c.length;if(!h)return null;for(s=r=a=0,t=0,e=h-1;t<h;e=t++)i=c[t],n=c[e],o=i.y*n.x-n.y*i.x,r+=(i.x+n.x)*o,a+=(i.y+n.y)*o,s+=3*o;return l=0===s?c[0]:[r/s,a/s],this._map.layerPointToLatLng(l)},_convertLatLngs:function(t){var e=rn.prototype._convertLatLngs.call(this,t),i=e.length;return i>=2&&e[0]instanceof Z&&e[0].equals(e[i-1])&&e.pop(),e},_setLatLngs:function(t){rn.prototype._setLatLngs.call(this,t),Mi(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Mi(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,i=new z(e,e);if(t=new N(t.min.subtract(i),t.max.add(i)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var n,o=0,s=this._rings.length;o<s;o++)(n=Ii(this._rings[o],t,!0)).length&&this._parts.push(n)},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(t){var e,i,n,o,s,r,a,l,c=!1;if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(o=0,a=this._parts.length;o<a;o++)for(s=0,r=(l=(e=this._parts[o]).length)-1;s<l;r=s++)i=e[s],n=e[r],i.y>t.y!=n.y>t.y&&t.x<(n.x-i.x)*(t.y-i.y)/(n.y-i.y)+i.x&&(c=!c);return c||rn.prototype._containsPoint.call(this,t,!0)}});function cn(t,e){return new ln(t,e)}var hn=Hi.extend({initialize:function(t,e){m(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,n,o=y(t)?t:t.features;if(o){for(e=0,i=o.length;e<i;e++)((n=o[e]).geometries||n.geometry||n.features||n.coordinates)&&this.addData(n);return this}var s=this.options;if(s.filter&&!s.filter(t))return this;var r=un(t,s);return r?(r.feature=vn(t),r.defaultOptions=r.options,this.resetStyle(r),s.onEachFeature&&s.onEachFeature(t,r),this.addLayer(r)):this},resetStyle:function(t){return t.options=n({},t.defaultOptions),this._setLayerStyle(t,this.options.style),this},setStyle:function(t){return this.eachLayer((function(e){this._setLayerStyle(e,t)}),this)},_setLayerStyle:function(t,e){t.setStyle&&("function"==typeof e&&(e=e(t.feature)),t.setStyle(e))}});function un(t,e){var i,n,o,s,r="Feature"===t.type?t.geometry:t,a=r?r.coordinates:null,l=[],c=e&&e.pointToLayer,h=e&&e.coordsToLatLng||dn;if(!a&&!r)return null;switch(r.type){case"Point":return i=h(a),c?c(t,i):new Xi(i);case"MultiPoint":for(o=0,s=a.length;o<s;o++)i=h(a[o]),l.push(c?c(t,i):new Xi(i));return new Hi(l);case"LineString":case"MultiLineString":return n=pn(a,"LineString"===r.type?0:1,h),new rn(n,e);case"Polygon":case"MultiPolygon":return n=pn(a,"Polygon"===r.type?1:2,h),new ln(n,e);case"GeometryCollection":for(o=0,s=r.geometries.length;o<s;o++){var u=un({geometry:r.geometries[o],type:"Feature",properties:t.properties},e);u&&l.push(u)}return new Hi(l);default:throw new Error("Invalid GeoJSON object.")}}function dn(t){return new Z(t[1],t[0],t[2])}function pn(t,e,i){for(var n,o=[],s=0,r=t.length;s<r;s++)n=e?pn(t[s],e-1,i):(i||dn)(t[s]),o.push(n);return o}function mn(t,e){return e="number"==typeof e?e:6,void 0!==t.alt?[u(t.lng,e),u(t.lat,e),u(t.alt,e)]:[u(t.lng,e),u(t.lat,e)]}function fn(t,e,i,n){for(var o=[],s=0,r=t.length;s<r;s++)o.push(e?fn(t[s],e-1,i,n):mn(t[s],n));return!e&&i&&o.push(o[0]),o}function gn(t,e){return t.feature?n({},t.feature,{geometry:e}):vn(e)}function vn(t){return"Feature"===t.type||"FeatureCollection"===t.type?t:{type:"Feature",properties:{},geometry:t}}var yn={toGeoJSON:function(t){return gn(this,{type:"Point",coordinates:mn(this.getLatLng(),t)})}};function bn(t,e){return new hn(t,e)}Xi.include(yn),on.include(yn),en.include(yn),rn.include({toGeoJSON:function(t){var e=!Mi(this._latlngs);return gn(this,{type:(e?"Multi":"")+"LineString",coordinates:fn(this._latlngs,e?1:0,!1,t)})}}),ln.include({toGeoJSON:function(t){var e=!Mi(this._latlngs),i=e&&!Mi(this._latlngs[0]),n=fn(this._latlngs,i?2:e?1:0,!0,t);return e||(n=[n]),gn(this,{type:(i?"Multi":"")+"Polygon",coordinates:n})}}),ji.include({toMultiPoint:function(t){var e=[];return this.eachLayer((function(i){e.push(i.toGeoJSON(t).geometry.coordinates)})),gn(this,{type:"MultiPoint",coordinates:e})},toGeoJSON:function(t){var e=this.feature&&this.feature.geometry&&this.feature.geometry.type;if("MultiPoint"===e)return this.toMultiPoint(t);var i="GeometryCollection"===e,n=[];return this.eachLayer((function(e){if(e.toGeoJSON){var o=e.toGeoJSON(t);if(i)n.push(o.geometry);else{var s=vn(o);"FeatureCollection"===s.type?n.push.apply(n,s.features):n.push(s)}}})),i?gn(this,{geometries:n,type:"GeometryCollection"}):{type:"FeatureCollection",features:n}}});var _n=bn,xn=Vi.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,e,i){this._url=t,this._bounds=q(e),m(this,i)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(ve(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){de(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&me(this._image),this},bringToBack:function(){return this._map&&fe(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=q(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t="IMG"===this._url.tagName,e=this._image=t?this._url:ue("img");ve(e,"leaflet-image-layer"),this._zoomAnimated&&ve(e,"leaflet-zoom-animated"),this.options.className&&ve(e,this.options.className),e.onselectstart=h,e.onmousemove=h,e.onload=s(this.fire,this,"load"),e.onerror=s(this._overlayOnError,this,"error"),(this.options.crossOrigin||""===this.options.crossOrigin)&&(e.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t?this._url=e.src:(e.src=this._url,e.alt=this.options.alt)},_animateZoom:function(t){var e=this._map.getZoomScale(t.zoom),i=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;Se(this._image,i,e)},_reset:function(){var t=this._image,e=new N(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),i=e.getSize();Ce(t,e.min),t.style.width=i.x+"px",t.style.height=i.y+"px"},_updateOpacity:function(){xe(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)}}),wn=function(t,e,i){return new xn(t,e,i)},kn=xn.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0},_initImage:function(){var t="VIDEO"===this._url.tagName,e=this._image=t?this._url:ue("video");if(ve(e,"leaflet-image-layer"),this._zoomAnimated&&ve(e,"leaflet-zoom-animated"),e.onselectstart=h,e.onmousemove=h,e.onloadeddata=s(this.fire,this,"load"),t){for(var i=e.getElementsByTagName("source"),n=[],o=0;o<i.length;o++)n.push(i[o].src);this._url=i.length>0?n:[e.src]}else{y(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&e.style.hasOwnProperty("objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop;for(var r=0;r<this._url.length;r++){var a=ue("source");a.src=this._url[r],e.appendChild(a)}}}});function Sn(t,e,i){return new kn(t,e,i)}var Cn=xn.extend({_initImage:function(){var t=this._image=this._url;ve(t,"leaflet-image-layer"),this._zoomAnimated&&ve(t,"leaflet-zoom-animated"),t.onselectstart=h,t.onmousemove=h}});function Tn(t,e,i){return new Cn(t,e,i)}var En=Vi.extend({options:{offset:[0,7],className:"",pane:"popupPane"},initialize:function(t,e){m(this,t),this._source=e},onAdd:function(t){this._zoomAnimated=t._zoomAnimated,this._container||this._initLayout(),t._fadeAnimated&&xe(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),t._fadeAnimated&&xe(this._container,1),this.bringToFront()},onRemove:function(t){t._fadeAnimated?(xe(this._container,0),this._removeTimeout=setTimeout(s(de,void 0,this._container),200)):de(this._container)},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=F(t),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(t){return this._content=t,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var t={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&me(this._container),this},bringToBack:function(){return this._map&&fe(this._container),this},_prepareOpen:function(t,e,i){if(e instanceof Vi||(i=e,e=t),e instanceof Hi)for(var n in t._layers){e=t._layers[n];break}if(!i)if(e.getCenter)i=e.getCenter();else{if(!e.getLatLng)throw new Error("Unable to get source layer LatLng.");i=e.getLatLng()}return this._source=e,this.update(),i},_updateContent:function(){if(this._content){var t=this._contentNode,e="function"==typeof this._content?this._content(this._source||this):this._content;if("string"==typeof e)t.innerHTML=e;else{for(;t.hasChildNodes();)t.removeChild(t.firstChild);t.appendChild(e)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),e=D(this.options.offset),i=this._getAnchor();this._zoomAnimated?Ce(this._container,t.add(i)):e=e.add(t).add(i);var n=this._containerBottom=-e.y,o=this._containerLeft=-Math.round(this._containerWidth/2)+e.x;this._container.style.bottom=n+"px",this._container.style.left=o+"px"}},_getAnchor:function(){return[0,0]}}),$n=En.extend({options:{maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(t){return t.openPopup(this),this},onAdd:function(t){En.prototype.onAdd.call(this,t),t.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof tn||this._source.on("preclick",qe))},onRemove:function(t){En.prototype.onRemove.call(this,t),t.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof tn||this._source.off("preclick",qe))},getEvents:function(){var t=En.prototype.getEvents.call(this);return(void 0!==this.options.closeOnClick?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(t.preclick=this._close),this.options.keepInView&&(t.moveend=this._adjustPan),t},_close:function(){this._map&&this._map.closePopup(this)},_initLayout:function(){var t="leaflet-popup",e=this._container=ue("div",t+" "+(this.options.className||"")+" leaflet-zoom-animated"),i=this._wrapper=ue("div",t+"-content-wrapper",e);if(this._contentNode=ue("div",t+"-content",i),Fe(i),Ze(this._contentNode),Ie(i,"contextmenu",qe),this._tipContainer=ue("div",t+"-tip-container",e),this._tip=ue("div",t+"-tip",this._tipContainer),this.options.closeButton){var n=this._closeButton=ue("a",t+"-close-button",e);n.href="#close",n.innerHTML="&#215;",Ie(n,"click",this._onCloseButtonClick,this)}},_updateLayout:function(){var t=this._contentNode,e=t.style;e.width="",e.whiteSpace="nowrap";var i=t.offsetWidth;i=Math.min(i,this.options.maxWidth),i=Math.max(i,this.options.minWidth),e.width=i+1+"px",e.whiteSpace="",e.height="";var n=t.offsetHeight,o=this.options.maxHeight,s="leaflet-popup-scrolled";o&&n>o?(e.height=o+"px",ve(t,s)):ye(t,s),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),i=this._getAnchor();Ce(this._container,e.add(i))},_adjustPan:function(){if(this.options.autoPan){this._map._panAnim&&this._map._panAnim.stop();var t=this._map,e=parseInt(he(this._container,"marginBottom"),10)||0,i=this._container.offsetHeight+e,n=this._containerWidth,o=new z(this._containerLeft,-i-this._containerBottom);o._add(Te(this._container));var s=t.layerPointToContainerPoint(o),r=D(this.options.autoPanPadding),a=D(this.options.autoPanPaddingTopLeft||r),l=D(this.options.autoPanPaddingBottomRight||r),c=t.getSize(),h=0,u=0;s.x+n+l.x>c.x&&(h=s.x+n-c.x+l.x),s.x-h-a.x<0&&(h=s.x-a.x),s.y+i+l.y>c.y&&(u=s.y+i-c.y+l.y),s.y-u-a.y<0&&(u=s.y-a.y),(h||u)&&t.fire("autopanstart").panBy([h,u])}},_onCloseButtonClick:function(t){this._close(),je(t)},_getAnchor:function(){return D(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Ln=function(t,e){return new $n(t,e)};ii.mergeOptions({closePopupOnClick:!0}),ii.include({openPopup:function(t,e,i){return t instanceof $n||(t=new $n(i).setContent(t)),e&&t.setLatLng(e),this.hasLayer(t)?this:(this._popup&&this._popup.options.autoClose&&this.closePopup(),this._popup=t,this.addLayer(t))},closePopup:function(t){return t&&t!==this._popup||(t=this._popup,this._popup=null),t&&this.removeLayer(t),this}}),Vi.include({bindPopup:function(t,e){return t instanceof $n?(m(t,e),this._popup=t,t._source=this):(this._popup&&!e||(this._popup=new $n(e,this)),this._popup.setContent(t)),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t,e){return this._popup&&this._map&&(e=this._popup._prepareOpen(this,t,e),this._map.openPopup(this._popup,e)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(t){return this._popup&&(this._popup._map?this.closePopup():this.openPopup(t)),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){var e=t.layer||t.target;this._popup&&this._map&&(je(t),e instanceof tn?this.openPopup(t.layer||t.target,t.latlng):this._map.hasLayer(this._popup)&&this._popup._source===e?this.closePopup():this.openPopup(e,t.latlng))},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}});var An=En.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,interactive:!1,opacity:.9},onAdd:function(t){En.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&this._source.fire("tooltipopen",{tooltip:this},!0)},onRemove:function(t){En.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&this._source.fire("tooltipclose",{tooltip:this},!0)},getEvents:function(){var t=En.prototype.getEvents.call(this);return St&&!this.options.permanent&&(t.preclick=this._close),t},_close:function(){this._map&&this._map.closeTooltip(this)},_initLayout:function(){var t="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=ue("div",t)},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e=this._map,i=this._container,n=e.latLngToContainerPoint(e.getCenter()),o=e.layerPointToContainerPoint(t),s=this.options.direction,r=i.offsetWidth,a=i.offsetHeight,l=D(this.options.offset),c=this._getAnchor();"top"===s?t=t.add(D(-r/2+l.x,-a+l.y+c.y,!0)):"bottom"===s?t=t.subtract(D(r/2-l.x,-l.y,!0)):"center"===s?t=t.subtract(D(r/2+l.x,a/2-c.y+l.y,!0)):"right"===s||"auto"===s&&o.x<n.x?(s="right",t=t.add(D(l.x+c.x,c.y-a/2+l.y,!0))):(s="left",t=t.subtract(D(r+c.x-l.x,a/2-c.y-l.y,!0))),ye(i,"leaflet-tooltip-right"),ye(i,"leaflet-tooltip-left"),ye(i,"leaflet-tooltip-top"),ye(i,"leaflet-tooltip-bottom"),ve(i,"leaflet-tooltip-"+s),Ce(i,t)},_updatePosition:function(){var t=this._map.latLngToLayerPoint(this._latlng);this._setPosition(t)},setOpacity:function(t){this.options.opacity=t,this._container&&xe(this._container,t)},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPosition(e)},_getAnchor:function(){return D(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),On=function(t,e){return new An(t,e)};ii.include({openTooltip:function(t,e,i){return t instanceof An||(t=new An(i).setContent(t)),e&&t.setLatLng(e),this.hasLayer(t)?this:this.addLayer(t)},closeTooltip:function(t){return t&&this.removeLayer(t),this}}),Vi.include({bindTooltip:function(t,e){return t instanceof An?(m(t,e),this._tooltip=t,t._source=this):(this._tooltip&&!e||(this._tooltip=new An(e,this)),this._tooltip.setContent(t)),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(t){if(t||!this._tooltipHandlersAdded){var e=t?"off":"on",i={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?i.add=this._openTooltip:(i.mouseover=this._openTooltip,i.mouseout=this.closeTooltip,this._tooltip.options.sticky&&(i.mousemove=this._moveTooltip),St&&(i.click=this._openTooltip)),this[e](i),this._tooltipHandlersAdded=!t}},openTooltip:function(t,e){return this._tooltip&&this._map&&(e=this._tooltip._prepareOpen(this,t,e),this._map.openTooltip(this._tooltip,e),this._tooltip.options.interactive&&this._tooltip._container&&(ve(this._tooltip._container,"leaflet-clickable"),this.addInteractiveTarget(this._tooltip._container))),this},closeTooltip:function(){return this._tooltip&&(this._tooltip._close(),this._tooltip.options.interactive&&this._tooltip._container&&(ye(this._tooltip._container,"leaflet-clickable"),this.removeInteractiveTarget(this._tooltip._container))),this},toggleTooltip:function(t){return this._tooltip&&(this._tooltip._map?this.closeTooltip():this.openTooltip(t)),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(t){return this._tooltip&&this._tooltip.setContent(t),this},getTooltip:function(){return this._tooltip},_openTooltip:function(t){var e=t.layer||t.target;this._tooltip&&this._map&&this.openTooltip(e,this._tooltip.options.sticky?t.latlng:void 0)},_moveTooltip:function(t){var e,i,n=t.latlng;this._tooltip.options.sticky&&t.originalEvent&&(e=this._map.mouseEventToContainerPoint(t.originalEvent),i=this._map.containerPointToLayerPoint(e),n=this._map.layerPointToLatLng(i)),this._tooltip.setLatLng(n)}});var Mn=Wi.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(t){var e=t&&"DIV"===t.tagName?t:document.createElement("div"),i=this.options;if(i.html instanceof Element?(pe(e),e.appendChild(i.html)):e.innerHTML=!1!==i.html?i.html:"",i.bgPos){var n=D(i.bgPos);e.style.backgroundPosition=-n.x+"px "+-n.y+"px"}return this._setIconStyles(e,"icon"),e},createShadow:function(){return null}});function Pn(t){return new Mn(t)}Wi.Default=Yi;var zn=Vi.extend({options:{tileSize:256,opacity:1,updateWhenIdle:bt,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(t){m(this,t)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView(),this._update()},beforeAdd:function(t){t._addZoomLimit(this)},onRemove:function(t){this._removeAllTiles(),de(this._container),t._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(me(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(fe(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){return this._map&&(this._removeAllTiles(),this._update()),this},getEvents:function(){var t={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=l(this._onMoveEnd,this.options.updateInterval,this)),t.move=this._onMove),this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},createTile:function(){return document.createElement("div")},getTileSize:function(){var t=this.options.tileSize;return t instanceof z?t:new z(t,t)},_updateZIndex:function(){this._container&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t){for(var e,i=this.getPane().children,n=-t(-1/0,1/0),o=0,s=i.length;o<s;o++)e=i[o].style.zIndex,i[o]!==this._container&&e&&(n=t(n,+e));isFinite(n)&&(this.options.zIndex=n+t(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!et){xe(this._container,this.options.opacity);var t=+new Date,e=!1,i=!1;for(var n in this._tiles){var o=this._tiles[n];if(o.current&&o.loaded){var s=Math.min(1,(t-o.loaded)/200);xe(o.el,s),s<1?e=!0:(o.active?i=!0:this._onOpaqueTile(o),o.active=!0)}}i&&!this._noPrune&&this._pruneTiles(),e&&(E(this._fadeFrame),this._fadeFrame=T(this._updateOpacity,this))}},_onOpaqueTile:h,_initContainer:function(){this._container||(this._container=ue("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var t=this._tileZoom,e=this.options.maxZoom;if(void 0!==t){for(var i in this._levels)this._levels[i].el.children.length||i===t?(this._levels[i].el.style.zIndex=e-Math.abs(t-i),this._onUpdateLevel(i)):(de(this._levels[i].el),this._removeTilesAtZoom(i),this._onRemoveLevel(i),delete this._levels[i]);var n=this._levels[t],o=this._map;return n||((n=this._levels[t]={}).el=ue("div","leaflet-tile-container leaflet-zoom-animated",this._container),n.el.style.zIndex=e,n.origin=o.project(o.unproject(o.getPixelOrigin()),t).round(),n.zoom=t,this._setZoomTransform(n,o.getCenter(),o.getZoom()),h(n.el.offsetWidth),this._onCreateLevel(n)),this._level=n,n}},_onUpdateLevel:h,_onRemoveLevel:h,_onCreateLevel:h,_pruneTiles:function(){if(this._map){var t,e,i=this._map.getZoom();if(i>this.options.maxZoom||i<this.options.minZoom)this._removeAllTiles();else{for(t in this._tiles)(e=this._tiles[t]).retain=e.current;for(t in this._tiles)if((e=this._tiles[t]).current&&!e.active){var n=e.coords;this._retainParent(n.x,n.y,n.z,n.z-5)||this._retainChildren(n.x,n.y,n.z,n.z+2)}for(t in this._tiles)this._tiles[t].retain||this._removeTile(t)}}},_removeTilesAtZoom:function(t){for(var e in this._tiles)this._tiles[e].coords.z===t&&this._removeTile(e)},_removeAllTiles:function(){for(var t in this._tiles)this._removeTile(t)},_invalidateAll:function(){for(var t in this._levels)de(this._levels[t].el),this._onRemoveLevel(t),delete this._levels[t];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(t,e,i,n){var o=Math.floor(t/2),s=Math.floor(e/2),r=i-1,a=new z(+o,+s);a.z=+r;var l=this._tileCoordsToKey(a),c=this._tiles[l];return c&&c.active?(c.retain=!0,!0):(c&&c.loaded&&(c.retain=!0),r>n&&this._retainParent(o,s,r,n))},_retainChildren:function(t,e,i,n){for(var o=2*t;o<2*t+2;o++)for(var s=2*e;s<2*e+2;s++){var r=new z(o,s);r.z=i+1;var a=this._tileCoordsToKey(r),l=this._tiles[a];l&&l.active?l.retain=!0:(l&&l.loaded&&(l.retain=!0),i+1<n&&this._retainChildren(o,s,i+1,n))}},_resetView:function(t){var e=t&&(t.pinch||t.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),e,e)},_animateZoom:function(t){this._setView(t.center,t.zoom,!0,t.noUpdate)},_clampZoom:function(t){var e=this.options;return void 0!==e.minNativeZoom&&t<e.minNativeZoom?e.minNativeZoom:void 0!==e.maxNativeZoom&&e.maxNativeZoom<t?e.maxNativeZoom:t},_setView:function(t,e,i,n){var o=this._clampZoom(Math.round(e));(void 0!==this.options.maxZoom&&o>this.options.maxZoom||void 0!==this.options.minZoom&&o<this.options.minZoom)&&(o=void 0);var s=this.options.updateWhenZooming&&o!==this._tileZoom;n&&!s||(this._tileZoom=o,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),void 0!==o&&this._update(t),i||this._pruneTiles(),this._noPrune=!!i),this._setZoomTransforms(t,e)},_setZoomTransforms:function(t,e){for(var i in this._levels)this._setZoomTransform(this._levels[i],t,e)},_setZoomTransform:function(t,e,i){var n=this._map.getZoomScale(i,t.zoom),o=t.origin.multiplyBy(n).subtract(this._map._getNewPixelOrigin(e,i)).round();yt?Se(t.el,o,n):Ce(t.el,o)},_resetGrid:function(){var t=this._map,e=t.options.crs,i=this._tileSize=this.getTileSize(),n=this._tileZoom,o=this._map.getPixelWorldBounds(this._tileZoom);o&&(this._globalTileRange=this._pxBoundsToTileRange(o)),this._wrapX=e.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,e.wrapLng[0]],n).x/i.x),Math.ceil(t.project([0,e.wrapLng[1]],n).x/i.y)],this._wrapY=e.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([e.wrapLat[0],0],n).y/i.x),Math.ceil(t.project([e.wrapLat[1],0],n).y/i.y)]},_onMoveEnd:function(){this._map&&!this._map._animatingZoom&&this._update()},_getTiledPixelBounds:function(t){var e=this._map,i=e._animatingZoom?Math.max(e._animateToZoom,e.getZoom()):e.getZoom(),n=e.getZoomScale(i,this._tileZoom),o=e.project(t,this._tileZoom).floor(),s=e.getSize().divideBy(2*n);return new N(o.subtract(s),o.add(s))},_update:function(t){var e=this._map;if(e){var i=this._clampZoom(e.getZoom());if(void 0===t&&(t=e.getCenter()),void 0!==this._tileZoom){var n=this._getTiledPixelBounds(t),o=this._pxBoundsToTileRange(n),s=o.getCenter(),r=[],a=this.options.keepBuffer,l=new N(o.getBottomLeft().subtract([a,-a]),o.getTopRight().add([a,-a]));if(!(isFinite(o.min.x)&&isFinite(o.min.y)&&isFinite(o.max.x)&&isFinite(o.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var c in this._tiles){var h=this._tiles[c].coords;h.z===this._tileZoom&&l.contains(new z(h.x,h.y))||(this._tiles[c].current=!1)}if(Math.abs(i-this._tileZoom)>1)this._setView(t,i);else{for(var u=o.min.y;u<=o.max.y;u++)for(var d=o.min.x;d<=o.max.x;d++){var p=new z(d,u);if(p.z=this._tileZoom,this._isValidTile(p)){var m=this._tiles[this._tileCoordsToKey(p)];m?m.current=!0:r.push(p)}}if(r.sort((function(t,e){return t.distanceTo(s)-e.distanceTo(s)})),0!==r.length){this._loading||(this._loading=!0,this.fire("loading"));var f=document.createDocumentFragment();for(d=0;d<r.length;d++)this._addTile(r[d],f);this._level.el.appendChild(f)}}}}},_isValidTile:function(t){var e=this._map.options.crs;if(!e.infinite){var i=this._globalTileRange;if(!e.wrapLng&&(t.x<i.min.x||t.x>i.max.x)||!e.wrapLat&&(t.y<i.min.y||t.y>i.max.y))return!1}if(!this.options.bounds)return!0;var n=this._tileCoordsToBounds(t);return q(this.options.bounds).overlaps(n)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,i=this.getTileSize(),n=t.scaleBy(i),o=n.add(i);return[e.unproject(n,t.z),e.unproject(o,t.z)]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),i=new B(e[0],e[1]);return this.options.noWrap||(i=this._map.wrapLatLngBounds(i)),i},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var e=t.split(":"),i=new z(+e[0],+e[1]);return i.z=+e[2],i},_removeTile:function(t){var e=this._tiles[t];e&&(de(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){ve(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=h,t.onmousemove=h,et&&this.options.opacity<1&&xe(t,this.options.opacity),ot&&!st&&(t.style.WebkitBackfaceVisibility="hidden")},_addTile:function(t,e){var i=this._getTilePos(t),n=this._tileCoordsToKey(t),o=this.createTile(this._wrapCoords(t),s(this._tileReady,this,t));this._initTile(o),this.createTile.length<2&&T(s(this._tileReady,this,t,null,o)),Ce(o,i),this._tiles[n]={el:o,coords:t,current:!0},e.appendChild(o),this.fire("tileloadstart",{tile:o,coords:t})},_tileReady:function(t,e,i){e&&this.fire("tileerror",{error:e,tile:i,coords:t});var n=this._tileCoordsToKey(t);(i=this._tiles[n])&&(i.loaded=+new Date,this._map._fadeAnimated?(xe(i.el,0),E(this._fadeFrame),this._fadeFrame=T(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),e||(ve(i.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),et||!this._map._fadeAnimated?T(this._pruneTiles,this):setTimeout(s(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new z(this._wrapX?c(t.x,this._wrapX):t.x,this._wrapY?c(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new N(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});function In(t){return new zn(t)}var Dn=zn.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1},initialize:function(t,e){this._url=t,(e=m(this,e)).detectRetina&&Et&&e.maxZoom>0&&(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom++):(e.zoomOffset++,e.maxZoom--),e.minZoom=Math.max(0,e.minZoom)),"string"==typeof e.subdomains&&(e.subdomains=e.subdomains.split("")),ot||this.on("tileunload",this._onTileRemove)},setUrl:function(t,e){return this._url===t&&void 0===e&&(e=!0),this._url=t,e||this.redraw(),this},createTile:function(t,e){var i=document.createElement("img");return Ie(i,"load",s(this._tileOnLoad,this,e,i)),Ie(i,"error",s(this._tileOnError,this,e,i)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(i.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),i.alt="",i.setAttribute("role","presentation"),i.src=this.getTileUrl(t),i},getTileUrl:function(t){var e={r:Et?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var i=this._globalTileRange.max.y-t.y;this.options.tms&&(e.y=i),e["-y"]=i}return v(this._url,n(e,this.options))},_tileOnLoad:function(t,e){et?setTimeout(s(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,i){var n=this.options.errorTileUrl;n&&e.getAttribute("src")!==n&&(e.src=n),t(i,e)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,e=this.options.maxZoom;return this.options.zoomReverse&&(t=e-t),t+this.options.zoomOffset},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_abortLoading:function(){var t,e;for(t in this._tiles)this._tiles[t].coords.z!==this._tileZoom&&((e=this._tiles[t].el).onload=h,e.onerror=h,e.complete||(e.src=_,de(e),delete this._tiles[t]))},_removeTile:function(t){var e=this._tiles[t];if(e)return at||e.el.setAttribute("src",_),zn.prototype._removeTile.call(this,t)},_tileReady:function(t,e,i){if(this._map&&(!i||i.getAttribute("src")!==_))return zn.prototype._tileReady.call(this,t,e,i)}});function Nn(t,e){return new Dn(t,e)}var Rn=Dn.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,e){this._url=t;var i=n({},this.defaultWmsParams);for(var o in e)o in this.options||(i[o]=e[o]);var s=(e=m(this,e)).detectRetina&&Et?2:1,r=this.getTileSize();i.width=r.x*s,i.height=r.y*s,this.wmsParams=i},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var e=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[e]=this._crs.code,Dn.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),i=this._crs,n=R(i.project(e[0]),i.project(e[1])),o=n.min,s=n.max,r=(this._wmsVersion>=1.3&&this._crs===Zi?[o.y,o.x,s.y,s.x]:[o.x,o.y,s.x,s.y]).join(","),a=Dn.prototype.getTileUrl.call(this,t);return a+f(this.wmsParams,a,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+r},setParams:function(t,e){return n(this.wmsParams,t),e||this.redraw(),this}});function Bn(t,e){return new Rn(t,e)}Dn.WMS=Rn,Nn.wms=Bn;var qn=Vi.extend({options:{padding:.1,tolerance:0},initialize:function(t){m(this,t),a(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),this._zoomAnimated&&ve(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,e){var i=this._map.getZoomScale(e,this._zoom),n=Te(this._container),o=this._map.getSize().multiplyBy(.5+this.options.padding),s=this._map.project(this._center,e),r=this._map.project(t,e).subtract(s),a=o.multiplyBy(-i).add(n).add(o).subtract(r);yt?Se(this._container,a,i):Ce(this._container,a)},_reset:function(){for(var t in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,e=this._map.getSize(),i=this._map.containerPointToLayerPoint(e.multiplyBy(-t)).round();this._bounds=new N(i,i.add(e.multiplyBy(1+2*t)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Zn=qn.extend({getEvents:function(){var t=qn.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){qn.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");Ie(t,"mousemove",l(this._onMouseMove,32,this),this),Ie(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Ie(t,"mouseout",this._handleMouseOut,this),this._ctx=t.getContext("2d")},_destroyContainer:function(){E(this._redrawRequest),delete this._ctx,de(this._container),Ne(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var t in this._redrawBounds=null,this._layers)this._layers[t]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){qn.prototype._update.call(this);var t=this._bounds,e=this._container,i=t.getSize(),n=Et?2:1;Ce(e,t.min),e.width=n*i.x,e.height=n*i.y,e.style.width=i.x+"px",e.style.height=i.y+"px",Et&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){qn.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[a(t)]=t;var e=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=e),this._drawLast=e,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=t._order,i=e.next,n=e.prev;i?i.prev=n:this._drawLast=n,n?n.next=i:this._drawFirst=i,delete t._order,delete this._layers[a(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if("string"==typeof t.options.dashArray){var e,i,n=t.options.dashArray.split(/[, ]+/),o=[];for(i=0;i<n.length;i++){if(e=Number(n[i]),isNaN(e))return;o.push(e)}t.options._dashArray=o}else t.options._dashArray=t.options.dashArray},_requestRedraw:function(t){this._map&&(this._extendRedrawBounds(t),this._redrawRequest=this._redrawRequest||T(this._redraw,this))},_extendRedrawBounds:function(t){if(t._pxBounds){var e=(t.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new N,this._redrawBounds.extend(t._pxBounds.min.subtract([e,e])),this._redrawBounds.extend(t._pxBounds.max.add([e,e]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var t=this._redrawBounds;if(t){var e=t.getSize();this._ctx.clearRect(t.min.x,t.min.y,e.x,e.y)}else this._ctx.clearRect(0,0,this._container.width,this._container.height)},_draw:function(){var t,e=this._redrawBounds;if(this._ctx.save(),e){var i=e.getSize();this._ctx.beginPath(),this._ctx.rect(e.min.x,e.min.y,i.x,i.y),this._ctx.clip()}this._drawing=!0;for(var n=this._drawFirst;n;n=n.next)t=n.layer,(!e||t._pxBounds&&t._pxBounds.intersects(e))&&t._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(t,e){if(this._drawing){var i,n,o,s,r=t._parts,a=r.length,l=this._ctx;if(a){for(l.beginPath(),i=0;i<a;i++){for(n=0,o=r[i].length;n<o;n++)s=r[i][n],l[n?"lineTo":"moveTo"](s.x,s.y);e&&l.closePath()}this._fillStroke(l,t)}}},_updateCircle:function(t){if(this._drawing&&!t._empty()){var e=t._point,i=this._ctx,n=Math.max(Math.round(t._radius),1),o=(Math.max(Math.round(t._radiusY),1)||n)/n;1!==o&&(i.save(),i.scale(1,o)),i.beginPath(),i.arc(e.x,e.y/o,n,0,2*Math.PI,!1),1!==o&&i.restore(),this._fillStroke(i,t)}},_fillStroke:function(t,e){var i=e.options;i.fill&&(t.globalAlpha=i.fillOpacity,t.fillStyle=i.fillColor||i.color,t.fill(i.fillRule||"evenodd")),i.stroke&&0!==i.weight&&(t.setLineDash&&t.setLineDash(e.options&&e.options._dashArray||[]),t.globalAlpha=i.opacity,t.lineWidth=i.weight,t.strokeStyle=i.color,t.lineCap=i.lineCap,t.lineJoin=i.lineJoin,t.stroke())},_onClick:function(t){for(var e,i,n=this._map.mouseEventToLayerPoint(t),o=this._drawFirst;o;o=o.next)(e=o.layer).options.interactive&&e._containsPoint(n)&&!this._map._draggableMoved(e)&&(i=e);i&&(Ye(t),this._fireEvent([i],t))},_onMouseMove:function(t){if(this._map&&!this._map.dragging.moving()&&!this._map._animatingZoom){var e=this._map.mouseEventToLayerPoint(t);this._handleMouseHover(t,e)}},_handleMouseOut:function(t){var e=this._hoveredLayer;e&&(ye(this._container,"leaflet-interactive"),this._fireEvent([e],t,"mouseout"),this._hoveredLayer=null)},_handleMouseHover:function(t,e){for(var i,n,o=this._drawFirst;o;o=o.next)(i=o.layer).options.interactive&&i._containsPoint(e)&&(n=i);n!==this._hoveredLayer&&(this._handleMouseOut(t),n&&(ve(this._container,"leaflet-interactive"),this._fireEvent([n],t,"mouseover"),this._hoveredLayer=n)),this._hoveredLayer&&this._fireEvent([this._hoveredLayer],t)},_fireEvent:function(t,e,i){this._map._fireDOMEvent(e,i||e.type,t)},_bringToFront:function(t){var e=t._order;if(e){var i=e.next,n=e.prev;i&&(i.prev=n,n?n.next=i:i&&(this._drawFirst=i),e.prev=this._drawLast,this._drawLast.next=e,e.next=null,this._drawLast=e,this._requestRedraw(t))}},_bringToBack:function(t){var e=t._order;if(e){var i=e.next,n=e.prev;n&&(n.next=i,i?i.prev=n:n&&(this._drawLast=n),e.prev=null,e.next=this._drawFirst,this._drawFirst.prev=e,this._drawFirst=e,this._requestRedraw(t))}}});function Fn(t){return $t?new Zn(t):null}var Vn=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return document.createElement("<lvml:"+t+' class="lvml">')}}catch(t){return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),jn={_initContainer:function(){this._container=ue("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(qn.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=Vn("shape");ve(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=Vn("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[a(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;de(e),t.removeInteractiveTarget(e),delete this._layers[a(t)]},_updateStyle:function(t){var e=t._stroke,i=t._fill,n=t.options,o=t._container;o.stroked=!!n.stroke,o.filled=!!n.fill,n.stroke?(e||(e=t._stroke=Vn("stroke")),o.appendChild(e),e.weight=n.weight+"px",e.color=n.color,e.opacity=n.opacity,n.dashArray?e.dashStyle=y(n.dashArray)?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):e.dashStyle="",e.endcap=n.lineCap.replace("butt","flat"),e.joinstyle=n.lineJoin):e&&(o.removeChild(e),t._stroke=null),n.fill?(i||(i=t._fill=Vn("fill")),o.appendChild(i),i.color=n.fillColor||n.color,i.opacity=n.fillOpacity):i&&(o.removeChild(i),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),i=Math.round(t._radius),n=Math.round(t._radiusY||i);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+i+","+n+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){me(t._container)},_bringToBack:function(t){fe(t._container)}},Un=At?Vn:J,Hn=qn.extend({getEvents:function(){var t=qn.prototype.getEvents.call(this);return t.zoomstart=this._onZoomStart,t},_initContainer:function(){this._container=Un("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Un("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){de(this._container),Ne(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_onZoomStart:function(){this._update()},_update:function(){if(!this._map._animatingZoom||!this._bounds){qn.prototype._update.call(this);var t=this._bounds,e=t.getSize(),i=this._container;this._svgSize&&this._svgSize.equals(e)||(this._svgSize=e,i.setAttribute("width",e.x),i.setAttribute("height",e.y)),Ce(i,t.min),i.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update")}},_initPath:function(t){var e=t._path=Un("path");t.options.className&&ve(e,t.options.className),t.options.interactive&&ve(e,"leaflet-interactive"),this._updateStyle(t),this._layers[a(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){de(t._path),t.removeInteractiveTarget(t._path),delete this._layers[a(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,i=t.options;e&&(i.stroke?(e.setAttribute("stroke",i.color),e.setAttribute("stroke-opacity",i.opacity),e.setAttribute("stroke-width",i.weight),e.setAttribute("stroke-linecap",i.lineCap),e.setAttribute("stroke-linejoin",i.lineJoin),i.dashArray?e.setAttribute("stroke-dasharray",i.dashArray):e.removeAttribute("stroke-dasharray"),i.dashOffset?e.setAttribute("stroke-dashoffset",i.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),i.fill?(e.setAttribute("fill",i.fillColor||i.color),e.setAttribute("fill-opacity",i.fillOpacity),e.setAttribute("fill-rule",i.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,X(t._parts,e))},_updateCircle:function(t){var e=t._point,i=Math.max(Math.round(t._radius),1),n="a"+i+","+(Math.max(Math.round(t._radiusY),1)||i)+" 0 1,0 ",o=t._empty()?"M0 0":"M"+(e.x-i)+","+e.y+n+2*i+",0 "+n+2*-i+",0 ";this._setPath(t,o)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){me(t._path)},_bringToBack:function(t){fe(t._path)}});function Gn(t){return Lt||At?new Hn(t):null}At&&Hn.include(jn),ii.include({getRenderer:function(t){var e=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return e||(e=this._renderer=this._createRenderer()),this.hasLayer(e)||this.addLayer(e),e},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var e=this._paneRenderers[t];return void 0===e&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e},_createRenderer:function(t){return this.options.preferCanvas&&Fn(t)||Gn(t)}});var Wn=ln.extend({initialize:function(t,e){ln.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=q(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});function Kn(t,e){return new Wn(t,e)}Hn.create=Un,Hn.pointsToPath=X,hn.geometryToLayer=un,hn.coordsToLatLng=dn,hn.coordsToLatLngs=pn,hn.latLngToCoords=mn,hn.latLngsToCoords=fn,hn.getFeature=gn,hn.asFeature=vn,ii.mergeOptions({boxZoom:!0});var Yn=mi.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){Ie(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Ne(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){de(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),ee(),$e(),this._startPoint=this._map.mouseEventToContainerPoint(t),Ie(document,{contextmenu:je,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=ue("div","leaflet-zoom-box",this._container),ve(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=new N(this._point,this._startPoint),i=e.getSize();Ce(this._box,e.min),this._box.style.width=i.x+"px",this._box.style.height=i.y+"px"},_finish:function(){this._moved&&(de(this._box),ye(this._container,"leaflet-crosshair")),ie(),Le(),Ne(document,{contextmenu:je,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if((1===t.which||1===t.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(s(this._resetState,this),0);var e=new B(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(e).fire("boxzoomend",{boxZoomBounds:e})}},_onKeyDown:function(t){27===t.keyCode&&this._finish()}});ii.addInitHook("addHandler","boxZoom",Yn),ii.mergeOptions({doubleClickZoom:!0});var Jn=mi.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,i=e.getZoom(),n=e.options.zoomDelta,o=t.originalEvent.shiftKey?i-n:i+n;"center"===e.options.doubleClickZoom?e.setZoom(o):e.setZoomAround(t.containerPoint,o)}});ii.addInitHook("addHandler","doubleClickZoom",Jn),ii.mergeOptions({dragging:!0,inertia:!st,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Xn=mi.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new _i(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}ve(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){ye(this._map._container,"leaflet-grab"),ye(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var e=q(this._map.options.maxBounds);this._offsetLimit=R(this._map.latLngToContainerPoint(e.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(e.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var e=this._lastTime=+new Date,i=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(i),this._times.push(e),this._prunePositions(e)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit;t.x<e.min.x&&(t.x=this._viscousLimit(t.x,e.min.x)),t.y<e.min.y&&(t.y=this._viscousLimit(t.y,e.min.y)),t.x>e.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-e+i)%t+e-i,s=(n+e+i)%t-e-i,r=Math.abs(o+i)<Math.abs(s+i)?o:s;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=r},_onDragEnd:function(t){var e=this._map,i=e.options,n=!i.inertia||this._times.length<2;if(e.fire("dragend",t),n)e.fire("moveend");else{this._prunePositions(+new Date);var o=this._lastPos.subtract(this._positions[0]),s=(this._lastTime-this._times[0])/1e3,r=i.easeLinearity,a=o.multiplyBy(r/s),l=a.distanceTo([0,0]),c=Math.min(i.inertiaMaxSpeed,l),h=a.multiplyBy(c/l),u=c/(i.inertiaDeceleration*r),d=h.multiplyBy(-u/2).round();d.x||d.y?(d=e._limitOffset(d,e.options.maxBounds),T((function(){e.panBy(d,{duration:u,easeLinearity:r,noMoveStart:!0,animate:!0})}))):e.fire("moveend")}}});ii.addInitHook("addHandler","dragging",Xn),ii.mergeOptions({keyboard:!0,keyboardPanDelta:80});var Qn=mi.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(t){this._map=t,this._setPanDelta(t.options.keyboardPanDelta),this._setZoomDelta(t.options.zoomDelta)},addHooks:function(){var t=this._map._container;t.tabIndex<=0&&(t.tabIndex="0"),Ie(t,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),Ne(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var t=document.body,e=document.documentElement,i=t.scrollTop||e.scrollTop,n=t.scrollLeft||e.scrollLeft;this._map._container.focus(),window.scrollTo(n,i)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(t){var e,i,n=this._panKeys={},o=this.keyCodes;for(e=0,i=o.left.length;e<i;e++)n[o.left[e]]=[-1*t,0];for(e=0,i=o.right.length;e<i;e++)n[o.right[e]]=[t,0];for(e=0,i=o.down.length;e<i;e++)n[o.down[e]]=[0,t];for(e=0,i=o.up.length;e<i;e++)n[o.up[e]]=[0,-1*t]},_setZoomDelta:function(t){var e,i,n=this._zoomKeys={},o=this.keyCodes;for(e=0,i=o.zoomIn.length;e<i;e++)n[o.zoomIn[e]]=t;for(e=0,i=o.zoomOut.length;e<i;e++)n[o.zoomOut[e]]=-t},_addHooks:function(){Ie(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){Ne(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e,i=t.keyCode,n=this._map;if(i in this._panKeys)n._panAnim&&n._panAnim._inProgress||(e=this._panKeys[i],t.shiftKey&&(e=D(e).multiplyBy(3)),n.panBy(e),n.options.maxBounds&&n.panInsideBounds(n.options.maxBounds));else if(i in this._zoomKeys)n.setZoom(n.getZoom()+(t.shiftKey?3:1)*this._zoomKeys[i]);else{if(27!==i||!n._popup||!n._popup.options.closeOnEscapeKey)return;n.closePopup()}je(t)}}});ii.addInitHook("addHandler","keyboard",Qn),ii.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var to=mi.extend({addHooks:function(){Ie(this._map._container,"mousewheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){Ne(this._map._container,"mousewheel",this._onWheelScroll,this)},_onWheelScroll:function(t){var e=Ge(t),i=this._map.options.wheelDebounceTime;this._delta+=e,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var n=Math.max(i-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(s(this._performZoom,this),n),je(t)},_performZoom:function(){var t=this._map,e=t.getZoom(),i=this._map.options.zoomSnap||0;t._stop();var n=this._delta/(4*this._map.options.wheelPxPerZoomLevel),o=4*Math.log(2/(1+Math.exp(-Math.abs(n))))/Math.LN2,s=i?Math.ceil(o/i)*i:o,r=t._limitZoom(e+(this._delta>0?s:-s))-e;this._delta=0,this._startTime=null,r&&("center"===t.options.scrollWheelZoom?t.setZoom(e+r):t.setZoomAround(this._lastMousePos,e+r))}});ii.addInitHook("addHandler","scrollWheelZoom",to),ii.mergeOptions({tap:!0,tapTolerance:15});var eo=mi.extend({addHooks:function(){Ie(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Ne(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(t.touches){if(Ve(t),this._fireClick=!0,t.touches.length>1)return this._fireClick=!1,void clearTimeout(this._holdTimeout);var e=t.touches[0],i=e.target;this._startPos=this._newPos=new z(e.clientX,e.clientY),i.tagName&&"a"===i.tagName.toLowerCase()&&ve(i,"leaflet-active"),this._holdTimeout=setTimeout(s((function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",e))}),this),1e3),this._simulateEvent("mousedown",e),Ie(document,{touchmove:this._onMove,touchend:this._onUp},this)}},_onUp:function(t){if(clearTimeout(this._holdTimeout),Ne(document,{touchmove:this._onMove,touchend:this._onUp},this),this._fireClick&&t&&t.changedTouches){var e=t.changedTouches[0],i=e.target;i&&i.tagName&&"a"===i.tagName.toLowerCase()&&ye(i,"leaflet-active"),this._simulateEvent("mouseup",e),this._isTapValid()&&this._simulateEvent("click",e)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(t){var e=t.touches[0];this._newPos=new z(e.clientX,e.clientY),this._simulateEvent("mousemove",e)},_simulateEvent:function(t,e){var i=document.createEvent("MouseEvents");i._simulated=!0,e.target._simulatedClick=!0,i.initMouseEvent(t,!0,!0,window,1,e.screenX,e.screenY,e.clientX,e.clientY,!1,!1,!1,!1,0,null),e.target.dispatchEvent(i)}});St&&!kt&&ii.addInitHook("addHandler","tap",eo),ii.mergeOptions({touchZoom:St&&!st,bounceAtZoomLimits:!0});var io=mi.extend({addHooks:function(){ve(this._map._container,"leaflet-touch-zoom"),Ie(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){ye(this._map._container,"leaflet-touch-zoom"),Ne(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var e=this._map;if(t.touches&&2===t.touches.length&&!e._animatingZoom&&!this._zooming){var i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=e.getSize()._divideBy(2),this._startLatLng=e.containerPointToLatLng(this._centerPoint),"center"!==e.options.touchZoom&&(this._pinchStartLatLng=e.containerPointToLatLng(i.add(n)._divideBy(2))),this._startDist=i.distanceTo(n),this._startZoom=e.getZoom(),this._moved=!1,this._zooming=!0,e._stop(),Ie(document,"touchmove",this._onTouchMove,this),Ie(document,"touchend",this._onTouchEnd,this),Ve(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var e=this._map,i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]),o=i.distanceTo(n)/this._startDist;if(this._zoom=e.getScaleZoom(o,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoom<e.getMinZoom()&&o<1||this._zoom>e.getMaxZoom()&&o>1)&&(this._zoom=e._limitZoom(this._zoom)),"center"===e.options.touchZoom){if(this._center=this._startLatLng,1===o)return}else{var r=i._add(n)._divideBy(2)._subtract(this._centerPoint);if(1===o&&0===r.x&&0===r.y)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(r),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),E(this._animRequest);var a=s(e._move,e,this._center,this._zoom,{pinch:!0,round:!1});this._animRequest=T(a,this,!0),Ve(t)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,E(this._animRequest),Ne(document,"touchmove",this._onTouchMove),Ne(document,"touchend",this._onTouchEnd),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))):this._zooming=!1}});ii.addInitHook("addHandler","touchZoom",io),ii.BoxZoom=Yn,ii.DoubleClickZoom=Jn,ii.Drag=Xn,ii.Keyboard=Qn,ii.ScrollWheelZoom=to,ii.Tap=eo,ii.TouchZoom=io,Object.freeze=i,t.version=e,t.Control=oi,t.control=si,t.Browser=Mt,t.Evented=P,t.Mixin=gi,t.Util=$,t.Class=A,t.Handler=mi,t.extend=n,t.bind=s,t.stamp=a,t.setOptions=m,t.DomEvent=ti,t.DomUtil=ze,t.PosAnimation=ei,t.Draggable=_i,t.LineUtil=zi,t.PolyUtil=Di,t.Point=z,t.point=D,t.Bounds=N,t.bounds=R,t.Transformation=G,t.transformation=W,t.Projection=Bi,t.LatLng=Z,t.latLng=F,t.LatLngBounds=B,t.latLngBounds=q,t.CRS=V,t.GeoJSON=hn,t.geoJSON=bn,t.geoJson=_n,t.Layer=Vi,t.LayerGroup=ji,t.layerGroup=Ui,t.FeatureGroup=Hi,t.featureGroup=Gi,t.ImageOverlay=xn,t.imageOverlay=wn,t.VideoOverlay=kn,t.videoOverlay=Sn,t.SVGOverlay=Cn,t.svgOverlay=Tn,t.DivOverlay=En,t.Popup=$n,t.popup=Ln,t.Tooltip=An,t.tooltip=On,t.Icon=Wi,t.icon=Ki,t.DivIcon=Mn,t.divIcon=Pn,t.Marker=Xi,t.marker=Qi,t.TileLayer=Dn,t.tileLayer=Nn,t.GridLayer=zn,t.gridLayer=In,t.SVG=Hn,t.svg=Gn,t.Renderer=qn,t.Canvas=Zn,t.canvas=Fn,t.Path=tn,t.CircleMarker=en,t.circleMarker=nn,t.Circle=on,t.circle=sn,t.Polyline=rn,t.polyline=an,t.Polygon=ln,t.polygon=cn,t.Rectangle=Wn,t.rectangle=Kn,t.Map=ii,t.map=ni;var no=window.L;t.noConflict=function(){return window.L=no,this},window.L=t}(e)},za(Ia={exports:{}},Ia.exports),Ia.exports);const Na={weight:1,opacity:1,color:"white",fillOpacity:.7,fillColor:"#2387ca"},Ra={weight:3,color:"white",fillOpacity:1,fillColor:"#2387ca"},Ba=()=>Na;class qa extends X{constructor(){super(),this.osmId="",this.endpoint="",this.hovered=null,this.path=[],this.renderedMap=null,this.states=null,this.paths={},this.lastHovered=null}static get styles(){return s`
5311
5400
  :host {
5312
5401
  display: block;
5313
5402
  padding: 0px;
@@ -5342,10 +5431,10 @@ function t(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPro
5342
5431
  color: var(--color-link-primary);
5343
5432
  cursor: pointer;
5344
5433
  }
5345
- `}getRenderRoot(){return this.renderRoot}getEndpoint(){return this.endpoint+(this.endpoint.endsWith("/")?"":"/")}refreshMap(){const t=(t,e)=>{this.paths[t.properties.osm_id]=e,e.on({click:t=>{const e=t.target.feature.properties;if(e.osm_id!==this.path[this.path.length-1].osm_id){const i=t.originalEvent;i.stopPropagation(),i.preventDefault(),this.onFeatureClicked&&this.onFeatureClicked(e),this.hovered=null,this.path.push(e),this.osmId=e.osm_id,this.refreshMap()}},mouseover:t=>{const e=t.target.feature.properties;e.osm_id!==this.path[this.path.length-1].osm_id&&(t.target.setStyle(fl),this.hovered=e)},mouseout:t=>{t.target.setStyle(ml),this.hovered=null}})};Wt(this.getEndpoint()+"geometry/"+this.osmId+"/").then((e=>{this.states&&this.renderedMap.removeLayer(this.states);const i=e.json;0===this.path.length&&(this.path=[{name:i.name,osm_id:this.osmId,level:0}]),this.states=pl.geoJSON(i.geometry,{style:gl,onEachFeature:t}),this.renderedMap.fitBounds(this.states.getBounds(),{}),this.states.addTo(this.renderedMap)}))}updated(t){if(t.has("hovered")&&(this.lastHovered&&this.lastHovered.setStyle(ml),this.hovered)){const t=this.paths[this.hovered.osm_id];this.lastHovered=t,t&&t.setStyle(fl)}if(t.has("feature")&&this.feature&&(this.hovered=null,0!==this.path.length&&this.path[this.path.length-1].osm_id===this.feature.osm_id||this.path.push(this.feature)),t.has("osmId")){const t=[];for(const e of this.path)if(t.push(e),e.osm_id===this.osmId){this.onFeatureClicked&&this.onFeatureClicked(e);break}this.path=t,this.refreshMap()}}firstUpdated(t){const e=this.getRenderRoot().getElementById("alias-map");this.renderedMap=pl.map(e,{attributionControl:!1,scrollWheelZoom:!1,zoomControl:!1}).setView([0,1],4),this.renderedMap.dragging.disable(),this.renderedMap.doubleClickZoom.disable(),this.refreshMap(),super.firstUpdated(t)}handleClickedBreadcrumb(t){this.osmId=t.currentTarget.getAttribute("data-osmid");const e=[];for(const t of this.path)if(e.push(t),t.osm_id===this.osmId){this.onFeatureClicked&&this.onFeatureClicked(t);break}this.path=e,this.refreshMap()}render(){return this.osmId?O`
5434
+ `}getRenderRoot(){return this.renderRoot}getEndpoint(){return this.endpoint+(this.endpoint.endsWith("/")?"":"/")}refreshMap(){const t=(t,e)=>{this.paths[t.properties.osm_id]=e,e.on({click:t=>{const e=t.target.feature.properties;if(e.osm_id!==this.path[this.path.length-1].osm_id){const i=t.originalEvent;i.stopPropagation(),i.preventDefault(),this.onFeatureClicked&&this.onFeatureClicked(e),this.hovered=null,this.path.push(e),this.osmId=e.osm_id,this.refreshMap()}},mouseover:t=>{const e=t.target.feature.properties;e.osm_id!==this.path[this.path.length-1].osm_id&&(t.target.setStyle(Ra),this.hovered=e)},mouseout:t=>{t.target.setStyle(Na),this.hovered=null}})};ft(this.getEndpoint()+"geometry/"+this.osmId+"/").then((e=>{this.states&&this.renderedMap.removeLayer(this.states);const i=e.json;0===this.path.length&&(this.path=[{name:i.name,osm_id:this.osmId,level:0}]),this.states=Da.geoJSON(i.geometry,{style:Ba,onEachFeature:t}),this.renderedMap.fitBounds(this.states.getBounds(),{}),this.states.addTo(this.renderedMap)}))}updated(t){if(t.has("hovered")&&(this.lastHovered&&this.lastHovered.setStyle(Na),this.hovered)){const t=this.paths[this.hovered.osm_id];this.lastHovered=t,t&&t.setStyle(Ra)}if(t.has("feature")&&this.feature&&(this.hovered=null,0!==this.path.length&&this.path[this.path.length-1].osm_id===this.feature.osm_id||this.path.push(this.feature)),t.has("osmId")){const t=[];for(const e of this.path)if(t.push(e),e.osm_id===this.osmId){this.onFeatureClicked&&this.onFeatureClicked(e);break}this.path=t,this.refreshMap()}}firstUpdated(t){const e=this.getRenderRoot().getElementById("alias-map");this.renderedMap=Da.map(e,{attributionControl:!1,scrollWheelZoom:!1,zoomControl:!1}).setView([0,1],4),this.renderedMap.dragging.disable(),this.renderedMap.doubleClickZoom.disable(),this.refreshMap(),super.firstUpdated(t)}handleClickedBreadcrumb(t){this.osmId=t.currentTarget.getAttribute("data-osmid");const e=[];for(const t of this.path)if(e.push(t),t.osm_id===this.osmId){this.onFeatureClicked&&this.onFeatureClicked(t);break}this.path=e,this.refreshMap()}render(){return this.osmId?P`
5346
5435
  <link
5347
5436
  rel="stylesheet"
5348
5437
  href="https://unpkg.com/leaflet@1.5.1/dist/leaflet.css"
5349
5438
  />
5350
5439
  <div id="alias-map"></div>
5351
- `:O`<div>No osm map id</div>`}}t([it()],vl.prototype,"feature",void 0),t([it()],vl.prototype,"osmId",void 0),t([it()],vl.prototype,"endpoint",void 0),t([it()],vl.prototype,"onFeatureClicked",void 0),t([it()],vl.prototype,"hovered",void 0),t([it()],vl.prototype,"path",void 0),cl("leaflet-map",vl),cl("alias-editor",hl);
5440
+ `:P`<div>No osm map id</div>`}}t([it()],qa.prototype,"feature",void 0),t([it()],qa.prototype,"osmId",void 0),t([it()],qa.prototype,"endpoint",void 0),t([it()],qa.prototype,"onFeatureClicked",void 0),t([it()],qa.prototype,"hovered",void 0),t([it()],qa.prototype,"path",void 0),Ma("leaflet-map",qa),Ma("alias-editor",Pa);