diff --git a/civicpatch/2dba439c07ca.png b/civicpatch/2dba439c07ca.png new file mode 100644 index 000000000..807d4fc61 Binary files /dev/null and b/civicpatch/2dba439c07ca.png differ diff --git a/civicpatch/3e2771d8c6d7.png b/civicpatch/3e2771d8c6d7.png new file mode 100644 index 000000000..868134407 Binary files /dev/null and b/civicpatch/3e2771d8c6d7.png differ diff --git a/civicpatch/92a1a277f78b.png b/civicpatch/92a1a277f78b.png new file mode 100644 index 000000000..d8a8e1a03 Binary files /dev/null and b/civicpatch/92a1a277f78b.png differ diff --git a/civicpatch/Dockerfile b/civicpatch/Dockerfile index 09a3240ce..11529048e 100644 --- a/civicpatch/Dockerfile +++ b/civicpatch/Dockerfile @@ -63,7 +63,7 @@ RUN poetry install FROM image-base AS post-install -RUN poetry run patchright install --with-deps chromium +RUN poetry run patchright install --with-deps chrome COPY --chown=civicpatch_user:civicpatch_user ${PROJECT_NAME}/src/setup.py /app/src/setup.py RUN poetry run post-install diff --git a/civicpatch/c8a27d7feb18.png b/civicpatch/c8a27d7feb18.png new file mode 100644 index 000000000..194c4307b Binary files /dev/null and b/civicpatch/c8a27d7feb18.png differ diff --git a/civicpatch/docker-compose.development.yml b/civicpatch/docker-compose.development.yml index ca33addbf..372e85b27 100644 --- a/civicpatch/docker-compose.development.yml +++ b/civicpatch/docker-compose.development.yml @@ -67,9 +67,15 @@ services: target: development environment: CIVICPATCH_ENV: test + # Integration tests + GOOGLE_GEMINI_TOKEN: ${GOOGLE_GEMINI_TOKEN} + OPENAI_TOKEN: ${OPENAI_TOKEN} + TOGETHER_AI_TOKEN: ${TOGETHER_AI_TOKEN} volumes: - ./data:/app/data - ./data_source:/app/data_source + - ../shared:/app/src/shared:ro + - .:/app civicpatch_prod: build: diff --git a/civicpatch/mise.toml b/civicpatch/mise.toml index 2188b11b5..7133a29a4 100644 --- a/civicpatch/mise.toml +++ b/civicpatch/mise.toml @@ -44,7 +44,12 @@ docker compose -f docker-compose.development.yml run --rm civicpatch pytest -vvm [tasks.evals] run = """ -docker compose -f docker-compose.development.yml run --rm civicpatch pytest -vvm evals tests/prompts +docker compose -f docker-compose.development.yml run --rm civicpatch_test pytest -vvm evals tests/prompts +""" + +[tasks.evals_relevant] +run = """ +docker compose -f docker-compose.development.yml run --rm civicpatch_test pytest -vvm evals_relevant tests/prompts """ [tasks.scratchtest] diff --git a/civicpatch/pytest.ini b/civicpatch/pytest.ini index 160743be3..2076a8da6 100644 --- a/civicpatch/pytest.ini +++ b/civicpatch/pytest.ini @@ -4,6 +4,7 @@ markers = integration: mark a test as an integration test unit: mark a test as a unit test evals: mark a test related to evaluations + evals_relevant: mark a test related to relevant page evaluation contracts: mark a test related to contracts # Add default options for pytest diff --git a/civicpatch/src/frontend/build/bundle.js b/civicpatch/src/frontend/build/bundle.js index 6360225ed..821d21de1 100644 --- a/civicpatch/src/frontend/build/bundle.js +++ b/civicpatch/src/frontend/build/bundle.js @@ -4,7 +4,7 @@ import{registerCivMap as e}from'@components'; * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -const t=globalThis,n=e=>{t.emitLitDebugLogEvents&&t.dispatchEvent(new CustomEvent('lit-debug',{detail:e}))};let i,o=0;t.litIssuedWarnings??=new Set,i=(e,n)=>{n+=e?` See https://lit.dev/msg/${e} for more information.`:'',t.litIssuedWarnings.has(n)||t.litIssuedWarnings.has(e)||(console.warn(n),t.litIssuedWarnings.add(n))},queueMicrotask(()=>{i('dev-mode','Lit is in dev mode. Not recommended for production!')});const r=t.ShadyDOM?.inUse&&!0===t.ShadyDOM?.noPatch?t.ShadyDOM.wrap:e=>e,s=t.trustedTypes,a=s?s.createPolicy('lit-html',{createHTML:e=>e}):void 0,l=e=>e,c=(e,t,n)=>l,d=e=>{if(I!==c)throw new Error('Attempted to overwrite existing lit-html security policy. setSanitizeDOMValueFactory should be called at most once.');I=e},u=()=>{I=c},p=(e,t,n)=>I(e,t,n),h='$lit$',m=`lit$${Math.random().toFixed(9).slice(2)}$`,f='?'+m,g=`<${f}>`,b=document,v=()=>b.createComment(''),y=e=>null===e||'object'!=typeof e&&'function'!=typeof e,_=Array.isArray,$='[ \t\n\f\r]',w=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,x=/-->/g,k=/>/g,S=new RegExp(`>|${$}(?:([^\\s"'>=/]+)(${$}*=${$}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,'g'),C=/'/g,A=/"/g,E=/^(?:script|style|textarea|title)$/i,O=(e=>(t,...n)=>(t.some(e=>void 0===e)&&console.warn('Some template strings are undefined.\nThis is probably caused by illegal octal escape sequences.'),n.some(e=>e?._$litStatic$)&&i('','Static values \'literal\' or \'unsafeStatic\' cannot be used as values to non-static templates.\nPlease use the static \'html\' tag function. See https://lit.dev/docs/templates/expressions/#static-expressions'),{_$litType$:e,strings:t,values:n}))(1),j=Symbol.for('lit-noChange'),P=Symbol.for('lit-nothing'),T=new WeakMap,N=b.createTreeWalker(b,129);let I=c;function M(e,t){if(!_(e)||!e.hasOwnProperty('raw')){let e='invalid template strings array';throw e='\n Internal Error: expected template strings to be an array\n with a \'raw\' field. Faking a template strings array by\n calling html or svg like an ordinary function is effectively\n the same as calling unsafeHtml and can lead to major security\n issues, e.g. opening your code up to XSS attacks.\n If you\'re using the html or svg tagged template functions normally\n and still seeing this error, please file a bug at\n https://github.com/lit/lit/issues/new?template=bug_report.md\n and include information about your build tooling, if any.\n '.trim().replace(/\n */g,'\n'),new Error(e)}return void 0!==a?a.createHTML(t):t}class D{constructor({strings:e,_$litType$:t},o){let r;this.parts=[];let a=0,l=0;const c=e.length-1,d=this.parts,[u,p]=((e,t)=>{const n=e.length-1,i=[];let o,r=2===t?'':3===t?'':'',s=w;for(let t=0;t'===l[0]?(s=o??w,c=-1):void 0===l[1]?c=-2:(c=s.lastIndex-l[2].length,a=l[1],s=void 0===l[3]?S:'"'===l[3]?A:C):s===A||s===C?s=S:s===x||s===k?s=w:(s=S,o=void 0);console.assert(-1===c||s===S||s===C||s===A,'unexpected parse state B');const u=s===S&&e[t+1].startsWith('/>')?' ':'';r+=s===w?n+g:c>=0?(i.push(a),n.slice(0,c)+h+n.slice(c)+m+u):n+m+(-2===c?t:u)}return[M(e,r+(e[n]||'')+(2===t?'':3===t?'':'')),i]})(e,t);if(this.el=D.createElement(u,o),N.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(r=N.nextNode())&&d.length0){r.textContent=s?s.emptyScript:'';for(let n=0;n" contains a duplicate "disabled" attribute. The error was detected in the following template: \n`'+e.join('${...}')+'`');n&&n({kind:'template prep',template:this,clonableTemplate:this.el,parts:this.parts,strings:e})}static createElement(e,t){const n=b.createElement('template');return n.innerHTML=e,n}}function L(e,t,n=e,i){if(t===j)return t;let o=void 0!==i?n.__directives?.[i]:n.__directive;const r=y(t)?void 0:t._$litDirective$;return o?.constructor!==r&&(o?._$notifyDirectiveConnectionChanged?.(!1),void 0===r?o=void 0:(o=new r(e),o._$initialize(e,n,i)),void 0!==i?(n.__directives??=[])[i]=o:n.__directive=o),void 0!==o&&(t=L(e,o._$resolve(e,t.values),o,i)),t}class U{constructor(e,t){this._$parts=[],this._$disconnectableChildren=void 0,this._$template=e,this._$parent=t}get parentNode(){return this._$parent.parentNode}get _$isConnected(){return this._$parent._$isConnected}_clone(e){const{el:{content:t},parts:n}=this._$template,i=(e?.creationScope??b).importNode(t,!0);N.currentNode=i;let o=N.nextNode(),r=0,s=0,a=n[0];for(;void 0!==a;){if(r===a.index){let t;2===a.type?t=new R(o,o.nextSibling,this,e):1===a.type?t=new a.ctor(o,a.name,a.strings,this,e):6===a.type&&(t=new W(o,this,e)),this._$parts.push(t),a=n[++s]}r!==a?.index&&(o=N.nextNode(),r++)}return N.currentNode=b,i}_update(e){let t=0;for(const i of this._$parts)void 0!==i&&(n&&n({kind:'set part',part:i,value:e[t],valueIndex:t,values:e,templateInstance:this}),void 0!==i.strings?(i._$setValue(e,i,t),t+=i.strings.length-2):i._$setValue(e[t])),t++}}class R{get _$isConnected(){return this._$parent?._$isConnected??this.__isConnected}constructor(e,t,n,i){this.type=2,this._$committedValue=P,this._$disconnectableChildren=void 0,this._$startNode=e,this._$endNode=t,this._$parent=n,this.options=i,this.__isConnected=i?.isConnected??!0,this._textSanitizer=void 0}get parentNode(){let e=r(this._$startNode).parentNode;const t=this._$parent;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$startNode}get endNode(){return this._$endNode}_$setValue(e,t=this){if(null===this.parentNode)throw new Error('This `ChildPart` has no `parentNode` and therefore cannot accept a value. This likely means the element containing the part was manipulated in an unsupported way outside of Lit\'s control such that the part\'s marker nodes were ejected from DOM. For example, setting the element\'s `innerHTML` or `textContent` can do this.');if(e=L(this,e,t),y(e))e===P||null==e||''===e?(this._$committedValue!==P&&(n&&n({kind:'commit nothing to child',start:this._$startNode,end:this._$endNode,parent:this._$parent,options:this.options}),this._$clear()),this._$committedValue=P):e!==this._$committedValue&&e!==j&&this._commitText(e);else if(void 0!==e._$litType$)this._commitTemplateResult(e);else if(void 0!==e.nodeType){if(this.options?.host===e)return this._commitText('[probable mistake: rendered a template\'s host in itself (commonly caused by writing ${this} in a template]'),void console.warn('Attempted to render the template host',e,'inside itself. This is almost always a mistake, and in dev mode ','we render some warning text. In production however, we\'ll ','render it, which will usually result in an error, and sometimes ','in the element disappearing from the DOM.');this._commitNode(e)}else(e=>_(e)||'function'==typeof e?.[Symbol.iterator])(e)?this._commitIterable(e):this._commitText(e)}_insert(e){return r(r(this._$startNode).parentNode).insertBefore(e,this._$endNode)}_commitNode(e){if(this._$committedValue!==e){if(this._$clear(),I!==c){const e=this._$startNode.parentNode?.nodeName;if('STYLE'===e||'SCRIPT'===e){let t='Forbidden';throw t='STYLE'===e?'Lit does not support binding inside style nodes. This is a security risk, as style injection attacks can exfiltrate data and spoof UIs. Consider instead using css`...` literals to compose styles, and do dynamic styling with css custom properties, ::parts, s, and by mutating the DOM rather than stylesheets.':'Lit does not support binding inside script nodes. This is a security risk, as it could allow arbitrary code execution.',new Error(t)}}n&&n({kind:'commit node',start:this._$startNode,parent:this._$parent,value:e,options:this.options}),this._$committedValue=this._insert(e)}}_commitText(e){if(this._$committedValue!==P&&y(this._$committedValue)){const t=r(this._$startNode).nextSibling;void 0===this._textSanitizer&&(this._textSanitizer=p(t,'data','property')),e=this._textSanitizer(e),n&&n({kind:'commit text',node:t,value:e,options:this.options}),t.data=e}else{const t=b.createTextNode('');this._commitNode(t),void 0===this._textSanitizer&&(this._textSanitizer=p(t,'data','property')),e=this._textSanitizer(e),n&&n({kind:'commit text',node:t,value:e,options:this.options}),t.data=e}this._$committedValue=e}_commitTemplateResult(e){const{values:t,_$litType$:i}=e,o='number'==typeof i?this._$getTemplate(e):(void 0===i.el&&(i.el=D.createElement(M(i.h,i.h[0]),this.options)),i);if(this._$committedValue?._$template===o)n&&n({kind:'template updating',template:o,instance:this._$committedValue,parts:this._$committedValue._$parts,options:this.options,values:t}),this._$committedValue._update(t);else{const e=new U(o,this),i=e._clone(this.options);n&&n({kind:'template instantiated',template:o,instance:e,parts:e._$parts,options:this.options,fragment:i,values:t}),e._update(t),n&&n({kind:'template instantiated and updated',template:o,instance:e,parts:e._$parts,options:this.options,fragment:i,values:t}),this._commitNode(i),this._$committedValue=e}}_$getTemplate(e){let t=T.get(e.strings);return void 0===t&&T.set(e.strings,t=new D(e)),t}_commitIterable(e){_(this._$committedValue)||(this._$committedValue=[],this._$clear());const t=this._$committedValue;let n,i=0;for(const o of e)i===t.length?t.push(n=new R(this._insert(v()),this._insert(v()),this,this.options)):n=t[i],n._$setValue(o),i++;i2||''!==n[0]||''!==n[1]?(this._$committedValue=new Array(n.length-1).fill(new String),this.strings=n):this._$committedValue=P,this._sanitizer=void 0}_$setValue(e,t=this,n,i){const o=this.strings;let r=!1;if(void 0===o)e=L(this,e,t,0),r=!y(e)||e!==this._$committedValue&&e!==j,r&&(this._$committedValue=e);else{const i=e;let s,a;for(e=o[0],s=0;s\` has a \`@${t}=...\` listener with invalid content. Event listeners in templates must have exactly one expression and no surrounding text.`)}_$setValue(e,t=this){if((e=L(this,e,t,0)??P)===j)return;const i=this._$committedValue,o=e===P&&i!==P||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,r=e!==P&&(i===P||o);n&&n({kind:'commit event listener',element:this.element,name:this.name,value:e,options:this.options,removeListener:o,addListener:r,oldListener:i}),o&&this.element.removeEventListener(this.name,this,i),r&&this.element.addEventListener(this.name,this,e),this._$committedValue=e}handleEvent(e){'function'==typeof this._$committedValue?this._$committedValue.call(this.options?.host??this.element,e):this._$committedValue.handleEvent(e)}}class W{constructor(e,t,n){this.element=e,this.type=6,this._$disconnectableChildren=void 0,this._$parent=t,this.options=n}get _$isConnected(){return this._$parent._$isConnected}_$setValue(e){n&&n({kind:'commit to element binding',element:this.element,value:e,options:this.options}),L(this,e)}}const K=t.litHtmlPolyfillSupportDevMode;K?.(D,R),(t.litHtmlVersions??=[]).push('3.3.1'),t.litHtmlVersions.length>1&&queueMicrotask(()=>{i('multiple-versions','Multiple versions of Lit loaded. Loading multiple versions is not recommended.')});const Y=(e,t,i)=>{if(null==t)throw new TypeError(`The container to render into may not be ${t}`);const r=o++,s=i?.renderBefore??t;let a=s._$litPart$;if(n&&n({kind:'begin render',id:r,value:e,container:t,options:i,part:a}),void 0===a){const e=i?.renderBefore??null;s._$litPart$=a=new R(t.insertBefore(v(),e),e,void 0,i??{})}return a._$setValue(e),n&&n({kind:'end render',id:r,value:e,container:t,options:i,part:a}),a};let B;Y.setSanitizer=d,Y.createSanitizer=p,Y._testOnlyClearSanitizerFactoryDoNotCallOrElse=u;let H=0;function J(e){B=e}function G(){B=null,H=0}const Z=Symbol('haunted.phase'),Q=Symbol('haunted.hook'),X=Symbol('haunted.update'),ee=Symbol('haunted.commit'),te=Symbol('haunted.effects'),ne=Symbol('haunted.layoutEffects'),ie='haunted.context';let oe=class{update;host;virtual;[Q];[te];[ne];constructor(e,t){this.update=e,this.host=t,this[Q]=new Map,this[te]=[],this[ne]=[]}run(e){J(this);let t=e();return G(),t}_runEffects(e){let t=this[e];J(this);for(let e of t)e.call(this);G()}runEffects(){this._runEffects(te)}runLayoutEffects(){this._runEffects(ne)}teardown(){this[Q].forEach(e=>{'function'==typeof e.teardown&&e.teardown()})}};const re=Promise.resolve().then.bind(Promise.resolve());function se(){let e,t=[];function n(){e=null;let n=t;t=[];for(var i=0,o=n.length;i{t.push(i),null==e&&(e=re(n))}}const ae=se(),le=se();class ce{renderer;host;state;[Z];_updateQueued;constructor(e,t){this.renderer=e,this.host=t,this.state=new oe(this.update.bind(this),t),this[Z]=null,this._updateQueued=!1}update(){this._updateQueued||(ae(()=>{let e=this.handlePhase(X);le(()=>{this.handlePhase(ee,e),le(()=>{this.handlePhase(te)})}),this._updateQueued=!1}),this._updateQueued=!0)}handlePhase(e,t){switch(this[Z]=e,e){case ee:return this.commit(t),void this.runEffects(ne);case X:return this.render();case te:return this.runEffects(te)}}render(){return this.state.run(()=>this.renderer.call(this.host,this.host))}runEffects(e){this.state._runEffects(e)}teardown(){this.state.teardown()}}function de(e){class t extends ce{frag;constructor(e,t,n){super(e,n||t),this.frag=t}commit(t){e(t,this.frag)}}return function(e,n,i){const o=(i||n||{}).baseElement||HTMLElement,{observedAttributes:r=[],useShadowDOM:s=!0,shadowRootInit:a={}}=i||n||{};class l extends o{_scheduler;static get observedAttributes(){return e.observedAttributes||r||[]}constructor(){super(),!1===s?this._scheduler=new t(e,this):(this.attachShadow({mode:'open',...a}),this._scheduler=new t(e,this.shadowRoot,this))}connectedCallback(){this._scheduler.update()}disconnectedCallback(){this._scheduler.teardown()}attributeChangedCallback(e,t,n){if(t===n)return;let i=''===n||n;Reflect.set(this,((e='')=>e.replace(/-+([a-z])?/g,(e,t)=>t?t.toUpperCase():''))(e),i)}}const c=new Proxy(o.prototype,{getPrototypeOf:e=>e,set(e,t,n,i){let o;return t in e?(o=Object.getOwnPropertyDescriptor(e,t),o&&o.set?(o.set.call(i,n),!0):(Reflect.set(e,t,n,i),!0)):(o='symbol'==typeof t||'_'===t[0]?{enumerable:!0,configurable:!0,writable:!0,value:n}:function(e){let t=e,n=!1;return Object.freeze({enumerable:!0,configurable:!0,get:()=>t,set(e){n&&t===e||(n=!0,t=e,this._scheduler&&this._scheduler.update())}})}(n),Object.defineProperty(i,t,o),o.set&&o.set.call(i,n),!0)}});return Object.setPrototypeOf(l.prototype,c),l}}class ue{id;state;constructor(e,t){this.id=e,this.state=t}}function pe(e,...t){let n=H++,i=B[Q],o=i.get(n);return o||(o=new e(n,B,...t),i.set(n,o)),o.update(...t)}function he(e){return pe.bind(null,e)}function me(e){return he(class extends ue{callback;lastValues;values;_teardown;constructor(t,n,i,o){super(t,n),e(n,this)}update(e,t){this.callback=e,this.values=t}call(){const e=!this.values||this.hasChanged();this.lastValues=this.values,e&&this.run()}run(){this.teardown(),this._teardown=this.callback.call(this.state)}teardown(){'function'==typeof this._teardown&&this._teardown()}hasChanged(){return!this.lastValues||this.values.some((e,t)=>this.lastValues[t]!==e)}})}function fe(e,t){e[te].push(t)}const ge=me(fe),be=he(class extends ue{Context;value;_ranEffect;_unsubscribe;constructor(e,t,n){super(e,t),this._updater=this._updater.bind(this),this._ranEffect=!1,this._unsubscribe=null,fe(t,this)}update(e){if(this.state.virtual)throw new Error('can\'t be used with virtual components');return this.Context!==e&&(this._subscribe(e),this.Context=e),this.value}call(){this._ranEffect||(this._ranEffect=!0,this._unsubscribe&&this._unsubscribe(),this._subscribe(this.Context),this.state.update())}_updater(e){this.value=e,this.state.update()}_subscribe(e){const t={Context:e,callback:this._updater};this.state.host.dispatchEvent(new CustomEvent(ie,{detail:t,bubbles:!0,cancelable:!0,composed:!0}));const{unsubscribe:n=null,value:i}=t;this.value=n?i:e.defaultValue,this._unsubscribe=n}teardown(){this._unsubscribe&&this._unsubscribe()}});const ve=he(class extends ue{value;values;constructor(e,t,n,i){super(e,t),this.value=n(),this.values=i}update(e,t){return this.hasChanged(t)&&(this.values=t,this.value=e()),this.value}hasChanged(e=[]){return e.some((e,t)=>this.values[t]!==e)}}),ye=(e,t)=>ve(()=>e,t);me(function(e,t){e[ne].push(t)});const _e=he(class extends ue{args;constructor(e,t,n){if(super(e,t),this.updater=this.updater.bind(this),'function'==typeof n){n=n()}this.makeArgs(n)}update(){return this.args}updater(e){const[t]=this.args;if('function'==typeof e){e=e(t)}Object.is(t,e)||(this.makeArgs(e),this.state.update())}makeArgs(e){this.args=Object.freeze([e,this.updater])}}); +const t=globalThis,n=e=>{t.emitLitDebugLogEvents&&t.dispatchEvent(new CustomEvent('lit-debug',{detail:e}))};let i,o=0;t.litIssuedWarnings??=new Set,i=(e,n)=>{n+=e?` See https://lit.dev/msg/${e} for more information.`:'',t.litIssuedWarnings.has(n)||t.litIssuedWarnings.has(e)||(console.warn(n),t.litIssuedWarnings.add(n))},queueMicrotask(()=>{i('dev-mode','Lit is in dev mode. Not recommended for production!')});const r=t.ShadyDOM?.inUse&&!0===t.ShadyDOM?.noPatch?t.ShadyDOM.wrap:e=>e,s=t.trustedTypes,a=s?s.createPolicy('lit-html',{createHTML:e=>e}):void 0,l=e=>e,c=(e,t,n)=>l,d=e=>{if(I!==c)throw new Error('Attempted to overwrite existing lit-html security policy. setSanitizeDOMValueFactory should be called at most once.');I=e},u=()=>{I=c},p=(e,t,n)=>I(e,t,n),h='$lit$',m=`lit$${Math.random().toFixed(9).slice(2)}$`,f='?'+m,g=`<${f}>`,b=document,v=()=>b.createComment(''),y=e=>null===e||'object'!=typeof e&&'function'!=typeof e,_=Array.isArray,$='[ \t\n\f\r]',w=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,x=/-->/g,k=/>/g,S=new RegExp(`>|${$}(?:([^\\s"'>=/]+)(${$}*=${$}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,'g'),C=/'/g,A=/"/g,E=/^(?:script|style|textarea|title)$/i,O=(e=>(t,...n)=>(t.some(e=>void 0===e)&&console.warn('Some template strings are undefined.\nThis is probably caused by illegal octal escape sequences.'),n.some(e=>e?._$litStatic$)&&i('','Static values \'literal\' or \'unsafeStatic\' cannot be used as values to non-static templates.\nPlease use the static \'html\' tag function. See https://lit.dev/docs/templates/expressions/#static-expressions'),{_$litType$:e,strings:t,values:n}))(1),j=Symbol.for('lit-noChange'),P=Symbol.for('lit-nothing'),N=new WeakMap,T=b.createTreeWalker(b,129);let I=c;function M(e,t){if(!_(e)||!e.hasOwnProperty('raw')){let e='invalid template strings array';throw e='\n Internal Error: expected template strings to be an array\n with a \'raw\' field. Faking a template strings array by\n calling html or svg like an ordinary function is effectively\n the same as calling unsafeHtml and can lead to major security\n issues, e.g. opening your code up to XSS attacks.\n If you\'re using the html or svg tagged template functions normally\n and still seeing this error, please file a bug at\n https://github.com/lit/lit/issues/new?template=bug_report.md\n and include information about your build tooling, if any.\n '.trim().replace(/\n */g,'\n'),new Error(e)}return void 0!==a?a.createHTML(t):t}class D{constructor({strings:e,_$litType$:t},o){let r;this.parts=[];let a=0,l=0;const c=e.length-1,d=this.parts,[u,p]=((e,t)=>{const n=e.length-1,i=[];let o,r=2===t?'':3===t?'':'',s=w;for(let t=0;t'===l[0]?(s=o??w,c=-1):void 0===l[1]?c=-2:(c=s.lastIndex-l[2].length,a=l[1],s=void 0===l[3]?S:'"'===l[3]?A:C):s===A||s===C?s=S:s===x||s===k?s=w:(s=S,o=void 0);console.assert(-1===c||s===S||s===C||s===A,'unexpected parse state B');const u=s===S&&e[t+1].startsWith('/>')?' ':'';r+=s===w?n+g:c>=0?(i.push(a),n.slice(0,c)+h+n.slice(c)+m+u):n+m+(-2===c?t:u)}return[M(e,r+(e[n]||'')+(2===t?'':3===t?'':'')),i]})(e,t);if(this.el=D.createElement(u,o),T.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(r=T.nextNode())&&d.length0){r.textContent=s?s.emptyScript:'';for(let n=0;n" contains a duplicate "disabled" attribute. The error was detected in the following template: \n`'+e.join('${...}')+'`');n&&n({kind:'template prep',template:this,clonableTemplate:this.el,parts:this.parts,strings:e})}static createElement(e,t){const n=b.createElement('template');return n.innerHTML=e,n}}function L(e,t,n=e,i){if(t===j)return t;let o=void 0!==i?n.__directives?.[i]:n.__directive;const r=y(t)?void 0:t._$litDirective$;return o?.constructor!==r&&(o?._$notifyDirectiveConnectionChanged?.(!1),void 0===r?o=void 0:(o=new r(e),o._$initialize(e,n,i)),void 0!==i?(n.__directives??=[])[i]=o:n.__directive=o),void 0!==o&&(t=L(e,o._$resolve(e,t.values),o,i)),t}class U{constructor(e,t){this._$parts=[],this._$disconnectableChildren=void 0,this._$template=e,this._$parent=t}get parentNode(){return this._$parent.parentNode}get _$isConnected(){return this._$parent._$isConnected}_clone(e){const{el:{content:t},parts:n}=this._$template,i=(e?.creationScope??b).importNode(t,!0);T.currentNode=i;let o=T.nextNode(),r=0,s=0,a=n[0];for(;void 0!==a;){if(r===a.index){let t;2===a.type?t=new R(o,o.nextSibling,this,e):1===a.type?t=new a.ctor(o,a.name,a.strings,this,e):6===a.type&&(t=new W(o,this,e)),this._$parts.push(t),a=n[++s]}r!==a?.index&&(o=T.nextNode(),r++)}return T.currentNode=b,i}_update(e){let t=0;for(const i of this._$parts)void 0!==i&&(n&&n({kind:'set part',part:i,value:e[t],valueIndex:t,values:e,templateInstance:this}),void 0!==i.strings?(i._$setValue(e,i,t),t+=i.strings.length-2):i._$setValue(e[t])),t++}}class R{get _$isConnected(){return this._$parent?._$isConnected??this.__isConnected}constructor(e,t,n,i){this.type=2,this._$committedValue=P,this._$disconnectableChildren=void 0,this._$startNode=e,this._$endNode=t,this._$parent=n,this.options=i,this.__isConnected=i?.isConnected??!0,this._textSanitizer=void 0}get parentNode(){let e=r(this._$startNode).parentNode;const t=this._$parent;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$startNode}get endNode(){return this._$endNode}_$setValue(e,t=this){if(null===this.parentNode)throw new Error('This `ChildPart` has no `parentNode` and therefore cannot accept a value. This likely means the element containing the part was manipulated in an unsupported way outside of Lit\'s control such that the part\'s marker nodes were ejected from DOM. For example, setting the element\'s `innerHTML` or `textContent` can do this.');if(e=L(this,e,t),y(e))e===P||null==e||''===e?(this._$committedValue!==P&&(n&&n({kind:'commit nothing to child',start:this._$startNode,end:this._$endNode,parent:this._$parent,options:this.options}),this._$clear()),this._$committedValue=P):e!==this._$committedValue&&e!==j&&this._commitText(e);else if(void 0!==e._$litType$)this._commitTemplateResult(e);else if(void 0!==e.nodeType){if(this.options?.host===e)return this._commitText('[probable mistake: rendered a template\'s host in itself (commonly caused by writing ${this} in a template]'),void console.warn('Attempted to render the template host',e,'inside itself. This is almost always a mistake, and in dev mode ','we render some warning text. In production however, we\'ll ','render it, which will usually result in an error, and sometimes ','in the element disappearing from the DOM.');this._commitNode(e)}else(e=>_(e)||'function'==typeof e?.[Symbol.iterator])(e)?this._commitIterable(e):this._commitText(e)}_insert(e){return r(r(this._$startNode).parentNode).insertBefore(e,this._$endNode)}_commitNode(e){if(this._$committedValue!==e){if(this._$clear(),I!==c){const e=this._$startNode.parentNode?.nodeName;if('STYLE'===e||'SCRIPT'===e){let t='Forbidden';throw t='STYLE'===e?'Lit does not support binding inside style nodes. This is a security risk, as style injection attacks can exfiltrate data and spoof UIs. Consider instead using css`...` literals to compose styles, and do dynamic styling with css custom properties, ::parts, s, and by mutating the DOM rather than stylesheets.':'Lit does not support binding inside script nodes. This is a security risk, as it could allow arbitrary code execution.',new Error(t)}}n&&n({kind:'commit node',start:this._$startNode,parent:this._$parent,value:e,options:this.options}),this._$committedValue=this._insert(e)}}_commitText(e){if(this._$committedValue!==P&&y(this._$committedValue)){const t=r(this._$startNode).nextSibling;void 0===this._textSanitizer&&(this._textSanitizer=p(t,'data','property')),e=this._textSanitizer(e),n&&n({kind:'commit text',node:t,value:e,options:this.options}),t.data=e}else{const t=b.createTextNode('');this._commitNode(t),void 0===this._textSanitizer&&(this._textSanitizer=p(t,'data','property')),e=this._textSanitizer(e),n&&n({kind:'commit text',node:t,value:e,options:this.options}),t.data=e}this._$committedValue=e}_commitTemplateResult(e){const{values:t,_$litType$:i}=e,o='number'==typeof i?this._$getTemplate(e):(void 0===i.el&&(i.el=D.createElement(M(i.h,i.h[0]),this.options)),i);if(this._$committedValue?._$template===o)n&&n({kind:'template updating',template:o,instance:this._$committedValue,parts:this._$committedValue._$parts,options:this.options,values:t}),this._$committedValue._update(t);else{const e=new U(o,this),i=e._clone(this.options);n&&n({kind:'template instantiated',template:o,instance:e,parts:e._$parts,options:this.options,fragment:i,values:t}),e._update(t),n&&n({kind:'template instantiated and updated',template:o,instance:e,parts:e._$parts,options:this.options,fragment:i,values:t}),this._commitNode(i),this._$committedValue=e}}_$getTemplate(e){let t=N.get(e.strings);return void 0===t&&N.set(e.strings,t=new D(e)),t}_commitIterable(e){_(this._$committedValue)||(this._$committedValue=[],this._$clear());const t=this._$committedValue;let n,i=0;for(const o of e)i===t.length?t.push(n=new R(this._insert(v()),this._insert(v()),this,this.options)):n=t[i],n._$setValue(o),i++;i2||''!==n[0]||''!==n[1]?(this._$committedValue=new Array(n.length-1).fill(new String),this.strings=n):this._$committedValue=P,this._sanitizer=void 0}_$setValue(e,t=this,n,i){const o=this.strings;let r=!1;if(void 0===o)e=L(this,e,t,0),r=!y(e)||e!==this._$committedValue&&e!==j,r&&(this._$committedValue=e);else{const i=e;let s,a;for(e=o[0],s=0;s\` has a \`@${t}=...\` listener with invalid content. Event listeners in templates must have exactly one expression and no surrounding text.`)}_$setValue(e,t=this){if((e=L(this,e,t,0)??P)===j)return;const i=this._$committedValue,o=e===P&&i!==P||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,r=e!==P&&(i===P||o);n&&n({kind:'commit event listener',element:this.element,name:this.name,value:e,options:this.options,removeListener:o,addListener:r,oldListener:i}),o&&this.element.removeEventListener(this.name,this,i),r&&this.element.addEventListener(this.name,this,e),this._$committedValue=e}handleEvent(e){'function'==typeof this._$committedValue?this._$committedValue.call(this.options?.host??this.element,e):this._$committedValue.handleEvent(e)}}class W{constructor(e,t,n){this.element=e,this.type=6,this._$disconnectableChildren=void 0,this._$parent=t,this.options=n}get _$isConnected(){return this._$parent._$isConnected}_$setValue(e){n&&n({kind:'commit to element binding',element:this.element,value:e,options:this.options}),L(this,e)}}const K=t.litHtmlPolyfillSupportDevMode;K?.(D,R),(t.litHtmlVersions??=[]).push('3.3.1'),t.litHtmlVersions.length>1&&queueMicrotask(()=>{i('multiple-versions','Multiple versions of Lit loaded. Loading multiple versions is not recommended.')});const Y=(e,t,i)=>{if(null==t)throw new TypeError(`The container to render into may not be ${t}`);const r=o++,s=i?.renderBefore??t;let a=s._$litPart$;if(n&&n({kind:'begin render',id:r,value:e,container:t,options:i,part:a}),void 0===a){const e=i?.renderBefore??null;s._$litPart$=a=new R(t.insertBefore(v(),e),e,void 0,i??{})}return a._$setValue(e),n&&n({kind:'end render',id:r,value:e,container:t,options:i,part:a}),a};let B;Y.setSanitizer=d,Y.createSanitizer=p,Y._testOnlyClearSanitizerFactoryDoNotCallOrElse=u;let H=0;function J(e){B=e}function G(){B=null,H=0}const Z=Symbol('haunted.phase'),Q=Symbol('haunted.hook'),X=Symbol('haunted.update'),ee=Symbol('haunted.commit'),te=Symbol('haunted.effects'),ne=Symbol('haunted.layoutEffects'),ie='haunted.context';let oe=class{update;host;virtual;[Q];[te];[ne];constructor(e,t){this.update=e,this.host=t,this[Q]=new Map,this[te]=[],this[ne]=[]}run(e){J(this);let t=e();return G(),t}_runEffects(e){let t=this[e];J(this);for(let e of t)e.call(this);G()}runEffects(){this._runEffects(te)}runLayoutEffects(){this._runEffects(ne)}teardown(){this[Q].forEach(e=>{'function'==typeof e.teardown&&e.teardown()})}};const re=Promise.resolve().then.bind(Promise.resolve());function se(){let e,t=[];function n(){e=null;let n=t;t=[];for(var i=0,o=n.length;i{t.push(i),null==e&&(e=re(n))}}const ae=se(),le=se();class ce{renderer;host;state;[Z];_updateQueued;constructor(e,t){this.renderer=e,this.host=t,this.state=new oe(this.update.bind(this),t),this[Z]=null,this._updateQueued=!1}update(){this._updateQueued||(ae(()=>{let e=this.handlePhase(X);le(()=>{this.handlePhase(ee,e),le(()=>{this.handlePhase(te)})}),this._updateQueued=!1}),this._updateQueued=!0)}handlePhase(e,t){switch(this[Z]=e,e){case ee:return this.commit(t),void this.runEffects(ne);case X:return this.render();case te:return this.runEffects(te)}}render(){return this.state.run(()=>this.renderer.call(this.host,this.host))}runEffects(e){this.state._runEffects(e)}teardown(){this.state.teardown()}}function de(e){class t extends ce{frag;constructor(e,t,n){super(e,n||t),this.frag=t}commit(t){e(t,this.frag)}}return function(e,n,i){const o=(i||n||{}).baseElement||HTMLElement,{observedAttributes:r=[],useShadowDOM:s=!0,shadowRootInit:a={}}=i||n||{};class l extends o{_scheduler;static get observedAttributes(){return e.observedAttributes||r||[]}constructor(){super(),!1===s?this._scheduler=new t(e,this):(this.attachShadow({mode:'open',...a}),this._scheduler=new t(e,this.shadowRoot,this))}connectedCallback(){this._scheduler.update()}disconnectedCallback(){this._scheduler.teardown()}attributeChangedCallback(e,t,n){if(t===n)return;let i=''===n||n;Reflect.set(this,((e='')=>e.replace(/-+([a-z])?/g,(e,t)=>t?t.toUpperCase():''))(e),i)}}const c=new Proxy(o.prototype,{getPrototypeOf:e=>e,set(e,t,n,i){let o;return t in e?(o=Object.getOwnPropertyDescriptor(e,t),o&&o.set?(o.set.call(i,n),!0):(Reflect.set(e,t,n,i),!0)):(o='symbol'==typeof t||'_'===t[0]?{enumerable:!0,configurable:!0,writable:!0,value:n}:function(e){let t=e,n=!1;return Object.freeze({enumerable:!0,configurable:!0,get:()=>t,set(e){n&&t===e||(n=!0,t=e,this._scheduler&&this._scheduler.update())}})}(n),Object.defineProperty(i,t,o),o.set&&o.set.call(i,n),!0)}});return Object.setPrototypeOf(l.prototype,c),l}}class ue{id;state;constructor(e,t){this.id=e,this.state=t}}function pe(e,...t){let n=H++,i=B[Q],o=i.get(n);return o||(o=new e(n,B,...t),i.set(n,o)),o.update(...t)}function he(e){return pe.bind(null,e)}function me(e){return he(class extends ue{callback;lastValues;values;_teardown;constructor(t,n,i,o){super(t,n),e(n,this)}update(e,t){this.callback=e,this.values=t}call(){const e=!this.values||this.hasChanged();this.lastValues=this.values,e&&this.run()}run(){this.teardown(),this._teardown=this.callback.call(this.state)}teardown(){'function'==typeof this._teardown&&this._teardown()}hasChanged(){return!this.lastValues||this.values.some((e,t)=>this.lastValues[t]!==e)}})}function fe(e,t){e[te].push(t)}const ge=me(fe),be=he(class extends ue{Context;value;_ranEffect;_unsubscribe;constructor(e,t,n){super(e,t),this._updater=this._updater.bind(this),this._ranEffect=!1,this._unsubscribe=null,fe(t,this)}update(e){if(this.state.virtual)throw new Error('can\'t be used with virtual components');return this.Context!==e&&(this._subscribe(e),this.Context=e),this.value}call(){this._ranEffect||(this._ranEffect=!0,this._unsubscribe&&this._unsubscribe(),this._subscribe(this.Context),this.state.update())}_updater(e){this.value=e,this.state.update()}_subscribe(e){const t={Context:e,callback:this._updater};this.state.host.dispatchEvent(new CustomEvent(ie,{detail:t,bubbles:!0,cancelable:!0,composed:!0}));const{unsubscribe:n=null,value:i}=t;this.value=n?i:e.defaultValue,this._unsubscribe=n}teardown(){this._unsubscribe&&this._unsubscribe()}});const ve=he(class extends ue{value;values;constructor(e,t,n,i){super(e,t),this.value=n(),this.values=i}update(e,t){return this.hasChanged(t)&&(this.values=t,this.value=e()),this.value}hasChanged(e=[]){return e.some((e,t)=>this.values[t]!==e)}}),ye=(e,t)=>ve(()=>e,t);me(function(e,t){e[ne].push(t)});const _e=he(class extends ue{args;constructor(e,t,n){if(super(e,t),this.updater=this.updater.bind(this),'function'==typeof n){n=n()}this.makeArgs(n)}update(){return this.args}updater(e){const[t]=this.args;if('function'==typeof e){e=e(t)}Object.is(t,e)||(this.makeArgs(e),this.state.update())}makeArgs(e){this.args=Object.freeze([e,this.updater])}}); /** * @license * Portions Copyright 2021 Google LLC @@ -20,7 +20,7 @@ const $e=2;class we{constructor(e){}get _$isConnected(){return this._$parent._$i * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const xe=globalThis,ke=xe.ShadowRoot&&(void 0===xe.ShadyCSS||xe.ShadyCSS.nativeShadow)&&'adoptedStyleSheets'in Document.prototype&&'replace'in CSSStyleSheet.prototype,Se=Symbol(),Ce=new WeakMap;class Ae{constructor(e,t,n){if(this._$cssResult$=!0,n!==Se)throw new Error('CSSResult is not constructable. Use `unsafeCSS` or `css` instead.');this.cssText=e,this._strings=t}get styleSheet(){let e=this._styleSheet;const t=this._strings;if(ke&&void 0===e){const n=void 0!==t&&1===t.length;n&&(e=Ce.get(t)),void 0===e&&((this._styleSheet=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Ce.set(t,e))}return e}toString(){return this.cssText}}const Ee=e=>{let t='';for(const n of e.cssRules)t+=n.cssText;return new Ae('string'==typeof(n=t)?n:String(n),void 0,Se);var n},Oe=ke?e=>e:e=>e instanceof CSSStyleSheet?Ee(e):e,{is:je,defineProperty:Pe,getOwnPropertyDescriptor:Te,getOwnPropertyNames:Ne,getOwnPropertySymbols:Ie,getPrototypeOf:Me}=Object,De=globalThis;let Le;const Ue=De.trustedTypes,Re=Ue?Ue.emptyScript:'',Ve=De.reactiveElementPolyfillSupportDevMode;De.litIssuedWarnings??=new Set,Le=(e,t)=>{t+=` See https://lit.dev/msg/${e} for more information.`,De.litIssuedWarnings.has(t)||De.litIssuedWarnings.has(e)||(console.warn(t),De.litIssuedWarnings.add(t))},queueMicrotask(()=>{Le('dev-mode','Lit is in dev mode. Not recommended for production!'),De.ShadyDOM?.inUse&&void 0===Ve&&Le('polyfill-support-missing','Shadow DOM is being polyfilled via `ShadyDOM` but the `polyfill-support` module has not been loaded.')});const ze=(e,t)=>e,Fe={toAttribute(e,t){switch(t){case Boolean:e=e?Re:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=null!==e;break;case Number:n=null===e?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch(e){n=null}}return n}},qe=(e,t)=>!je(e,t),We={attribute:!0,type:String,converter:Fe,reflect:!1,useDefault:!1,hasChanged:qe};Symbol.metadata??=Symbol('metadata'),De.litPropertyMetadata??=new WeakMap;class Ke extends HTMLElement{static addInitializer(e){this.__prepare(),(this._initializers??=[]).push(e)}static get observedAttributes(){return this.finalize(),this.__attributeToPropertyMap&&[...this.__attributeToPropertyMap.keys()]}static createProperty(e,t=We){if(t.state&&(t.attribute=!1),this.__prepare(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const n=Symbol.for(`${String(e)} (@property() cache)`),i=this.getPropertyDescriptor(e,n,t);void 0!==i&&Pe(this.prototype,e,i)}}static getPropertyDescriptor(e,t,n){const{get:i,set:o}=Te(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};if(null==i){if('value'in(Te(this.prototype,e)??{}))throw new Error(`Field ${JSON.stringify(String(e))} on ${this.name} was declared as a reactive property but it's actually declared as a value on the prototype. Usually this is due to using @property or @state on a method.`);Le('reactive-property-without-getter',`Field ${JSON.stringify(String(e))} on ${this.name} was declared as a reactive property but it does not have a getter. This will be an error in a future version of Lit.`)}return{get:i,set(t){const r=i?.call(this);o?.call(this,t),this.requestUpdate(e,r,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??We}static __prepare(){if(this.hasOwnProperty(ze('elementProperties')))return;const e=Me(this);e.finalize(),void 0!==e._initializers&&(this._initializers=[...e._initializers]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(ze('finalized')))return;if(this.finalized=!0,this.__prepare(),this.hasOwnProperty(ze('properties'))){const e=this.properties,t=[...Ne(e),...Ie(e)];for(const n of t)this.createProperty(n,e[n])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,n]of t)this.elementProperties.set(e,n)}this.__attributeToPropertyMap=new Map;for(const[e,t]of this.elementProperties){const n=this.__attributeNameForProperty(e,t);void 0!==n&&this.__attributeToPropertyMap.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles),this.hasOwnProperty('createProperty')&&Le('no-override-create-property','Overriding ReactiveElement.createProperty() is deprecated. The override will not be called with standard decorators'),this.hasOwnProperty('getPropertyDescriptor')&&Le('no-override-get-property-descriptor','Overriding ReactiveElement.getPropertyDescriptor() is deprecated. The override will not be called with standard decorators')}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const e of n)t.unshift(Oe(e))}else void 0!==e&&t.push(Oe(e));return t}static __attributeNameForProperty(e,t){const n=t.attribute;return!1===n?void 0:'string'==typeof n?n:'string'==typeof e?e.toLowerCase():void 0}constructor(){super(),this.__instanceProperties=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this.__reflectingProperty=null,this.__initialize()}__initialize(){this.__updatePromise=new Promise(e=>this.enableUpdating=e),this._$changedProperties=new Map,this.__saveInstanceProperties(),this.requestUpdate(),this.constructor._initializers?.forEach(e=>e(this))}addController(e){(this.__controllers??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this.__controllers?.delete(e)}__saveInstanceProperties(){const e=new Map,t=this.constructor.elementProperties;for(const n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this.__instanceProperties=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((e,t)=>{if(ke)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const n of t){const t=document.createElement('style'),i=xe.litNonce;void 0!==i&&t.setAttribute('nonce',i),t.textContent=n.cssText,e.appendChild(t)}})(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this.__controllers?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this.__controllers?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,n){this._$attributeToProperty(e,n)}__propertyToAttribute(e,t){const n=this.constructor.elementProperties.get(e),i=this.constructor.__attributeNameForProperty(e,n);if(void 0!==i&&!0===n.reflect){const o=(void 0!==n.converter?.toAttribute?n.converter:Fe).toAttribute(t,n.type);this.constructor.enabledWarnings.includes('migration')&&void 0===o&&Le('undefined-attribute-value',`The attribute value for the ${e} property is undefined on element ${this.localName}. The attribute will be removed, but in the previous version of \`ReactiveElement\`, the attribute would not have changed.`),this.__reflectingProperty=e,null==o?this.removeAttribute(i):this.setAttribute(i,o),this.__reflectingProperty=null}}_$attributeToProperty(e,t){const n=this.constructor,i=n.__attributeToPropertyMap.get(e);if(void 0!==i&&this.__reflectingProperty!==i){const e=n.getPropertyOptions(i),o='function'==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:Fe;this.__reflectingProperty=i;const r=o.fromAttribute(t,e.type);this[i]=r??this.__defaultValues?.get(i)??r,this.__reflectingProperty=null}}requestUpdate(e,t,n){if(void 0!==e){e instanceof Event&&Le('','The requestUpdate() method was called with an Event as the property name. This is probably a mistake caused by binding this.requestUpdate as an event listener. Instead bind a function that will call it with no arguments: () => this.requestUpdate()');const i=this.constructor,o=this[e];n??=i.getPropertyOptions(e);if(!((n.hasChanged??qe)(o,t)||n.useDefault&&n.reflect&&o===this.__defaultValues?.get(e)&&!this.hasAttribute(i.__attributeNameForProperty(e,n))))return;this._$changeProperty(e,t,n)}!1===this.isUpdatePending&&(this.__updatePromise=this.__enqueueUpdate())}_$changeProperty(e,t,{useDefault:n,reflect:i,wrapped:o},r){n&&!(this.__defaultValues??=new Map).has(e)&&(this.__defaultValues.set(e,r??t??this[e]),!0!==o||void 0!==r)||(this._$changedProperties.has(e)||(this.hasUpdated||n||(t=void 0),this._$changedProperties.set(e,t)),!0===i&&this.__reflectingProperty!==e&&(this.__reflectingProperties??=new Set).add(e))}async __enqueueUpdate(){this.isUpdatePending=!0;try{await this.__updatePromise}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){const e=this.performUpdate();return this.constructor.enabledWarnings.includes('async-perform-update')&&'function'==typeof e?.then&&Le('async-perform-update',`Element ${this.localName} returned a Promise from performUpdate(). This behavior is deprecated and will be removed in a future version of ReactiveElement.`),e}performUpdate(){if(!this.isUpdatePending)return;var e;if(e={kind:'update'},De.emitLitDebugLogEvents&&De.dispatchEvent(new CustomEvent('lit-debug',{detail:e})),!this.hasUpdated){this.renderRoot??=this.createRenderRoot();{const e=[...this.constructor.elementProperties.keys()].filter(e=>this.hasOwnProperty(e)&&e in Me(this));if(e.length)throw new Error(`The following properties on element ${this.localName} will not trigger updates as expected because they are set using class fields: ${e.join(', ')}. Native class fields and some compiled output will overwrite accessors used for detecting changes. See https://lit.dev/msg/class-field-shadowing for more information.`)}if(this.__instanceProperties){for(const[e,t]of this.__instanceProperties)this[e]=t;this.__instanceProperties=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,n]of e){const{wrapped:e}=n,i=this[t];!0!==e||this._$changedProperties.has(t)||void 0===i||this._$changeProperty(t,void 0,n,i)}}let t=!1;const n=this._$changedProperties;try{t=this.shouldUpdate(n),t?(this.willUpdate(n),this.__controllers?.forEach(e=>e.hostUpdate?.()),this.update(n)):this.__markUpdated()}catch(e){throw t=!1,this.__markUpdated(),e}t&&this._$didUpdate(n)}willUpdate(e){}_$didUpdate(e){this.__controllers?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e),this.isUpdatePending&&this.constructor.enabledWarnings.includes('change-in-update')&&Le('change-in-update',`Element ${this.localName} scheduled an update (generally because a property was set) after an update completed, causing a new update to be scheduled. This is inefficient and should be avoided unless the next update can only be scheduled as a side effect of the previous update.`)}__markUpdated(){this._$changedProperties=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this.__updatePromise}shouldUpdate(e){return!0}update(e){this.__reflectingProperties&&=this.__reflectingProperties.forEach(e=>this.__propertyToAttribute(e,this[e])),this.__markUpdated()}updated(e){}firstUpdated(e){}}Ke.elementStyles=[],Ke.shadowRootOptions={mode:'open'},Ke[ze('elementProperties')]=new Map,Ke[ze('finalized')]=new Map,Ve?.({ReactiveElement:Ke});{Ke.enabledWarnings=['change-in-update','async-perform-update'];const e=e=>{e.hasOwnProperty(ze('enabledWarnings'))||(e.enabledWarnings=e.enabledWarnings.slice())};Ke.enableWarning=function(t){e(this),this.enabledWarnings.includes(t)||this.enabledWarnings.push(t)},Ke.disableWarning=function(t){e(this);const n=this.enabledWarnings.indexOf(t);n>=0&&this.enabledWarnings.splice(n,1)}}(De.reactiveElementVersions??=[]).push('2.1.1'),De.reactiveElementVersions.length>1&&queueMicrotask(()=>{Le('multiple-versions','Multiple versions of Lit loaded. Loading multiple versions is not recommended.')}) + */const xe=globalThis,ke=xe.ShadowRoot&&(void 0===xe.ShadyCSS||xe.ShadyCSS.nativeShadow)&&'adoptedStyleSheets'in Document.prototype&&'replace'in CSSStyleSheet.prototype,Se=Symbol(),Ce=new WeakMap;class Ae{constructor(e,t,n){if(this._$cssResult$=!0,n!==Se)throw new Error('CSSResult is not constructable. Use `unsafeCSS` or `css` instead.');this.cssText=e,this._strings=t}get styleSheet(){let e=this._styleSheet;const t=this._strings;if(ke&&void 0===e){const n=void 0!==t&&1===t.length;n&&(e=Ce.get(t)),void 0===e&&((this._styleSheet=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Ce.set(t,e))}return e}toString(){return this.cssText}}const Ee=e=>{let t='';for(const n of e.cssRules)t+=n.cssText;return new Ae('string'==typeof(n=t)?n:String(n),void 0,Se);var n},Oe=ke?e=>e:e=>e instanceof CSSStyleSheet?Ee(e):e,{is:je,defineProperty:Pe,getOwnPropertyDescriptor:Ne,getOwnPropertyNames:Te,getOwnPropertySymbols:Ie,getPrototypeOf:Me}=Object,De=globalThis;let Le;const Ue=De.trustedTypes,Re=Ue?Ue.emptyScript:'',Ve=De.reactiveElementPolyfillSupportDevMode;De.litIssuedWarnings??=new Set,Le=(e,t)=>{t+=` See https://lit.dev/msg/${e} for more information.`,De.litIssuedWarnings.has(t)||De.litIssuedWarnings.has(e)||(console.warn(t),De.litIssuedWarnings.add(t))},queueMicrotask(()=>{Le('dev-mode','Lit is in dev mode. Not recommended for production!'),De.ShadyDOM?.inUse&&void 0===Ve&&Le('polyfill-support-missing','Shadow DOM is being polyfilled via `ShadyDOM` but the `polyfill-support` module has not been loaded.')});const ze=(e,t)=>e,Fe={toAttribute(e,t){switch(t){case Boolean:e=e?Re:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=null!==e;break;case Number:n=null===e?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch(e){n=null}}return n}},qe=(e,t)=>!je(e,t),We={attribute:!0,type:String,converter:Fe,reflect:!1,useDefault:!1,hasChanged:qe};Symbol.metadata??=Symbol('metadata'),De.litPropertyMetadata??=new WeakMap;class Ke extends HTMLElement{static addInitializer(e){this.__prepare(),(this._initializers??=[]).push(e)}static get observedAttributes(){return this.finalize(),this.__attributeToPropertyMap&&[...this.__attributeToPropertyMap.keys()]}static createProperty(e,t=We){if(t.state&&(t.attribute=!1),this.__prepare(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const n=Symbol.for(`${String(e)} (@property() cache)`),i=this.getPropertyDescriptor(e,n,t);void 0!==i&&Pe(this.prototype,e,i)}}static getPropertyDescriptor(e,t,n){const{get:i,set:o}=Ne(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};if(null==i){if('value'in(Ne(this.prototype,e)??{}))throw new Error(`Field ${JSON.stringify(String(e))} on ${this.name} was declared as a reactive property but it's actually declared as a value on the prototype. Usually this is due to using @property or @state on a method.`);Le('reactive-property-without-getter',`Field ${JSON.stringify(String(e))} on ${this.name} was declared as a reactive property but it does not have a getter. This will be an error in a future version of Lit.`)}return{get:i,set(t){const r=i?.call(this);o?.call(this,t),this.requestUpdate(e,r,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??We}static __prepare(){if(this.hasOwnProperty(ze('elementProperties')))return;const e=Me(this);e.finalize(),void 0!==e._initializers&&(this._initializers=[...e._initializers]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(ze('finalized')))return;if(this.finalized=!0,this.__prepare(),this.hasOwnProperty(ze('properties'))){const e=this.properties,t=[...Te(e),...Ie(e)];for(const n of t)this.createProperty(n,e[n])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,n]of t)this.elementProperties.set(e,n)}this.__attributeToPropertyMap=new Map;for(const[e,t]of this.elementProperties){const n=this.__attributeNameForProperty(e,t);void 0!==n&&this.__attributeToPropertyMap.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles),this.hasOwnProperty('createProperty')&&Le('no-override-create-property','Overriding ReactiveElement.createProperty() is deprecated. The override will not be called with standard decorators'),this.hasOwnProperty('getPropertyDescriptor')&&Le('no-override-get-property-descriptor','Overriding ReactiveElement.getPropertyDescriptor() is deprecated. The override will not be called with standard decorators')}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const e of n)t.unshift(Oe(e))}else void 0!==e&&t.push(Oe(e));return t}static __attributeNameForProperty(e,t){const n=t.attribute;return!1===n?void 0:'string'==typeof n?n:'string'==typeof e?e.toLowerCase():void 0}constructor(){super(),this.__instanceProperties=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this.__reflectingProperty=null,this.__initialize()}__initialize(){this.__updatePromise=new Promise(e=>this.enableUpdating=e),this._$changedProperties=new Map,this.__saveInstanceProperties(),this.requestUpdate(),this.constructor._initializers?.forEach(e=>e(this))}addController(e){(this.__controllers??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this.__controllers?.delete(e)}__saveInstanceProperties(){const e=new Map,t=this.constructor.elementProperties;for(const n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this.__instanceProperties=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((e,t)=>{if(ke)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const n of t){const t=document.createElement('style'),i=xe.litNonce;void 0!==i&&t.setAttribute('nonce',i),t.textContent=n.cssText,e.appendChild(t)}})(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this.__controllers?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this.__controllers?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,n){this._$attributeToProperty(e,n)}__propertyToAttribute(e,t){const n=this.constructor.elementProperties.get(e),i=this.constructor.__attributeNameForProperty(e,n);if(void 0!==i&&!0===n.reflect){const o=(void 0!==n.converter?.toAttribute?n.converter:Fe).toAttribute(t,n.type);this.constructor.enabledWarnings.includes('migration')&&void 0===o&&Le('undefined-attribute-value',`The attribute value for the ${e} property is undefined on element ${this.localName}. The attribute will be removed, but in the previous version of \`ReactiveElement\`, the attribute would not have changed.`),this.__reflectingProperty=e,null==o?this.removeAttribute(i):this.setAttribute(i,o),this.__reflectingProperty=null}}_$attributeToProperty(e,t){const n=this.constructor,i=n.__attributeToPropertyMap.get(e);if(void 0!==i&&this.__reflectingProperty!==i){const e=n.getPropertyOptions(i),o='function'==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:Fe;this.__reflectingProperty=i;const r=o.fromAttribute(t,e.type);this[i]=r??this.__defaultValues?.get(i)??r,this.__reflectingProperty=null}}requestUpdate(e,t,n){if(void 0!==e){e instanceof Event&&Le('','The requestUpdate() method was called with an Event as the property name. This is probably a mistake caused by binding this.requestUpdate as an event listener. Instead bind a function that will call it with no arguments: () => this.requestUpdate()');const i=this.constructor,o=this[e];n??=i.getPropertyOptions(e);if(!((n.hasChanged??qe)(o,t)||n.useDefault&&n.reflect&&o===this.__defaultValues?.get(e)&&!this.hasAttribute(i.__attributeNameForProperty(e,n))))return;this._$changeProperty(e,t,n)}!1===this.isUpdatePending&&(this.__updatePromise=this.__enqueueUpdate())}_$changeProperty(e,t,{useDefault:n,reflect:i,wrapped:o},r){n&&!(this.__defaultValues??=new Map).has(e)&&(this.__defaultValues.set(e,r??t??this[e]),!0!==o||void 0!==r)||(this._$changedProperties.has(e)||(this.hasUpdated||n||(t=void 0),this._$changedProperties.set(e,t)),!0===i&&this.__reflectingProperty!==e&&(this.__reflectingProperties??=new Set).add(e))}async __enqueueUpdate(){this.isUpdatePending=!0;try{await this.__updatePromise}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){const e=this.performUpdate();return this.constructor.enabledWarnings.includes('async-perform-update')&&'function'==typeof e?.then&&Le('async-perform-update',`Element ${this.localName} returned a Promise from performUpdate(). This behavior is deprecated and will be removed in a future version of ReactiveElement.`),e}performUpdate(){if(!this.isUpdatePending)return;var e;if(e={kind:'update'},De.emitLitDebugLogEvents&&De.dispatchEvent(new CustomEvent('lit-debug',{detail:e})),!this.hasUpdated){this.renderRoot??=this.createRenderRoot();{const e=[...this.constructor.elementProperties.keys()].filter(e=>this.hasOwnProperty(e)&&e in Me(this));if(e.length)throw new Error(`The following properties on element ${this.localName} will not trigger updates as expected because they are set using class fields: ${e.join(', ')}. Native class fields and some compiled output will overwrite accessors used for detecting changes. See https://lit.dev/msg/class-field-shadowing for more information.`)}if(this.__instanceProperties){for(const[e,t]of this.__instanceProperties)this[e]=t;this.__instanceProperties=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,n]of e){const{wrapped:e}=n,i=this[t];!0!==e||this._$changedProperties.has(t)||void 0===i||this._$changeProperty(t,void 0,n,i)}}let t=!1;const n=this._$changedProperties;try{t=this.shouldUpdate(n),t?(this.willUpdate(n),this.__controllers?.forEach(e=>e.hostUpdate?.()),this.update(n)):this.__markUpdated()}catch(e){throw t=!1,this.__markUpdated(),e}t&&this._$didUpdate(n)}willUpdate(e){}_$didUpdate(e){this.__controllers?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e),this.isUpdatePending&&this.constructor.enabledWarnings.includes('change-in-update')&&Le('change-in-update',`Element ${this.localName} scheduled an update (generally because a property was set) after an update completed, causing a new update to be scheduled. This is inefficient and should be avoided unless the next update can only be scheduled as a side effect of the previous update.`)}__markUpdated(){this._$changedProperties=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this.__updatePromise}shouldUpdate(e){return!0}update(e){this.__reflectingProperties&&=this.__reflectingProperties.forEach(e=>this.__propertyToAttribute(e,this[e])),this.__markUpdated()}updated(e){}firstUpdated(e){}}Ke.elementStyles=[],Ke.shadowRootOptions={mode:'open'},Ke[ze('elementProperties')]=new Map,Ke[ze('finalized')]=new Map,Ve?.({ReactiveElement:Ke});{Ke.enabledWarnings=['change-in-update','async-perform-update'];const e=e=>{e.hasOwnProperty(ze('enabledWarnings'))||(e.enabledWarnings=e.enabledWarnings.slice())};Ke.enableWarning=function(t){e(this),this.enabledWarnings.includes(t)||this.enabledWarnings.push(t)},Ke.disableWarning=function(t){e(this);const n=this.enabledWarnings.indexOf(t);n>=0&&this.enabledWarnings.splice(n,1)}}(De.reactiveElementVersions??=[]).push('2.1.1'),De.reactiveElementVersions.length>1&&queueMicrotask(()=>{Le('multiple-versions','Multiple versions of Lit loaded. Loading multiple versions is not recommended.')}) /** * @license * Copyright 2017 Google LLC @@ -626,121 +626,87 @@ function ct(e){return null==e}customElements.define('civ-autocomplete-select',ot .footer=${b} .modalProps=${i} > - `},{useShadowDOM:!1})),customElements.define('person-card',ot(function({person:e,onSelect:t,onChange:n,onDelete:i,onReset:o}){const r=(t,i,o)=>{const r=[...e[t]||[]];r[i]=o,n&&n(t,r)},s=t=>{const i=[...e[t]||[]];i.push(''),n&&n(t,i)},a=(t,i)=>{const o=[...e[t]||[]];o.splice(i,1),n&&n(t,o)},l=(e,t)=>{n&&n(e,t)},c=e._changes?.includes('name'),d=e._changes?.includes('office'),u=e._changes?.includes('start_date'),p=e._changes?.includes('end_date'),h=e._changes?.includes('phones'),m=e._changes?.includes('emails'),f=e._changes?.includes('other_names'),g=e._changes?.includes('urls'),b=e._changes?.includes('source_urls'),v=e._changes?.includes('image'),y=e.image||e.cdn_image||null;return O` - -
toggleSelect(e._tempKey)} - > -
- {e.stopPropagation(),t&&t(e.target.checked)}} - aria-label="Select ${e.name}" - ?disabled=${e._deleted} - /> -
- - + `},{useShadowDOM:!1})),customElements.define('person-card',ot(function({person:e,onSelect:t,onChange:n,onDelete:i,onReset:o}){const[r,s]=_e(!1),a=(t,i,o)=>{const r=[...e[t]||[]];r[i]=o,n&&n(t,r)},l=t=>{const i=[...e[t]||[]];i.push(''),n&&n(t,i)},c=(t,i)=>{const o=[...e[t]||[]];o.splice(i,1),n&&n(t,o)},d=(e,t)=>{n&&n(e,t)},u=e._changes?.includes('name'),p=e._changes?.includes('office'),h=e._changes?.includes('start_date'),m=e._changes?.includes('end_date'),f=e._changes?.includes('phones'),g=e._changes?.includes('emails'),b=e._changes?.includes('other_names'),v=e._changes?.includes('urls'),y=e._changes?.includes('source_urls'),_=e._changes?.includes('image'),$=e.image||e.cdn_image||null,w=O` + +
+
+ Name: + ${e.name||'N/A'} +
+
+ Office: + ${e.office?.name||'N/A'} +
+
+ Office Division: + ${e.office?.division_ocdid}
-
- -
-
- ${y?O`Avatar of ${e.name}`:O`${e.name?e.name.charAt(0).toUpperCase():'?'}`} -
-
+ ${e.start_date?O` +
+ Start Date: + ${e.start_date||'N/A'} +
+ `:''} + ${e.end_date?O` +
+ End Date: + ${e.end_date||'N/A'} +
+ `:''} + ${e.phones&&e.phones.length>0?O` +
+ Phone Numbers: + ${(e.phones||[]).join(', ')||'N/A'} +
+ `:''} + ${e.emails&&e.emails.length>0?O` +
+ Email Addresses: + ${(e.emails||[]).join(', ')||'N/A'} +
+ `:''} + ${e.urls&&e.urls.length>0?O` +
+ Links: + ${(e.urls||[]).join(', ')||'N/A'} +
+ `:''} +
+ Source URLs: + ${(e.source_urls||[]).join(', ')||'N/A'} +
+ ${e.other_names&&e.other_names.length>0?O` +
+ Other Names: + ${(e.other_names||[]).join(', ')||'N/A'} +
+ `:''} + ${e.image?O` +
+ Image: + + View + +
+ `:''} +
+ Last Updated: + ${e.updated_at||'N/A'} +
+ + `,x=O`
e.stopPropagation()} .value=${e.name||''} - @input=${e=>l('name',e.target.value)} + @input=${e=>d('name',e.target.value)} placeholder="Full Name" style="flex: 1;" /> @@ -751,7 +717,7 @@ function ct(e){return null==e}customElements.define('civ-autocomplete-select',ot
e.stopPropagation()} @input=${t=>{const i={...e.office||{},name:t.target.value};n&&n('office',i)}} @@ -761,7 +727,7 @@ function ct(e){return null==e}customElements.define('civ-autocomplete-select',ot