UNPKG

@kor-ui/popover

Version:

Kor popover component.

78 lines 28.7 kB
!function(t){var e={};function __webpack_require__(s){if(e[s])return e[s].exports;var i=e[s]={i:s,l:!1,exports:{}};return t[s].call(i.exports,i,i.exports,__webpack_require__),i.l=!0,i.exports}__webpack_require__.m=t,__webpack_require__.c=e,__webpack_require__.d=function(t,e,s){__webpack_require__.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:s})},__webpack_require__.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},__webpack_require__.t=function(t,e){if(1&e&&(t=__webpack_require__(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var s=Object.create(null);if(__webpack_require__.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)__webpack_require__.d(s,i,function(e){return t[e]}.bind(null,i));return s},__webpack_require__.n=function(t){var e=t&&t.__esModule?function getDefault(){return t.default}:function getModuleExports(){return t};return __webpack_require__.d(e,"a",e),e},__webpack_require__.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=64)}({0:function(t,e,s){"use strict";s.d(e,"c",(function(){return customElement})),s.d(e,"e",(function(){return property})),s.d(e,"d",(function(){return lit_html_html})),s.d(e,"b",(function(){return css})),s.d(e,"a",(function(){return lit_element_LitElement}));const i="undefined"!=typeof window&&null!=window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,removeNodes=(t,e,s=null)=>{for(;e!==s;){const s=e.nextSibling;t.removeChild(e),e=s}},r=`{{lit-${String(Math.random()).slice(2)}}}`,n=`\x3c!--${r}--\x3e`,o=new RegExp(`${r}|${n}`);class Template{constructor(t,e){this.parts=[],this.element=e;const s=[],i=[],n=document.createTreeWalker(e.content,133,null,!1);let l=0,c=-1,p=0;const{strings:d,values:{length:h}}=t;for(;p<h;){const t=n.nextNode();if(null!==t){if(c++,1===t.nodeType){if(t.hasAttributes()){const e=t.attributes,{length:s}=e;let i=0;for(let t=0;t<s;t++)endsWith(e[t].name,"$lit$")&&i++;for(;i-- >0;){const e=d[p],s=a.exec(e)[2],i=s.toLowerCase()+"$lit$",r=t.getAttribute(i);t.removeAttribute(i);const n=r.split(o);this.parts.push({type:"attribute",index:c,name:s,strings:n}),p+=n.length-1}}"TEMPLATE"===t.tagName&&(i.push(t),n.currentNode=t.content)}else if(3===t.nodeType){const e=t.data;if(e.indexOf(r)>=0){const i=t.parentNode,r=e.split(o),n=r.length-1;for(let e=0;e<n;e++){let s,n=r[e];if(""===n)s=createMarker();else{const t=a.exec(n);null!==t&&endsWith(t[2],"$lit$")&&(n=n.slice(0,t.index)+t[1]+t[2].slice(0,-"$lit$".length)+t[3]),s=document.createTextNode(n)}i.insertBefore(s,t),this.parts.push({type:"node",index:++c})}""===r[n]?(i.insertBefore(createMarker(),t),s.push(t)):t.data=r[n],p+=n}}else if(8===t.nodeType)if(t.data===r){const e=t.parentNode;null!==t.previousSibling&&c!==l||(c++,e.insertBefore(createMarker(),t)),l=c,this.parts.push({type:"node",index:c}),null===t.nextSibling?t.data="":(s.push(t),c--),p++}else{let e=-1;for(;-1!==(e=t.data.indexOf(r,e+1));)this.parts.push({type:"node",index:-1}),p++}}else n.currentNode=i.pop()}for(const t of s)t.parentNode.removeChild(t)}}const endsWith=(t,e)=>{const s=t.length-e.length;return s>=0&&t.slice(s)===e},isTemplatePartActive=t=>-1!==t.index,createMarker=()=>document.createComment(""),a=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;function removeNodesFromTemplate(t,e){const{element:{content:s},parts:i}=t,r=document.createTreeWalker(s,133,null,!1);let n=nextActiveIndexInTemplateParts(i),o=i[n],a=-1,l=0;const c=[];let p=null;for(;r.nextNode();){a++;const t=r.currentNode;for(t.previousSibling===p&&(p=null),e.has(t)&&(c.push(t),null===p&&(p=t)),null!==p&&l++;void 0!==o&&o.index===a;)o.index=null!==p?-1:o.index-l,n=nextActiveIndexInTemplateParts(i,n),o=i[n]}c.forEach(t=>t.parentNode.removeChild(t))}const countNodes=t=>{let e=11===t.nodeType?0:1;const s=document.createTreeWalker(t,133,null,!1);for(;s.nextNode();)e++;return e},nextActiveIndexInTemplateParts=(t,e=-1)=>{for(let s=e+1;s<t.length;s++){const e=t[s];if(isTemplatePartActive(e))return s}return-1};const l=new WeakMap,isDirective=t=>"function"==typeof t&&l.has(t),c={},p={};class template_instance_TemplateInstance{constructor(t,e,s){this.__parts=[],this.template=t,this.processor=e,this.options=s}update(t){let e=0;for(const s of this.__parts)void 0!==s&&s.setValue(t[e]),e++;for(const t of this.__parts)void 0!==t&&t.commit()}_clone(){const t=i?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),e=[],s=this.template.parts,r=document.createTreeWalker(t,133,null,!1);let n,o=0,a=0,l=r.nextNode();for(;o<s.length;)if(n=s[o],isTemplatePartActive(n)){for(;a<n.index;)a++,"TEMPLATE"===l.nodeName&&(e.push(l),r.currentNode=l.content),null===(l=r.nextNode())&&(r.currentNode=e.pop(),l=r.nextNode());if("node"===n.type){const t=this.processor.handleTextExpression(this.options);t.insertAfterNode(l.previousSibling),this.__parts.push(t)}else this.__parts.push(...this.processor.handleAttributeExpressions(l,n.name,n.strings,this.options));o++}else this.__parts.push(void 0),o++;return i&&(document.adoptNode(t),customElements.upgrade(t)),t}}const d=` ${r} `;class template_result_TemplateResult{constructor(t,e,s,i){this.strings=t,this.values=e,this.type=s,this.processor=i}getHTML(){const t=this.strings.length-1;let e="",s=!1;for(let i=0;i<t;i++){const t=this.strings[i],o=t.lastIndexOf("\x3c!--");s=(o>-1||s)&&-1===t.indexOf("--\x3e",o+1);const l=a.exec(t);e+=null===l?t+(s?d:n):t.substr(0,l.index)+l[1]+l[2]+"$lit$"+l[3]+r}return e+=this.strings[t],e}getTemplateElement(){const t=document.createElement("template");return t.innerHTML=this.getHTML(),t}}const isPrimitive=t=>null===t||!("object"==typeof t||"function"==typeof t),isIterable=t=>Array.isArray(t)||!(!t||!t[Symbol.iterator]);class AttributeCommitter{constructor(t,e,s){this.dirty=!0,this.element=t,this.name=e,this.strings=s,this.parts=[];for(let t=0;t<s.length-1;t++)this.parts[t]=this._createPart()}_createPart(){return new parts_AttributePart(this)}_getValue(){const t=this.strings,e=t.length-1;let s="";for(let i=0;i<e;i++){s+=t[i];const e=this.parts[i];if(void 0!==e){const t=e.value;if(isPrimitive(t)||!isIterable(t))s+="string"==typeof t?t:String(t);else for(const e of t)s+="string"==typeof e?e:String(e)}}return s+=t[e],s}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}class parts_AttributePart{constructor(t){this.value=void 0,this.committer=t}setValue(t){t===c||isPrimitive(t)&&t===this.value||(this.value=t,isDirective(t)||(this.committer.dirty=!0))}commit(){for(;isDirective(this.value);){const t=this.value;this.value=c,t(this)}this.value!==c&&this.committer.commit()}}class parts_NodePart{constructor(t){this.value=void 0,this.__pendingValue=void 0,this.options=t}appendInto(t){this.startNode=t.appendChild(createMarker()),this.endNode=t.appendChild(createMarker())}insertAfterNode(t){this.startNode=t,this.endNode=t.nextSibling}appendIntoPart(t){t.__insert(this.startNode=createMarker()),t.__insert(this.endNode=createMarker())}insertAfterPart(t){t.__insert(this.startNode=createMarker()),this.endNode=t.endNode,t.endNode=this.startNode}setValue(t){this.__pendingValue=t}commit(){if(null===this.startNode.parentNode)return;for(;isDirective(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=c,t(this)}const t=this.__pendingValue;t!==c&&(isPrimitive(t)?t!==this.value&&this.__commitText(t):t instanceof template_result_TemplateResult?this.__commitTemplateResult(t):t instanceof Node?this.__commitNode(t):isIterable(t)?this.__commitIterable(t):t===p?(this.value=p,this.clear()):this.__commitText(t))}__insert(t){this.endNode.parentNode.insertBefore(t,this.endNode)}__commitNode(t){this.value!==t&&(this.clear(),this.__insert(t),this.value=t)}__commitText(t){const e=this.startNode.nextSibling,s="string"==typeof(t=null==t?"":t)?t:String(t);e===this.endNode.previousSibling&&3===e.nodeType?e.data=s:this.__commitNode(document.createTextNode(s)),this.value=t}__commitTemplateResult(t){const e=this.options.templateFactory(t);if(this.value instanceof template_instance_TemplateInstance&&this.value.template===e)this.value.update(t.values);else{const s=new template_instance_TemplateInstance(e,t.processor,this.options),i=s._clone();s.update(t.values),this.__commitNode(i),this.value=s}}__commitIterable(t){Array.isArray(this.value)||(this.value=[],this.clear());const e=this.value;let s,i=0;for(const r of t)s=e[i],void 0===s&&(s=new parts_NodePart(this.options),e.push(s),0===i?s.appendIntoPart(this):s.insertAfterPart(e[i-1])),s.setValue(r),s.commit(),i++;i<e.length&&(e.length=i,this.clear(s&&s.endNode))}clear(t=this.startNode){removeNodes(this.startNode.parentNode,t.nextSibling,this.endNode)}}class parts_BooleanAttributePart{constructor(t,e,s){if(this.value=void 0,this.__pendingValue=void 0,2!==s.length||""!==s[0]||""!==s[1])throw new Error("Boolean attributes can only contain a single expression");this.element=t,this.name=e,this.strings=s}setValue(t){this.__pendingValue=t}commit(){for(;isDirective(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=c,t(this)}if(this.__pendingValue===c)return;const t=!!this.__pendingValue;this.value!==t&&(t?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name),this.value=t),this.__pendingValue=c}}class PropertyCommitter extends AttributeCommitter{constructor(t,e,s){super(t,e,s),this.single=2===s.length&&""===s[0]&&""===s[1]}_createPart(){return new PropertyPart(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}class PropertyPart extends parts_AttributePart{}let h=!1;(()=>{try{const t={get capture(){return h=!0,!1}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){}})();class parts_EventPart{constructor(t,e,s){this.value=void 0,this.__pendingValue=void 0,this.element=t,this.eventName=e,this.eventContext=s,this.__boundHandleEvent=t=>this.handleEvent(t)}setValue(t){this.__pendingValue=t}commit(){for(;isDirective(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=c,t(this)}if(this.__pendingValue===c)return;const t=this.__pendingValue,e=this.value,s=null==t||null!=e&&(t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive),i=null!=t&&(null==e||s);s&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),i&&(this.__options=getOptions(t),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=t,this.__pendingValue=c}handleEvent(t){"function"==typeof this.value?this.value.call(this.eventContext||this.element,t):this.value.handleEvent(t)}}const getOptions=t=>t&&(h?{capture:t.capture,passive:t.passive,once:t.once}:t.capture);function templateFactory(t){let e=u.get(t.type);void 0===e&&(e={stringsArray:new WeakMap,keyString:new Map},u.set(t.type,e));let s=e.stringsArray.get(t.strings);if(void 0!==s)return s;const i=t.strings.join(r);return s=e.keyString.get(i),void 0===s&&(s=new Template(t,t.getTemplateElement()),e.keyString.set(i,s)),e.stringsArray.set(t.strings,s),s}const u=new Map,_=new WeakMap;const m=new class default_template_processor_DefaultTemplateProcessor{handleAttributeExpressions(t,e,s,i){const r=e[0];if("."===r){return new PropertyCommitter(t,e.slice(1),s).parts}return"@"===r?[new parts_EventPart(t,e.slice(1),i.eventContext)]:"?"===r?[new parts_BooleanAttributePart(t,e.slice(1),s)]:new AttributeCommitter(t,e,s).parts}handleTextExpression(t){return new parts_NodePart(t)}};"undefined"!=typeof window&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.2.1");const lit_html_html=(t,...e)=>new template_result_TemplateResult(t,e,"html",m),getTemplateCacheKey=(t,e)=>`${t}--${e}`;let f=!0;void 0===window.ShadyCSS?f=!1:void 0===window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),f=!1);const shadyTemplateFactory=t=>e=>{const s=getTemplateCacheKey(e.type,t);let i=u.get(s);void 0===i&&(i={stringsArray:new WeakMap,keyString:new Map},u.set(s,i));let n=i.stringsArray.get(e.strings);if(void 0!==n)return n;const o=e.strings.join(r);if(n=i.keyString.get(o),void 0===n){const s=e.getTemplateElement();f&&window.ShadyCSS.prepareTemplateDom(s,t),n=new Template(e,s),i.keyString.set(o,n)}return i.stringsArray.set(e.strings,n),n},y=["html","svg"],g=new Set,prepareTemplateStyles=(t,e,s)=>{g.add(t);const i=s?s.element:document.createElement("template"),r=e.querySelectorAll("style"),{length:n}=r;if(0===n)return void window.ShadyCSS.prepareTemplateStyles(i,t);const o=document.createElement("style");for(let t=0;t<n;t++){const e=r[t];e.parentNode.removeChild(e),o.textContent+=e.textContent}(t=>{y.forEach(e=>{const s=u.get(getTemplateCacheKey(e,t));void 0!==s&&s.keyString.forEach(t=>{const{element:{content:e}}=t,s=new Set;Array.from(e.querySelectorAll("style")).forEach(t=>{s.add(t)}),removeNodesFromTemplate(t,s)})})})(t);const a=i.content;s?function insertNodeIntoTemplate(t,e,s=null){const{element:{content:i},parts:r}=t;if(null==s)return void i.appendChild(e);const n=document.createTreeWalker(i,133,null,!1);let o=nextActiveIndexInTemplateParts(r),a=0,l=-1;for(;n.nextNode();){for(l++,n.currentNode===s&&(a=countNodes(e),s.parentNode.insertBefore(e,s));-1!==o&&r[o].index===l;){if(a>0){for(;-1!==o;)r[o].index+=a,o=nextActiveIndexInTemplateParts(r,o);return}o=nextActiveIndexInTemplateParts(r,o)}}}(s,o,a.firstChild):a.insertBefore(o,a.firstChild),window.ShadyCSS.prepareTemplateStyles(i,t);const l=a.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==l)e.insertBefore(l.cloneNode(!0),e.firstChild);else if(s){a.insertBefore(o,a.firstChild);const t=new Set;t.add(o),removeNodesFromTemplate(s,t)}};window.JSCompiler_renameProperty=(t,e)=>t;const b={toAttribute(t,e){switch(e){case Boolean:return t?"":null;case Object:case Array:return null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){switch(e){case Boolean:return null!==t;case Number:return null===t?null:Number(t);case Object:case Array:return JSON.parse(t)}return t}},notEqual=(t,e)=>e!==t&&(e==e||t==t),v={attribute:!0,type:String,converter:b,reflect:!1,hasChanged:notEqual};class UpdatingElement extends HTMLElement{constructor(){super(),this._updateState=0,this._instanceProperties=void 0,this._updatePromise=new Promise(t=>this._enableUpdatingResolver=t),this._changedProperties=new Map,this._reflectingProperties=void 0,this.initialize()}static get observedAttributes(){this.finalize();const t=[];return this._classProperties.forEach((e,s)=>{const i=this._attributeNameForProperty(s,e);void 0!==i&&(this._attributeToPropertyMap.set(i,s),t.push(i))}),t}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;const t=Object.getPrototypeOf(this)._classProperties;void 0!==t&&t.forEach((t,e)=>this._classProperties.set(e,t))}}static createProperty(t,e=v){if(this._ensureClassProperties(),this._classProperties.set(t,e),e.noAccessor||this.prototype.hasOwnProperty(t))return;const s="symbol"==typeof t?Symbol():"__"+t,i=this.getPropertyDescriptor(t,s,e);void 0!==i&&Object.defineProperty(this.prototype,t,i)}static getPropertyDescriptor(t,e,s){return{get(){return this[e]},set(s){const i=this[t];this[e]=s,this._requestUpdate(t,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this._classProperties&&this._classProperties.get(t)||v}static finalize(){const t=Object.getPrototypeOf(this);if(t.hasOwnProperty("finalized")||t.finalize(),this.finalized=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){const t=this.properties,e=[...Object.getOwnPropertyNames(t),..."function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t):[]];for(const s of e)this.createProperty(s,t[s])}}static _attributeNameForProperty(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}static _valueHasChanged(t,e,s=notEqual){return s(t,e)}static _propertyValueFromAttribute(t,e){const s=e.type,i=e.converter||b,r="function"==typeof i?i:i.fromAttribute;return r?r(t,s):t}static _propertyValueToAttribute(t,e){if(void 0===e.reflect)return;const s=e.type,i=e.converter;return(i&&i.toAttribute||b.toAttribute)(t,s)}initialize(){this._saveInstanceProperties(),this._requestUpdate()}_saveInstanceProperties(){this.constructor._classProperties.forEach((t,e)=>{if(this.hasOwnProperty(e)){const t=this[e];delete this[e],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(e,t)}})}_applyInstanceProperties(){this._instanceProperties.forEach((t,e)=>this[e]=t),this._instanceProperties=void 0}connectedCallback(){this.enableUpdating()}enableUpdating(){void 0!==this._enableUpdatingResolver&&(this._enableUpdatingResolver(),this._enableUpdatingResolver=void 0)}disconnectedCallback(){}attributeChangedCallback(t,e,s){e!==s&&this._attributeToProperty(t,s)}_propertyToAttribute(t,e,s=v){const i=this.constructor,r=i._attributeNameForProperty(t,s);if(void 0!==r){const t=i._propertyValueToAttribute(e,s);if(void 0===t)return;this._updateState=8|this._updateState,null==t?this.removeAttribute(r):this.setAttribute(r,t),this._updateState=-9&this._updateState}}_attributeToProperty(t,e){if(8&this._updateState)return;const s=this.constructor,i=s._attributeToPropertyMap.get(t);if(void 0!==i){const t=s.getPropertyOptions(i);this._updateState=16|this._updateState,this[i]=s._propertyValueFromAttribute(e,t),this._updateState=-17&this._updateState}}_requestUpdate(t,e){let s=!0;if(void 0!==t){const i=this.constructor,r=i.getPropertyOptions(t);i._valueHasChanged(this[t],e,r.hasChanged)?(this._changedProperties.has(t)||this._changedProperties.set(t,e),!0!==r.reflect||16&this._updateState||(void 0===this._reflectingProperties&&(this._reflectingProperties=new Map),this._reflectingProperties.set(t,r))):s=!1}!this._hasRequestedUpdate&&s&&(this._updatePromise=this._enqueueUpdate())}requestUpdate(t,e){return this._requestUpdate(t,e),this.updateComplete}async _enqueueUpdate(){this._updateState=4|this._updateState;try{await this._updatePromise}catch(t){}const t=this.performUpdate();return null!=t&&await t,!this._hasRequestedUpdate}get _hasRequestedUpdate(){return 4&this._updateState}get hasUpdated(){return 1&this._updateState}performUpdate(){this._instanceProperties&&this._applyInstanceProperties();let t=!1;const e=this._changedProperties;try{t=this.shouldUpdate(e),t?this.update(e):this._markUpdated()}catch(e){throw t=!1,this._markUpdated(),e}t&&(1&this._updateState||(this._updateState=1|this._updateState,this.firstUpdated(e)),this.updated(e))}_markUpdated(){this._changedProperties=new Map,this._updateState=-5&this._updateState}get updateComplete(){return this._getUpdateComplete()}_getUpdateComplete(){return this._updatePromise}shouldUpdate(t){return!0}update(t){void 0!==this._reflectingProperties&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach((t,e)=>this._propertyToAttribute(e,this[e],t)),this._reflectingProperties=void 0),this._markUpdated()}updated(t){}firstUpdated(t){}}UpdatingElement.finalized=!0;const customElement=t=>e=>"function"==typeof e?((t,e)=>(window.customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:s,elements:i}=e;return{kind:s,elements:i,finisher(e){window.customElements.define(t,e)}}})(t,e),standardProperty=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?Object.assign(Object.assign({},e),{finisher(s){s.createProperty(e.key,t)}}):{kind:"field",key:Symbol(),placement:"own",descriptor:{},initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(s){s.createProperty(e.key,t)}};function property(t){return(e,s)=>void 0!==s?((t,e,s)=>{e.constructor.createProperty(s,t)})(t,e,s):standardProperty(t,e)}const S="adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,w=Symbol();class CSSResult{constructor(t,e){if(e!==w)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t}get styleSheet(){return void 0===this._styleSheet&&(S?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}}const css=(t,...e)=>{const s=e.reduce((e,s,i)=>e+(t=>{if(t instanceof CSSResult)return t.cssText;if("number"==typeof t)return t;throw new Error(`Value passed to 'css' function must be a 'css' function result: ${t}. Use 'unsafeCSS' to pass non-literal values, but\n take care to ensure page security.`)})(s)+t[i+1],t[0]);return new CSSResult(s,w)};(window.litElementVersions||(window.litElementVersions=[])).push("2.3.1");const x={};class lit_element_LitElement extends UpdatingElement{static getStyles(){return this.styles}static _getUniqueStyles(){if(this.hasOwnProperty(JSCompiler_renameProperty("_styles",this)))return;const t=this.getStyles();if(void 0===t)this._styles=[];else if(Array.isArray(t)){const addStyles=(t,e)=>t.reduceRight((t,e)=>Array.isArray(e)?addStyles(e,t):(t.add(e),t),e),e=addStyles(t,new Set),s=[];e.forEach(t=>s.unshift(t)),this._styles=s}else this._styles=[t]}initialize(){super.initialize(),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow({mode:"open"})}adoptStyles(){const t=this.constructor._styles;0!==t.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?S?this.renderRoot.adoptedStyleSheets=t.map(t=>t.styleSheet):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(t.map(t=>t.cssText),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(t){const e=this.render();super.update(t),e!==x&&this.constructor.render(e,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach(t=>{const e=document.createElement("style");e.textContent=t.cssText,this.renderRoot.appendChild(e)}))}render(){return x}}lit_element_LitElement.finalized=!0,lit_element_LitElement.render=(t,e,s)=>{if(!s||"object"!=typeof s||!s.scopeName)throw new Error("The `scopeName` option is required.");const i=s.scopeName,r=_.has(e),n=f&&11===e.nodeType&&!!e.host,o=n&&!g.has(i),a=o?document.createDocumentFragment():e;if(((t,e,s)=>{let i=_.get(e);void 0===i&&(removeNodes(e,e.firstChild),_.set(e,i=new parts_NodePart(Object.assign({templateFactory:templateFactory},s))),i.appendInto(e)),i.setValue(t),i.commit()})(t,a,Object.assign({templateFactory:shadyTemplateFactory(i)},s)),o){const t=_.get(a);_.delete(a);const s=t.value instanceof template_instance_TemplateInstance?t.value.template:void 0;prepareTemplateStyles(i,a,s),removeNodes(e,e.firstChild),e.appendChild(a),_.set(e,t)}!r&&n&&window.ShadyCSS.styleElement(e.host)}},1:function(t,e,s){"use strict";s.d(e,"a",(function(){return i}));const i=s(0).b` /* scrollbar */ *::-webkit-scrollbar { width: 8px; height: 8px; background-color: transparent; visibility: hidden; } *::-webkit-scrollbar-track { background-color: rgba(var(--neutral-1), 0.05); border-radius: 8px; } *::-webkit-scrollbar-thumb { background-color: rgba(var(--neutral-1), 0.1); border-radius: 8px; } *::-webkit-scrollbar-thumb:active, *::-webkit-scrollbar-thumb:hover { background-color: rgba(var(--neutral-1), 0.2); } `},24:function(t,e,s){"use strict";s.d(e,"a",(function(){return n}));var i=s(0),r=s(1),__decorate=function(t,e,s,i){var r,n=arguments.length,o=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(n<3?r(o):n>3?r(e,s,o):r(e,s))||o);return n>3&&o&&Object.defineProperty(e,s,o),o};let n=class korPopover extends i.a{constructor(){super(...arguments),this.flexDirection="column",this.position="bottom",this.visible=!1,this.emptyHeader=!0,this.emptyFunctions=!0,this.emptyFooter=!0}static get styles(){return[r.a,i.b` :host { background-color: rgb(var(--base-4)); border-radius: 4px; display: flex; box-shadow: var(--shadow-1); transition: var(--transition-1), 0s top, 0s left; position: fixed; opacity: 1; z-index: 4; width: 240px; } :host(:not([visible])) { opacity: 0; pointer-events: none; } :host([position^='bottom']:not([visible])) { margin-top: -8px; } :host([position^='top']:not([visible])) { margin-top: 8px; } :host([position^='right']:not([visible])) { margin-left: -8px; } :host([position^='left']:not([visible])) { margin-left: 8px; } kor-card { background-color: transparent; box-shadow: none; } `]}render(){return i.d` <kor-card @click="${t=>t.stopPropagation()}" @wheel="${t=>t.stopPropagation()}" .label="${this.label}" .icon="${this.icon}" flex-direction="${this.flexDirection}" > <slot name="header" slot="${this.emptyHeader?void 0:"header"}" @slotchange="${t=>this.emptyHeader=0===t.target.assignedNodes().length}" ></slot> <slot name="functions" slot="${this.emptyFunctions?void 0:"functions"}" @slotchange="${t=>this.emptyFunctions=0===t.target.assignedNodes().length}" ></slot> <slot></slot> <slot name="footer" slot="${this.emptyFooter?void 0:"footer"}" @slotchange="${t=>this.emptyFooter=0===t.target.assignedNodes().length}" ></slot> </kor-card> `}attributeChangedCallback(t,e,s){super.attributeChangedCallback(t,e,s),this.dispatchEvent(new Event(t+"-changed")),"target"===t&&this.target?this.targetObserver():"visible"===t&&this.visible&&this.visibleObserver()}targetObserver(){const t="string"==typeof this.target?document.querySelector(this.target):this.target;t&&t.addEventListener("click",()=>this.handlePosition(t))}visibleObserver(){const t="string"==typeof this.target?document.querySelector(this.target):this.target;t&&this.handlePosition(t),!this.sticky&&this.target&&this.addDocListener(t)}handlePosition(t){if(!t)return;let e=this,s=t.getBoundingClientRect();e.visible=!0,e.position.startsWith("bottom")?e.style.top=s.top+s.height+8+"px":e.position.startsWith("top")?e.style.top=s.top-e.clientHeight-8+"px":e.style.top=s.top+s.height/2-e.clientHeight/2+"px",e.position.startsWith("right")?e.style.left=s.left+s.width+8+"px":e.position.startsWith("left")?e.style.left=s.left-e.clientWidth-8+"px":e.style.left=s.left+s.width/2-e.clientWidth/2+"px"}addDocListener(t){let e=this,closePopover=function(s){(s.target!==t&&"click"===s.type||"wheel"===s.type)&&(e.visible=!1,document.removeEventListener("click",closePopover),document.removeEventListener("wheel",closePopover))};document.addEventListener("click",closePopover),document.addEventListener("wheel",closePopover)}};__decorate([Object(i.e)({type:String,reflect:!0})],n.prototype,"label",void 0),__decorate([Object(i.e)({type:String,reflect:!0})],n.prototype,"icon",void 0),__decorate([Object(i.e)({type:String,reflect:!0,attribute:"flex-direction"})],n.prototype,"flexDirection",void 0),__decorate([Object(i.e)({type:String,reflect:!0})],n.prototype,"position",void 0),__decorate([Object(i.e)({type:String,reflect:!0})],n.prototype,"target",void 0),__decorate([Object(i.e)({type:Boolean,reflect:!0})],n.prototype,"visible",void 0),__decorate([Object(i.e)({type:Boolean,reflect:!0})],n.prototype,"sticky",void 0),__decorate([Object(i.e)({type:Boolean})],n.prototype,"emptyHeader",void 0),__decorate([Object(i.e)({type:Boolean})],n.prototype,"emptyFunctions",void 0),__decorate([Object(i.e)({type:Boolean})],n.prototype,"emptyFooter",void 0),n=__decorate([Object(i.c)("kor-popover")],n)},64:function(t,e,s){"use strict";s.r(e);var i=s(24);s.d(e,"korPopover",(function(){return i.a}))}});