@trintel/zooy 1.8.0 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{register-DlEgJmDa.js → register-Cm3JnDVX.js} +1 -1
- package/dist/chunks/{register-BC7Ka0IZ.js → register-DWdA1wzt.js} +1 -1
- package/dist/chunks/zoo-26MN2vmT.js +64 -0
- package/dist/chunks/{zoo-CaW98OQn.js → zoo-BmMuETpN.js} +79 -36
- package/dist/zooy.cjs.js +4 -4
- package/dist/zooy.es.js +225 -217
- package/package.json +1 -1
- package/dist/chunks/zoo-Cpc0eKfk.js +0 -52
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as f, t as St } from "./component-library-registry-DB5UeqC2.js";
|
|
2
|
-
import { i as Pt, n as W, r as i } from "./zoo-
|
|
2
|
+
import { i as Pt, n as W, r as i } from "./zoo-BmMuETpN.js";
|
|
3
3
|
import { isDefAndNotNull as yt, objToPaths as kt } from "badu";
|
|
4
4
|
import * as M from "ramda";
|
|
5
5
|
import { TABLE_SORT_DIRECTION as Ct } from "@carbon/web-components/lib/components/data-table/defs.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var yt=Object.create;var Q=Object.defineProperty;var Pt=Object.getOwnPropertyDescriptor;var _t=Object.getOwnPropertyNames;var kt=Object.getPrototypeOf,Ct=Object.prototype.hasOwnProperty;var wt=(t,e,s,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of _t(e))!Ct.call(t,o)&&o!==s&&Q(t,o,{get:()=>e[o],enumerable:!(n=Pt(e,o))||n.enumerable});return t};var d=(t,e,s)=>(s=t!=null?yt(kt(t)):{},wt(e||!t||!t.__esModule?Q(s,"default",{value:t,enumerable:!0}):s,t));const m=require("./component-library-registry-BBQV6Kpv.js"),i=require("./zoo-Cpc0eKfk.js");let at=require("badu"),B=require("ramda");B=m.__toESM(B,1);let xt=require("@carbon/web-components/lib/components/data-table/defs.js");var Dt=m.__exportAll({cdsTableWrap:()=>Mt}),X=(t,e,s)=>{const n=customElements.get("cds-table"),o=customElements.get("cds-pagination"),a=customElements.get(n.selectorTableBatchActions);customElements.get("cds-popover");const r=e.dataBinder,c=e.pagination,p=e.skeleton,S=e.querySelector(n.selectorTableToolbarSearch),W=e.querySelector(n.selectorTableBatchActions),w=e.querySelector(n.selectorTableBody),z=["button","a","input","select","textarea",'[role="button"]',".cds--table-expand",".cds--table-column-checkbox"].join(","),Z=e.querySelectorAll(n.selectorHeaderCell+"[is-sortable]"),lt=e.isSortable||Z.length>0,O=Symbol(),L=Symbol(),x=new Map,dt=l=>{t.listen(e,"click",u=>{const v=u.target.closest(n.selectorTableRow);if(!v||u.composedPath().some(h=>h.matches&&h.matches(z)))return;u.stopPropagation();const g=i.getSemanticAttributes(v);t.dispatchPanelEvent(l,{...g})})},pt=l=>{t.listen(e,n.eventExpandoToggle,u=>{const v=u.target,g=v.tagName==="CDS-TABLE-HEADER-ROW",h=u.detail.expanded,E={tableAttrs:s,...i.getSemanticAttributes(v),target:v,allRows:g,didExpand:h};t.dispatchPanelEvent(l,E)})},ut=l=>{x.set(O,u=>{t.dispatchPanelEvent(l,u)})},vt=l=>{x.set(L,u=>{const v=u.detail.selectedRows,g=Math.min(v.length,W.totalRowsCount),h=u.target,E=i.getSemanticAttributes(h),I=v.map(i.getSemanticAttributes),_={tableAttrs:s,...E,target:h,selectCount:g,selection:I};t.dispatchPanelEvent(l,_)})},mt=l=>{t.listen(e,n.eventTableRowSelect,u=>{const v=u.target,g=u.detail.selectedRows||[],h=g.length,E=g.map(i.getSemanticAttributes),I={tableAttrs:s,...i.getSemanticAttributes(v),selectCount:h,selection:E,target:v};t.dispatchPanelEvent(l,I)})},gt=()=>{t.listen(e,n.eventBeforeSort,l=>{const u=l.target,v=l.detail.oldSortDirection,g=l.detail.sortDirection,h=i.getSemanticAttributes(u),E=h.sortField,I=g===xt.TABLE_SORT_DIRECTION.DESCENDING?`-${E}`:E;l.cancelBubble=!0,l.stopPropagation(),l.preventDefault(),w.innerHTML="",p&&p.show(),Z.forEach((k,b)=>{k===u?(k.setAttribute("sort-active","true"),k.setAttribute("sort-direction",g)):(k.removeAttribute("sort-active"),k.setAttribute("sort-direction","none"))});const _={ordering:I};r.fetchData(_).then(()=>{c.setData(r),p&&p.hide()}),x.has(O)&&x.get(O)({tableAttrs:s,...h,sortNow:g,sortWas:v,sortField:E,ordering:I,target:u})})},ft=()=>{t.listen(e,n.eventTableRowSelectAll,l=>{l.detail.selectedRows.length===0&&e.querySelectorAll(n.selectorTableRow).forEach(u=>{u.disabled=!1,u.selected=!1}),x.has(L)&&x.get(L)(l)})},ht=()=>{t.listen(e,n.eventBeforeChangeSelectionAll,l=>{l.stopPropagation(),l.detail.callback&&l.detail.callback()})},bt=l=>{const u=e.querySelector("cds-table-header-row");t.listen(l,a.eventClickSelectAll,v=>{v.stopPropagation(),u.dispatchEvent(new CustomEvent(n.eventBeforeChangeSelectionAll,{bubbles:!0,cancelable:!0,composed:!0,detail:{selected:!0,callback:()=>{l.selectedRowsCount=l.totalRowsCount,e.querySelectorAll(n.selectorTableRow).forEach(g=>{g.disabled=!0})}}}))})},Et=l=>{t.listen(l,"keydown",u=>{if(u.key==="Enter"){p&&p.show(),c.totalItems=0,e.querySelector("cds-table-body").replaceChildren();const v={search:l.value||"",offset:0};r.fetchData(v).then(()=>{c.setData(r),p&&p.hide()})}})},At=l=>{t.listen(l,n.eventSearchInput,u=>{if((u.detail.value||"")===""){const v={search:"",offset:0};p&&p.show(),r.fetchData(v).then(()=>{p&&p.hide(),c.setData(r)})}})},St=l=>{l.caret=!1;const u=l.querySelector("cds-icon-button, button:not([slot])"),v=l.querySelectorAll("cds-checkbox"),g=l.querySelectorAll("cds-modal-footer-button"),h=[...l.querySelectorAll("cds-checkbox-group")].map(i.getSemanticAttributes).map(B.pathOr("noop",["zoo","filter","field"])).reduce((b,A)=>(b[A]=null,b),{offset:0});if(!u||!g){console.error("Improperly configured Batch Filter popover");return}new MutationObserver(()=>{l.classList.toggle("cds--overflow-menu--open",l.open)}).observe(l,{attributes:!0,attributeFilter:["open"]});const E=Symbol(),I=Symbol(),_=[...g].reduce((b,A,C)=>(A.hasAttribute("reset-filter")&&b.set(E,A),A.hasAttribute("apply-filter")&&b.set(I,A),b),new Map),k=()=>{const b=new Map;return v.forEach(A=>{const C=A.getAttribute("id");if(!C||!C.includes(":"))return;const[N,T]=C.split(":");b.has(N)||b.set(N,[]),A.checked&&b.get(N).push(T)}),b};if(_.has(E)){const b=A=>A.checked=!1;t.listen(_.get(E),"click",A=>{A.stopPropagation(),v.forEach(b),p&&p.show(),r.fetchData(h).then(()=>{c&&c.setData(r),p&&p.hide(),l.open=!1})})}_.has(I)&&t.listen(_.get(I),"click",b=>{b.stopPropagation();const A=[...k()].reduce((C,[N,T])=>(C[N]=Array.isArray(T)&&T.length===0?null:T,C),{offset:0});p&&p.show(),r.fetchData(A).then(()=>{c&&c.setData(r),p&&p.hide(),l.open=!1})}),t.listen(u,"click",b=>{b.stopPropagation(),l.open=!l.open,l.classList.toggle("cds--overflow-menu--open",l.open)})},Wt=()=>{t.listen(c,o.eventPageSizeChanged,l=>{const u={limit:c.pageSize,offset:0};r.fetchData(u).then(()=>{c.setData(r)})})},It=()=>{let l=null;t.listen(c,o.eventChangeCurrent,u=>{const{page:v}=u.detail,g=c.pageSize,h=(v-1)*g;if(h!==l){l=h;const E={limit:g,offset:h};r.fetchData(E).then(()=>{c.setData(r),p&&p.hide()})}})};r&&c&&(Wt(),It()),r&&S&&(Et(S),At(S));const J=e.querySelector(n.selectorTableToolbarContent);if(J){const l=J.querySelectorAll("cds-popover[data-batch-filter]");r&&l&&l.forEach(St)}e.isSelectable&&(ft(),ht(),W&&bt(W)),r&<&>();const K={zoo:{event:{row:{click:dt,expand:pt,check:{one:mt,all:vt}},column:{sort:ut}}}};(0,at.objToPaths)(s).forEach(([l,u])=>{B.hasPath(l,K)&&B.path(l,K)(u)})},Bt=t=>{const e=document.createElement("cds-pagination");return e.backwardText="Previous page",e.forwardText="Next page",e.itemsPerPageText="Items per page:",e.pageSize=t.limit,e.size="lg",[10,25,50,100,500].forEach(s=>{const n=document.createElement("cds-select-item");n.value=s.toString(),n.textContent=s.toString(),e.appendChild(n)}),e.setData=s=>{if(s.isPaginated){const{count:n}=B.pick(["count"],s.data);e.pagesUnknown=Math.ceil(n/s.limit)>100,e.totalItems=n,e.pagesUnknown?e.formatStatusWithIndeterminateTotal=({start:o,end:a})=>`${o}–${a} of ${n} item${n<=1?"":"s"}`:delete e.formatStatusWithIndeterminateTotal}},e},Nt=t=>{if(!t.parentNode){console.error("[Carbon Table] Cannot create skeleton: table has no parent node");return}const e=!!t.querySelector("cds-table-header-title"),s=!!t.querySelector("cds-table-header-description"),n=!!t.querySelector("cds-table-toolbar"),o=[...t.querySelectorAll("cds-table-header-cell")].length,a=t.hasAttribute("zebra"),r=t.getAttribute("size"),c=document.createElement("cds-table-skeleton");c.showHeader=e||s,c.showToolbar=n,c.zebra=a,c.columnCount=o,c.size=r,c.show=()=>c.classList.remove("hidden"),c.hide=()=>c.classList.add("hidden");const p=document.createElement("div");return p.classList.add("zoo-datatable-skeleton-wrapper"),t.parentNode.insertBefore(p,t),p.appendChild(c),p.appendChild(t),c},Tt=(t,e)=>{const s=e.getAttribute("zoo-url-api"),n=parseInt(e.getAttribute("data-page-size")||25,10);if(s)return new i.Binder(t,s,e,{urlParams:{limit:n}})},Mt={selector:"cds-table",init:function(t){const e=i.getSemanticAttributes(t),s=this,n=Tt(s,t);if((0,at.isDefAndNotNull)(n)){t.dataBinder=n;const o=Nt(t);t.skeleton=o;const a=Bt(n);t.pagination=a,t.after(a),n.fetchData().then(r=>{o.hide(),a.setData(n),X(s,t,e)})}else X(s,t,e)}},Ft=m.__exportAll({cdsPaginationWrap:()=>qt}),qt={selector:"cds-pagination",init:function(t){const e=this,s=customElements.get("cds-pagination");let n=null;e.listen(t,s.eventChangeCurrent,o=>{const a=o.detail.page,r=t.pageSize,c=(a-1)*r;c!==n&&(n=c,e.dispatchPanelEvent("pagination-changed-current",{detail:{page:a,pageSize:r,action:"page-change"}}))}),e.listen(t,s.eventPageSizeChanged,o=>{const a=t.pageSize;n=null,e.dispatchPanelEvent("pagination-changed-page-size",{detail:{page:1,pageSize:a,action:"page-size-change"}})})}},zt=m.__exportAll({cdsModalBodyContentWrap:()=>jt,cdsModalBodyWrap:()=>Ht,cdsModalCloseButWrap:()=>$t,cdsModalFooterButWrap:()=>Vt,cdsModalFooterWrap:()=>Gt,cdsModalHeaderWrap:()=>Lt,cdsModalHeadingWrap:()=>Rt,cdsModalLabelWrap:()=>Ut,cdsModalWrap:()=>Ot}),Ot={selector:"cds-modal",init:function(t){const e=customElements.get("cds-modal"),s=i.getSemanticAttributes(t),n=i.getEventAttribute(t,"open-event","event");n&&this.listen(t,"cds-modal-beingopened",r=>{this.dispatchPanelEvent(n,{...s,action:"opened"})});const o=t.getAttribute("before-close-event");o&&this.listen(t,e.eventBeforeClose,r=>{this.dispatchPanelEvent(o,{...s,action:"closing",cancelable:!0})}),this.listen(t,e.eventClose,r=>{this.dispatchPanelEvent("destroy_me",{...s,action:"closed",triggeredBy:r.detail?.triggeredBy})});const a=i.getEventAttribute(t,"primary-event","event");a&&this.listen(t,"cds-modal-primary-focus",r=>{this.dispatchPanelEvent(a,{...s,action:"primary"})})}},Lt={selector:"cds-modal-header"},Rt={selector:"cds-modal-heading"},Ut={selector:"cds-modal-label"},$t={selector:"cds-modal-close-button"},Ht={selector:"cds-modal-body"},jt={selector:"cds-modal-body-content"},Gt={selector:"cds-modal-footer"},Vt={selector:"cds-modal-footer-button",init:function(t){const e=i.getSemanticAttributes(t);if(t.getAttribute("type")==="submit"){this.listen(t,"click",n=>{let o=t.closest("form");if(!o){const a=t.getAttribute("form");a&&(o=document.getElementById(a))}o&&o.requestSubmit()});return}const s=e.event;s&&this.listen(t,"click",n=>{n.stopPropagation(),this.dispatchPanelEvent(s,e)})}},Zt=m.__exportAll({cdsMenuButtonWrap:()=>Kt,cdsMenuWrap:()=>Jt}),Jt={selector:"cds-menu",init:function(t){const e=i.getSemanticAttributes(t),s=i.getEventAttribute(t,"open-event");s&&this.listen(t,"cds-menu-opened",o=>{this.dispatchPanelEvent(s,{...e,action:"opened"})});const n=i.getEventAttribute(t,"close-event");n&&this.listen(t,"cds-menu-closed",o=>{this.dispatchPanelEvent(n,{...e,action:"closed"})}),this.listen(t,"click",o=>{if(o.target.tagName==="CDS-MENU-ITEM"){const a=i.getSemanticAttributes(o.target),r=a.event||e.event;r&&(o.stopPropagation(),this.dispatchPanelEvent(r,{...e,...a}))}}),this.listen(t,"cds-item-changed",o=>{const a=o.detail.triggeredBy,r=i.getSemanticAttributes(a),c=r.event||e.event;c&&this.dispatchPanelEvent(c,{...e,...r,action:"selection-changed"})})}},Kt={selector:"cds-menu-button",init:function(t){const e=i.getSemanticAttributes(t),s=t.querySelector("cds-menu");s&&this.listen(s,"click",n=>{if(n.target.tagName==="CDS-MENU-ITEM"){const o=i.getSemanticAttributes(n.target),a=o.event||e.event;a&&(n.stopPropagation(),this.dispatchPanelEvent(a,{...e,...o}))}})}},Qt=m.__exportAll({cdsButFabWrap:()=>ee,cdsButtonWrap:()=>Xt,cdsComboButWrap:()=>ne,cdsCopyButWrap:()=>se,cdsIconButToggleWrap:()=>te,cdsIconButWrap:()=>Yt}),Xt={selector:"cds-button",init:function(t){const e=i.getSemanticAttributes(t);if(t.getAttribute("type")==="submit"){this.listen(t,"click",n=>{let o=t.closest("form");if(!o){const a=t.getAttribute("form");a&&(o=document.getElementById(a))}o&&o.requestSubmit()});return}const s=e.event;s&&this.listen(t,"click",n=>{n.stopPropagation(),this.dispatchPanelEvent(s,i.getSemanticAttributes(t))})}},Yt={selector:"cds-icon-button:not([data-toggle])",event:"click",getData:(t,e)=>e},te={selector:"cds-icon-button[data-toggle]",init:function(t){const e=i.getSemanticAttributes(t);e.event&&this.listen(t,"click",s=>{s.stopPropagation(),t.isSelected=!t.isSelected,this.dispatchPanelEvent(e.event,{...e,isOn:t.isSelected})})}},ee={selector:"cds-button[data-fab]",event:"click",getData:(t,e)=>e},se={selector:"cds-copy-button",init:function(t){const e=i.getSemanticAttributes(t),s=e.event;s&&this.listen(t,"click",o=>{o.stopPropagation(),this.dispatchPanelEvent(s,{...e,action:"copy"})});const n=t.getAttribute("success-event");if(n){const o=new MutationObserver(()=>{t.hasAttribute("feedback-shown")&&this.dispatchPanelEvent(n,{...e,action:"copied"})});o.observe(t,{attributes:!0,attributeFilter:["feedback-shown"]}),t._copyObserver=o}}},ne={selector:"cds-combo-button",init:function(t){const e=i.getSemanticAttributes(t);e.event&&this.listen(t,"click",n=>{const o=n.composedPath(),a=o.some(c=>c.tagName==="CDS-MENU-ITEM"),r=o.some(c=>c.tagName==="CDS-ICON-BUTTON");!a&&!r&&(n.stopPropagation(),this.dispatchPanelEvent(e.event,{...e,action:"primary"}))});const s=t.querySelector("cds-menu");s&&this.listen(s,"click",n=>{if(n.target.tagName==="CDS-MENU-ITEM"){const o=i.getSemanticAttributes(n.target),a=o.event||i.getEventAttribute(t,"menu-event","event");a&&this.dispatchPanelEvent(a,{...e,...o,action:"menu-item"})}})}},oe=m.__exportAll({cdsComboBoxWrap:()=>re,cdsDropdownWrap:()=>ae,cdsMultiSelectWrap:()=>ie}),ae={selector:"cds-dropdown",init:function(t){const e=customElements.get("cds-dropdown"),s=i.getSemanticAttributes(t),n=s.event;n&&this.listen(t,e.eventSelect,a=>{this.dispatchPanelEvent(n,{...s,value:t.value,selectedValue:a.detail?.item?.value,selectedText:a.detail?.item?.textContent?.trim()})});const o=t.getAttribute("toggle-event");o&&this.listen(t,e.eventToggle,a=>{this.dispatchPanelEvent(o,{...s,open:t.hasAttribute("open")})})}},re={selector:"cds-combo-box",init:function(t){const e=customElements.get("cds-combo-box"),s=i.getSemanticAttributes(t),n=s.event;n&&this.listen(t,e.eventSelect,a=>{const r=a.detail?.item;this.dispatchPanelEvent(n,{...s,value:t.value,selectedValue:r?.value,selectedText:r?.textContent?.trim()})});const o=t.getAttribute("toggle-event");o&&this.listen(t,e.eventToggle,a=>{this.dispatchPanelEvent(o,{...s,open:t.hasAttribute("open")})})}},ie={selector:"cds-multi-select",init:function(t){const e=customElements.get("cds-multi-select"),s=i.getSemanticAttributes(t),n=s.event;n&&this.listen(t,e.eventSelect,a=>{const r=t.value?t.value.split(","):[];this.dispatchPanelEvent(n,{...s,selectedItems:r})});const o=t.getAttribute("toggle-event");o&&this.listen(t,e.eventToggle,a=>{this.dispatchPanelEvent(o,{...s,open:t.hasAttribute("open")})})}},ce=m.__exportAll({cdsDatePickerWrap:()=>le,cdsTimePickerWrap:()=>de}),le={selector:"cds-date-picker",init:function(t){const e=customElements.get("cds-date-picker"),s=i.getSemanticAttributes(t),n=t.querySelector('cds-date-picker-input[kind="from"]'),o=t.querySelector('cds-date-picker-input[kind="to"]'),a=n&&o,r=s.event;r&&this.listen(t,e.eventChange,p=>{let S;a?S={from:n.value||"",to:o.value||""}:S=t.value,this.dispatchPanelEvent(r,{...s,value:S})});const c=t.getAttribute("error-event");c&&this.listen(t,e.eventFlatpickrError,p=>{this.dispatchPanelEvent(c,{...s,error:p.detail})})}},de={selector:"cds-time-picker",event:"cds-time-picker-changed",getData:(t,e,s)=>({...e,value:s.value})},pe=m.__exportAll({cdsFileUploaderButtonWrap:()=>ve,cdsFileUploaderDropContainerWrap:()=>fe,cdsFileUploaderWrap:()=>ue});function rt(t){customElements.whenDefined(t).then(e=>{if(!(!e||e.prototype.__zooyAcceptPatched)){if(typeof e.prototype._getFiles!="function"){console.warn(`[Zooy] ${t}._getFiles missing; accept-split patch skipped (Carbon may have refactored).`);return}e.prototype._getFiles=function(s,n){if(n===void 0&&(n=(s.type==="drop"?s.dataTransfer:s.target)?.files),!this.accept||!/^(change|drop)$/.test(s.type))return Array.from(n??[]);const o=new Set(this.accept.split(/[\s,]+/).filter(Boolean));return Array.prototype.filter.call(n??[],({name:a,type:r=""})=>{const c=a.match(/\.[^.]+$/),p=c?c[0].toLowerCase():void 0;return o.has(r)||p&&o.has(p)})},e.prototype.__zooyAcceptPatched=!0}})}rt("cds-file-uploader-drop-container");rt("cds-file-uploader-button");var ue={selector:"cds-file-uploader",init:function(t){const e=i.getSemanticAttributes(t),s=e.event;if(s){const o=t.querySelector('input[type="file"]');o&&this.listen(o,"change",a=>{this.dispatchPanelEvent(s,{...e,files:Array.from(a.target.files||[])})})}const n=t.getAttribute("delete-event");n&&this.listen(t,"cds-file-uploader-item-deleted",o=>{this.dispatchPanelEvent(n,{...e,fileName:o.detail?.fileName,fileId:o.detail?.fileId})})}};function it(t,e){const s=new DataTransfer;for(const n of e)s.items.add(n);t.files=s.files,t.dispatchEvent(new Event("change",{bubbles:!0}))}function ct(t){const e=t.getAttribute("for");if(!e)return console.warn(`[Zooy] ${t.tagName.toLowerCase()} missing 'for' attribute; cannot bind to a form input.`,t),null;const s=t.ownerDocument.getElementById(e);return!s||s.tagName!=="INPUT"||s.type!=="file"?(console.warn(`[Zooy] 'for=${e}' did not resolve to an <input type="file">.`,t),null):s}var ve={selector:"cds-file-uploader-button",init:function(t){const e=ct(t),s=i.getSemanticAttributes(t),n=s.event;this.listen(t,"cds-file-uploader-button-changed",o=>{const a=o.detail?.addedFiles||[];e&&it(e,a),n&&this.dispatchPanelEvent(n,{...s,files:Array.from(a)})})}};function me(t,e,s,n){const o=t.querySelector(`[data-file-list-for="${e}"]`);if(o){o.replaceChildren();for(const a of s){const r=t.createElement("cds-file-uploader-item");r.setAttribute("state","edit"),r.textContent=a.name,r.addEventListener("cds-file-uploader-item-deleted",()=>{n(a.name)}),o.appendChild(r)}}}function ge(t,e){const s=new DataTransfer;for(const n of t.files)n.name!==e&&s.items.add(n);t.files=s.files,t.dispatchEvent(new Event("change",{bubbles:!0}))}var fe={selector:"cds-file-uploader-drop-container",init:function(t){const e=ct(t),s=i.getSemanticAttributes(t),n=s.event,o=t.getAttribute("for"),a=()=>{if(!o||!e)return;const r=Array.from(e.files);me(t.ownerDocument,o,r,c=>{ge(e,c),a()}),t.multiple||(t.style.display=r.length>0?"none":"")};this.listen(t,"cds-file-uploader-drop-container-changed",r=>{const c=r.detail?.addedFiles||[],p=t.multiple?c:c.slice(0,1);e&&it(e,p),a(),n&&this.dispatchPanelEvent(n,{...s,files:Array.from(p)})})}},he=m.__exportAll({cdsAccordionWrap:()=>Ee,cdsContentSwitcherWrap:()=>Ae,cdsTabsWrap:()=>be}),be={selector:"cds-tabs",init:function(t){const e=customElements.get("cds-tabs"),s=i.getSemanticAttributes(t),n=t.getAttribute("before-select-event");n&&this.listen(t,e.eventBeforeSelect,a=>{this.dispatchPanelEvent(n,{...s,tabValue:a.detail.value,cancelable:!0})});const o=s.event;o&&this.listen(t,e.eventSelect,a=>{const r=a.detail.item,c=i.getSemanticAttributes(r);this.dispatchPanelEvent(o,{...s,...c,tabValue:a.detail.value})})}},Ee={selector:"cds-accordion",init:function(t){const e=customElements.get("cds-accordion-item"),s=i.getSemanticAttributes(t);[...t.querySelectorAll("cds-accordion-item")].forEach(n=>{const o=i.getSemanticAttributes(n),a=o.event||s.event;a&&this.listen(n,e.eventToggle,r=>{this.dispatchPanelEvent(a,{...s,...o,open:r.detail.open})})})}},Ae={selector:"cds-content-switcher",init:function(t){const e=customElements.get("cds-content-switcher"),s=i.getSemanticAttributes(t),n=t.getAttribute("before-select-event");n&&this.listen(t,e.eventBeforeSelect,a=>{this.dispatchPanelEvent(n,{...s,value:a.detail.value,cancelable:!0})});const o=s.event;o&&this.listen(t,e.eventSelect,a=>{const r=a.detail.item,c=i.getSemanticAttributes(r);this.dispatchPanelEvent(o,{...s,...c,value:r.getAttribute("value")})})}},Se=m.__exportAll({cdsBreadCrumbWrap:()=>ye,cdsBreadcrumbItemWrap:()=>We,cdsBreadcrumbLinkWrap:()=>Ie}),We={selector:"cds-breadcrumb-item"},Ie={selector:"cds-breadcrumb-link",event:"click",getData:(t,e,s)=>(t.preventDefault(),{...e,href:s.getAttribute("href")})},ye={selector:"cds-breadcrumb",init:function(t){const e=this,s=i.getSemanticAttributes(t),n=s.event;if(n){const o=r=>{e.dispatchPanelEvent(n,{...s,...r})};e.listen(t,"click",r=>{const c=r.target.closest("cds-breadcrumb-link");c&&(r.preventDefault(),r.stopPropagation(),o(i.getSemanticAttributes(c)))});const a=t.querySelector("cds-overflow-menu-body");a&&e.listen(a,"cds-overflow-menu-item-clicked",r=>{r.stopPropagation(),o(i.getSemanticAttributes(r.target))})}}},Pe=m.__exportAll({cdsNumberInputWrap:()=>Ce,cdsPasswordInputWrap:()=>we,cdsSearchWrap:()=>xe,cdsTextAreaWrap:()=>ke,cdsTextInputWrap:()=>_e}),_e={selector:"cds-text-input",multiEvent:!0,events:[{type:"input",attrName:"event",getData:(t,e)=>({...e,value:t.currentTarget.value})},{type:"change",attrName:"change-event",getData:(t,e)=>({...e,value:t.currentTarget.value})}]},ke={selector:"cds-textarea",multiEvent:!0,events:[{type:"input",attrName:"event",getData:(t,e)=>({...e,value:t.currentTarget.value})},{type:"change",attrName:"change-event",getData:(t,e)=>({...e,value:t.currentTarget.value})}]},Ce={selector:"cds-number-input",event:"cds-number-input",getData:(t,e,s)=>({...e,value:t.detail.value,direction:t.detail.direction})},we={selector:"cds-password-input",multiEvent:!0,events:[{type:"input",attrName:"event",getData:(t,e)=>({...e,value:t.currentTarget.value})},{type:"change",attrName:"change-event",getData:(t,e)=>({...e,value:t.currentTarget.value})}]},xe={selector:"cds-search",event:"cds-search-input",getData:(t,e,s)=>({...e,value:s.value})},De=m.__exportAll({cdsCheckboxWrap:()=>Be,cdsRadioButGroupWrap:()=>Ne,cdsSelectWrap:()=>Me,cdsSliderWrap:()=>Fe,cdsToggleWrap:()=>Te}),Be={selector:"cds-checkbox",event:"cds-checkbox-changed",getData:(t,e,s)=>({...e,checked:t.detail.checked,value:s.value})},Ne={selector:"cds-radio-button-group",event:"cds-radio-button-group-changed",getData:(t,e)=>({...e,value:t.detail?.value})},Te={selector:"cds-toggle",event:"cds-toggle-changed",getData:(t,e)=>({...e,isOn:t.detail.checked,value:t.detail.checked})},Me={selector:"cds-select",event:"cds-select-selected",getData:(t,e)=>({...e,value:t.detail.value})},Fe={selector:"cds-slider",init:function(t){const e=i.getSemanticAttributes(t),s=e.event;s&&this.listen(t,"cds-slider-changed",o=>{this.dispatchPanelEvent(s,{...e,value:o.detail.value})});const n=t.getAttribute("input-event");n&&this.listen(t,"cds-slider-input-changed",o=>{this.dispatchPanelEvent(n,{...e,value:o.detail.value})})}},qe=m.__exportAll({cdsFilterTagWrap:()=>Le,cdsSDismissibleTagWrap:()=>Oe,cdsTagsWrap:()=>ze}),ze={selector:"cds-tag",event:"click",getData:(t,e)=>e},Oe={selector:"cds-dismissible-tag",init:function(t){const e=i.getSemanticAttributes(t),s=t.getAttribute("click-event");s&&this.listen(t,"click",o=>{o.target.closest("button")||this.dispatchPanelEvent(s,{...e})});const n=e.event;n&&this.listen(t,"cds-dismissible-tag-closed",o=>{this.dispatchPanelEvent(n,{...e,action:"closed"})})}},Le={selector:"cds-filter-tag",event:"cds-filter-tag-closed",getData:(t,e)=>({...e,action:"remove"})},Re=m.__exportAll({cdsContainedListDescriptionWrap:()=>je,cdsContainedListItemWrap:()=>Ge,cdsContainedListWrap:()=>He,cdsOverflowMenuWrap:()=>Ue,cdsStructuredListWrap:()=>$e,cdsTreeViewWrap:()=>Ve}),Ue={selector:"cds-overflow-menu",init:function(t){const e=i.getSemanticAttributes(t),s=e.event,n=t.querySelector("cds-overflow-menu-body");s&&n&&this.listen(n,"cds-overflow-menu-item-clicked",o=>{o.stopPropagation();const a=i.getSemanticAttributes(o.target);this.dispatchPanelEvent(s,{...e,...a})})}},$e={selector:"cds-structured-list",init:function(t){const e=i.getSemanticAttributes(t);[...t.querySelectorAll("cds-structured-list-row")].forEach(s=>{const n=i.getSemanticAttributes(s),o=n.event||e.event;o&&this.listen(s,"click",a=>{a.stopPropagation(),this.dispatchPanelEvent(o,{...e,...n})})}),t.hasAttribute("selection")&&this.listen(t,"cds-structured-list-selected",s=>{const n=s.detail.row,o=i.getSemanticAttributes(n),a=e.event;a&&this.dispatchPanelEvent(a,{...e,...o})})}},He={selector:"cds-contained-list"},je={selector:"cds-contained-list-description"},Ge={selector:"cds-contained-list-item",event:"cds-contained-list-item-click",getData:(t,e)=>e},Ve={selector:"cds-tree-view",init:function(t){const e=i.getSemanticAttributes(t);this.listen(t,"cds-tree-node-selected",n=>{const o=n.detail.node,a=i.getSemanticAttributes(o),r=a.event||e.event;r&&this.dispatchPanelEvent(r,{...e,...a,nodeId:o.id,label:o.getAttribute("label")})});const s=i.getEventAttribute(t,"expand-event");s&&this.listen(t,"cds-tree-node-expanded",n=>{this.dispatchPanelEvent(s,{...e,nodeId:n.detail.node.id,expanded:n.detail.expanded})})}},Ze=m.__exportAll({cdsActionableNotificationWrap:()=>Qe,cdsInlineNotificationWrap:()=>Ke,cdsToastNotificationWrap:()=>Je}),Je={selector:"cds-toast-notification",event:"cds-notification-closed",getData:(t,e)=>({...e,action:"closed"})},Ke={selector:"cds-inline-notification",event:"cds-notification-closed",getData:(t,e)=>({...e,action:"closed"})},Qe={selector:"cds-actionable-notification",init:function(t){const e=i.getSemanticAttributes(t),s=i.getEventAttribute(t,"close-event","event");s&&this.listen(t,"cds-notification-closed",o=>{this.dispatchPanelEvent(s,{...e,action:"closed"})});const n=i.getEventAttribute(t,"action-event");n&&this.listen(t,"cds-notification-actioned",o=>{this.dispatchPanelEvent(n,{...e,action:"actioned"})})}},Xe=m.__exportAll({cdsClickableTileWrap:()=>ts,cdsExpandableTileWrap:()=>es,cdsRadioTileWrap:()=>ns,cdsSelectableTileWrap:()=>ss,cdsTileGroupWrap:()=>os,cdsTileWrap:()=>Ye}),Ye={selector:"cds-tile"},ts={selector:"cds-clickable-tile",init:function(t){const e=i.getSemanticAttributes(t),s=e.event;if(s){const n=e.href||t.getAttribute("href")||"";t.removeAttribute("href"),t.addEventListener("click",o=>{o.preventDefault(),o.stopPropagation(),this.dispatchPanelEvent(s,{...e,href:n})},!0)}}},es={selector:"cds-expandable-tile",init:function(t){const e=i.getSemanticAttributes(t),s=t.getAttribute("before-toggle-event");s&&this.listen(t,"cds-expandable-tile-beingtoggled",o=>{this.dispatchPanelEvent(s,{...e,expanded:o.detail.expanded,cancelable:!0})});const n=e.event;n&&this.listen(t,"cds-expandable-tile-toggled",o=>{this.dispatchPanelEvent(n,{...e,expanded:o.detail.expanded})})}},ss={selector:"cds-selectable-tile",event:"cds-selectable-tile-changed",getData:(t,e,s)=>({...e,selected:t.detail.selected,value:s.value})},ns={selector:"cds-radio-tile",event:"cds-radio-tile-selected",getData:(t,e,s)=>({...e,selected:t.detail.selected,name:t.detail.name,value:s.value})},os={selector:"cds-tile-group",init:function(t){const e=i.getSemanticAttributes(t),s=e.event;s&&(this.listen(t,"cds-current-radio-tile-selection",n=>{const o=n.detail.target;this.dispatchPanelEvent(s,{...e,value:o?.value,name:o?.name,selected:o?.selected})}),this.listen(t,"cds-current-selectable-tile-selections",n=>{const o=n.detail.currentSelections||[];this.dispatchPanelEvent(s,{...e,values:o.map(a=>a.value),names:o.map(a=>a.name),count:o.length})}))}},as=m.__exportAll({cdsInlineLoadingWrap:()=>cs,cdsProgressBarWrap:()=>rs,cdsProgressIndicatorWrap:()=>is}),rs={selector:"cds-progress-bar",init:function(t){const e=i.getSemanticAttributes(t);if(e.event){const s=new MutationObserver(()=>{const n=parseFloat(t.getAttribute("value")||"0");n>=parseFloat(t.getAttribute("max")||"100")&&this.dispatchPanelEvent(e.event,{...e,value:n,status:"complete"})});s.observe(t,{attributes:!0,attributeFilter:["value"]}),t._progressObserver=s}}},is={selector:"cds-progress-indicator",init:function(t){const e=i.getSemanticAttributes(t);this.listen(t,"cds-progress-step-click",s=>{const n=s.target,o=i.getSemanticAttributes(n),a=o.event||e.event;a&&this.dispatchPanelEvent(a,{...e,...o,stepIndex:n.getAttribute("data-index"),stepLabel:n.getAttribute("label")})})}},cs={selector:"cds-inline-loading",init:function(t){const e=i.getSemanticAttributes(t),s=e.event;s&&this.listen(t,"cds-inline-loading-onsuccess",o=>{this.dispatchPanelEvent(s,{...e,status:"finished"})});const n=t.getAttribute("status-event");if(n){const o=new MutationObserver(a=>{a.forEach(r=>{if(r.attributeName==="status"){const c=t.getAttribute("status");this.dispatchPanelEvent(n,{...e,status:c})}})});o.observe(t,{attributes:!0,attributeFilter:["status"]}),t._statusObserver=o}}},ls=m.__exportAll({cdsPopoverWrap:()=>ps,cdsToggletipWrap:()=>us,cdsTooltipWrap:()=>ds}),ds={selector:"cds-tooltip",init:function(t){const e=i.getSemanticAttributes(t),s=i.getEventAttribute(t,"open-event");s&&this.listen(t,"cds-tooltip-beingopened",o=>{this.dispatchPanelEvent(s,{...e,action:"opened"})});const n=i.getEventAttribute(t,"close-event");n&&this.listen(t,"cds-tooltip-closed",o=>{this.dispatchPanelEvent(n,{...e,action:"closed"})})}},ps={selector:"cds-popover",init:function(t){const e=i.getSemanticAttributes(t),s=i.getEventAttribute(t,"open-event");s&&this.listen(t,"cds-popover-beingopened",o=>{this.dispatchPanelEvent(s,{...e,action:"opened"})});const n=i.getEventAttribute(t,"close-event");n&&this.listen(t,"cds-popover-closed",o=>{this.dispatchPanelEvent(n,{...e,action:"closed"})})}},us={selector:"cds-toggletip",init:function(t){const e=i.getSemanticAttributes(t);if(e.event){const s=new MutationObserver(n=>{n.forEach(o=>{if(o.attributeName==="open"){const a=t.hasAttribute("open");this.dispatchPanelEvent(e.event,{...e,action:a?"opened":"closed",open:a})}})});s.observe(t,{attributes:!0,attributeFilter:["open"]}),t._toggletipObserver=s}}},vs=m.__exportAll({cdsCodeSnipWrap:()=>gs,cdsLinkWrap:()=>ms}),ms={selector:"cds-link",event:"click",getData:(t,e,s)=>({...e,href:s.getAttribute("href")})},gs={selector:"cds-code-snippet",event:"cds-copy-button-clicked",getData:(t,e)=>({...e,action:"copied"})},fs=m.__exportAll({cdsBadgeIndicatorWrap:()=>Ps,cdsFormGroupWrap:()=>Es,cdsFormItemWrap:()=>bs,cdsFormWrap:()=>hs,cdsHeadingWrap:()=>Ss,cdsIconIndicatorWrap:()=>ys,cdsIconWrap:()=>Is,cdsLoadingWrap:()=>_s,cdsSectionWrap:()=>Ws,cdsSkeletonPlaceholderWrap:()=>Cs,cdsSkeletonTextWrap:()=>ks,cdsStackWrap:()=>As}),hs={selector:"cds-form"},bs={selector:"cds-form-item"},Es={selector:"cds-form-group"},As={selector:"cds-stack"},Ss={selector:"cds-heading"},Ws={selector:"cds-section"},Is={selector:"cds-icon"},ys={selector:"cds-icon-indicator"},Ps={selector:"cds-badge-indicator"},_s={selector:"cds-loading"},ks={selector:"cds-skeleton-text"},Cs={selector:"cds-skeleton-placeholder"};function f(t){return Object.values(t).filter(e=>typeof e=="object"&&e!==null&&e.selector)}var ws=[...f(Ft),...f(Dt),...f(zt),...f(Zt),...f(Qt),...f(oe),...f(ce),...f(pe),...f(he),...f(Se),...f(Pe),...f(De),...f(qe),...f(Re),...f(Ze),...f(Xe),...f(as),...f(ls),...f(vs),...f(fs)];function xs(){const t=new Map;return ws.forEach(e=>{t.set(e.selector,e)}),t}var Ds=()=>import("@carbon/web-components/es/components/accordion/index.js"),R=()=>import("@carbon/web-components/es/components/breadcrumb/index.js"),Bs=()=>import("@carbon/web-components/es/components/stack/index.js"),Ns=()=>import("@carbon/web-components/es/components/structured-list/index.js"),U=()=>import("@carbon/web-components/es/components/contained-list/index.js"),D=()=>import("@carbon/web-components/es/components/tile/index.js"),Ts=()=>import("@carbon/web-components/es/components/tree-view/index.js"),Ms=()=>import("@carbon/web-components/es/components/link/index.js"),Fs=()=>import("@carbon/web-components/es/components/tabs/index.js"),qs=()=>import("@carbon/web-components/es/components/content-switcher/index.js"),Y=()=>import("@carbon/web-components/es/components/menu/index.js"),zs=()=>import("@carbon/web-components/es/components/overflow-menu/index.js"),$=()=>import("@carbon/web-components/es/components/button/index.js"),tt=()=>import("@carbon/web-components/es/components/icon-button/index.js"),Os=()=>import("@carbon/web-components/es/components/combo-button/index.js"),Ls=()=>import("@carbon/web-components/es/components/copy-button/index.js"),Rs=()=>import("@carbon/web-components/es/components/checkbox/index.js"),Us=()=>import("@carbon/web-components/es/components/radio-button/index.js"),$s=()=>import("@carbon/web-components/es/components/toggle/index.js"),H=()=>import("@carbon/web-components/es/components/select/index.js"),Hs=()=>import("@carbon/web-components/es/components/slider/index.js"),j=()=>import("@carbon/web-components/es/components/text-input/index.js"),js=()=>import("@carbon/web-components/es/components/textarea/index.js"),Gs=()=>import("@carbon/web-components/es/components/number-input/index.js"),Vs=()=>import("@carbon/web-components/es/components/password-input/index.js"),et=()=>import("@carbon/web-components/es/components/search/index.js"),Zs=()=>import("@carbon/web-components/es/components/combo-box/index.js"),Js=()=>import("@carbon/web-components/es/components/dropdown/index.js"),Ks=()=>import("@carbon/web-components/es/components/multi-select/index.js"),Qs=()=>import("@carbon/web-components/es/components/date-picker/index.js"),Xs=()=>import("@carbon/web-components/es/components/time-picker/index.js"),M=()=>import("@carbon/web-components/es/components/file-uploader/index.js"),st=()=>import("@carbon/web-components/es/components/form/index.js"),Ys=()=>import("@carbon/web-components/es/components/form-group/index.js"),tn=()=>import("@carbon/web-components/es/components/data-table/index.js"),nt=()=>import("@carbon/web-components/es/components/pagination/index.js"),en=()=>import("@carbon/web-components/es/components/code-snippet/index.js"),G=()=>import("@carbon/web-components/es/components/tag/index.js"),sn=()=>import("@carbon/web-components/es/components/badge-indicator/index.js"),V=()=>import("@carbon/web-components/es/components/notification/index.js"),nn=()=>import("@carbon/web-components/es/components/loading/index.js"),on=()=>import("@carbon/web-components/es/components/inline-loading/index.js"),an=()=>import("@carbon/web-components/es/components/progress-bar/index.js"),rn=()=>import("@carbon/web-components/es/components/progress-indicator/index.js"),cn=()=>import("@carbon/web-components/es/components/skeleton-placeholder/index.js"),ln=()=>import("@carbon/web-components/es/components/skeleton-text/index.js"),y=()=>import("@carbon/web-components/es/components/modal/index.js"),P=()=>import("@carbon/web-components/es/components/tooltip/index.js"),dn=()=>import("@carbon/web-components/es/components/popover/index.js"),pn=()=>import("@carbon/web-components/es/components/toggle-tip/index.js"),ot=()=>import("@carbon/web-components/es/components/heading/index.js"),un=()=>import("@carbon/web-components/es/components/icon/index.js"),vn=()=>import("@carbon/web-components/es/components/icon-indicator/index.js"),q={"cds-table":[P,$,j,et,H,nt,tn],"cds-pagination":[H,j,nt],"cds-button":[P,$],"cds-icon-button:not([data-toggle])":[P,tt],"cds-icon-button[data-toggle]":[P,tt],"cds-button[data-fab]":[P,$],"cds-copy-button":[P,Ls],"cds-combo-button":[P,Os],"cds-checkbox":[Rs],"cds-radio-button-group":[Us],"cds-toggle":[$s],"cds-select":[H],"cds-slider":[Hs],"cds-text-input":[j],"cds-textarea":[js],"cds-number-input":[Gs],"cds-password-input":[P,Vs],"cds-search":[et],"cds-dropdown":[Js],"cds-combo-box":[Zs],"cds-multi-select":[Ks],"cds-date-picker":[Qs],"cds-time-picker":[Xs],"cds-file-uploader":[M],"cds-file-uploader-button":[M],"cds-file-uploader-drop-container":[M],"cds-file-uploader-item":[M],"cds-tabs":[Fs],"cds-accordion":[Ds],"cds-content-switcher":[qs],"cds-breadcrumb":[R],"cds-breadcrumb-item":[R],"cds-breadcrumb-link":[R],"cds-menu":[Y],"cds-menu-button":[Y],"cds-overflow-menu":[zs],"cds-structured-list":[Ns],"cds-contained-list":[U],"cds-contained-list-item":[U],"cds-contained-list-description":[U],"cds-tree-view":[Ts],"cds-modal":[y],"cds-modal-header":[y],"cds-modal-heading":[y],"cds-modal-label":[y],"cds-modal-close-button":[y],"cds-modal-body":[y],"cds-modal-body-content":[y],"cds-modal-footer":[y],"cds-modal-footer-button":[y],"cds-toast-notification":[V],"cds-inline-notification":[V],"cds-actionable-notification":[V],"cds-tile":[D],"cds-tile-group":[D],"cds-clickable-tile":[D],"cds-expandable-tile":[D],"cds-selectable-tile":[D],"cds-radio-tile":[D],"cds-progress-bar":[an],"cds-progress-indicator":[rn],"cds-inline-loading":[on],"cds-tooltip":[P],"cds-popover":[dn],"cds-toggletip":[pn],"cds-tag":[G],"cds-dismissible-tag":[G],"cds-filter-tag":[G],"cds-link":[Ms],"cds-code-snippet":[en],"cds-form":[st],"cds-form-item":[st],"cds-form-group":[Ys],"cds-stack":[Bs],"cds-heading":[ot],"cds-section":[ot],"cds-icon":[un],"cds-icon-indicator":[vn],"cds-badge-indicator":[sn],"cds-loading":[nn],"cds-skeleton-text":[ln],"cds-skeleton-placeholder":[cn]};function mn(t){const e=new Map;if(!t||!(t instanceof Element))return e;for(const n of Object.keys(F))e.set(n,[]);for(const[n]of Object.entries(F))t.matches(n)&&e.get(n).push(t);const s=t.querySelectorAll("*");for(const n of s)for(const[o]of Object.entries(F))n.matches(o)&&e.get(o).push(n);for(const[n,o]of e.entries())o.length===0&&e.delete(n);return e}function gn(t){const e=new Set;for(const[s,n]of t.entries())n.length>0&&q[s]&&q[s].forEach(o=>e.add(o));return e}async function fn(t,e){if(t.size===0)return;const s=Array.from(t).map(async n=>(e.has(n)||e.set(n,n()),e.get(n)));await Promise.all(s)}function hn(t,e){let s=0;for(const[n,o]of t.entries()){const a=F[n];o.forEach(r=>{if(a.init){a.init.call(e,r);return}if(a.multiEvent){const S=i.getSemanticAttributes(r);a.events.forEach(W=>{const w=i.getEventAttribute(r,W.attrName,"event");w&&e.listen(r,W.type,z=>{e.dispatchPanelEvent(w,W.getData(z,S,r))})});return}const c=i.getSemanticAttributes(r),p=c.event;p&&e.listen(r,a.event,S=>{S.stopPropagation();const W=a.getData(S,c,r),w=W._eventOverride||p;delete W._eventOverride,e.dispatchPanelEvent(w,W)})}),s+=o.length}return s}var F=Object.fromEntries(xs()),bn=async function(t,e){const s=mn(t);if(s.size===0){this.debugMe("[Carbon] No Carbon components found in panel");return}this.carbonComponents||(this.carbonComponents=new Map);for(const[a,r]of s.entries())this.carbonComponents.set(a,r);const n=gn(s);if(n.size>0)try{await fn(n,e)}catch(a){console.error("[Carbon] Failed to load some component modules:",a)}const o=hn(s,this);o>0&&this.debugMe(`[Carbon] Total components initialized: ${o}`)},En=(t={})=>{const{preload:e=[]}=t,s=new Map;if(e.length>0){const n=e.filter(a=>q[a]?!0:(console.warn(`[Carbon] No import found for selector: ${a}`),!1)),o=n.flatMap(a=>q[a].map(r=>(s.has(r)||s.set(r,r()),s.get(r))));Promise.all(o).then(()=>console.debug(`[Carbon] Preloaded: ${n.join(", ")}`)).catch(a=>console.warn("[Carbon] Preload error:",a))}m.ComponentLibraryRegistry.register("carbon",{cache:s,render:async function(n,o){try{await bn.call(this,n,o)}catch(a){console.error("[Carbon] Initialization error:",a)}},dispose:function(n){},config:{version:"2.0",description:"IBM Carbon Design System Web Components"}}),console.debug("[Zooy] Carbon Design System library registered")};exports.registerCarbonLibrary=En;
|
|
1
|
+
var yt=Object.create;var Q=Object.defineProperty;var Pt=Object.getOwnPropertyDescriptor;var _t=Object.getOwnPropertyNames;var kt=Object.getPrototypeOf,Ct=Object.prototype.hasOwnProperty;var wt=(t,e,s,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of _t(e))!Ct.call(t,o)&&o!==s&&Q(t,o,{get:()=>e[o],enumerable:!(n=Pt(e,o))||n.enumerable});return t};var d=(t,e,s)=>(s=t!=null?yt(kt(t)):{},wt(e||!t||!t.__esModule?Q(s,"default",{value:t,enumerable:!0}):s,t));const m=require("./component-library-registry-BBQV6Kpv.js"),i=require("./zoo-26MN2vmT.js");let at=require("badu"),B=require("ramda");B=m.__toESM(B,1);let xt=require("@carbon/web-components/lib/components/data-table/defs.js");var Dt=m.__exportAll({cdsTableWrap:()=>Mt}),X=(t,e,s)=>{const n=customElements.get("cds-table"),o=customElements.get("cds-pagination"),a=customElements.get(n.selectorTableBatchActions);customElements.get("cds-popover");const r=e.dataBinder,c=e.pagination,p=e.skeleton,S=e.querySelector(n.selectorTableToolbarSearch),W=e.querySelector(n.selectorTableBatchActions),w=e.querySelector(n.selectorTableBody),z=["button","a","input","select","textarea",'[role="button"]',".cds--table-expand",".cds--table-column-checkbox"].join(","),Z=e.querySelectorAll(n.selectorHeaderCell+"[is-sortable]"),lt=e.isSortable||Z.length>0,O=Symbol(),L=Symbol(),x=new Map,dt=l=>{t.listen(e,"click",u=>{const v=u.target.closest(n.selectorTableRow);if(!v||u.composedPath().some(h=>h.matches&&h.matches(z)))return;u.stopPropagation();const g=i.getSemanticAttributes(v);t.dispatchPanelEvent(l,{...g})})},pt=l=>{t.listen(e,n.eventExpandoToggle,u=>{const v=u.target,g=v.tagName==="CDS-TABLE-HEADER-ROW",h=u.detail.expanded,E={tableAttrs:s,...i.getSemanticAttributes(v),target:v,allRows:g,didExpand:h};t.dispatchPanelEvent(l,E)})},ut=l=>{x.set(O,u=>{t.dispatchPanelEvent(l,u)})},vt=l=>{x.set(L,u=>{const v=u.detail.selectedRows,g=Math.min(v.length,W.totalRowsCount),h=u.target,E=i.getSemanticAttributes(h),I=v.map(i.getSemanticAttributes),_={tableAttrs:s,...E,target:h,selectCount:g,selection:I};t.dispatchPanelEvent(l,_)})},mt=l=>{t.listen(e,n.eventTableRowSelect,u=>{const v=u.target,g=u.detail.selectedRows||[],h=g.length,E=g.map(i.getSemanticAttributes),I={tableAttrs:s,...i.getSemanticAttributes(v),selectCount:h,selection:E,target:v};t.dispatchPanelEvent(l,I)})},gt=()=>{t.listen(e,n.eventBeforeSort,l=>{const u=l.target,v=l.detail.oldSortDirection,g=l.detail.sortDirection,h=i.getSemanticAttributes(u),E=h.sortField,I=g===xt.TABLE_SORT_DIRECTION.DESCENDING?`-${E}`:E;l.cancelBubble=!0,l.stopPropagation(),l.preventDefault(),w.innerHTML="",p&&p.show(),Z.forEach((k,b)=>{k===u?(k.setAttribute("sort-active","true"),k.setAttribute("sort-direction",g)):(k.removeAttribute("sort-active"),k.setAttribute("sort-direction","none"))});const _={ordering:I};r.fetchData(_).then(()=>{c.setData(r),p&&p.hide()}),x.has(O)&&x.get(O)({tableAttrs:s,...h,sortNow:g,sortWas:v,sortField:E,ordering:I,target:u})})},ft=()=>{t.listen(e,n.eventTableRowSelectAll,l=>{l.detail.selectedRows.length===0&&e.querySelectorAll(n.selectorTableRow).forEach(u=>{u.disabled=!1,u.selected=!1}),x.has(L)&&x.get(L)(l)})},ht=()=>{t.listen(e,n.eventBeforeChangeSelectionAll,l=>{l.stopPropagation(),l.detail.callback&&l.detail.callback()})},bt=l=>{const u=e.querySelector("cds-table-header-row");t.listen(l,a.eventClickSelectAll,v=>{v.stopPropagation(),u.dispatchEvent(new CustomEvent(n.eventBeforeChangeSelectionAll,{bubbles:!0,cancelable:!0,composed:!0,detail:{selected:!0,callback:()=>{l.selectedRowsCount=l.totalRowsCount,e.querySelectorAll(n.selectorTableRow).forEach(g=>{g.disabled=!0})}}}))})},Et=l=>{t.listen(l,"keydown",u=>{if(u.key==="Enter"){p&&p.show(),c.totalItems=0,e.querySelector("cds-table-body").replaceChildren();const v={search:l.value||"",offset:0};r.fetchData(v).then(()=>{c.setData(r),p&&p.hide()})}})},At=l=>{t.listen(l,n.eventSearchInput,u=>{if((u.detail.value||"")===""){const v={search:"",offset:0};p&&p.show(),r.fetchData(v).then(()=>{p&&p.hide(),c.setData(r)})}})},St=l=>{l.caret=!1;const u=l.querySelector("cds-icon-button, button:not([slot])"),v=l.querySelectorAll("cds-checkbox"),g=l.querySelectorAll("cds-modal-footer-button"),h=[...l.querySelectorAll("cds-checkbox-group")].map(i.getSemanticAttributes).map(B.pathOr("noop",["zoo","filter","field"])).reduce((b,A)=>(b[A]=null,b),{offset:0});if(!u||!g){console.error("Improperly configured Batch Filter popover");return}new MutationObserver(()=>{l.classList.toggle("cds--overflow-menu--open",l.open)}).observe(l,{attributes:!0,attributeFilter:["open"]});const E=Symbol(),I=Symbol(),_=[...g].reduce((b,A,C)=>(A.hasAttribute("reset-filter")&&b.set(E,A),A.hasAttribute("apply-filter")&&b.set(I,A),b),new Map),k=()=>{const b=new Map;return v.forEach(A=>{const C=A.getAttribute("id");if(!C||!C.includes(":"))return;const[N,T]=C.split(":");b.has(N)||b.set(N,[]),A.checked&&b.get(N).push(T)}),b};if(_.has(E)){const b=A=>A.checked=!1;t.listen(_.get(E),"click",A=>{A.stopPropagation(),v.forEach(b),p&&p.show(),r.fetchData(h).then(()=>{c&&c.setData(r),p&&p.hide(),l.open=!1})})}_.has(I)&&t.listen(_.get(I),"click",b=>{b.stopPropagation();const A=[...k()].reduce((C,[N,T])=>(C[N]=Array.isArray(T)&&T.length===0?null:T,C),{offset:0});p&&p.show(),r.fetchData(A).then(()=>{c&&c.setData(r),p&&p.hide(),l.open=!1})}),t.listen(u,"click",b=>{b.stopPropagation(),l.open=!l.open,l.classList.toggle("cds--overflow-menu--open",l.open)})},Wt=()=>{t.listen(c,o.eventPageSizeChanged,l=>{const u={limit:c.pageSize,offset:0};r.fetchData(u).then(()=>{c.setData(r)})})},It=()=>{let l=null;t.listen(c,o.eventChangeCurrent,u=>{const{page:v}=u.detail,g=c.pageSize,h=(v-1)*g;if(h!==l){l=h;const E={limit:g,offset:h};r.fetchData(E).then(()=>{c.setData(r),p&&p.hide()})}})};r&&c&&(Wt(),It()),r&&S&&(Et(S),At(S));const J=e.querySelector(n.selectorTableToolbarContent);if(J){const l=J.querySelectorAll("cds-popover[data-batch-filter]");r&&l&&l.forEach(St)}e.isSelectable&&(ft(),ht(),W&&bt(W)),r&<&>();const K={zoo:{event:{row:{click:dt,expand:pt,check:{one:mt,all:vt}},column:{sort:ut}}}};(0,at.objToPaths)(s).forEach(([l,u])=>{B.hasPath(l,K)&&B.path(l,K)(u)})},Bt=t=>{const e=document.createElement("cds-pagination");return e.backwardText="Previous page",e.forwardText="Next page",e.itemsPerPageText="Items per page:",e.pageSize=t.limit,e.size="lg",[10,25,50,100,500].forEach(s=>{const n=document.createElement("cds-select-item");n.value=s.toString(),n.textContent=s.toString(),e.appendChild(n)}),e.setData=s=>{if(s.isPaginated){const{count:n}=B.pick(["count"],s.data);e.pagesUnknown=Math.ceil(n/s.limit)>100,e.totalItems=n,e.pagesUnknown?e.formatStatusWithIndeterminateTotal=({start:o,end:a})=>`${o}–${a} of ${n} item${n<=1?"":"s"}`:delete e.formatStatusWithIndeterminateTotal}},e},Nt=t=>{if(!t.parentNode){console.error("[Carbon Table] Cannot create skeleton: table has no parent node");return}const e=!!t.querySelector("cds-table-header-title"),s=!!t.querySelector("cds-table-header-description"),n=!!t.querySelector("cds-table-toolbar"),o=[...t.querySelectorAll("cds-table-header-cell")].length,a=t.hasAttribute("zebra"),r=t.getAttribute("size"),c=document.createElement("cds-table-skeleton");c.showHeader=e||s,c.showToolbar=n,c.zebra=a,c.columnCount=o,c.size=r,c.show=()=>c.classList.remove("hidden"),c.hide=()=>c.classList.add("hidden");const p=document.createElement("div");return p.classList.add("zoo-datatable-skeleton-wrapper"),t.parentNode.insertBefore(p,t),p.appendChild(c),p.appendChild(t),c},Tt=(t,e)=>{const s=e.getAttribute("zoo-url-api"),n=parseInt(e.getAttribute("data-page-size")||25,10);if(s)return new i.Binder(t,s,e,{urlParams:{limit:n}})},Mt={selector:"cds-table",init:function(t){const e=i.getSemanticAttributes(t),s=this,n=Tt(s,t);if((0,at.isDefAndNotNull)(n)){t.dataBinder=n;const o=Nt(t);t.skeleton=o;const a=Bt(n);t.pagination=a,t.after(a),n.fetchData().then(r=>{o.hide(),a.setData(n),X(s,t,e)})}else X(s,t,e)}},Ft=m.__exportAll({cdsPaginationWrap:()=>qt}),qt={selector:"cds-pagination",init:function(t){const e=this,s=customElements.get("cds-pagination");let n=null;e.listen(t,s.eventChangeCurrent,o=>{const a=o.detail.page,r=t.pageSize,c=(a-1)*r;c!==n&&(n=c,e.dispatchPanelEvent("pagination-changed-current",{detail:{page:a,pageSize:r,action:"page-change"}}))}),e.listen(t,s.eventPageSizeChanged,o=>{const a=t.pageSize;n=null,e.dispatchPanelEvent("pagination-changed-page-size",{detail:{page:1,pageSize:a,action:"page-size-change"}})})}},zt=m.__exportAll({cdsModalBodyContentWrap:()=>jt,cdsModalBodyWrap:()=>Ht,cdsModalCloseButWrap:()=>$t,cdsModalFooterButWrap:()=>Vt,cdsModalFooterWrap:()=>Gt,cdsModalHeaderWrap:()=>Lt,cdsModalHeadingWrap:()=>Rt,cdsModalLabelWrap:()=>Ut,cdsModalWrap:()=>Ot}),Ot={selector:"cds-modal",init:function(t){const e=customElements.get("cds-modal"),s=i.getSemanticAttributes(t),n=i.getEventAttribute(t,"open-event","event");n&&this.listen(t,"cds-modal-beingopened",r=>{this.dispatchPanelEvent(n,{...s,action:"opened"})});const o=t.getAttribute("before-close-event");o&&this.listen(t,e.eventBeforeClose,r=>{this.dispatchPanelEvent(o,{...s,action:"closing",cancelable:!0})}),this.listen(t,e.eventClose,r=>{this.dispatchPanelEvent("destroy_me",{...s,action:"closed",triggeredBy:r.detail?.triggeredBy})});const a=i.getEventAttribute(t,"primary-event","event");a&&this.listen(t,"cds-modal-primary-focus",r=>{this.dispatchPanelEvent(a,{...s,action:"primary"})})}},Lt={selector:"cds-modal-header"},Rt={selector:"cds-modal-heading"},Ut={selector:"cds-modal-label"},$t={selector:"cds-modal-close-button"},Ht={selector:"cds-modal-body"},jt={selector:"cds-modal-body-content"},Gt={selector:"cds-modal-footer"},Vt={selector:"cds-modal-footer-button",init:function(t){const e=i.getSemanticAttributes(t);if(t.getAttribute("type")==="submit"){this.listen(t,"click",n=>{let o=t.closest("form");if(!o){const a=t.getAttribute("form");a&&(o=document.getElementById(a))}o&&o.requestSubmit()});return}const s=e.event;s&&this.listen(t,"click",n=>{n.stopPropagation(),this.dispatchPanelEvent(s,e)})}},Zt=m.__exportAll({cdsMenuButtonWrap:()=>Kt,cdsMenuWrap:()=>Jt}),Jt={selector:"cds-menu",init:function(t){const e=i.getSemanticAttributes(t),s=i.getEventAttribute(t,"open-event");s&&this.listen(t,"cds-menu-opened",o=>{this.dispatchPanelEvent(s,{...e,action:"opened"})});const n=i.getEventAttribute(t,"close-event");n&&this.listen(t,"cds-menu-closed",o=>{this.dispatchPanelEvent(n,{...e,action:"closed"})}),this.listen(t,"click",o=>{if(o.target.tagName==="CDS-MENU-ITEM"){const a=i.getSemanticAttributes(o.target),r=a.event||e.event;r&&(o.stopPropagation(),this.dispatchPanelEvent(r,{...e,...a}))}}),this.listen(t,"cds-item-changed",o=>{const a=o.detail.triggeredBy,r=i.getSemanticAttributes(a),c=r.event||e.event;c&&this.dispatchPanelEvent(c,{...e,...r,action:"selection-changed"})})}},Kt={selector:"cds-menu-button",init:function(t){const e=i.getSemanticAttributes(t),s=t.querySelector("cds-menu");s&&this.listen(s,"click",n=>{if(n.target.tagName==="CDS-MENU-ITEM"){const o=i.getSemanticAttributes(n.target),a=o.event||e.event;a&&(n.stopPropagation(),this.dispatchPanelEvent(a,{...e,...o}))}})}},Qt=m.__exportAll({cdsButFabWrap:()=>ee,cdsButtonWrap:()=>Xt,cdsComboButWrap:()=>ne,cdsCopyButWrap:()=>se,cdsIconButToggleWrap:()=>te,cdsIconButWrap:()=>Yt}),Xt={selector:"cds-button",init:function(t){const e=i.getSemanticAttributes(t);if(t.getAttribute("type")==="submit"){this.listen(t,"click",n=>{let o=t.closest("form");if(!o){const a=t.getAttribute("form");a&&(o=document.getElementById(a))}o&&o.requestSubmit()});return}const s=e.event;s&&this.listen(t,"click",n=>{n.stopPropagation(),this.dispatchPanelEvent(s,i.getSemanticAttributes(t))})}},Yt={selector:"cds-icon-button:not([data-toggle])",event:"click",getData:(t,e)=>e},te={selector:"cds-icon-button[data-toggle]",init:function(t){const e=i.getSemanticAttributes(t);e.event&&this.listen(t,"click",s=>{s.stopPropagation(),t.isSelected=!t.isSelected,this.dispatchPanelEvent(e.event,{...e,isOn:t.isSelected})})}},ee={selector:"cds-button[data-fab]",event:"click",getData:(t,e)=>e},se={selector:"cds-copy-button",init:function(t){const e=i.getSemanticAttributes(t),s=e.event;s&&this.listen(t,"click",o=>{o.stopPropagation(),this.dispatchPanelEvent(s,{...e,action:"copy"})});const n=t.getAttribute("success-event");if(n){const o=new MutationObserver(()=>{t.hasAttribute("feedback-shown")&&this.dispatchPanelEvent(n,{...e,action:"copied"})});o.observe(t,{attributes:!0,attributeFilter:["feedback-shown"]}),t._copyObserver=o}}},ne={selector:"cds-combo-button",init:function(t){const e=i.getSemanticAttributes(t);e.event&&this.listen(t,"click",n=>{const o=n.composedPath(),a=o.some(c=>c.tagName==="CDS-MENU-ITEM"),r=o.some(c=>c.tagName==="CDS-ICON-BUTTON");!a&&!r&&(n.stopPropagation(),this.dispatchPanelEvent(e.event,{...e,action:"primary"}))});const s=t.querySelector("cds-menu");s&&this.listen(s,"click",n=>{if(n.target.tagName==="CDS-MENU-ITEM"){const o=i.getSemanticAttributes(n.target),a=o.event||i.getEventAttribute(t,"menu-event","event");a&&this.dispatchPanelEvent(a,{...e,...o,action:"menu-item"})}})}},oe=m.__exportAll({cdsComboBoxWrap:()=>re,cdsDropdownWrap:()=>ae,cdsMultiSelectWrap:()=>ie}),ae={selector:"cds-dropdown",init:function(t){const e=customElements.get("cds-dropdown"),s=i.getSemanticAttributes(t),n=s.event;n&&this.listen(t,e.eventSelect,a=>{this.dispatchPanelEvent(n,{...s,value:t.value,selectedValue:a.detail?.item?.value,selectedText:a.detail?.item?.textContent?.trim()})});const o=t.getAttribute("toggle-event");o&&this.listen(t,e.eventToggle,a=>{this.dispatchPanelEvent(o,{...s,open:t.hasAttribute("open")})})}},re={selector:"cds-combo-box",init:function(t){const e=customElements.get("cds-combo-box"),s=i.getSemanticAttributes(t),n=s.event;n&&this.listen(t,e.eventSelect,a=>{const r=a.detail?.item;this.dispatchPanelEvent(n,{...s,value:t.value,selectedValue:r?.value,selectedText:r?.textContent?.trim()})});const o=t.getAttribute("toggle-event");o&&this.listen(t,e.eventToggle,a=>{this.dispatchPanelEvent(o,{...s,open:t.hasAttribute("open")})})}},ie={selector:"cds-multi-select",init:function(t){const e=customElements.get("cds-multi-select"),s=i.getSemanticAttributes(t),n=s.event;n&&this.listen(t,e.eventSelect,a=>{const r=t.value?t.value.split(","):[];this.dispatchPanelEvent(n,{...s,selectedItems:r})});const o=t.getAttribute("toggle-event");o&&this.listen(t,e.eventToggle,a=>{this.dispatchPanelEvent(o,{...s,open:t.hasAttribute("open")})})}},ce=m.__exportAll({cdsDatePickerWrap:()=>le,cdsTimePickerWrap:()=>de}),le={selector:"cds-date-picker",init:function(t){const e=customElements.get("cds-date-picker"),s=i.getSemanticAttributes(t),n=t.querySelector('cds-date-picker-input[kind="from"]'),o=t.querySelector('cds-date-picker-input[kind="to"]'),a=n&&o,r=s.event;r&&this.listen(t,e.eventChange,p=>{let S;a?S={from:n.value||"",to:o.value||""}:S=t.value,this.dispatchPanelEvent(r,{...s,value:S})});const c=t.getAttribute("error-event");c&&this.listen(t,e.eventFlatpickrError,p=>{this.dispatchPanelEvent(c,{...s,error:p.detail})})}},de={selector:"cds-time-picker",event:"cds-time-picker-changed",getData:(t,e,s)=>({...e,value:s.value})},pe=m.__exportAll({cdsFileUploaderButtonWrap:()=>ve,cdsFileUploaderDropContainerWrap:()=>fe,cdsFileUploaderWrap:()=>ue});function rt(t){customElements.whenDefined(t).then(e=>{if(!(!e||e.prototype.__zooyAcceptPatched)){if(typeof e.prototype._getFiles!="function"){console.warn(`[Zooy] ${t}._getFiles missing; accept-split patch skipped (Carbon may have refactored).`);return}e.prototype._getFiles=function(s,n){if(n===void 0&&(n=(s.type==="drop"?s.dataTransfer:s.target)?.files),!this.accept||!/^(change|drop)$/.test(s.type))return Array.from(n??[]);const o=new Set(this.accept.split(/[\s,]+/).filter(Boolean));return Array.prototype.filter.call(n??[],({name:a,type:r=""})=>{const c=a.match(/\.[^.]+$/),p=c?c[0].toLowerCase():void 0;return o.has(r)||p&&o.has(p)})},e.prototype.__zooyAcceptPatched=!0}})}rt("cds-file-uploader-drop-container");rt("cds-file-uploader-button");var ue={selector:"cds-file-uploader",init:function(t){const e=i.getSemanticAttributes(t),s=e.event;if(s){const o=t.querySelector('input[type="file"]');o&&this.listen(o,"change",a=>{this.dispatchPanelEvent(s,{...e,files:Array.from(a.target.files||[])})})}const n=t.getAttribute("delete-event");n&&this.listen(t,"cds-file-uploader-item-deleted",o=>{this.dispatchPanelEvent(n,{...e,fileName:o.detail?.fileName,fileId:o.detail?.fileId})})}};function it(t,e){const s=new DataTransfer;for(const n of e)s.items.add(n);t.files=s.files,t.dispatchEvent(new Event("change",{bubbles:!0}))}function ct(t){const e=t.getAttribute("for");if(!e)return console.warn(`[Zooy] ${t.tagName.toLowerCase()} missing 'for' attribute; cannot bind to a form input.`,t),null;const s=t.ownerDocument.getElementById(e);return!s||s.tagName!=="INPUT"||s.type!=="file"?(console.warn(`[Zooy] 'for=${e}' did not resolve to an <input type="file">.`,t),null):s}var ve={selector:"cds-file-uploader-button",init:function(t){const e=ct(t),s=i.getSemanticAttributes(t),n=s.event;this.listen(t,"cds-file-uploader-button-changed",o=>{const a=o.detail?.addedFiles||[];e&&it(e,a),n&&this.dispatchPanelEvent(n,{...s,files:Array.from(a)})})}};function me(t,e,s,n){const o=t.querySelector(`[data-file-list-for="${e}"]`);if(o){o.replaceChildren();for(const a of s){const r=t.createElement("cds-file-uploader-item");r.setAttribute("state","edit"),r.textContent=a.name,r.addEventListener("cds-file-uploader-item-deleted",()=>{n(a.name)}),o.appendChild(r)}}}function ge(t,e){const s=new DataTransfer;for(const n of t.files)n.name!==e&&s.items.add(n);t.files=s.files,t.dispatchEvent(new Event("change",{bubbles:!0}))}var fe={selector:"cds-file-uploader-drop-container",init:function(t){const e=ct(t),s=i.getSemanticAttributes(t),n=s.event,o=t.getAttribute("for"),a=()=>{if(!o||!e)return;const r=Array.from(e.files);me(t.ownerDocument,o,r,c=>{ge(e,c),a()}),t.multiple||(t.style.display=r.length>0?"none":"")};this.listen(t,"cds-file-uploader-drop-container-changed",r=>{const c=r.detail?.addedFiles||[],p=t.multiple?c:c.slice(0,1);e&&it(e,p),a(),n&&this.dispatchPanelEvent(n,{...s,files:Array.from(p)})})}},he=m.__exportAll({cdsAccordionWrap:()=>Ee,cdsContentSwitcherWrap:()=>Ae,cdsTabsWrap:()=>be}),be={selector:"cds-tabs",init:function(t){const e=customElements.get("cds-tabs"),s=i.getSemanticAttributes(t),n=t.getAttribute("before-select-event");n&&this.listen(t,e.eventBeforeSelect,a=>{this.dispatchPanelEvent(n,{...s,tabValue:a.detail.value,cancelable:!0})});const o=s.event;o&&this.listen(t,e.eventSelect,a=>{const r=a.detail.item,c=i.getSemanticAttributes(r);this.dispatchPanelEvent(o,{...s,...c,tabValue:a.detail.value})})}},Ee={selector:"cds-accordion",init:function(t){const e=customElements.get("cds-accordion-item"),s=i.getSemanticAttributes(t);[...t.querySelectorAll("cds-accordion-item")].forEach(n=>{const o=i.getSemanticAttributes(n),a=o.event||s.event;a&&this.listen(n,e.eventToggle,r=>{this.dispatchPanelEvent(a,{...s,...o,open:r.detail.open})})})}},Ae={selector:"cds-content-switcher",init:function(t){const e=customElements.get("cds-content-switcher"),s=i.getSemanticAttributes(t),n=t.getAttribute("before-select-event");n&&this.listen(t,e.eventBeforeSelect,a=>{this.dispatchPanelEvent(n,{...s,value:a.detail.value,cancelable:!0})});const o=s.event;o&&this.listen(t,e.eventSelect,a=>{const r=a.detail.item,c=i.getSemanticAttributes(r);this.dispatchPanelEvent(o,{...s,...c,value:r.getAttribute("value")})})}},Se=m.__exportAll({cdsBreadCrumbWrap:()=>ye,cdsBreadcrumbItemWrap:()=>We,cdsBreadcrumbLinkWrap:()=>Ie}),We={selector:"cds-breadcrumb-item"},Ie={selector:"cds-breadcrumb-link",event:"click",getData:(t,e,s)=>(t.preventDefault(),{...e,href:s.getAttribute("href")})},ye={selector:"cds-breadcrumb",init:function(t){const e=this,s=i.getSemanticAttributes(t),n=s.event;if(n){const o=r=>{e.dispatchPanelEvent(n,{...s,...r})};e.listen(t,"click",r=>{const c=r.target.closest("cds-breadcrumb-link");c&&(r.preventDefault(),r.stopPropagation(),o(i.getSemanticAttributes(c)))});const a=t.querySelector("cds-overflow-menu-body");a&&e.listen(a,"cds-overflow-menu-item-clicked",r=>{r.stopPropagation(),o(i.getSemanticAttributes(r.target))})}}},Pe=m.__exportAll({cdsNumberInputWrap:()=>Ce,cdsPasswordInputWrap:()=>we,cdsSearchWrap:()=>xe,cdsTextAreaWrap:()=>ke,cdsTextInputWrap:()=>_e}),_e={selector:"cds-text-input",multiEvent:!0,events:[{type:"input",attrName:"event",getData:(t,e)=>({...e,value:t.currentTarget.value})},{type:"change",attrName:"change-event",getData:(t,e)=>({...e,value:t.currentTarget.value})}]},ke={selector:"cds-textarea",multiEvent:!0,events:[{type:"input",attrName:"event",getData:(t,e)=>({...e,value:t.currentTarget.value})},{type:"change",attrName:"change-event",getData:(t,e)=>({...e,value:t.currentTarget.value})}]},Ce={selector:"cds-number-input",event:"cds-number-input",getData:(t,e,s)=>({...e,value:t.detail.value,direction:t.detail.direction})},we={selector:"cds-password-input",multiEvent:!0,events:[{type:"input",attrName:"event",getData:(t,e)=>({...e,value:t.currentTarget.value})},{type:"change",attrName:"change-event",getData:(t,e)=>({...e,value:t.currentTarget.value})}]},xe={selector:"cds-search",event:"cds-search-input",getData:(t,e,s)=>({...e,value:s.value})},De=m.__exportAll({cdsCheckboxWrap:()=>Be,cdsRadioButGroupWrap:()=>Ne,cdsSelectWrap:()=>Me,cdsSliderWrap:()=>Fe,cdsToggleWrap:()=>Te}),Be={selector:"cds-checkbox",event:"cds-checkbox-changed",getData:(t,e,s)=>({...e,checked:t.detail.checked,value:s.value})},Ne={selector:"cds-radio-button-group",event:"cds-radio-button-group-changed",getData:(t,e)=>({...e,value:t.detail?.value})},Te={selector:"cds-toggle",event:"cds-toggle-changed",getData:(t,e)=>({...e,isOn:t.detail.checked,value:t.detail.checked})},Me={selector:"cds-select",event:"cds-select-selected",getData:(t,e)=>({...e,value:t.detail.value})},Fe={selector:"cds-slider",init:function(t){const e=i.getSemanticAttributes(t),s=e.event;s&&this.listen(t,"cds-slider-changed",o=>{this.dispatchPanelEvent(s,{...e,value:o.detail.value})});const n=t.getAttribute("input-event");n&&this.listen(t,"cds-slider-input-changed",o=>{this.dispatchPanelEvent(n,{...e,value:o.detail.value})})}},qe=m.__exportAll({cdsFilterTagWrap:()=>Le,cdsSDismissibleTagWrap:()=>Oe,cdsTagsWrap:()=>ze}),ze={selector:"cds-tag",event:"click",getData:(t,e)=>e},Oe={selector:"cds-dismissible-tag",init:function(t){const e=i.getSemanticAttributes(t),s=t.getAttribute("click-event");s&&this.listen(t,"click",o=>{o.target.closest("button")||this.dispatchPanelEvent(s,{...e})});const n=e.event;n&&this.listen(t,"cds-dismissible-tag-closed",o=>{this.dispatchPanelEvent(n,{...e,action:"closed"})})}},Le={selector:"cds-filter-tag",event:"cds-filter-tag-closed",getData:(t,e)=>({...e,action:"remove"})},Re=m.__exportAll({cdsContainedListDescriptionWrap:()=>je,cdsContainedListItemWrap:()=>Ge,cdsContainedListWrap:()=>He,cdsOverflowMenuWrap:()=>Ue,cdsStructuredListWrap:()=>$e,cdsTreeViewWrap:()=>Ve}),Ue={selector:"cds-overflow-menu",init:function(t){const e=i.getSemanticAttributes(t),s=e.event,n=t.querySelector("cds-overflow-menu-body");s&&n&&this.listen(n,"cds-overflow-menu-item-clicked",o=>{o.stopPropagation();const a=i.getSemanticAttributes(o.target);this.dispatchPanelEvent(s,{...e,...a})})}},$e={selector:"cds-structured-list",init:function(t){const e=i.getSemanticAttributes(t);[...t.querySelectorAll("cds-structured-list-row")].forEach(s=>{const n=i.getSemanticAttributes(s),o=n.event||e.event;o&&this.listen(s,"click",a=>{a.stopPropagation(),this.dispatchPanelEvent(o,{...e,...n})})}),t.hasAttribute("selection")&&this.listen(t,"cds-structured-list-selected",s=>{const n=s.detail.row,o=i.getSemanticAttributes(n),a=e.event;a&&this.dispatchPanelEvent(a,{...e,...o})})}},He={selector:"cds-contained-list"},je={selector:"cds-contained-list-description"},Ge={selector:"cds-contained-list-item",event:"cds-contained-list-item-click",getData:(t,e)=>e},Ve={selector:"cds-tree-view",init:function(t){const e=i.getSemanticAttributes(t);this.listen(t,"cds-tree-node-selected",n=>{const o=n.detail.node,a=i.getSemanticAttributes(o),r=a.event||e.event;r&&this.dispatchPanelEvent(r,{...e,...a,nodeId:o.id,label:o.getAttribute("label")})});const s=i.getEventAttribute(t,"expand-event");s&&this.listen(t,"cds-tree-node-expanded",n=>{this.dispatchPanelEvent(s,{...e,nodeId:n.detail.node.id,expanded:n.detail.expanded})})}},Ze=m.__exportAll({cdsActionableNotificationWrap:()=>Qe,cdsInlineNotificationWrap:()=>Ke,cdsToastNotificationWrap:()=>Je}),Je={selector:"cds-toast-notification",event:"cds-notification-closed",getData:(t,e)=>({...e,action:"closed"})},Ke={selector:"cds-inline-notification",event:"cds-notification-closed",getData:(t,e)=>({...e,action:"closed"})},Qe={selector:"cds-actionable-notification",init:function(t){const e=i.getSemanticAttributes(t),s=i.getEventAttribute(t,"close-event","event");s&&this.listen(t,"cds-notification-closed",o=>{this.dispatchPanelEvent(s,{...e,action:"closed"})});const n=i.getEventAttribute(t,"action-event");n&&this.listen(t,"cds-notification-actioned",o=>{this.dispatchPanelEvent(n,{...e,action:"actioned"})})}},Xe=m.__exportAll({cdsClickableTileWrap:()=>ts,cdsExpandableTileWrap:()=>es,cdsRadioTileWrap:()=>ns,cdsSelectableTileWrap:()=>ss,cdsTileGroupWrap:()=>os,cdsTileWrap:()=>Ye}),Ye={selector:"cds-tile"},ts={selector:"cds-clickable-tile",init:function(t){const e=i.getSemanticAttributes(t),s=e.event;if(s){const n=e.href||t.getAttribute("href")||"";t.removeAttribute("href"),t.addEventListener("click",o=>{o.preventDefault(),o.stopPropagation(),this.dispatchPanelEvent(s,{...e,href:n})},!0)}}},es={selector:"cds-expandable-tile",init:function(t){const e=i.getSemanticAttributes(t),s=t.getAttribute("before-toggle-event");s&&this.listen(t,"cds-expandable-tile-beingtoggled",o=>{this.dispatchPanelEvent(s,{...e,expanded:o.detail.expanded,cancelable:!0})});const n=e.event;n&&this.listen(t,"cds-expandable-tile-toggled",o=>{this.dispatchPanelEvent(n,{...e,expanded:o.detail.expanded})})}},ss={selector:"cds-selectable-tile",event:"cds-selectable-tile-changed",getData:(t,e,s)=>({...e,selected:t.detail.selected,value:s.value})},ns={selector:"cds-radio-tile",event:"cds-radio-tile-selected",getData:(t,e,s)=>({...e,selected:t.detail.selected,name:t.detail.name,value:s.value})},os={selector:"cds-tile-group",init:function(t){const e=i.getSemanticAttributes(t),s=e.event;s&&(this.listen(t,"cds-current-radio-tile-selection",n=>{const o=n.detail.target;this.dispatchPanelEvent(s,{...e,value:o?.value,name:o?.name,selected:o?.selected})}),this.listen(t,"cds-current-selectable-tile-selections",n=>{const o=n.detail.currentSelections||[];this.dispatchPanelEvent(s,{...e,values:o.map(a=>a.value),names:o.map(a=>a.name),count:o.length})}))}},as=m.__exportAll({cdsInlineLoadingWrap:()=>cs,cdsProgressBarWrap:()=>rs,cdsProgressIndicatorWrap:()=>is}),rs={selector:"cds-progress-bar",init:function(t){const e=i.getSemanticAttributes(t);if(e.event){const s=new MutationObserver(()=>{const n=parseFloat(t.getAttribute("value")||"0");n>=parseFloat(t.getAttribute("max")||"100")&&this.dispatchPanelEvent(e.event,{...e,value:n,status:"complete"})});s.observe(t,{attributes:!0,attributeFilter:["value"]}),t._progressObserver=s}}},is={selector:"cds-progress-indicator",init:function(t){const e=i.getSemanticAttributes(t);this.listen(t,"cds-progress-step-click",s=>{const n=s.target,o=i.getSemanticAttributes(n),a=o.event||e.event;a&&this.dispatchPanelEvent(a,{...e,...o,stepIndex:n.getAttribute("data-index"),stepLabel:n.getAttribute("label")})})}},cs={selector:"cds-inline-loading",init:function(t){const e=i.getSemanticAttributes(t),s=e.event;s&&this.listen(t,"cds-inline-loading-onsuccess",o=>{this.dispatchPanelEvent(s,{...e,status:"finished"})});const n=t.getAttribute("status-event");if(n){const o=new MutationObserver(a=>{a.forEach(r=>{if(r.attributeName==="status"){const c=t.getAttribute("status");this.dispatchPanelEvent(n,{...e,status:c})}})});o.observe(t,{attributes:!0,attributeFilter:["status"]}),t._statusObserver=o}}},ls=m.__exportAll({cdsPopoverWrap:()=>ps,cdsToggletipWrap:()=>us,cdsTooltipWrap:()=>ds}),ds={selector:"cds-tooltip",init:function(t){const e=i.getSemanticAttributes(t),s=i.getEventAttribute(t,"open-event");s&&this.listen(t,"cds-tooltip-beingopened",o=>{this.dispatchPanelEvent(s,{...e,action:"opened"})});const n=i.getEventAttribute(t,"close-event");n&&this.listen(t,"cds-tooltip-closed",o=>{this.dispatchPanelEvent(n,{...e,action:"closed"})})}},ps={selector:"cds-popover",init:function(t){const e=i.getSemanticAttributes(t),s=i.getEventAttribute(t,"open-event");s&&this.listen(t,"cds-popover-beingopened",o=>{this.dispatchPanelEvent(s,{...e,action:"opened"})});const n=i.getEventAttribute(t,"close-event");n&&this.listen(t,"cds-popover-closed",o=>{this.dispatchPanelEvent(n,{...e,action:"closed"})})}},us={selector:"cds-toggletip",init:function(t){const e=i.getSemanticAttributes(t);if(e.event){const s=new MutationObserver(n=>{n.forEach(o=>{if(o.attributeName==="open"){const a=t.hasAttribute("open");this.dispatchPanelEvent(e.event,{...e,action:a?"opened":"closed",open:a})}})});s.observe(t,{attributes:!0,attributeFilter:["open"]}),t._toggletipObserver=s}}},vs=m.__exportAll({cdsCodeSnipWrap:()=>gs,cdsLinkWrap:()=>ms}),ms={selector:"cds-link",event:"click",getData:(t,e,s)=>({...e,href:s.getAttribute("href")})},gs={selector:"cds-code-snippet",event:"cds-copy-button-clicked",getData:(t,e)=>({...e,action:"copied"})},fs=m.__exportAll({cdsBadgeIndicatorWrap:()=>Ps,cdsFormGroupWrap:()=>Es,cdsFormItemWrap:()=>bs,cdsFormWrap:()=>hs,cdsHeadingWrap:()=>Ss,cdsIconIndicatorWrap:()=>ys,cdsIconWrap:()=>Is,cdsLoadingWrap:()=>_s,cdsSectionWrap:()=>Ws,cdsSkeletonPlaceholderWrap:()=>Cs,cdsSkeletonTextWrap:()=>ks,cdsStackWrap:()=>As}),hs={selector:"cds-form"},bs={selector:"cds-form-item"},Es={selector:"cds-form-group"},As={selector:"cds-stack"},Ss={selector:"cds-heading"},Ws={selector:"cds-section"},Is={selector:"cds-icon"},ys={selector:"cds-icon-indicator"},Ps={selector:"cds-badge-indicator"},_s={selector:"cds-loading"},ks={selector:"cds-skeleton-text"},Cs={selector:"cds-skeleton-placeholder"};function f(t){return Object.values(t).filter(e=>typeof e=="object"&&e!==null&&e.selector)}var ws=[...f(Ft),...f(Dt),...f(zt),...f(Zt),...f(Qt),...f(oe),...f(ce),...f(pe),...f(he),...f(Se),...f(Pe),...f(De),...f(qe),...f(Re),...f(Ze),...f(Xe),...f(as),...f(ls),...f(vs),...f(fs)];function xs(){const t=new Map;return ws.forEach(e=>{t.set(e.selector,e)}),t}var Ds=()=>import("@carbon/web-components/es/components/accordion/index.js"),R=()=>import("@carbon/web-components/es/components/breadcrumb/index.js"),Bs=()=>import("@carbon/web-components/es/components/stack/index.js"),Ns=()=>import("@carbon/web-components/es/components/structured-list/index.js"),U=()=>import("@carbon/web-components/es/components/contained-list/index.js"),D=()=>import("@carbon/web-components/es/components/tile/index.js"),Ts=()=>import("@carbon/web-components/es/components/tree-view/index.js"),Ms=()=>import("@carbon/web-components/es/components/link/index.js"),Fs=()=>import("@carbon/web-components/es/components/tabs/index.js"),qs=()=>import("@carbon/web-components/es/components/content-switcher/index.js"),Y=()=>import("@carbon/web-components/es/components/menu/index.js"),zs=()=>import("@carbon/web-components/es/components/overflow-menu/index.js"),$=()=>import("@carbon/web-components/es/components/button/index.js"),tt=()=>import("@carbon/web-components/es/components/icon-button/index.js"),Os=()=>import("@carbon/web-components/es/components/combo-button/index.js"),Ls=()=>import("@carbon/web-components/es/components/copy-button/index.js"),Rs=()=>import("@carbon/web-components/es/components/checkbox/index.js"),Us=()=>import("@carbon/web-components/es/components/radio-button/index.js"),$s=()=>import("@carbon/web-components/es/components/toggle/index.js"),H=()=>import("@carbon/web-components/es/components/select/index.js"),Hs=()=>import("@carbon/web-components/es/components/slider/index.js"),j=()=>import("@carbon/web-components/es/components/text-input/index.js"),js=()=>import("@carbon/web-components/es/components/textarea/index.js"),Gs=()=>import("@carbon/web-components/es/components/number-input/index.js"),Vs=()=>import("@carbon/web-components/es/components/password-input/index.js"),et=()=>import("@carbon/web-components/es/components/search/index.js"),Zs=()=>import("@carbon/web-components/es/components/combo-box/index.js"),Js=()=>import("@carbon/web-components/es/components/dropdown/index.js"),Ks=()=>import("@carbon/web-components/es/components/multi-select/index.js"),Qs=()=>import("@carbon/web-components/es/components/date-picker/index.js"),Xs=()=>import("@carbon/web-components/es/components/time-picker/index.js"),M=()=>import("@carbon/web-components/es/components/file-uploader/index.js"),st=()=>import("@carbon/web-components/es/components/form/index.js"),Ys=()=>import("@carbon/web-components/es/components/form-group/index.js"),tn=()=>import("@carbon/web-components/es/components/data-table/index.js"),nt=()=>import("@carbon/web-components/es/components/pagination/index.js"),en=()=>import("@carbon/web-components/es/components/code-snippet/index.js"),G=()=>import("@carbon/web-components/es/components/tag/index.js"),sn=()=>import("@carbon/web-components/es/components/badge-indicator/index.js"),V=()=>import("@carbon/web-components/es/components/notification/index.js"),nn=()=>import("@carbon/web-components/es/components/loading/index.js"),on=()=>import("@carbon/web-components/es/components/inline-loading/index.js"),an=()=>import("@carbon/web-components/es/components/progress-bar/index.js"),rn=()=>import("@carbon/web-components/es/components/progress-indicator/index.js"),cn=()=>import("@carbon/web-components/es/components/skeleton-placeholder/index.js"),ln=()=>import("@carbon/web-components/es/components/skeleton-text/index.js"),y=()=>import("@carbon/web-components/es/components/modal/index.js"),P=()=>import("@carbon/web-components/es/components/tooltip/index.js"),dn=()=>import("@carbon/web-components/es/components/popover/index.js"),pn=()=>import("@carbon/web-components/es/components/toggle-tip/index.js"),ot=()=>import("@carbon/web-components/es/components/heading/index.js"),un=()=>import("@carbon/web-components/es/components/icon/index.js"),vn=()=>import("@carbon/web-components/es/components/icon-indicator/index.js"),q={"cds-table":[P,$,j,et,H,nt,tn],"cds-pagination":[H,j,nt],"cds-button":[P,$],"cds-icon-button:not([data-toggle])":[P,tt],"cds-icon-button[data-toggle]":[P,tt],"cds-button[data-fab]":[P,$],"cds-copy-button":[P,Ls],"cds-combo-button":[P,Os],"cds-checkbox":[Rs],"cds-radio-button-group":[Us],"cds-toggle":[$s],"cds-select":[H],"cds-slider":[Hs],"cds-text-input":[j],"cds-textarea":[js],"cds-number-input":[Gs],"cds-password-input":[P,Vs],"cds-search":[et],"cds-dropdown":[Js],"cds-combo-box":[Zs],"cds-multi-select":[Ks],"cds-date-picker":[Qs],"cds-time-picker":[Xs],"cds-file-uploader":[M],"cds-file-uploader-button":[M],"cds-file-uploader-drop-container":[M],"cds-file-uploader-item":[M],"cds-tabs":[Fs],"cds-accordion":[Ds],"cds-content-switcher":[qs],"cds-breadcrumb":[R],"cds-breadcrumb-item":[R],"cds-breadcrumb-link":[R],"cds-menu":[Y],"cds-menu-button":[Y],"cds-overflow-menu":[zs],"cds-structured-list":[Ns],"cds-contained-list":[U],"cds-contained-list-item":[U],"cds-contained-list-description":[U],"cds-tree-view":[Ts],"cds-modal":[y],"cds-modal-header":[y],"cds-modal-heading":[y],"cds-modal-label":[y],"cds-modal-close-button":[y],"cds-modal-body":[y],"cds-modal-body-content":[y],"cds-modal-footer":[y],"cds-modal-footer-button":[y],"cds-toast-notification":[V],"cds-inline-notification":[V],"cds-actionable-notification":[V],"cds-tile":[D],"cds-tile-group":[D],"cds-clickable-tile":[D],"cds-expandable-tile":[D],"cds-selectable-tile":[D],"cds-radio-tile":[D],"cds-progress-bar":[an],"cds-progress-indicator":[rn],"cds-inline-loading":[on],"cds-tooltip":[P],"cds-popover":[dn],"cds-toggletip":[pn],"cds-tag":[G],"cds-dismissible-tag":[G],"cds-filter-tag":[G],"cds-link":[Ms],"cds-code-snippet":[en],"cds-form":[st],"cds-form-item":[st],"cds-form-group":[Ys],"cds-stack":[Bs],"cds-heading":[ot],"cds-section":[ot],"cds-icon":[un],"cds-icon-indicator":[vn],"cds-badge-indicator":[sn],"cds-loading":[nn],"cds-skeleton-text":[ln],"cds-skeleton-placeholder":[cn]};function mn(t){const e=new Map;if(!t||!(t instanceof Element))return e;for(const n of Object.keys(F))e.set(n,[]);for(const[n]of Object.entries(F))t.matches(n)&&e.get(n).push(t);const s=t.querySelectorAll("*");for(const n of s)for(const[o]of Object.entries(F))n.matches(o)&&e.get(o).push(n);for(const[n,o]of e.entries())o.length===0&&e.delete(n);return e}function gn(t){const e=new Set;for(const[s,n]of t.entries())n.length>0&&q[s]&&q[s].forEach(o=>e.add(o));return e}async function fn(t,e){if(t.size===0)return;const s=Array.from(t).map(async n=>(e.has(n)||e.set(n,n()),e.get(n)));await Promise.all(s)}function hn(t,e){let s=0;for(const[n,o]of t.entries()){const a=F[n];o.forEach(r=>{if(a.init){a.init.call(e,r);return}if(a.multiEvent){const S=i.getSemanticAttributes(r);a.events.forEach(W=>{const w=i.getEventAttribute(r,W.attrName,"event");w&&e.listen(r,W.type,z=>{e.dispatchPanelEvent(w,W.getData(z,S,r))})});return}const c=i.getSemanticAttributes(r),p=c.event;p&&e.listen(r,a.event,S=>{S.stopPropagation();const W=a.getData(S,c,r),w=W._eventOverride||p;delete W._eventOverride,e.dispatchPanelEvent(w,W)})}),s+=o.length}return s}var F=Object.fromEntries(xs()),bn=async function(t,e){const s=mn(t);if(s.size===0){this.debugMe("[Carbon] No Carbon components found in panel");return}this.carbonComponents||(this.carbonComponents=new Map);for(const[a,r]of s.entries())this.carbonComponents.set(a,r);const n=gn(s);if(n.size>0)try{await fn(n,e)}catch(a){console.error("[Carbon] Failed to load some component modules:",a)}const o=hn(s,this);o>0&&this.debugMe(`[Carbon] Total components initialized: ${o}`)},En=(t={})=>{const{preload:e=[]}=t,s=new Map;if(e.length>0){const n=e.filter(a=>q[a]?!0:(console.warn(`[Carbon] No import found for selector: ${a}`),!1)),o=n.flatMap(a=>q[a].map(r=>(s.has(r)||s.set(r,r()),s.get(r))));Promise.all(o).then(()=>console.debug(`[Carbon] Preloaded: ${n.join(", ")}`)).catch(a=>console.warn("[Carbon] Preload error:",a))}m.ComponentLibraryRegistry.register("carbon",{cache:s,render:async function(n,o){try{await bn.call(this,n,o)}catch(a){console.error("[Carbon] Initialization error:",a)}},dispose:function(n){},config:{version:"2.0",description:"IBM Carbon Design System Web Components"}}),console.debug("[Zooy] Carbon Design System library registered")};exports.registerCarbonLibrary=En;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
const v=require("./component-library-registry-BBQV6Kpv.js");let d=require("badu"),c=require("ramda"),l=require("lit");var k={date_parse:t=>Date.parse(t),filesize:t=>(0,d.formatBytes)(5)((0,d.toInt)(t)),json:t=>JSON.stringify(t,null,2),tpl:(t,r,e)=>{const i=e?.getAttribute("zoo-bind-attr-tpl")||e?.getAttribute("zoo-bind-tpl");if(!i)return t;try{return new Function("value","data",`return \`${i}\`;`)(t,r)}catch(n){return console.warn("[Binder] Invalid template:",i,n),t}}},A=class{#s;#t;#r;#e=null;#i;constructor(t,r,e,i={}){if(!r)throw new Error("Binder requires a URL");if(!e||!(e instanceof Element))throw new Error("Binder requires a valid rootEl Element");this.#s=t,this.#t=new URL(r,window.location.origin),this.#r=e,this.#i={...k,...i.formatters},i.urlParams?this.#a(i.urlParams):this.#n()}get url(){return this.#t}get data(){return this.#e}get limit(){return parseInt(this.#t.searchParams.get("limit")||"0",10)}get offset(){return parseInt(this.#t.searchParams.get("offset")||"0",10)}get isPaginated(){return(0,c.both)((0,c.has)("count"),(0,c.has)("results"))(this.#e)}#a(t){return Object.entries(t).forEach(([r,e])=>{if(!(0,d.isDefAndNotNull)(e)||e===""||Array.isArray(e)&&e.length<1){this.#t.searchParams.delete(r);return}if(Array.isArray(e)){this.#t.searchParams.set(r,e.join(","));return}this.#t.searchParams.set(r,e)}),this.#n(),this.#t}#n(){const t=this.#t.href.split(this.url.origin)[1].slice(1);this.#r.querySelectorAll("[zoo-bind-binderurl]").forEach(r=>{r.setAttribute("zoo-bind-binderurl",t)})}async fetchData(t={}){const r=await this.#s.user.fetchJson(this.#a(t).toString(),this.#s.abortController.signal);this.setData(r)}setData(t){this.#e=t,this.render()}render(){if(!(0,d.isDefAndNotNull)(this.#e)){console.warn("[Binder] No data to render");return}this.#n(),this.#o(this.#r,this.#e,0),this.#c()}#o(t,r,e=0,i={}){const n=i.removeAttributes??!1;t.querySelectorAll("[zoo-bind-attr]").forEach(s=>{s.closest("[zoo-template]")||(s.getAttribute("zoo-bind-attr").split(",").forEach(a=>{const[o,u]=a.split(":").map(p=>p.trim()),[m,f]=u.split("|").map(p=>p.trim());let h=this.#l(r,m,e);f&&this.#i[f]&&(h=this.#i[f](h,r,s)),(0,d.isDefAndNotNull)(h)&&s.setAttribute(o,h)}),n&&(s.removeAttribute("zoo-bind-attr"),s.removeAttribute("zoo-bind-attr-tpl")))}),t.querySelectorAll("[zoo-bind]").forEach(s=>{if(s.closest("[zoo-template]"))return;const[a,o]=s.getAttribute("zoo-bind").split("|").map(m=>m.trim());let u=this.#l(r,a,e);o&&this.#i[o]&&(u=this.#i[o](u,r,s)),s.textContent=u??"",n&&(s.removeAttribute("zoo-bind"),s.removeAttribute("zoo-bind-tpl"))})}#c(){this.#r.querySelectorAll("[zoo-template]").forEach(t=>{const r=t.getAttribute("zoo-template"),e=t.getAttribute("zoo-template-bind");if(!r){console.warn("[Binder] Consumer missing template ID",t);return}const i=this.#r.querySelector(`#${r}`);if(!i||i.tagName!=="TEMPLATE"){console.error(`[DataBinder] Template not found or invalid: ${r}`);return}const n=e?(0,c.path)(e.split("."),this.#e):this.#e;if(!n){console.warn(`[DataBinder] Data slice is undefined. Path: ${e}. Skipping render for this consumer.`);return}if(!Array.isArray(n)){console.error(`[DataBinder] Data slice is not an array. Path: ${e}`,n);return}if(t.innerHTML="",n.forEach((s,a)=>{const o=this.#u(i,s,a);t.appendChild(o)}),v.ComponentLibraryRegistry.has("carbon")){const s=v.ComponentLibraryRegistry.get("carbon");s.render.call(this.#s,t,s.cache).catch(a=>console.error("[Binder] Carbon init failed:",a))}})}#u(t,r,e){const i=t.content.cloneNode(!0);return this.#o(i,r,e,{removeAttributes:!0}),i}#l(t,r,e){const i={$index:()=>e,$index__paged:()=>this.offset+e,$index1:()=>e+1,$index1__paged:()=>this.offset+e+1};return i[r]?i[r]():(0,c.path)(r.split("."),t)}},g=new Map(Object.entries({event:"event",endpoint:"endpoint",href:"href",url:"url",target:"target","record-id":"recordId","zoo-sort-field":"sortField","zoo-view":"view","zoo-event":"event","zoo-href":"href"})),b=t=>{let r={};return Array.from(t.attributes).forEach(e=>{const i=e.name,n=e.value;g.has(i)?r[g.get(i)]=n:(i.startsWith("data-")||i.startsWith("zoo-"))&&(r=(0,c.assocPath)(i.split("-"),n,r))}),r},y=(t,r,e="event")=>t.getAttribute(r)||t.getAttribute(e),z=class extends l.LitElement{static properties={token:{type:String},prefix:{type:String},postfix:{type:String}};static styles=l.css`
|
|
2
|
+
:host {
|
|
3
|
+
display: inline-block;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.tag {
|
|
7
|
+
text-align: center;
|
|
8
|
+
display: inline-flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
justify-content: center;
|
|
11
|
+
line-height: initial;
|
|
12
|
+
width: max-content;
|
|
13
|
+
padding: 0.2em 1em;
|
|
14
|
+
border-radius: 1em;
|
|
15
|
+
font-size: var(--zoo-theme-chips-font-size, 0.75rem);
|
|
16
|
+
white-space: nowrap;
|
|
17
|
+
word-break: break-word;
|
|
18
|
+
box-sizing: border-box;
|
|
19
|
+
}
|
|
20
|
+
`;render(){const t=`${this.prefix??""}${this.token??"default"}${this.postfix??""}`;return l.html`
|
|
21
|
+
<span
|
|
22
|
+
class="tag"
|
|
23
|
+
style="
|
|
24
|
+
background-color: var(--zoo-tag-${t}-bg, var(--zoo-tag-default-bg, #9e9e9e));
|
|
25
|
+
color: var(--zoo-tag-${t}-fg, var(--zoo-tag-default-fg, #ffffff));
|
|
26
|
+
"
|
|
27
|
+
>
|
|
28
|
+
<slot></slot>
|
|
29
|
+
</span>
|
|
30
|
+
`}};customElements.get("zoo-tag")||customElements.define("zoo-tag",z);var _=t=>{const r=Math.floor((new Date-t)/1e3),e=[{name:"year",seconds:31536e3},{name:"month",seconds:2592e3},{name:"week",seconds:604800},{name:"day",seconds:86400},{name:"hour",seconds:3600},{name:"minute",seconds:60},{name:"second",seconds:1}];if(r<0){const i=Math.abs(r);for(const n of e){const s=Math.floor(i/n.seconds);if(s>=1)return new Intl.RelativeTimeFormat("en",{numeric:"auto"}).format(s,n.name)}return"just now"}for(const i of e){const n=Math.floor(r/i.seconds);if(n>=1)return new Intl.RelativeTimeFormat("en",{numeric:"auto"}).format(-n,i.name)}return"just now"},w=t=>{const[{value:r},,{value:e},,{value:i},,{value:n},,{value:s},,{value:a}]=new Intl.DateTimeFormat("en",{day:"2-digit",month:"short",year:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hourCycle:"h23"}).formatToParts(t);return`${e} ${r} ${i} ${n}:${s}:${a}`},x=t=>{const[{value:r},,{value:e},,{value:i}]=new Intl.DateTimeFormat("en",{day:"2-digit",month:"short",year:"2-digit"}).formatToParts(t);return`${e} ${r} ${i}`},T=class extends l.LitElement{static properties={timestamp:{type:Number},kind:{type:String},concat:{type:String}};static styles=l.css`
|
|
31
|
+
:host {
|
|
32
|
+
display: inline;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.relative {
|
|
36
|
+
color: var(--zoo-timestamp-relative-color, inherit);
|
|
37
|
+
font-weight: var(--zoo-timestamp-relative-weight, inherit);
|
|
38
|
+
font-size: var(--zoo-timestamp-relative-size, inherit);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.static {
|
|
42
|
+
color: var(--zoo-timestamp-static-color, inherit);
|
|
43
|
+
font-weight: var(--zoo-timestamp-static-weight, inherit);
|
|
44
|
+
font-size: var(--zoo-timestamp-static-size, inherit);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.separator {
|
|
48
|
+
color: var(--zoo-timestamp-separator-color, inherit);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
:host([kind="stack"]) {
|
|
52
|
+
display: inline-block;
|
|
53
|
+
vertical-align: middle;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
:host([kind="stack"]) time {
|
|
57
|
+
display: flex;
|
|
58
|
+
flex-direction: column;
|
|
59
|
+
gap: var(--zoo-timestamp-stack-gap, 0);
|
|
60
|
+
align-items: var(--zoo-timestamp-stack-align, stretch);
|
|
61
|
+
}
|
|
62
|
+
`;constructor(){super(),this.timestamp=Date.now(),this.kind="both",this.concat="r (s)",this._boundTickHandler=this._onTimeTick.bind(this),this._isListening=!1}_shouldListenToTicks(){return this.kind==="relative"||this.kind==="both"||this.kind==="stack"}connectedCallback(){super.connectedCallback(),this._updateTickListener()}disconnectedCallback(){this._removeTickListener(),super.disconnectedCallback()}updated(t){super.updated(t),t.has("kind")&&this._updateTickListener()}_updateTickListener(){const t=this._shouldListenToTicks();t&&!this._isListening?(document.addEventListener("zoo-tick-60",this._boundTickHandler),this._isListening=!0):!t&&this._isListening&&this._removeTickListener()}_removeTickListener(){this._isListening&&(document.removeEventListener("zoo-tick-60",this._boundTickHandler),this._isListening=!1)}_onTimeTick(){this.requestUpdate()}_parseTemplate(t){const r=[];let e=t;for(;e.length>0;){const i=e.indexOf("r"),n=e.indexOf("s"),s=[i,n,e.indexOf("d")].filter(a=>a!==-1).sort((a,o)=>a-o)[0];if(s===void 0){e.length>0&&r.push({type:"text",value:e});break}s>0&&r.push({type:"text",value:e.substring(0,s)}),s===i?r.push({type:"relative",value:""}):s===n?r.push({type:"static",value:""}):r.push({type:"dateOnly",value:""}),e=e.substring(s+1)}return r}_parseStackOrder(t){const r=t.indexOf("r"),e=t.indexOf("s"),i=t.indexOf("d");let n=-1,s=null;return e!==-1&&(i===-1||e<i)?(n=e,s="static"):i!==-1&&(n=i,s="dateOnly"),r!==-1&&n!==-1?r<n?["relative",s]:[s,"relative"]:r!==-1?["relative"]:n!==-1?[s]:["relative","static"]}_getFormattedParts(){let t=this.timestamp;t<9466848e5&&(t=t*1e3);const r=new Date(t),e=_(r),i=w(r),n=x(r);switch(this.kind){case"relative":return[{type:"relative",value:e}];case"datetime":return[{type:"static",value:i}];case"date":return[{type:"static",value:n}];case"both":return this._parseTemplate(this.concat).map(s=>s.type==="relative"?{type:"relative",value:e}:s.type==="static"?{type:"static",value:i}:s.type==="dateOnly"?{type:"static",value:n}:s);case"stack":return this._parseStackOrder(this.concat).map(s=>s==="relative"?{type:"relative",value:e}:s==="dateOnly"?{type:"static",value:n}:{type:"static",value:i});default:return this._parseTemplate(this.concat).map(s=>s.type==="relative"?{type:"relative",value:e}:s.type==="static"?{type:"static",value:i}:s.type==="dateOnly"?{type:"static",value:n}:s)}}render(){let t=this.timestamp;t<9466848e5&&(t=t*1e3);const r=new Date(t),e=this._getFormattedParts();return l.html`<time datetime="${r.toISOString()}">
|
|
63
|
+
${e.map(i=>i.type==="relative"?l.html`<span class="relative">${i.value}</span>`:i.type==="static"?l.html`<span class="static">${i.value}</span>`:l.html`<span class="separator">${i.value}</span>`)}
|
|
64
|
+
</time>`}};customElements.get("zoo-timestamp")||customElements.define("zoo-timestamp",T);var E=v.__exportAll({ZooTag:()=>z,ZooTimestamp:()=>T,getEventAttribute:()=>y,getSemanticAttributes:()=>b});Object.defineProperty(exports,"Binder",{enumerable:!0,get:function(){return A}});Object.defineProperty(exports,"getEventAttribute",{enumerable:!0,get:function(){return y}});Object.defineProperty(exports,"getSemanticAttributes",{enumerable:!0,get:function(){return b}});Object.defineProperty(exports,"zoo_exports",{enumerable:!0,get:function(){return E}});
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { n as
|
|
2
|
-
import { isDefAndNotNull as f } from "badu";
|
|
3
|
-
import { assocPath as
|
|
1
|
+
import { n as A, t as p } from "./component-library-registry-DB5UeqC2.js";
|
|
2
|
+
import { formatBytes as w, isDefAndNotNull as f, toInt as _ } from "badu";
|
|
3
|
+
import { assocPath as x, both as $, has as v, path as g } from "ramda";
|
|
4
4
|
import { LitElement as y, css as z, html as c } from "lit";
|
|
5
|
-
var
|
|
5
|
+
var E = {
|
|
6
|
+
date_parse: (t) => Date.parse(t),
|
|
7
|
+
filesize: (t) => w(5)(_(t)),
|
|
6
8
|
json: (t) => JSON.stringify(t, null, 2),
|
|
7
9
|
tpl: (t, i, e) => {
|
|
8
10
|
const r = e?.getAttribute("zoo-bind-attr-tpl") || e?.getAttribute("zoo-bind-tpl");
|
|
@@ -13,7 +15,7 @@ var $ = {
|
|
|
13
15
|
return console.warn("[Binder] Invalid template:", r, a), t;
|
|
14
16
|
}
|
|
15
17
|
}
|
|
16
|
-
},
|
|
18
|
+
}, M = class {
|
|
17
19
|
#s;
|
|
18
20
|
#t;
|
|
19
21
|
#i;
|
|
@@ -23,7 +25,7 @@ var $ = {
|
|
|
23
25
|
if (!i) throw new Error("Binder requires a URL");
|
|
24
26
|
if (!e || !(e instanceof Element)) throw new Error("Binder requires a valid rootEl Element");
|
|
25
27
|
this.#s = t, this.#t = new URL(i, window.location.origin), this.#i = e, this.#r = {
|
|
26
|
-
|
|
28
|
+
...E,
|
|
27
29
|
...r.formatters
|
|
28
30
|
}, r.urlParams ? this.#n(r.urlParams) : this.#a();
|
|
29
31
|
}
|
|
@@ -40,7 +42,7 @@ var $ = {
|
|
|
40
42
|
return parseInt(this.#t.searchParams.get("offset") || "0", 10);
|
|
41
43
|
}
|
|
42
44
|
get isPaginated() {
|
|
43
|
-
return
|
|
45
|
+
return $(v("count"), v("results"))(this.#e);
|
|
44
46
|
}
|
|
45
47
|
#n(t) {
|
|
46
48
|
return Object.entries(t).forEach(([i, e]) => {
|
|
@@ -79,13 +81,13 @@ var $ = {
|
|
|
79
81
|
const a = r.removeAttributes ?? !1;
|
|
80
82
|
t.querySelectorAll("[zoo-bind-attr]").forEach((s) => {
|
|
81
83
|
s.closest("[zoo-template]") || (s.getAttribute("zoo-bind-attr").split(",").forEach((n) => {
|
|
82
|
-
const [o, l] = n.split(":").map((
|
|
83
|
-
let u = this.#l(i,
|
|
84
|
-
|
|
84
|
+
const [o, l] = n.split(":").map((m) => m.trim()), [d, h] = l.split("|").map((m) => m.trim());
|
|
85
|
+
let u = this.#l(i, d, e);
|
|
86
|
+
h && this.#r[h] && (u = this.#r[h](u, i, s)), f(u) && s.setAttribute(o, u);
|
|
85
87
|
}), a && (s.removeAttribute("zoo-bind-attr"), s.removeAttribute("zoo-bind-attr-tpl")));
|
|
86
88
|
}), t.querySelectorAll("[zoo-bind]").forEach((s) => {
|
|
87
89
|
if (s.closest("[zoo-template]")) return;
|
|
88
|
-
const [n, o] = s.getAttribute("zoo-bind").split("|").map((
|
|
90
|
+
const [n, o] = s.getAttribute("zoo-bind").split("|").map((d) => d.trim());
|
|
89
91
|
let l = this.#l(i, n, e);
|
|
90
92
|
o && this.#r[o] && (l = this.#r[o](l, i, s)), s.textContent = l ?? "", a && (s.removeAttribute("zoo-bind"), s.removeAttribute("zoo-bind-tpl"));
|
|
91
93
|
});
|
|
@@ -144,13 +146,13 @@ var $ = {
|
|
|
144
146
|
"zoo-view": "view",
|
|
145
147
|
"zoo-event": "event",
|
|
146
148
|
"zoo-href": "href"
|
|
147
|
-
})),
|
|
149
|
+
})), L = (t) => {
|
|
148
150
|
let i = {};
|
|
149
151
|
return Array.from(t.attributes).forEach((e) => {
|
|
150
152
|
const r = e.name, a = e.value;
|
|
151
|
-
b.has(r) ? i[b.get(r)] = a : (r.startsWith("data-") || r.startsWith("zoo-")) && (i =
|
|
153
|
+
b.has(r) ? i[b.get(r)] = a : (r.startsWith("data-") || r.startsWith("zoo-")) && (i = x(r.split("-"), a, i));
|
|
152
154
|
}), i;
|
|
153
|
-
},
|
|
155
|
+
}, S = (t, i, e = "event") => t.getAttribute(i) || t.getAttribute(e), T = class extends y {
|
|
154
156
|
static properties = {
|
|
155
157
|
token: { type: String },
|
|
156
158
|
prefix: { type: String },
|
|
@@ -192,7 +194,7 @@ var $ = {
|
|
|
192
194
|
}
|
|
193
195
|
};
|
|
194
196
|
customElements.get("zoo-tag") || customElements.define("zoo-tag", T);
|
|
195
|
-
var
|
|
197
|
+
var I = (t) => {
|
|
196
198
|
const i = Math.floor((/* @__PURE__ */ new Date() - t) / 1e3), e = [
|
|
197
199
|
{
|
|
198
200
|
name: "year",
|
|
@@ -236,7 +238,7 @@ var x = (t) => {
|
|
|
236
238
|
if (a >= 1) return new Intl.RelativeTimeFormat("en", { numeric: "auto" }).format(-a, r.name);
|
|
237
239
|
}
|
|
238
240
|
return "just now";
|
|
239
|
-
},
|
|
241
|
+
}, D = (t) => {
|
|
240
242
|
const [{ value: i }, , { value: e }, , { value: r }, , { value: a }, , { value: s }, , { value: n }] = new Intl.DateTimeFormat("en", {
|
|
241
243
|
day: "2-digit",
|
|
242
244
|
month: "short",
|
|
@@ -247,14 +249,14 @@ var x = (t) => {
|
|
|
247
249
|
hourCycle: "h23"
|
|
248
250
|
}).formatToParts(t);
|
|
249
251
|
return `${e} ${i} ${r} ${a}:${s}:${n}`;
|
|
250
|
-
},
|
|
252
|
+
}, O = (t) => {
|
|
251
253
|
const [{ value: i }, , { value: e }, , { value: r }] = new Intl.DateTimeFormat("en", {
|
|
252
254
|
day: "2-digit",
|
|
253
255
|
month: "short",
|
|
254
256
|
year: "2-digit"
|
|
255
257
|
}).formatToParts(t);
|
|
256
258
|
return `${e} ${i} ${r}`;
|
|
257
|
-
},
|
|
259
|
+
}, k = class extends y {
|
|
258
260
|
static properties = {
|
|
259
261
|
timestamp: { type: Number },
|
|
260
262
|
kind: { type: String },
|
|
@@ -280,12 +282,24 @@ var x = (t) => {
|
|
|
280
282
|
.separator {
|
|
281
283
|
color: var(--zoo-timestamp-separator-color, inherit);
|
|
282
284
|
}
|
|
285
|
+
|
|
286
|
+
:host([kind="stack"]) {
|
|
287
|
+
display: inline-block;
|
|
288
|
+
vertical-align: middle;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
:host([kind="stack"]) time {
|
|
292
|
+
display: flex;
|
|
293
|
+
flex-direction: column;
|
|
294
|
+
gap: var(--zoo-timestamp-stack-gap, 0);
|
|
295
|
+
align-items: var(--zoo-timestamp-stack-align, stretch);
|
|
296
|
+
}
|
|
283
297
|
`;
|
|
284
298
|
constructor() {
|
|
285
299
|
super(), this.timestamp = Date.now(), this.kind = "both", this.concat = "r (s)", this._boundTickHandler = this._onTimeTick.bind(this), this._isListening = !1;
|
|
286
300
|
}
|
|
287
301
|
_shouldListenToTicks() {
|
|
288
|
-
return this.kind === "relative" || this.kind === "both";
|
|
302
|
+
return this.kind === "relative" || this.kind === "both" || this.kind === "stack";
|
|
289
303
|
}
|
|
290
304
|
connectedCallback() {
|
|
291
305
|
super.connectedCallback(), this._updateTickListener();
|
|
@@ -310,31 +324,43 @@ var x = (t) => {
|
|
|
310
324
|
const i = [];
|
|
311
325
|
let e = t;
|
|
312
326
|
for (; e.length > 0; ) {
|
|
313
|
-
const r = e.indexOf("r"), a =
|
|
314
|
-
|
|
327
|
+
const r = e.indexOf("r"), a = e.indexOf("s"), s = [
|
|
328
|
+
r,
|
|
329
|
+
a,
|
|
330
|
+
e.indexOf("d")
|
|
331
|
+
].filter((n) => n !== -1).sort((n, o) => n - o)[0];
|
|
332
|
+
if (s === void 0) {
|
|
315
333
|
e.length > 0 && i.push({
|
|
316
334
|
type: "text",
|
|
317
335
|
value: e
|
|
318
336
|
});
|
|
319
337
|
break;
|
|
320
338
|
}
|
|
321
|
-
|
|
339
|
+
s > 0 && i.push({
|
|
322
340
|
type: "text",
|
|
323
|
-
value: e.substring(0,
|
|
324
|
-
}),
|
|
341
|
+
value: e.substring(0, s)
|
|
342
|
+
}), s === r ? i.push({
|
|
325
343
|
type: "relative",
|
|
326
344
|
value: ""
|
|
327
|
-
}) : i.push({
|
|
345
|
+
}) : s === a ? i.push({
|
|
328
346
|
type: "static",
|
|
329
347
|
value: ""
|
|
330
|
-
})
|
|
348
|
+
}) : i.push({
|
|
349
|
+
type: "dateOnly",
|
|
350
|
+
value: ""
|
|
351
|
+
}), e = e.substring(s + 1);
|
|
331
352
|
}
|
|
332
353
|
return i;
|
|
333
354
|
}
|
|
355
|
+
_parseStackOrder(t) {
|
|
356
|
+
const i = t.indexOf("r"), e = t.indexOf("s"), r = t.indexOf("d");
|
|
357
|
+
let a = -1, s = null;
|
|
358
|
+
return e !== -1 && (r === -1 || e < r) ? (a = e, s = "static") : r !== -1 && (a = r, s = "dateOnly"), i !== -1 && a !== -1 ? i < a ? ["relative", s] : [s, "relative"] : i !== -1 ? ["relative"] : a !== -1 ? [s] : ["relative", "static"];
|
|
359
|
+
}
|
|
334
360
|
_getFormattedParts() {
|
|
335
361
|
let t = this.timestamp;
|
|
336
362
|
t < 9466848e5 && (t = t * 1e3);
|
|
337
|
-
const i = new Date(t), e =
|
|
363
|
+
const i = new Date(t), e = I(i), r = D(i), a = O(i);
|
|
338
364
|
switch (this.kind) {
|
|
339
365
|
case "relative":
|
|
340
366
|
return [{
|
|
@@ -358,7 +384,21 @@ var x = (t) => {
|
|
|
358
384
|
} : s.type === "static" ? {
|
|
359
385
|
type: "static",
|
|
360
386
|
value: r
|
|
387
|
+
} : s.type === "dateOnly" ? {
|
|
388
|
+
type: "static",
|
|
389
|
+
value: a
|
|
361
390
|
} : s);
|
|
391
|
+
case "stack":
|
|
392
|
+
return this._parseStackOrder(this.concat).map((s) => s === "relative" ? {
|
|
393
|
+
type: "relative",
|
|
394
|
+
value: e
|
|
395
|
+
} : s === "dateOnly" ? {
|
|
396
|
+
type: "static",
|
|
397
|
+
value: a
|
|
398
|
+
} : {
|
|
399
|
+
type: "static",
|
|
400
|
+
value: r
|
|
401
|
+
});
|
|
362
402
|
default:
|
|
363
403
|
return this._parseTemplate(this.concat).map((s) => s.type === "relative" ? {
|
|
364
404
|
type: "relative",
|
|
@@ -366,6 +406,9 @@ var x = (t) => {
|
|
|
366
406
|
} : s.type === "static" ? {
|
|
367
407
|
type: "static",
|
|
368
408
|
value: r
|
|
409
|
+
} : s.type === "dateOnly" ? {
|
|
410
|
+
type: "static",
|
|
411
|
+
value: a
|
|
369
412
|
} : s);
|
|
370
413
|
}
|
|
371
414
|
}
|
|
@@ -378,16 +421,16 @@ var x = (t) => {
|
|
|
378
421
|
</time>`;
|
|
379
422
|
}
|
|
380
423
|
};
|
|
381
|
-
customElements.get("zoo-timestamp") || customElements.define("zoo-timestamp",
|
|
382
|
-
var
|
|
424
|
+
customElements.get("zoo-timestamp") || customElements.define("zoo-timestamp", k);
|
|
425
|
+
var R = /* @__PURE__ */ A({
|
|
383
426
|
ZooTag: () => T,
|
|
384
|
-
ZooTimestamp: () =>
|
|
385
|
-
getEventAttribute: () =>
|
|
386
|
-
getSemanticAttributes: () =>
|
|
427
|
+
ZooTimestamp: () => k,
|
|
428
|
+
getEventAttribute: () => S,
|
|
429
|
+
getSemanticAttributes: () => L
|
|
387
430
|
});
|
|
388
431
|
export {
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
432
|
+
M as i,
|
|
433
|
+
S as n,
|
|
434
|
+
L as r,
|
|
435
|
+
R as t
|
|
393
436
|
};
|