@nuitral/react-ui-suite
Version:
nuitral React UI Suite
73 lines (72 loc) • 36.7 kB
JavaScript
;var t=require("react");
/**
* @license
* Copyright 2019 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const e=globalThis,s=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,r=Symbol(),i=new WeakMap;let n=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==r)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(s&&void 0===t){const s=void 0!==e&&1===e.length;s&&(t=i.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&i.set(e,t))}return t}toString(){return this.cssText}};const o=s?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return(t=>new n("string"==typeof t?t:t+"",void 0,r))(e)})(t):t,{is:a,defineProperty:l,getOwnPropertyDescriptor:c,getOwnPropertyNames:h,getOwnPropertySymbols:d,getPrototypeOf:u}=Object,p=globalThis,f=p.trustedTypes,y=f?f.emptyScript:"",m=p.reactiveElementPolyfillSupport,$=(t,e)=>t,_={toAttribute(t,e){switch(e){case Boolean:t=t?y:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let s=t;switch(e){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch(t){s=null}}return s}},v=(t,e)=>!a(t,e),b={attribute:!0,type:String,converter:_,reflect:!1,useDefault:!1,hasChanged:v};
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/Symbol.metadata??=Symbol("metadata"),p.litPropertyMetadata??=new WeakMap;let g=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=b){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),r=this.getPropertyDescriptor(t,s,e);void 0!==r&&l(this.prototype,t,r)}}static getPropertyDescriptor(t,e,s){const{get:r,set:i}=c(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:r,set(e){const n=r?.call(this);i?.call(this,e),this.requestUpdate(t,n,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??b}static _$Ei(){if(this.hasOwnProperty($("elementProperties")))return;const t=u(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty($("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty($("properties"))){const t=this.properties,e=[...h(t),...d(t)];for(const s of e)this.createProperty(s,t[s])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,s]of e)this.elementProperties.set(t,s)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const s=this._$Eu(t,e);void 0!==s&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const t of s)e.unshift(o(t))}else void 0!==t&&e.push(o(t));return e}static _$Eu(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,r)=>{if(s)t.adoptedStyleSheets=r.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const s of r){const r=document.createElement("style"),i=e.litNonce;void 0!==i&&r.setAttribute("nonce",i),r.textContent=s.cssText,t.appendChild(r)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$ET(t,e){const s=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,s);if(void 0!==r&&!0===s.reflect){const i=(void 0!==s.converter?.toAttribute?s.converter:_).toAttribute(e,s.type);this._$Em=t,null==i?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(t,e){const s=this.constructor,r=s._$Eh.get(t);if(void 0!==r&&this._$Em!==r){const t=s.getPropertyOptions(r),i="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:_;this._$Em=r;const n=i.fromAttribute(e,t.type);this[r]=n??this._$Ej?.get(r)??n,this._$Em=null}}requestUpdate(t,e,s){if(void 0!==t){const r=this.constructor,i=this[t];if(s??=r.getPropertyOptions(t),!((s.hasChanged??v)(i,e)||s.useDefault&&s.reflect&&i===this._$Ej?.get(t)&&!this.hasAttribute(r._$Eu(t,s))))return;this.C(t,e,s)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:s,reflect:r,wrapped:i},n){s&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,n??e??this[t]),!0!==i||void 0!==n)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),!0===r&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,s]of t){const{wrapped:t}=s,r=this[e];!0!==t||this._$AL.has(e)||void 0===r||this.C(e,void 0,s,r)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(e){throw t=!1,this._$EM(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(t){}firstUpdated(t){}};g.elementStyles=[],g.shadowRootOptions={mode:"open"},g[$("elementProperties")]=new Map,g[$("finalized")]=new Map,m?.({ReactiveElement:g}),(p.reactiveElementVersions??=[]).push("2.1.1");
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
const S=globalThis,E=S.trustedTypes,A=E?E.createPolicy("lit-html",{createHTML:t=>t}):void 0,w="$lit$",P=`lit$${Math.random().toFixed(9).slice(2)}$`,x="?"+P,O=`<${x}>`,C=document,j=()=>C.createComment(""),k=t=>null===t||"object"!=typeof t&&"function"!=typeof t,N=Array.isArray,U="[ \t\n\f\r]",R=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,M=/-->/g,T=/>/g,H=RegExp(`>|${U}(?:([^\\s"'>=/]+)(${U}*=${U}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),D=/'/g,z=/"/g,L=/^(?:script|style|textarea|title)$/i,I=(t=>(e,...s)=>({_$litType$:t,strings:e,values:s}))(1),B=Symbol.for("lit-noChange"),V=Symbol.for("lit-nothing"),q=new WeakMap,W=C.createTreeWalker(C,129);function F(t,e){if(!N(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==A?A.createHTML(e):e}class J{constructor({strings:t,_$litType$:e},s){let r;this.parts=[];let i=0,n=0;const o=t.length-1,a=this.parts,[l,c]=((t,e)=>{const s=t.length-1,r=[];let i,n=2===e?"<svg>":3===e?"<math>":"",o=R;for(let e=0;e<s;e++){const s=t[e];let a,l,c=-1,h=0;for(;h<s.length&&(o.lastIndex=h,l=o.exec(s),null!==l);)h=o.lastIndex,o===R?"!--"===l[1]?o=M:void 0!==l[1]?o=T:void 0!==l[2]?(L.test(l[2])&&(i=RegExp("</"+l[2],"g")),o=H):void 0!==l[3]&&(o=H):o===H?">"===l[0]?(o=i??R,c=-1):void 0===l[1]?c=-2:(c=o.lastIndex-l[2].length,a=l[1],o=void 0===l[3]?H:'"'===l[3]?z:D):o===z||o===D?o=H:o===M||o===T?o=R:(o=H,i=void 0);const d=o===H&&t[e+1].startsWith("/>")?" ":"";n+=o===R?s+O:c>=0?(r.push(a),s.slice(0,c)+w+s.slice(c)+P+d):s+P+(-2===c?e:d)}return[F(t,n+(t[s]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),r]})(t,e);if(this.el=J.createElement(l,s),W.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(r=W.nextNode())&&a.length<o;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(w)){const e=c[n++],s=r.getAttribute(t).split(P),o=/([.?@])?(.*)/.exec(e);a.push({type:1,index:i,name:o[2],strings:s,ctor:"."===o[1]?G:"?"===o[1]?Q:"@"===o[1]?tt:Z}),r.removeAttribute(t)}else t.startsWith(P)&&(a.push({type:6,index:i}),r.removeAttribute(t));if(L.test(r.tagName)){const t=r.textContent.split(P),e=t.length-1;if(e>0){r.textContent=E?E.emptyScript:"";for(let s=0;s<e;s++)r.append(t[s],j()),W.nextNode(),a.push({type:2,index:++i});r.append(t[e],j())}}}else if(8===r.nodeType)if(r.data===x)a.push({type:2,index:i});else{let t=-1;for(;-1!==(t=r.data.indexOf(P,t+1));)a.push({type:7,index:i}),t+=P.length-1}i++}}static createElement(t,e){const s=C.createElement("template");return s.innerHTML=t,s}}function K(t,e,s=t,r){if(e===B)return e;let i=void 0!==r?s._$Co?.[r]:s._$Cl;const n=k(e)?void 0:e._$litDirective$;return i?.constructor!==n&&(i?._$AO?.(!1),void 0===n?i=void 0:(i=new n(t),i._$AT(t,s,r)),void 0!==r?(s._$Co??=[])[r]=i:s._$Cl=i),void 0!==i&&(e=K(t,i._$AS(t,e.values),i,r)),e}class X{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:s}=this._$AD,r=(t?.creationScope??C).importNode(e,!0);W.currentNode=r;let i=W.nextNode(),n=0,o=0,a=s[0];for(;void 0!==a;){if(n===a.index){let e;2===a.type?e=new Y(i,i.nextSibling,this,t):1===a.type?e=new a.ctor(i,a.name,a.strings,this,t):6===a.type&&(e=new et(i,this,t)),this._$AV.push(e),a=s[++o]}n!==a?.index&&(i=W.nextNode(),n++)}return W.currentNode=C,r}p(t){let e=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}let Y=class t{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,r){this.type=2,this._$AH=V,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=r,this._$Cv=r?.isConnected??!0}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=K(this,t,e),k(t)?t===V||null==t||""===t?(this._$AH!==V&&this._$AR(),this._$AH=V):t!==this._$AH&&t!==B&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>N(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==V&&k(this._$AH)?this._$AA.nextSibling.data=t:this.T(C.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:s}=t,r="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=J.createElement(F(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===r)this._$AH.p(e);else{const t=new X(r,this),s=t.u(this.options);t.p(e),this.T(s),this._$AH=t}}_$AC(t){let e=q.get(t.strings);return void 0===e&&q.set(t.strings,e=new J(t)),e}k(e){N(this._$AH)||(this._$AH=[],this._$AR());const s=this._$AH;let r,i=0;for(const n of e)i===s.length?s.push(r=new t(this.O(j()),this.O(j()),this,this.options)):r=s[i],r._$AI(n),i++;i<s.length&&(this._$AR(r&&r._$AB.nextSibling,i),s.length=i)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}};class Z{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,r,i){this.type=1,this._$AH=V,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=i,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=V}_$AI(t,e=this,s,r){const i=this.strings;let n=!1;if(void 0===i)t=K(this,t,e,0),n=!k(t)||t!==this._$AH&&t!==B,n&&(this._$AH=t);else{const r=t;let o,a;for(t=i[0],o=0;o<i.length-1;o++)a=K(this,r[s+o],e,o),a===B&&(a=this._$AH[o]),n||=!k(a)||a!==this._$AH[o],a===V?t=V:t!==V&&(t+=(a??"")+i[o+1]),this._$AH[o]=a}n&&!r&&this.j(t)}j(t){t===V?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class G extends Z{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===V?void 0:t}}class Q extends Z{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==V)}}class tt extends Z{constructor(t,e,s,r,i){super(t,e,s,r,i),this.type=5}_$AI(t,e=this){if((t=K(this,t,e,0)??V)===B)return;const s=this._$AH,r=t===V&&s!==V||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,i=t!==V&&(s===V||r);r&&this.element.removeEventListener(this.name,this,s),i&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class et{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){K(this,t)}}const st=S.litHtmlPolyfillSupport;st?.(J,Y),(S.litHtmlVersions??=[]).push("3.3.1");const rt=globalThis;
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/let it=class extends g{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,s)=>{const r=s?.renderBefore??e;let i=r._$litPart$;if(void 0===i){const t=s?.renderBefore??null;r._$litPart$=i=new Y(e.insertBefore(j(),t),t,void 0,s??{})}return i._$AI(t),i})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return B}};it._$litElement$=!0,it.finalized=!0,rt.litElementHydrateSupport?.({LitElement:it});const nt=rt.litElementPolyfillSupport;function ot(t,e,s,r){var i,n=arguments.length,o=n<3?e:r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,s,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(o=(n<3?i(o):n>3?i(e,s,o):i(e,s))||o);return n>3&&o&&Object.defineProperty(e,s,o),o}nt?.({LitElement:it}),(rt.litElementVersions??=[]).push("4.2.1"),"function"==typeof SuppressedError&&SuppressedError;
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
const at=t=>(e,s)=>{void 0!==s?s.addInitializer(()=>{customElements.define(t,e)}):customElements.define(t,e)},lt=globalThis,ct=lt.ShadowRoot&&(void 0===lt.ShadyCSS||lt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ht=Symbol(),dt=new WeakMap;
/**
* @license
* Copyright 2019 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/let ut=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==ht)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(ct&&void 0===t){const s=void 0!==e&&1===e.length;s&&(t=dt.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&dt.set(e,t))}return t}toString(){return this.cssText}};const pt=ct?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return(t=>new ut("string"==typeof t?t:t+"",void 0,ht))(e)})(t):t,{is:ft,defineProperty:yt,getOwnPropertyDescriptor:mt,getOwnPropertyNames:$t,getOwnPropertySymbols:_t,getPrototypeOf:vt}=Object,bt=globalThis,gt=bt.trustedTypes,St=gt?gt.emptyScript:"",Et=bt.reactiveElementPolyfillSupport,At=(t,e)=>t,wt={toAttribute(t,e){switch(e){case Boolean:t=t?St:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let s=t;switch(e){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch(t){s=null}}return s}},Pt=(t,e)=>!ft(t,e),xt={attribute:!0,type:String,converter:wt,reflect:!1,useDefault:!1,hasChanged:Pt};
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/Symbol.metadata??=Symbol("metadata"),bt.litPropertyMetadata??=new WeakMap;class Ot extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=xt){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),r=this.getPropertyDescriptor(t,s,e);void 0!==r&&yt(this.prototype,t,r)}}static getPropertyDescriptor(t,e,s){const{get:r,set:i}=mt(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:r,set(e){const n=r?.call(this);i?.call(this,e),this.requestUpdate(t,n,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??xt}static _$Ei(){if(this.hasOwnProperty(At("elementProperties")))return;const t=vt(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(At("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(At("properties"))){const t=this.properties,e=[...$t(t),..._t(t)];for(const s of e)this.createProperty(s,t[s])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,s]of e)this.elementProperties.set(t,s)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const s=this._$Eu(t,e);void 0!==s&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const t of s)e.unshift(pt(t))}else void 0!==t&&e.push(pt(t));return e}static _$Eu(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{if(ct)t.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const s of e){const e=document.createElement("style"),r=lt.litNonce;void 0!==r&&e.setAttribute("nonce",r),e.textContent=s.cssText,t.appendChild(e)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$ET(t,e){const s=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,s);if(void 0!==r&&!0===s.reflect){const i=(void 0!==s.converter?.toAttribute?s.converter:wt).toAttribute(e,s.type);this._$Em=t,null==i?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(t,e){const s=this.constructor,r=s._$Eh.get(t);if(void 0!==r&&this._$Em!==r){const t=s.getPropertyOptions(r),i="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:wt;this._$Em=r;const n=i.fromAttribute(e,t.type);this[r]=n??this._$Ej?.get(r)??n,this._$Em=null}}requestUpdate(t,e,s){if(void 0!==t){const r=this.constructor,i=this[t];if(s??=r.getPropertyOptions(t),!((s.hasChanged??Pt)(i,e)||s.useDefault&&s.reflect&&i===this._$Ej?.get(t)&&!this.hasAttribute(r._$Eu(t,s))))return;this.C(t,e,s)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:s,reflect:r,wrapped:i},n){s&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,n??e??this[t]),!0!==i||void 0!==n)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),!0===r&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,s]of t){const{wrapped:t}=s,r=this[e];!0!==t||this._$AL.has(e)||void 0===r||this.C(e,void 0,s,r)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(e){throw t=!1,this._$EM(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(t){}firstUpdated(t){}}Ot.elementStyles=[],Ot.shadowRootOptions={mode:"open"},Ot[At("elementProperties")]=new Map,Ot[At("finalized")]=new Map,Et?.({ReactiveElement:Ot}),(bt.reactiveElementVersions??=[]).push("2.1.1");
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
const Ct={attribute:!0,type:String,converter:wt,reflect:!1,hasChanged:Pt},jt=(t=Ct,e,s)=>{const{kind:r,metadata:i}=s;let n=globalThis.litPropertyMetadata.get(i);if(void 0===n&&globalThis.litPropertyMetadata.set(i,n=new Map),"setter"===r&&((t=Object.create(t)).wrapped=!0),n.set(s.name,t),"accessor"===r){const{name:r}=s;return{set(s){const i=e.get.call(this);e.set.call(this,s),this.requestUpdate(r,i,t)},init(e){return void 0!==e&&this.C(r,void 0,t,e),e}}}if("setter"===r){const{name:r}=s;return function(s){const i=this[r];e.call(this,s),this.requestUpdate(r,i,t)}}throw Error("Unsupported decorator location: "+r)};function kt(t){return(e,s)=>"object"==typeof s?jt(t,e,s):((t,e,s)=>{const r=e.hasOwnProperty(s);return e.constructor.createProperty(s,t),r?Object.getOwnPropertyDescriptor(e,s):void 0})(t,e,s)}let Nt=class extends it{constructor(){super(...arguments),this.icon=null}createRenderRoot(){return this}render(){return this.icon?I`<div class="nuitral-icon nuitral-icon-${this.icon}"></div>`:null}};ot([kt()],Nt.prototype,"icon",void 0),Nt=ot([at("nuitral-core-icon")],Nt);let Ut=class extends it{constructor(){super(...arguments),this.value="",this.classes="",this.type="text",this.iconPosition="left",this.icon=null,this.placeholder="",this.disabled=!1,this.onInput=t=>{const e=t.target;this.value=e.value,this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this.value},bubbles:!0,composed:!0}))}}iconOrderClass(){return"left"===this.iconPosition?"order-1":"order-2"}inputOrderClass(){return"left"===this.iconPosition?"order-2":"order-1"}iconRender(){return I`
${this.icon?I`<nuitral-core-icon
icon="${this.icon}"
class="${this.iconOrderClass()}"
></nuitral-core-icon>`:""}
`}inputRender(){return I`
<input
.value=${this.value}
@input=${this.onInput}
type=${this.type}
placeholder=${this.placeholder}
?disabled=${this.disabled}
class="nuitral-input-element ${this.inputOrderClass()}"
/>
`}createRenderRoot(){return this}render(){return I`
<div class="nuitral-input nuitral-input-text-color ${this.classes}">
${this.iconRender()} ${this.inputRender()}
</div>
`}};ot([kt({type:String,reflect:!0})],Ut.prototype,"value",void 0),ot([kt()],Ut.prototype,"classes",void 0),ot([kt()],Ut.prototype,"type",void 0),ot([kt()],Ut.prototype,"iconPosition",void 0),ot([kt()],Ut.prototype,"icon",void 0),ot([kt()],Ut.prototype,"placeholder",void 0),ot([kt()],Ut.prototype,"disabled",void 0),Ut=ot([at("nuitral-core-input")],Ut);var Rt,Mt={exports:{}},Tt={};var Ht,Dt,zt={};
/**
* @license React
* react-jsx-runtime.development.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/function Lt(){return Ht||(Ht=1,"production"!==process.env.NODE_ENV&&function(){function e(t){if(null==t)return null;if("function"==typeof t)return t.$$typeof===w?null:t.displayName||t.name||null;if("string"==typeof t)return t;switch(t){case f:return"Fragment";case m:return"Profiler";case y:return"StrictMode";case b:return"Suspense";case g:return"SuspenseList";case A:return"Activity"}if("object"==typeof t)switch("number"==typeof t.tag&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),t.$$typeof){case p:return"Portal";case _:return t.displayName||"Context";case $:return(t._context.displayName||"Context")+".Consumer";case v:var s=t.render;return(t=t.displayName)||(t=""!==(t=s.displayName||s.name||"")?"ForwardRef("+t+")":"ForwardRef"),t;case S:return null!==(s=t.displayName||null)?s:e(t.type)||"Memo";case E:s=t._payload,t=t._init;try{return e(t(s))}catch(t){}}return null}function s(t){return""+t}function r(t){try{s(t);var e=!1}catch(t){e=!0}if(e){var r=(e=console).error,i="function"==typeof Symbol&&Symbol.toStringTag&&t[Symbol.toStringTag]||t.constructor.name||"Object";return r.call(e,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",i),s(t)}}function i(t){if(t===f)return"<>";if("object"==typeof t&&null!==t&&t.$$typeof===E)return"<...>";try{var s=e(t);return s?"<"+s+">":"<...>"}catch(t){return"<...>"}}function n(){return Error("react-stack-top-frame")}function o(){var t=e(this.type);return j[t]||(j[t]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),void 0!==(t=this.props.ref)?t:null}function a(t,s,i,n,a,c){var d,p=s.children;if(void 0!==p)if(n)if(O(p)){for(n=0;n<p.length;n++)l(p[n]);Object.freeze&&Object.freeze(p)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else l(p);if(x.call(s,"key")){p=e(t);var f=Object.keys(s).filter(function(t){return"key"!==t});n=0<f.length?"{key: someKey, "+f.join(": ..., ")+": ...}":"{key: someKey}",U[p+n]||(f=0<f.length?"{"+f.join(": ..., ")+": ...}":"{}",console.error('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',n,p,f,p),U[p+n]=!0)}if(p=null,void 0!==i&&(r(i),p=""+i),function(t){if(x.call(t,"key")){var e=Object.getOwnPropertyDescriptor(t,"key").get;if(e&&e.isReactWarning)return!1}return void 0!==t.key}(s)&&(r(s.key),p=""+s.key),"key"in s)for(var y in i={},s)"key"!==y&&(i[y]=s[y]);else i=s;return p&&function(t,e){function s(){h||(h=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",e))}s.isReactWarning=!0,Object.defineProperty(t,"key",{get:s,configurable:!0})}(i,"function"==typeof t?t.displayName||t.name||"Unknown":t),function(t,e,s,r,i,n){var a=s.ref;return t={$$typeof:u,type:t,key:e,props:s,_owner:r},null!==(void 0!==a?a:null)?Object.defineProperty(t,"ref",{enumerable:!1,get:o}):Object.defineProperty(t,"ref",{enumerable:!1,value:null}),t._store={},Object.defineProperty(t._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(t,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(t,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:i}),Object.defineProperty(t,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:n}),Object.freeze&&(Object.freeze(t.props),Object.freeze(t)),t}(t,p,i,null===(d=P.A)?null:d.getOwner(),a,c)}function l(t){c(t)?t._store&&(t._store.validated=1):"object"==typeof t&&null!==t&&t.$$typeof===E&&("fulfilled"===t._payload.status?c(t._payload.value)&&t._payload.value._store&&(t._payload.value._store.validated=1):t._store&&(t._store.validated=1))}function c(t){return"object"==typeof t&&null!==t&&t.$$typeof===u}var h,d=t,u=Symbol.for("react.transitional.element"),p=Symbol.for("react.portal"),f=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),$=Symbol.for("react.consumer"),_=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),g=Symbol.for("react.suspense_list"),S=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),A=Symbol.for("react.activity"),w=Symbol.for("react.client.reference"),P=d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,x=Object.prototype.hasOwnProperty,O=Array.isArray,C=console.createTask?console.createTask:function(){return null},j={},k=(d={react_stack_bottom_frame:function(t){return t()}}).react_stack_bottom_frame.bind(d,n)(),N=C(i(n)),U={};zt.Fragment=f,zt.jsx=function(t,e,s){var r=1e4>P.recentlyCreatedOwnerStacks++;return a(t,e,s,!1,r?Error("react-stack-top-frame"):k,r?C(i(t)):N)},zt.jsxs=function(t,e,s){var r=1e4>P.recentlyCreatedOwnerStacks++;return a(t,e,s,!0,r?Error("react-stack-top-frame"):k,r?C(i(t)):N)}}()),zt}var It=(Dt||(Dt=1,"production"===process.env.NODE_ENV?Mt.exports=function(){if(Rt)return Tt;Rt=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function s(e,s,r){var i=null;if(void 0!==r&&(i=""+r),void 0!==s.key&&(i=""+s.key),"key"in s)for(var n in r={},s)"key"!==n&&(r[n]=s[n]);else r=s;return s=r.ref,{$$typeof:t,type:e,key:i,ref:void 0!==s?s:null,props:r}}return Tt.Fragment=e,Tt.jsx=s,Tt.jsxs=s,Tt}():Mt.exports=Lt()),Mt.exports);const Bt=(e,s=[])=>t.useMemo(()=>{const t={};for(const r in e)if(!s.includes(r)){const s=e[r];t[r]="boolean"==typeof s?s.toString():s}return t},[e,s]),Vt=()=>{const e=t.useMemo(()=>["primary","secondary","accent","error","success","warning","info","neutral","background","surface"],[]),s=t.useMemo(()=>["100","200","300","400","500","600","700","800","900"],[]),r=[];e.forEach(t=>{r.push(`${t}`),s.forEach(e=>{r.push(`${t}-${e}`)}),r.push(`border-${t}`),s.forEach(e=>{r.push(`border-${t}-${e}`)})});return{isValidAttribute:t=>r.includes(t)}},qt=({icon:t=null})=>It.jsx("nuitral-core-icon",{icon:t});exports.NuitralBox=({title:e,description:s,...r})=>{const i=Bt(r),{isValidAttribute:n}=Vt(),o=t.useMemo(()=>{const t={};for(const e in i)n(e)&&(t[e]=i[e]);return Object.keys(t).map(t=>`nuitral-box-${t}`)},[i]);return It.jsxs("div",{className:`nuitral-box ${o}`,children:[It.jsx("div",{className:"nuitral-box-title",children:e}),It.jsx("div",{children:s})]})},exports.NuitralButton=({classes:e="",type:s="button",disabled:r=!1,icon:i,iconPosition:n="left",children:o,leftSide:a,rightSide:l,...c})=>{const h=Bt(c),{isValidAttribute:d}=Vt(),u=t.useMemo(()=>{const t={};for(const e in h)d(e)&&(t[e]=h[e]);return Object.keys(t).map(t=>`nuitral-button-background-${t}`)},[h]);return It.jsxs("button",{className:`nuitral-button ${e} ${u} ${r?"disabled":""}`,type:s,disabled:r,...h,children:[a&&It.jsx("div",{className:"left-side",children:a}),i&&"left"===n&&It.jsx(qt,{icon:i}),o,i&&"right"===n&&It.jsx(qt,{icon:i}),l&&It.jsx("div",{className:"right-side",children:l})]})},exports.NuitralCard=({classes:e="",children:s,header:r,footer:i,hasShadow:n=!1,...o})=>{const a=Bt(o),{isValidAttribute:l}=Vt(),c=t.useMemo(()=>{const t={};for(const e in a)l(e)&&!e.startsWith("border-")&&(t[e]=a[e]);return Object.keys(t).length?Object.keys(t).map(t=>`nuitral-card-${t}`):"nuitral-card-background"},[a]),h=t.useMemo(()=>{const t={};for(const e in a)l(e)&&e.startsWith("border-")&&(t[e]=a[e]);return Object.keys(t).length?Object.keys(t).map(t=>`nuitral-card-${t}`):"nuitral-card-border-primary"},[a]);return It.jsxs(It.Fragment,{children:[It.jsx("div",{children:c}),It.jsxs("div",{...a,className:`nuitral-card ${e} ${c} ${n?"nuitral-card-shadow":h}`,children:[r&&It.jsx("div",{className:"nuitral-card-header",children:r}),s,i&&It.jsx("div",{className:"nuitral-card-footer",children:i})]})]})},exports.NuitralIcon=qt,exports.NuitralInput=({type:e="text",placeholder:s="",disabled:r=!1,icon:i=null,iconPosition:n="left",classes:o="",value:a="",onChange:l})=>{const c=t.useRef(null),h=`${o} ${r?"disabled":""}`.trim();return t.useEffect(()=>{const t=c.current;if(!t)return;const e=t=>{l?.(t.detail.value)};return t.addEventListener("value-change",e),()=>{t.removeEventListener("value-change",e)}},[l]),t.useEffect(()=>{c.current&&c.current.value!==a&&(c.current.value=a)},[a]),It.jsx("nuitral-core-input",{ref:c,value:a,type:e,icon:i,iconPosition:n,placeholder:s,disabled:r,classes:h})},exports.NuitralTab=()=>It.jsx(It.Fragment,{}),exports.NuitralTabs=({items:e=[],children:s=[],classes:r="",selected:i=0,onSelection:n,...o})=>{const[a,l]=t.useState(i),c=Bt(o),{isValidAttribute:h}=Vt(),d=t.useMemo(()=>{const t={};for(const e in c)h(e)&&(t[e]=c[e]);return Object.keys(t).map(t=>`nuitral-tab-${t}`).join(" ")},[c]),u=t=>{l(t.index),(t=>{n&&n(t)})(t)},p=t.useMemo(()=>{const r={label:"",children:null,component:null,icon:null,iconPosition:"left",classes:"",disabled:!1,leftSide:null,rightSide:null};return e.length>0?e.map(t=>({...r,...t})):t.Children.map(s,e=>t.isValidElement(e)?{...r,...e.props}:null)?.filter(t=>null!==t)||[]},[e,s]);return It.jsxs(It.Fragment,{children:[It.jsx("div",{className:`nuitral-tabs ${d} ${r}`,children:p.map((t,e)=>It.jsxs("div",{className:`nuitral-tab ${e===a?"nuitral-tab-active":""} ${t.disabled?"disabled":""}`,onClick:()=>!t.disabled&&u({item:t,index:e}),children:[t.leftSide&&It.jsx("div",{className:"left-side",children:t.leftSide}),t.icon&&"left"===t.iconPosition&&It.jsx(qt,{icon:t.icon}),t.label,t.icon&&"right"===t.iconPosition&&It.jsx(qt,{icon:t.icon}),t.rightSide&&It.jsx("div",{className:"right-side",children:t.rightSide})]},e))}),It.jsx("div",{className:`nuitral-tab-content ${p[a].classes}`,children:p[a]?.component?t.createElement(p[a].component):p[a]?.children?It.jsx("div",{children:p[a].children}):null})]})},exports.useAttrs=Bt,exports.useColorsAttributesValidator=Vt,exports.useNuitralTheming=({theme:e="nuitral",darkMode:s=!1,lightModeName:r="nuitral-light-mode",darkModeName:i="nuitral-dark-mode",rootId:n="nuitral-app",saveSettings:o=!1})=>{const a=(t,e)=>{o&&localStorage.setItem("nuitral",JSON.stringify({darkMode:t,theme:e}))},{theme:l,darkMode:c}=(()=>{if(!o)return{theme:e,darkMode:s};const t=localStorage.getItem("nuitral");return t?JSON.parse(t):{theme:e,darkMode:s}})(),[h,d]=t.useState(c),[u,p]=t.useState(l),f=t.useRef(null),y=()=>{if(f.current){const t=h?i:r;f.current.setAttribute("nuitral-theme",u),f.current.classList.add(t),f.current.classList.remove(h?r:i)}};return t.useEffect(()=>{f.current=document.getElementById(n),y()},[n]),t.useEffect(()=>{y()},[h,u]),{manageDarkMode:()=>{d(t=>{const e=!t;return a(e,u),e})},isDarkMode:h,manageTheme:t=>{p(t),a(h,t)},themeName:u}};
//# sourceMappingURL=react-ui-suite.cjs.js.map