diff --git a/docs/v1/assets/iframe.12e9b233.js b/docs/v1/assets/iframe.12e9b233.js index 0eab85181..78dfd7771 100644 --- a/docs/v1/assets/iframe.12e9b233.js +++ b/docs/v1/assets/iframe.12e9b233.js @@ -1,4 +1,4 @@ -var LT=Object.defineProperty,_T=Object.defineProperties;var IT=Object.getOwnPropertyDescriptors;var Ar=Object.getOwnPropertySymbols;var Om=Object.prototype.hasOwnProperty,qm=Object.prototype.propertyIsEnumerable;var Tu=(t,n,o)=>n in t?LT(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o,T=(t,n)=>{for(var o in n||(n={}))Om.call(n,o)&&Tu(t,o,n[o]);if(Ar)for(var o of Ar(n))qm.call(n,o)&&Tu(t,o,n[o]);return t},D=(t,n)=>_T(t,IT(n));var ae=(t,n)=>{var o={};for(var l in t)Om.call(t,l)&&n.indexOf(l)<0&&(o[l]=t[l]);if(t!=null&&Ar)for(var l of Ar(t))n.indexOf(l)<0&&qm.call(t,l)&&(o[l]=t[l]);return o};var Kt=(t,n,o)=>(Tu(t,typeof n!="symbol"?n+"":n,o),o);import{d as B,u as Ae,c as m,o as s,a as N,w as y,b as x,e as a,f as w,g as A,h as u,r as v,F as O,i as H,t as F,n as d,j as PT,k as Oe,l as qt,m as MT,p as Dh,q as Dt,s as BT,v as ei,x as lp,y as C,z as at,A as we,B as et,C as ct,D as Fh,E as ti,G as Ue,H as Nt,I as ha,J as Te,K as rt,L as pt,M as Ra,N as sp,O as ba,P as xl,Q as xn,T as Ja,R as Da,S as cs,U as Eh,V as tn,W as $T,X as Rh,Y as ds,Z as us,_ as DT,$ as FT,a0 as rp,a1 as Kl,a2 as ET,a3 as RT,a4 as OT,a5 as qT,a6 as ps,a7 as Oh,a8 as Fu,a9 as Vr,aa as VT,ab as Vm,ac as Su,ad as HT,ae as Oa,af as WT,ag as UT,ah as ja,ai as qh,aj as Hm,ak as Vh,al as jT,am as zT,an as Eu,ao as GT,ap as XT,aq as e,ar as ce,as as de,at as I,au as U,av as j,aw as ye,ax as Hr,ay as Ru,az as KT,aA as Wm,aB as ip,aC as Hh,aD as Ou,aE as YT,aF as Um,aG as ZT,aH as Wh,aI as Uh,aJ as QT,aK as JT,aL as eS,aM as tS,aN as aS,aO as nS,aP as oS,aQ as lS,aR as sS,aS as jm,aT as rS,aU as iS,aV as cS,aW as dS,aX as uS,aY as pS,aZ as mS,a_ as gS,a$ as yS,b0 as hS,b1 as bS,b2 as fS,b3 as vS,b4 as xS,b5 as TS,b6 as SS}from"./vendor.0038c16e.js";const CS=function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))l(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const c of i.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&l(c)}).observe(document,{childList:!0,subtree:!0});function o(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerpolicy&&(i.referrerPolicy=r.referrerpolicy),r.crossorigin==="use-credentials"?i.credentials="include":r.crossorigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function l(r){if(r.ep)return;r.ep=!0;const i=o(r);fetch(r.href,i)}};CS();function z(t){if(!t)return!1;if(t&&t()[0].children){if(typeof t()[0].children=="string")return t()[0].children!=="v-if";if(Array.isArray(t()[0].children))return t()[0].children.length>0}return!0}const AS="Polaris-AccountConnection__TermsOfService",kS="Polaris-AccountConnection__Content";var zm={TermsOfService:AS,Content:kS};const wS={key:0},NS={key:1},LS={key:2},ai=B({props:{title:null,details:null,termsOfService:null,accountName:{default:""},avatarUrl:null,connected:{type:Boolean,default:!1},action:null},setup(t){const n=t,o=Ae(),l=m(()=>n.accountName?n.accountName.split(/\s+/).map(r=>r[0]).join(""):void 0);return(r,i)=>(s(),N(a(Je),{sectioned:""},{default:y(()=>[x(a(Np),null,{action:y(()=>[t.action?(s(),N(a(ht),{key:0,action:t.action,overrides:{primary:!t.connected}},null,8,["action","overrides"])):w("",!0)]),setting:y(()=>[x(a(Qe),null,{default:y(()=>[t.connected?(s(),N(a(fa),{key:0,accessibilityLabel:"",name:t.accountName,initials:a(l),source:t.avatarUrl},null,8,["name","initials","source"])):w("",!0),x(a(Ot),{fill:""},{default:y(()=>[A("div",{class:d(a(zm).Content)},[t.title||a(z)(a(o).title)?(s(),u("div",wS,[a(z)(a(o).title)?v(r.$slots,"title",{key:0}):(s(),u(O,{key:1},[H(F(t.title),1)],64))])):t.accountName?(s(),u("div",NS,F(t.accountName),1)):w("",!0),t.details||a(z)(a(o).details)?(s(),u("div",LS,[x(a(ve),{variant:"bodyMd",color:"subdued",as:"span"},{default:y(()=>[a(z)(a(o).details)?v(r.$slots,"details",{key:0}):(s(),u(O,{key:1},[H(F(t.details),1)],64))]),_:3})])):w("",!0)],2)]),_:3})]),_:3})]),_:3}),t.termsOfService||a(z)(a(o).termsOfService)?(s(),u("div",{key:0,class:d(a(zm).TermsOfService)},[a(z)(a(o).termsOfService)?v(r.$slots,"termsOfService",{key:0}):(s(),u(O,{key:1},[H(F(t.termsOfService),1)],64))],2)):w("",!0)]),_:3}))}});ai.__docgenInfo={exportName:"default",displayName:"AccountConnection",description:"",tags:{},props:[{name:"title",description:"Content to display as title",required:!1,type:{name:"string"}},{name:"details",description:"Content to display as additional details",required:!1,type:{name:"string"}},{name:"termsOfService",description:"Content to display as terms of service",required:!1,type:{name:"string"}},{name:"accountName",description:"The name of the service",required:!1,type:{name:"string"},defaultValue:{func:!1,value:"''"}},{name:"avatarUrl",description:"URL for the user\u2019s avatar image",required:!1,type:{name:"string"}},{name:"connected",description:"Set if the account is connected",required:!1,type:{name:"boolean"},defaultValue:{func:!1,value:"false"}},{name:"action",description:"Action for account connection",required:!1,type:{name:"Action"}}],slots:[{name:"title"},{name:"details"},{name:"termsOfService"}]};function E(...t){return t.filter(Boolean).join(" ")}function Ye(t,n){return`${t}${n.charAt(0).toUpperCase()}${n.slice(1)}`}function _S(t,n,o,l){return typeof l=="string"?{[`--pc-${t}-${n}-xs`]:`var(--p-${o}-${l})`}:Object.fromEntries(Object.entries(l).map(([r,i])=>[`--pc-${t}-${n}-${r}`,`var(--p-${o}-${i})`]))}const Wr='a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]:not([tabindex="-1"])',qu="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]",IS='a[role="menuitem"],frame[role="menuitem"],iframe[role="menuitem"],input[role="menuitem"]:not([type=hidden]):not(:disabled),select[role="menuitem"]:not(:disabled),textarea[role="menuitem"]:not(:disabled),button[role="menuitem"]:not(:disabled),*[tabindex]:not([tabindex="-1"])';function ni(t,n){if(t.matches)return t.matches(n);const o=(t.ownerDocument||document).querySelectorAll(n);let l=o.length;for(;l>=0&&o.item(l)!==t;)return l-=1,l>-1}function Cu(t){const n="a,button,frame,iframe,input:not([type=hidden]),select,textarea,*[tabindex]";return ni(t,n)?t:t.querySelector(n)}function PS(t,n){const o=[...document.querySelectorAll(qu)],l=o.indexOf(t)+1,r=o.slice(l);for(const i of r)if(PT(i)&&(!n||n&&n(i)))return i;return null}function MS(t,n){const o=PS(t,n);return o&&o instanceof HTMLElement?(o.focus(),!0):!1}function jh(t,n=!0){return!n&&ni(t,qu)?t:t.querySelector(qu)}function zh(t){return t.querySelectorAll(IS)}function Gh(t,n){let o=0;for(const l of t){if(l===n)break;o+=1}return o===t.length?-1:o}function BS(t,n){const o=zh(t),l=Gh(o,n);l===-1?o[0].focus():o[(l-1+o.length)%o.length].focus()}function $S(t,n){const o=zh(t),l=Gh(o,n);l===-1?o[0].focus():o[(l+1)%o.length].focus()}const ca=t=>{t.currentTarget.blur()};function an(t,n=!0){var o;(o=jh(t,n))==null||o.focus()}function cp(t,n=!0){return!n&&ni(t,Wr)?t:t.querySelector(Wr)}function Xh(t,n=!0){if(!n&&ni(t,Wr))return t;const o=t.querySelectorAll(Wr);return o[o.length-1]}function DS(t,n=!0){const o=cp(t,n);return o?(o.focus(),!0):!1}function FS(t,n=!0){const o=Xh(t,n);return o?(o.focus(),!0):!1}const ES={inheritAttrs:!1,render(){return null}},Wt=B(D(T({},ES),{props:{keyCode:{type:String,required:!0},keyEvent:{type:String,default:"keyup"},handler:{type:Function,required:!0},useCapture:{type:Boolean},options:{type:Object}},setup(t){const n=t;function o(l){l.key===n.keyCode&&n.handler(l)}return Oe(()=>document.addEventListener(n.keyEvent,o,n.useCapture||n.options)),qt(()=>document.removeEventListener(n.keyEvent,o,n.useCapture||n.options)),()=>{}}}));Wt.__docgenInfo={exportName:"default",displayName:"KeypressListener",description:"",tags:{},props:[{name:"keyCode",type:{name:"String as () => Key"},required:!0},{name:"keyEvent",type:{name:"String as () => KeyEvent"},defaultValue:{func:!1,value:"'keyup'"}},{name:"handler",type:{name:"func"},required:!0},{name:"useCapture",type:{name:"boolean"}},{name:"options",type:{name:"Object as () => AddEventListenerOptions"}}]};var yt=(t=>(t.Backspace="Backspace",t.Tab="Tab",t.Enter="Enter",t.Shift="Shift",t.Ctrl="Ctrl",t.Alt="Alt",t.Pause="Pause",t.CapsLock="CapsLock",t.Escape="Escape",t.Space="Space",t.PageUp="PageUp",t.PageDown="PageDown",t.End="End",t.Home="Home",t.ArrowRight="ArrowRight",t.ArrowLeft="ArrowLeft",t.ArrowUp="ArrowUp",t.ArrowDown="ArrowDown",t.Insert="Insert",t.Delete="Delete",t.Key0="Key0",t.Key1="Key1",t.Key2="Key2",t.Key3="Key3",t.Key4="Key4",t.Key5="Key5",t.Key6="Key6",t.Key7="Key7",t.Key8="Key8",t.Key9="Key9",t.KeyA="KeyA",t.KeyB="KeyB",t.KeyC="KeyC",t.KeyD="KeyD",t.KeyE="KeyE",t.KeyF="KeyF",t.KeyG="KeyG",t.KeyH="KeyH",t.KeyI="KeyI",t.KeyJ="KeyJ",t.KeyK="KeyK",t.KeyL="KeyL",t.KeyM="KeyM",t.KeyN="KeyN",t.KeyO="KeyO",t.KeyP="KeyP",t.KeyQ="KeyQ",t.KeyR="KeyR",t.KeyS="KeyS",t.KeyT="KeyT",t.KeyU="KeyU",t.KeyV="KeyV",t.KeyW="KeyW",t.KeyX="KeyX",t.KeyY="KeyY",t.KeyZ="KeyZ",t.LeftMeta="LeftMeta",t.RightMeta="RightMeta",t.Select="Select",t.Numpad0="Numpad0",t.Numpad1="Numpad1",t.Numpad2="Numpad2",t.Numpad3="Numpad3",t.Numpad4="Numpad4",t.Numpad5="Numpad5",t.Numpad6="Numpad6",t.Numpad7="Numpad7",t.Numpad8="Numpad8",t.Numpad9="Numpad9",t.Multiply="Multiply",t.Add="Add",t.Subtract="Subtract",t.Decimal="Decimal",t.Divide="Divide",t.F1="F1",t.F2="F2",t.F3="F3",t.F4="F4",t.F5="F5",t.F6="F6",t.F7="F7",t.F8="F8",t.F9="F9",t.F10="F10",t.F11="F11",t.F12="F12",t.NumLock="NumLock",t.ScrollLock="ScrollLock",t.Semicolon="Semicolon",t.Equals="Equals",t.Comma="Comma",t.Dash="Dash",t.Period="Period",t.ForwardSlash="ForwardSlash",t.GraveAccent="GraveAccent",t.OpenBracket="OpenBracket",t.BackSlash="BackSlash",t.CloseBracket="CloseBracket",t.SingleQuote="SingleQuote",t))(yt||{});const RS="Polaris-ActionList",OS="Polaris-ActionList__Actions",qS="Polaris-ActionList__Section",VS="Polaris-ActionList__Item",HS="Polaris-ActionList--active",WS="Polaris-ActionList--destructive",US="Polaris-ActionList--disabled",jS="Polaris-ActionList__Prefix",zS="Polaris-ActionList__Suffix",GS="Polaris-ActionList__Content",XS="Polaris-ActionList__ContentBlock",KS="Polaris-ActionList__ContentBlockInner",YS="Polaris-ActionList__Text";var Rt={ActionList:RS,"Section-withoutTitle":"Polaris-ActionList__Section--withoutTitle",Actions:OS,Section:qS,Item:VS,active:HS,destructive:WS,disabled:US,Prefix:jS,Suffix:zS,Content:GS,ContentBlock:XS,ContentBlockInner:KS,Text:YS};const Kh={navigationBarCollapsed:"767.95px",stackedContent:"1039.95px"},Yh={media:"",addListener:Yl,removeListener:Yl,matches:!1,onchange:Yl,addEventListener:Yl,removeEventListener:Yl,dispatchEvent:t=>!0};function Yl(){}function Gm(){return typeof window=="undefined"?Yh:window.matchMedia(`(max-width: ${Kh.navigationBarCollapsed})`)}function ZS(){return typeof window=="undefined"?Yh:window.matchMedia(`(max-width: ${Kh.stackedContent})`)}QS(Dh);function QS(t){return Object.entries(MT(t)).map(([o,l])=>Object.entries(l).map(([r,i])=>[`${o.split("-")[1]}${JS(r)}`,i])).flat()}function JS(t){return t.charAt(0).toUpperCase()+t.slice(1)}class Tn{constructor({top:n=0,left:o=0,width:l=0,height:r=0}={}){Kt(this,"top");Kt(this,"left");Kt(this,"width");Kt(this,"height");this.top=n,this.left=o,this.width=l,this.height=r}static get zero(){return new Tn}get center(){return{x:this.left+this.width/2,y:this.top+this.height/2}}}function Aa(t){if(!(t instanceof Element))return new Tn({width:window.innerWidth,height:window.innerHeight});const n=t.getBoundingClientRect();return new Tn({top:n.top,left:n.left,width:n.width,height:n.height})}const kr=1e3/60;function Zh(t){return t===document}function eC(t){return Zh(t)?document.body.scrollTop||document.documentElement.scrollTop:t.scrollTop}function tC(t,n){const o=t.left,l=t.left+t.width,r=n.left;return n.left+n.width{this.manageStickyItems()},kr,{leading:!0,trailing:!0,maxWait:kr}));Kt(this,"handleScroll",Dt(()=>{this.manageStickyItems()},kr,{leading:!0,trailing:!0,maxWait:kr}));n&&this.setContainer(n)}registerStickyItem(n){this.stickyItems.push(n)}unregisterStickyItem(n){const o=this.stickyItems.findIndex(({stickyNode:l})=>n===l);this.stickyItems.splice(o,1)}setContainer(n){this.container=n,Zh(n)&&this.setTopBarOffset(n),this.container.addEventListener("scroll",this.handleScroll),window.addEventListener("resize",this.handleResize),this.manageStickyItems()}removeScrollListener(){this.container&&(this.container.removeEventListener("scroll",this.handleScroll),window.removeEventListener("resize",this.handleResize))}manageStickyItems(){if(this.stickyItems.length<=0)return;const n=this.container?eC(this.container):0,o=Aa(this.container).top+this.topBarOffset;this.stickyItems.forEach(l=>{const{handlePositioning:r}=l,{sticky:i,top:c,left:p,width:g}=this.evaluateStickyItem(l,n,o);this.updateStuckItems(l,i),r(i,c,p,g)})}evaluateStickyItem(n,o,l){var M;const{stickyNode:r,placeHolderNode:i,boundingElement:c,offset:p,disableWhenStacked:g}=n;if(g&&ZS().matches)return{sticky:!1,top:0,left:0,width:"auto"};const h=p?this.getOffset(r)+parseInt(BT["space-5"],10):this.getOffset(r),b=o+h,f=i.getBoundingClientRect().top-l+o,S=l+h,{left:L,width:P}=i.getBoundingClientRect();let k;if(c==null)k=b>=f;else{const _=r.getBoundingClientRect().height||((M=r.firstElementChild)==null?void 0:M.getBoundingClientRect().height)||0,$=c.getBoundingClientRect().bottom-_+o-l;k=b>=f&&b<$}return{sticky:k,top:S,left:L,width:P}}updateStuckItems(n,o){const{stickyNode:l}=n;o&&!this.isNodeStuck(l)?this.addStuckItem(n):!o&&this.isNodeStuck(l)&&this.removeStuckItem(n)}addStuckItem(n){this.stuckItems.push(n)}removeStuckItem(n){const{stickyNode:o}=n,l=this.stuckItems.findIndex(({stickyNode:r})=>o===r);this.stuckItems.splice(l,1)}getOffset(n){if(this.stuckItems.length===0)return 0;let o=0,l=0;const r=this.stuckItems.length,i=Aa(n);for(;ln===l)>=0}setTopBarOffset(n){const o=n.querySelector(`:not(${ei.selector}) ${lp.selector}`);this.topBarOffset=o?o.clientHeight:0}}const aC="Polaris-Scrollable",nC="Polaris-Scrollable--horizontal",oC="Polaris-Scrollable--vertical",lC="Polaris-Scrollable--hasTopShadow",sC="Polaris-Scrollable--hasBottomShadow";var Zl={Scrollable:aC,horizontal:nC,vertical:oC,hasTopShadow:lC,hasBottomShadow:sC};const rC=["tabindex"],da=B({props:{vertical:{type:Boolean,default:!0},horizontal:{type:Boolean,default:!0},shadow:{type:Boolean},hint:{type:Boolean},focusable:{type:Boolean}},emits:["scrolled-to-bottom"],setup(t,{emit:n}){const o=t,l=100,r=2,i=C(null),c=C(!1),p=C(!1),g=new Qh,h=m(()=>E(Zl.Scrollable,o.vertical&&Zl.vertical,o.horizontal&&Zl.horizontal,o.shadow&&c.value&&Zl.hasTopShadow,o.shadow&&p.value&&Zl.hasBottomShadow)),b=k=>{var _;const M=L()?"auto":"smooth";(_=i.value)==null||_.scrollTo({top:k,behavior:M})};at("stickyManagerContext",g),at("scrollableContext",b);const f=()=>{const k=i.value;!k||requestAnimationFrame(()=>{const{scrollTop:M,clientHeight:_,scrollHeight:$}=k,V=Boolean($>_),X=Boolean(M>0),R=Boolean(M+_>=$-r);c.value=X,p.value=!R,V&&R&&n("scrolled-to-bottom")})},S=Dt(f,50,{trailing:!0});Oe(()=>{f(),o.hint&&window.requestAnimationFrame(()=>P(i.value));const k=i.value;!k||(g.setContainer(k),k.addEventListener("scroll",f),document.addEventListener("resize",S))}),qt(()=>{!i.value||(i.value.removeEventListener("scroll",f),document.removeEventListener("resize",S),g.removeScrollListener())});function L(){try{return window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return!1}}function P(k){if(!k||L())return;const M=k.scrollHeight-k.clientHeight,_=Math.min(l,M)-r,$=()=>{requestAnimationFrame(()=>{k.scrollTop>=_&&(k.removeEventListener("scroll",$),k.scrollTo({top:0,behavior:"smooth"}))})};k.addEventListener("scroll",$),k.scrollTo({top:l,behavior:"smooth"})}return(k,M)=>(s(),u("div",we({ref_key:"scrollArea",ref:i},a(ei).props,{class:[k.$attrs.class,a(h)],tabindex:t.focusable?0:void 0}),[v(k.$slots,"default")],16,rC))}});da.__docgenInfo={exportName:"default",displayName:"Scrollable",description:"",tags:{},props:[{name:"vertical",description:"Scroll content vertically",tags:{default:[{description:"true",title:"default"}]},required:!1,type:{name:"boolean"},defaultValue:{func:!1,value:"true"}},{name:"horizontal",description:"Scroll content horizontally",tags:{default:[{description:"true",title:"default"}]},required:!1,type:{name:"boolean"},defaultValue:{func:!1,value:"true"}},{name:"shadow",description:"Add a shadow when content is scrollable",required:!1,type:{name:"boolean"}},{name:"hint",description:"Slightly hints content upon mounting when scrollable",required:!1,type:{name:"boolean"}},{name:"focusable",description:"Adds a tabIndex to scrollable when children are not focusable",required:!1,type:{name:"boolean"}}],events:[{name:"scrolled-to-bottom"}],slots:[{name:"default"}]};class oi extends Error{constructor(n=""){super(`${n&&`${n} `}Your application must be wrapped in an component. See https://ownego.github.io/polaris-vue/?path=/docs/components-app-provider for implementation instructions.`);this.name="MissingAppProviderError"}}class iC extends Error{constructor(n=""){super(`${n&&`${n} `}Your component must be wrapped in a component. See https://ownego.github.io/polaris-vue/?path=/docs/components-frame--page for implementation instructions.`);this.name="MissingFrameError"}}function mt(){const t=et("uniqueIdFactory"),n=C("");function o(l="",r=""){if(!t)throw new oi("No UniqueIdFactory was provided.");return r||(n.value||(n.value=t.nextId(l)),n.value)}return{uniqueIdRef:n,useUniqueId:o}}function cC(t){const n=et("focusManager"),{useUniqueId:o,uniqueIdRef:l}=mt();ct([()=>t.trapping],()=>{t.trapping&&l&&n.add(l.value)});const r=m(()=>n.trapFocusList[0]===l.value);return Fh(()=>{if(!n)throw new oi("No FocusManager was provided.")}),Oe(()=>{const i=o();t.trapping&&n.add(i)}),qt(()=>{l.value&&n.remove(l.value)}),{canSafelyFocus:r}}function Ze(){const t=et("lang"),n=et("i18n");return{translate:(l,r)=>{if(!t)throw new oi("I18n");return n.translate(l,r)}}}const dC=["id"],li=B({setup(t){const n=et("scrollableContext",()=>!1),o=C(null),{useUniqueId:l}=mt(),r=l("ScrollTo");return Oe(()=>{!n||!o.value||n(o.value.offsetTop)}),(i,c)=>(s(),u("a",{id:a(r),ref_key:"anchorNode",ref:o},null,8,dC))}});li.__docgenInfo={exportName:"default",displayName:"ScrollTo",description:"",tags:{}};const uC=["href","target","rel"],zt=B({props:{to:null,url:null,external:{type:Boolean}},setup(t){return(n,o)=>{const l=ti("router-link");return t.to?(s(),N(l,{key:0,to:t.to},{default:y(()=>[v(n.$slots,"default")]),_:3},8,["to"])):(s(),u("a",{key:1,href:t.url,target:t.to?"_blank":void 0,rel:t.external?"noopener noreferrer":void 0},[v(n.$slots,"default")],8,uC))}}});zt.__docgenInfo={exportName:"default",displayName:"UnstyledLink",description:"",tags:{},props:[{name:"to",required:!1,type:{name:"union",elements:[{name:"string"},{name:"Record",elements:[{name:"string"},{name:"unknown"}]}]}},{name:"url",required:!1,type:{name:"string"}},{name:"external",required:!1,type:{name:"boolean"}}],slots:[{name:"default"}]};const pC={inheritAttrs:!1},Vu=B(D(T({},pC),{props:{id:null,content:null,url:null,external:{type:Boolean},badge:null,destructive:{type:Boolean},disabled:{type:Boolean},icon:null,accessibilityLabel:null,helpText:null,image:null,prefixId:null,suffixId:null,ellipsis:{type:Boolean},active:{type:Boolean},role:null,onAction:null,onMouseEnter:null,onTouchStart:null},setup(t){const n=t,o=m(()=>n.ellipsis&&n.content?`${n.content}\u2026`:n.content);return(l,r)=>(s(),u("span",{class:d(a(Rt).Content)},[t.prefixId?(s(),u("span",{key:0,class:d(a(Rt).Prefix)},[v(l.$slots,"prefix")],2)):t.icon?(s(),u("span",{key:1,class:d(a(Rt).Prefix)},[x(a(Le),{source:t.icon},null,8,["source"])],2)):t.image?(s(),u("span",{key:2,class:d(a(Rt).Prefix),role:"presentation",style:Ue({backgroundImage:`url(${t.image}`})},null,6)):w("",!0),A("span",{class:d(a(Rt).Text)},[t.helpText?(s(),u("span",{key:0,class:d(a(Rt).ContentBlock)},[A("span",{class:d(a(Rt).ContentBlockInner)},F(a(o)),3),x(a(ve),{variant:"bodyMd",color:"subdued",as:"span"},{default:y(()=>[H(F(t.helpText),1)]),_:1})],2)):(s(),u(O,{key:1},[H(F(a(o)),1)],64))],2),t.badge?(s(),u("span",{key:3,class:d(a(Rt).Suffix)},[x(a(Lt),{status:t.badge.status},{default:y(()=>[H(F(t.badge.content),1)]),_:1},8,["status"])],2)):w("",!0),t.suffixId?(s(),u("span",{key:4,class:d(a(Rt).Suffix)},[v(l.$slots,"suffix")],2)):w("",!0)],2))}}));Vu.__docgenInfo={exportName:"default",displayName:"ContentElement",description:"",tags:{},props:[{name:"id",required:!1,type:{name:"string"}},{name:"content",required:!1,type:{name:"string"}},{name:"url",required:!1,type:{name:"string"}},{name:"external",required:!1,type:{name:"boolean"}},{name:"badge",required:!1,type:{name:`{ +var LT=Object.defineProperty,_T=Object.defineProperties;var IT=Object.getOwnPropertyDescriptors;var Ar=Object.getOwnPropertySymbols;var Om=Object.prototype.hasOwnProperty,qm=Object.prototype.propertyIsEnumerable;var Tu=(t,n,o)=>n in t?LT(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o,T=(t,n)=>{for(var o in n||(n={}))Om.call(n,o)&&Tu(t,o,n[o]);if(Ar)for(var o of Ar(n))qm.call(n,o)&&Tu(t,o,n[o]);return t},D=(t,n)=>_T(t,IT(n));var ae=(t,n)=>{var o={};for(var l in t)Om.call(t,l)&&n.indexOf(l)<0&&(o[l]=t[l]);if(t!=null&&Ar)for(var l of Ar(t))n.indexOf(l)<0&&qm.call(t,l)&&(o[l]=t[l]);return o};var Kt=(t,n,o)=>(Tu(t,typeof n!="symbol"?n+"":n,o),o);import{d as B,u as Ae,c as m,o as s,a as N,w as y,b as x,e as a,f as w,g as A,h as u,r as v,F as O,i as H,t as F,n as d,j as PT,k as Oe,l as qt,m as MT,p as Dh,q as Dt,s as BT,v as ei,x as lp,y as C,z as at,A as we,B as et,C as ct,D as Fh,E as ti,G as Ue,H as Nt,I as ha,J as Te,K as rt,L as pt,M as Ra,N as sp,O as ba,P as xl,Q as xn,T as Ja,R as Da,S as cs,U as Eh,V as tn,W as $T,X as Rh,Y as ds,Z as us,_ as DT,$ as FT,a0 as rp,a1 as Kl,a2 as ET,a3 as RT,a4 as OT,a5 as qT,a6 as ps,a7 as Oh,a8 as Fu,a9 as Vr,aa as VT,ab as Vm,ac as Su,ad as HT,ae as Oa,af as WT,ag as UT,ah as ja,ai as qh,aj as Hm,ak as Vh,al as jT,am as zT,an as Eu,ao as GT,ap as XT,aq as e,ar as ce,as as de,at as I,au as U,av as j,aw as ye,ax as Hr,ay as Ru,az as KT,aA as Wm,aB as ip,aC as Hh,aD as Ou,aE as YT,aF as Um,aG as ZT,aH as Wh,aI as Uh,aJ as QT,aK as JT,aL as eS,aM as tS,aN as aS,aO as nS,aP as oS,aQ as lS,aR as sS,aS as jm,aT as rS,aU as iS,aV as cS,aW as dS,aX as uS,aY as pS,aZ as mS,a_ as gS,a$ as yS,b0 as hS,b1 as bS,b2 as fS,b3 as vS,b4 as xS,b5 as TS,b6 as SS}from"./vendor.0038c16e.js";const CS=function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))l(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const c of i.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&l(c)}).observe(document,{childList:!0,subtree:!0});function o(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerpolicy&&(i.referrerPolicy=r.referrerpolicy),r.crossorigin==="use-credentials"?i.credentials="include":r.crossorigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function l(r){if(r.ep)return;r.ep=!0;const i=o(r);fetch(r.href,i)}};CS();function z(t){if(!t)return!1;if(t&&t()[0].children){if(typeof t()[0].children=="string")return t()[0].children!=="v-if";if(Array.isArray(t()[0].children))return t()[0].children.length>0}return!0}const AS="Polaris-AccountConnection__TermsOfService",kS="Polaris-AccountConnection__Content";var zm={TermsOfService:AS,Content:kS};const wS={key:0},NS={key:1},LS={key:2},ai=B({props:{title:null,details:null,termsOfService:null,accountName:{default:""},avatarUrl:null,connected:{type:Boolean,default:!1},action:null},setup(t){const n=t,o=Ae(),l=m(()=>n.accountName?n.accountName.split(/\s+/).map(r=>r[0]).join(""):void 0);return(r,i)=>(s(),N(a(Je),{sectioned:""},{default:y(()=>[x(a(Np),null,{action:y(()=>[t.action?(s(),N(a(ht),{key:0,action:t.action,overrides:{primary:!t.connected}},null,8,["action","overrides"])):w("",!0)]),setting:y(()=>[x(a(Qe),null,{default:y(()=>[t.connected?(s(),N(a(fa),{key:0,accessibilityLabel:"",name:t.accountName,initials:a(l),source:t.avatarUrl},null,8,["name","initials","source"])):w("",!0),x(a(Ot),{fill:""},{default:y(()=>[A("div",{class:d(a(zm).Content)},[t.title||a(z)(a(o).title)?(s(),u("div",wS,[a(z)(a(o).title)?v(r.$slots,"title",{key:0}):(s(),u(O,{key:1},[H(F(t.title),1)],64))])):t.accountName?(s(),u("div",NS,F(t.accountName),1)):w("",!0),t.details||a(z)(a(o).details)?(s(),u("div",LS,[x(a(ve),{variant:"bodyMd",color:"subdued",as:"span"},{default:y(()=>[a(z)(a(o).details)?v(r.$slots,"details",{key:0}):(s(),u(O,{key:1},[H(F(t.details),1)],64))]),_:3})])):w("",!0)],2)]),_:3})]),_:3})]),_:3}),t.termsOfService||a(z)(a(o).termsOfService)?(s(),u("div",{key:0,class:d(a(zm).TermsOfService)},[a(z)(a(o).termsOfService)?v(r.$slots,"termsOfService",{key:0}):(s(),u(O,{key:1},[H(F(t.termsOfService),1)],64))],2)):w("",!0)]),_:3}))}});ai.__docgenInfo={exportName:"default",displayName:"AccountConnection",description:"",tags:{},props:[{name:"title",description:"Content to display as title",required:!1,type:{name:"string"}},{name:"details",description:"Content to display as additional details",required:!1,type:{name:"string"}},{name:"termsOfService",description:"Content to display as terms of service",required:!1,type:{name:"string"}},{name:"accountName",description:"The name of the service",required:!1,type:{name:"string"},defaultValue:{func:!1,value:"''"}},{name:"avatarUrl",description:"URL for the user\u2019s avatar image",required:!1,type:{name:"string"}},{name:"connected",description:"Set if the account is connected",required:!1,type:{name:"boolean"},defaultValue:{func:!1,value:"false"}},{name:"action",description:"Action for account connection",required:!1,type:{name:"Action"}}],slots:[{name:"title"},{name:"details"},{name:"termsOfService"}]};function E(...t){return t.filter(Boolean).join(" ")}function Ye(t,n){return`${t}${n.charAt(0).toUpperCase()}${n.slice(1)}`}function _S(t,n,o,l){return typeof l=="string"?{[`--pc-${t}-${n}-xs`]:`var(--p-${o}-${l})`}:Object.fromEntries(Object.entries(l).map(([r,i])=>[`--pc-${t}-${n}-${r}`,`var(--p-${o}-${i})`]))}const Wr='a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]:not([tabindex="-1"])',qu="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]",IS='a[role="menuitem"],frame[role="menuitem"],iframe[role="menuitem"],input[role="menuitem"]:not([type=hidden]):not(:disabled),select[role="menuitem"]:not(:disabled),textarea[role="menuitem"]:not(:disabled),button[role="menuitem"]:not(:disabled),*[tabindex]:not([tabindex="-1"])';function ni(t,n){if(t.matches)return t.matches(n);const o=(t.ownerDocument||document).querySelectorAll(n);let l=o.length;for(;l>=0&&o.item(l)!==t;)return l-=1,l>-1}function Cu(t){const n="a,button,frame,iframe,input:not([type=hidden]),select,textarea,*[tabindex]";return ni(t,n)?t:t.querySelector(n)}function PS(t,n){const o=[...document.querySelectorAll(qu)],l=o.indexOf(t)+1,r=o.slice(l);for(const i of r)if(PT(i)&&(!n||n&&n(i)))return i;return null}function MS(t,n){const o=PS(t,n);return o&&o instanceof HTMLElement?(o.focus(),!0):!1}function jh(t,n=!0){return!n&&ni(t,qu)?t:t.querySelector(qu)}function zh(t){return t.querySelectorAll(IS)}function Gh(t,n){let o=0;for(const l of t){if(l===n)break;o+=1}return o===t.length?-1:o}function BS(t,n){const o=zh(t),l=Gh(o,n);l===-1?o[0].focus():o[(l-1+o.length)%o.length].focus()}function $S(t,n){const o=zh(t),l=Gh(o,n);l===-1?o[0].focus():o[(l+1)%o.length].focus()}const ca=t=>{t.currentTarget.blur()};function an(t,n=!0){var o;(o=jh(t,n))==null||o.focus()}function cp(t,n=!0){return!n&&ni(t,Wr)?t:t.querySelector(Wr)}function Xh(t,n=!0){if(!n&&ni(t,Wr))return t;const o=t.querySelectorAll(Wr);return o[o.length-1]}function DS(t,n=!0){const o=cp(t,n);return o?(o.focus(),!0):!1}function FS(t,n=!0){const o=Xh(t,n);return o?(o.focus(),!0):!1}const ES={inheritAttrs:!1,render(){return null}},Wt=B(D(T({},ES),{props:{keyCode:{type:String,required:!0},keyEvent:{type:String,default:"keyup"},handler:{type:Function,required:!0},useCapture:{type:Boolean},options:{type:Object}},setup(t){const n=t;function o(l){l.key===n.keyCode&&n.handler(l)}return Oe(()=>document.addEventListener(n.keyEvent,o,n.useCapture||n.options)),qt(()=>document.removeEventListener(n.keyEvent,o,n.useCapture||n.options)),()=>{}}}));Wt.__docgenInfo={exportName:"default",displayName:"KeypressListener",description:"",tags:{},props:[{name:"keyCode",type:{name:"String as () => Key"},required:!0},{name:"keyEvent",type:{name:"String as () => KeyEvent"},defaultValue:{func:!1,value:"'keyup'"}},{name:"handler",type:{name:"func"},required:!0},{name:"useCapture",type:{name:"boolean"}},{name:"options",type:{name:"Object as () => AddEventListenerOptions"}}]};var yt=(t=>(t.Backspace="Backspace",t.Tab="Tab",t.Enter="Enter",t.Shift="Shift",t.Ctrl="Ctrl",t.Alt="Alt",t.Pause="Pause",t.CapsLock="CapsLock",t.Escape="Escape",t.Space="Space",t.PageUp="PageUp",t.PageDown="PageDown",t.End="End",t.Home="Home",t.ArrowRight="ArrowRight",t.ArrowLeft="ArrowLeft",t.ArrowUp="ArrowUp",t.ArrowDown="ArrowDown",t.Insert="Insert",t.Delete="Delete",t.Key0="Key0",t.Key1="Key1",t.Key2="Key2",t.Key3="Key3",t.Key4="Key4",t.Key5="Key5",t.Key6="Key6",t.Key7="Key7",t.Key8="Key8",t.Key9="Key9",t.KeyA="KeyA",t.KeyB="KeyB",t.KeyC="KeyC",t.KeyD="KeyD",t.KeyE="KeyE",t.KeyF="KeyF",t.KeyG="KeyG",t.KeyH="KeyH",t.KeyI="KeyI",t.KeyJ="KeyJ",t.KeyK="KeyK",t.KeyL="KeyL",t.KeyM="KeyM",t.KeyN="KeyN",t.KeyO="KeyO",t.KeyP="KeyP",t.KeyQ="KeyQ",t.KeyR="KeyR",t.KeyS="KeyS",t.KeyT="KeyT",t.KeyU="KeyU",t.KeyV="KeyV",t.KeyW="KeyW",t.KeyX="KeyX",t.KeyY="KeyY",t.KeyZ="KeyZ",t.LeftMeta="LeftMeta",t.RightMeta="RightMeta",t.Select="Select",t.Numpad0="Numpad0",t.Numpad1="Numpad1",t.Numpad2="Numpad2",t.Numpad3="Numpad3",t.Numpad4="Numpad4",t.Numpad5="Numpad5",t.Numpad6="Numpad6",t.Numpad7="Numpad7",t.Numpad8="Numpad8",t.Numpad9="Numpad9",t.Multiply="Multiply",t.Add="Add",t.Subtract="Subtract",t.Decimal="Decimal",t.Divide="Divide",t.F1="F1",t.F2="F2",t.F3="F3",t.F4="F4",t.F5="F5",t.F6="F6",t.F7="F7",t.F8="F8",t.F9="F9",t.F10="F10",t.F11="F11",t.F12="F12",t.NumLock="NumLock",t.ScrollLock="ScrollLock",t.Semicolon="Semicolon",t.Equals="Equals",t.Comma="Comma",t.Dash="Dash",t.Period="Period",t.ForwardSlash="ForwardSlash",t.GraveAccent="GraveAccent",t.OpenBracket="OpenBracket",t.BackSlash="BackSlash",t.CloseBracket="CloseBracket",t.SingleQuote="SingleQuote",t))(yt||{});const RS="Polaris-ActionList",OS="Polaris-ActionList__Actions",qS="Polaris-ActionList__Section",VS="Polaris-ActionList__Item",HS="Polaris-ActionList--active",WS="Polaris-ActionList--destructive",US="Polaris-ActionList--disabled",jS="Polaris-ActionList__Prefix",zS="Polaris-ActionList__Suffix",GS="Polaris-ActionList__Content",XS="Polaris-ActionList__ContentBlock",KS="Polaris-ActionList__ContentBlockInner",YS="Polaris-ActionList__Text";var Rt={ActionList:RS,"Section-withoutTitle":"Polaris-ActionList__Section--withoutTitle",Actions:OS,Section:qS,Item:VS,active:HS,destructive:WS,disabled:US,Prefix:jS,Suffix:zS,Content:GS,ContentBlock:XS,ContentBlockInner:KS,Text:YS};const Kh={navigationBarCollapsed:"767.95px",stackedContent:"1039.95px"},Yh={media:"",addListener:Yl,removeListener:Yl,matches:!1,onchange:Yl,addEventListener:Yl,removeEventListener:Yl,dispatchEvent:t=>!0};function Yl(){}function Gm(){return typeof window=="undefined"?Yh:window.matchMedia(`(max-width: ${Kh.navigationBarCollapsed})`)}function ZS(){return typeof window=="undefined"?Yh:window.matchMedia(`(max-width: ${Kh.stackedContent})`)}QS(Dh);function QS(t){return Object.entries(MT(t)).map(([o,l])=>Object.entries(l).map(([r,i])=>[`${o.split("-")[1]}${JS(r)}`,i])).flat()}function JS(t){return t.charAt(0).toUpperCase()+t.slice(1)}class Tn{constructor({top:n=0,left:o=0,width:l=0,height:r=0}={}){Kt(this,"top");Kt(this,"left");Kt(this,"width");Kt(this,"height");this.top=n,this.left=o,this.width=l,this.height=r}static get zero(){return new Tn}get center(){return{x:this.left+this.width/2,y:this.top+this.height/2}}}function Aa(t){if(!(t instanceof Element))return new Tn({width:window.innerWidth,height:window.innerHeight});const n=t.getBoundingClientRect();return new Tn({top:n.top,left:n.left,width:n.width,height:n.height})}const kr=1e3/60;function Zh(t){return t===document}function eC(t){return Zh(t)?document.body.scrollTop||document.documentElement.scrollTop:t.scrollTop}function tC(t,n){const o=t.left,l=t.left+t.width,r=n.left;return n.left+n.width{this.manageStickyItems()},kr,{leading:!0,trailing:!0,maxWait:kr}));Kt(this,"handleScroll",Dt(()=>{this.manageStickyItems()},kr,{leading:!0,trailing:!0,maxWait:kr}));n&&this.setContainer(n)}registerStickyItem(n){this.stickyItems.push(n)}unregisterStickyItem(n){const o=this.stickyItems.findIndex(({stickyNode:l})=>n===l);this.stickyItems.splice(o,1)}setContainer(n){this.container=n,Zh(n)&&this.setTopBarOffset(n),this.container.addEventListener("scroll",this.handleScroll),window.addEventListener("resize",this.handleResize),this.manageStickyItems()}removeScrollListener(){this.container&&(this.container.removeEventListener("scroll",this.handleScroll),window.removeEventListener("resize",this.handleResize))}manageStickyItems(){if(this.stickyItems.length<=0)return;const n=this.container?eC(this.container):0,o=Aa(this.container).top+this.topBarOffset;this.stickyItems.forEach(l=>{const{handlePositioning:r}=l,{sticky:i,top:c,left:p,width:g}=this.evaluateStickyItem(l,n,o);this.updateStuckItems(l,i),r(i,c,p,g)})}evaluateStickyItem(n,o,l){var M;const{stickyNode:r,placeHolderNode:i,boundingElement:c,offset:p,disableWhenStacked:g}=n;if(g&&ZS().matches)return{sticky:!1,top:0,left:0,width:"auto"};const h=p?this.getOffset(r)+parseInt(BT["space-5"],10):this.getOffset(r),b=o+h,f=i.getBoundingClientRect().top-l+o,S=l+h,{left:L,width:P}=i.getBoundingClientRect();let k;if(c==null)k=b>=f;else{const _=r.getBoundingClientRect().height||((M=r.firstElementChild)==null?void 0:M.getBoundingClientRect().height)||0,$=c.getBoundingClientRect().bottom-_+o-l;k=b>=f&&b<$}return{sticky:k,top:S,left:L,width:P}}updateStuckItems(n,o){const{stickyNode:l}=n;o&&!this.isNodeStuck(l)?this.addStuckItem(n):!o&&this.isNodeStuck(l)&&this.removeStuckItem(n)}addStuckItem(n){this.stuckItems.push(n)}removeStuckItem(n){const{stickyNode:o}=n,l=this.stuckItems.findIndex(({stickyNode:r})=>o===r);this.stuckItems.splice(l,1)}getOffset(n){if(this.stuckItems.length===0)return 0;let o=0,l=0;const r=this.stuckItems.length,i=Aa(n);for(;ln===l)>=0}setTopBarOffset(n){const o=n.querySelector(`:not(${ei.selector}) ${lp.selector}`);this.topBarOffset=o?o.clientHeight:0}}const aC="Polaris-Scrollable",nC="Polaris-Scrollable--horizontal",oC="Polaris-Scrollable--vertical",lC="Polaris-Scrollable--hasTopShadow",sC="Polaris-Scrollable--hasBottomShadow";var Zl={Scrollable:aC,horizontal:nC,vertical:oC,hasTopShadow:lC,hasBottomShadow:sC};const rC=["tabindex"],da=B({props:{vertical:{type:Boolean,default:!0},horizontal:{type:Boolean,default:!0},shadow:{type:Boolean},hint:{type:Boolean},focusable:{type:Boolean}},emits:["scrolled-to-bottom"],setup(t,{emit:n}){const o=t,l=100,r=2,i=C(null),c=C(!1),p=C(!1),g=new Qh,h=m(()=>E(Zl.Scrollable,o.vertical&&Zl.vertical,o.horizontal&&Zl.horizontal,o.shadow&&c.value&&Zl.hasTopShadow,o.shadow&&p.value&&Zl.hasBottomShadow)),b=k=>{var _;const M=L()?"auto":"smooth";(_=i.value)==null||_.scrollTo({top:k,behavior:M})};at("stickyManagerContext",g),at("scrollableContext",b);const f=()=>{const k=i.value;!k||requestAnimationFrame(()=>{const{scrollTop:M,clientHeight:_,scrollHeight:$}=k,V=Boolean($>_),X=Boolean(M>0),R=Boolean(M+_>=$-r);c.value=X,p.value=!R,V&&R&&n("scrolled-to-bottom")})},S=Dt(f,50,{trailing:!0});Oe(()=>{f(),o.hint&&window.requestAnimationFrame(()=>P(i.value));const k=i.value;!k||(g.setContainer(k),k.addEventListener("scroll",f),document.addEventListener("resize",S))}),qt(()=>{!i.value||(i.value.removeEventListener("scroll",f),document.removeEventListener("resize",S),g.removeScrollListener())});function L(){try{return window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return!1}}function P(k){if(!k||L())return;const M=k.scrollHeight-k.clientHeight,_=Math.min(l,M)-r,$=()=>{requestAnimationFrame(()=>{k.scrollTop>=_&&(k.removeEventListener("scroll",$),k.scrollTo({top:0,behavior:"smooth"}))})};k.addEventListener("scroll",$),k.scrollTo({top:l,behavior:"smooth"})}return(k,M)=>(s(),u("div",we({ref_key:"scrollArea",ref:i},a(ei).props,{class:[k.$attrs.class,a(h)],tabindex:t.focusable?0:void 0}),[v(k.$slots,"default")],16,rC))}});da.__docgenInfo={exportName:"default",displayName:"Scrollable",description:"",tags:{},props:[{name:"vertical",description:"Scroll content vertically",tags:{default:[{description:"true",title:"default"}]},required:!1,type:{name:"boolean"},defaultValue:{func:!1,value:"true"}},{name:"horizontal",description:"Scroll content horizontally",tags:{default:[{description:"true",title:"default"}]},required:!1,type:{name:"boolean"},defaultValue:{func:!1,value:"true"}},{name:"shadow",description:"Add a shadow when content is scrollable",required:!1,type:{name:"boolean"}},{name:"hint",description:"Slightly hints content upon mounting when scrollable",required:!1,type:{name:"boolean"}},{name:"focusable",description:"Adds a tabIndex to scrollable when children are not focusable",required:!1,type:{name:"boolean"}}],events:[{name:"scrolled-to-bottom"}],slots:[{name:"default"}]};class oi extends Error{constructor(n=""){super(`${n&&`${n} `}Your application must be wrapped in an component. See https://ownego.github.io/polaris-vue/v1?path=/docs/components-app-provider for implementation instructions.`);this.name="MissingAppProviderError"}}class iC extends Error{constructor(n=""){super(`${n&&`${n} `}Your component must be wrapped in a component. See https://ownego.github.io/polaris-vue/v1?path=/docs/components-frame--page for implementation instructions.`);this.name="MissingFrameError"}}function mt(){const t=et("uniqueIdFactory"),n=C("");function o(l="",r=""){if(!t)throw new oi("No UniqueIdFactory was provided.");return r||(n.value||(n.value=t.nextId(l)),n.value)}return{uniqueIdRef:n,useUniqueId:o}}function cC(t){const n=et("focusManager"),{useUniqueId:o,uniqueIdRef:l}=mt();ct([()=>t.trapping],()=>{t.trapping&&l&&n.add(l.value)});const r=m(()=>n.trapFocusList[0]===l.value);return Fh(()=>{if(!n)throw new oi("No FocusManager was provided.")}),Oe(()=>{const i=o();t.trapping&&n.add(i)}),qt(()=>{l.value&&n.remove(l.value)}),{canSafelyFocus:r}}function Ze(){const t=et("lang"),n=et("i18n");return{translate:(l,r)=>{if(!t)throw new oi("I18n");return n.translate(l,r)}}}const dC=["id"],li=B({setup(t){const n=et("scrollableContext",()=>!1),o=C(null),{useUniqueId:l}=mt(),r=l("ScrollTo");return Oe(()=>{!n||!o.value||n(o.value.offsetTop)}),(i,c)=>(s(),u("a",{id:a(r),ref_key:"anchorNode",ref:o},null,8,dC))}});li.__docgenInfo={exportName:"default",displayName:"ScrollTo",description:"",tags:{}};const uC=["href","target","rel"],zt=B({props:{to:null,url:null,external:{type:Boolean}},setup(t){return(n,o)=>{const l=ti("router-link");return t.to?(s(),N(l,{key:0,to:t.to},{default:y(()=>[v(n.$slots,"default")]),_:3},8,["to"])):(s(),u("a",{key:1,href:t.url,target:t.to?"_blank":void 0,rel:t.external?"noopener noreferrer":void 0},[v(n.$slots,"default")],8,uC))}}});zt.__docgenInfo={exportName:"default",displayName:"UnstyledLink",description:"",tags:{},props:[{name:"to",required:!1,type:{name:"union",elements:[{name:"string"},{name:"Record",elements:[{name:"string"},{name:"unknown"}]}]}},{name:"url",required:!1,type:{name:"string"}},{name:"external",required:!1,type:{name:"boolean"}}],slots:[{name:"default"}]};const pC={inheritAttrs:!1},Vu=B(D(T({},pC),{props:{id:null,content:null,url:null,external:{type:Boolean},badge:null,destructive:{type:Boolean},disabled:{type:Boolean},icon:null,accessibilityLabel:null,helpText:null,image:null,prefixId:null,suffixId:null,ellipsis:{type:Boolean},active:{type:Boolean},role:null,onAction:null,onMouseEnter:null,onTouchStart:null},setup(t){const n=t,o=m(()=>n.ellipsis&&n.content?`${n.content}\u2026`:n.content);return(l,r)=>(s(),u("span",{class:d(a(Rt).Content)},[t.prefixId?(s(),u("span",{key:0,class:d(a(Rt).Prefix)},[v(l.$slots,"prefix")],2)):t.icon?(s(),u("span",{key:1,class:d(a(Rt).Prefix)},[x(a(Le),{source:t.icon},null,8,["source"])],2)):t.image?(s(),u("span",{key:2,class:d(a(Rt).Prefix),role:"presentation",style:Ue({backgroundImage:`url(${t.image}`})},null,6)):w("",!0),A("span",{class:d(a(Rt).Text)},[t.helpText?(s(),u("span",{key:0,class:d(a(Rt).ContentBlock)},[A("span",{class:d(a(Rt).ContentBlockInner)},F(a(o)),3),x(a(ve),{variant:"bodyMd",color:"subdued",as:"span"},{default:y(()=>[H(F(t.helpText),1)]),_:1})],2)):(s(),u(O,{key:1},[H(F(a(o)),1)],64))],2),t.badge?(s(),u("span",{key:3,class:d(a(Rt).Suffix)},[x(a(Lt),{status:t.badge.status},{default:y(()=>[H(F(t.badge.content),1)]),_:1},8,["status"])],2)):w("",!0),t.suffixId?(s(),u("span",{key:4,class:d(a(Rt).Suffix)},[v(l.$slots,"suffix")],2)):w("",!0)],2))}}));Vu.__docgenInfo={exportName:"default",displayName:"ContentElement",description:"",tags:{},props:[{name:"id",required:!1,type:{name:"string"}},{name:"content",required:!1,type:{name:"string"}},{name:"url",required:!1,type:{name:"string"}},{name:"external",required:!1,type:{name:"boolean"}},{name:"badge",required:!1,type:{name:`{ status: 'new'; content: string; }`}},{name:"destructive",required:!1,type:{name:"boolean"}},{name:"disabled",required:!1,type:{name:"boolean"}},{name:"icon",required:!1,type:{name:"IconSource"}},{name:"accessibilityLabel",required:!1,type:{name:"string"}},{name:"helpText",required:!1,type:{name:"string"}},{name:"image",required:!1,type:{name:"string"}},{name:"prefixId",required:!1,type:{name:"string"}},{name:"suffixId",required:!1,type:{name:"string"}},{name:"ellipsis",required:!1,type:{name:"boolean"}},{name:"active",required:!1,type:{name:"boolean"}},{name:"role",required:!1,type:{name:"string"}}],slots:[{name:"prefix"},{name:"suffix"}]};const mC=["id","disabled","aria-label","role"],gC={inheritAttrs:!1},Jh=B(D(T({},gC),{props:{id:null,content:null,url:null,external:{type:Boolean},badge:null,destructive:{type:Boolean},disabled:{type:Boolean},icon:null,accessibilityLabel:null,helpText:null,image:null,prefixId:null,suffixId:null,ellipsis:{type:Boolean},active:{type:Boolean},role:null,onAction:null,onMouseEnter:null,onTouchStart:null},emits:["action"],setup(t,{emit:n}){const o=t,l=m(()=>E(Rt.Item,o.disabled&&Rt.disabled,o.destructive&&Rt.destructive,o.active&&Rt.active)),r=m(()=>({badge:o.badge,content:o.content,helpText:o.helpText,icon:o.icon,prefixId:o.prefixId,suffixId:o.suffixId,image:o.image,disabled:o.disabled,ellipsis:o.ellipsis,role:o.role}));m(()=>o.role==="menuitem"?"presentation":void 0);const i=()=>{o.disabled||n("action")};return(c,p)=>(s(),u(O,null,[t.active?(s(),N(a(li),{key:0})):w("",!0),t.url?(s(),N(a(zt),{key:1,id:t.id,url:t.disabled?void 0:t.url,class:d(a(l)),external:t.external,"aria-label":t.accessibilityLabel,role:t.role,onClick:i},{default:y(()=>[x(Vu,Nt(ha(a(r))),{suffix:y(()=>[v(c.$slots,"suffix")]),prefix:y(()=>[v(c.$slots,"prefix")]),_:3},16)]),_:3},8,["id","url","class","external","aria-label","role"])):(s(),u("button",{key:2,id:t.id,type:"button",class:d(a(l)),disabled:t.disabled,"aria-label":t.accessibilityLabel,role:t.role,onClick:i,onMouseup:p[0]||(p[0]=(...g)=>a(ca)&&a(ca)(...g))},[x(Vu,Nt(ha(a(r))),{suffix:y(()=>[v(c.$slots,"suffix")]),prefix:y(()=>[v(c.$slots,"prefix")]),_:3},16)],42,mC))],64))}}));Jh.__docgenInfo={exportName:"default",displayName:"Item",description:"",tags:{},props:[{name:"id",required:!1,type:{name:"string"}},{name:"content",required:!1,type:{name:"string"}},{name:"url",required:!1,type:{name:"string"}},{name:"external",required:!1,type:{name:"boolean"}},{name:"badge",required:!1,type:{name:`{ diff --git a/docs/v1/assets/iframe.12e9b233.js.map b/docs/v1/assets/iframe.12e9b233.js.map index 24980743e..7a9a5a9cb 100644 --- a/docs/v1/assets/iframe.12e9b233.js.map +++ b/docs/v1/assets/iframe.12e9b233.js.map @@ -1 +1 @@ -{"version":3,"file":"iframe.12e9b233.js","sources":["../../vite/modulepreload-polyfill","../../src/utilities/has-slot.ts","../../src/utilities/css.ts","../../src/utilities/focus.ts","../../src/components/KeypressListener/KeypressListener.vue","../../src/components/KeypressListener/utils.ts","../../src/utilities/breakpoints.ts","../../src/utilities/geometry.ts","../../src/utilities/sticky-manager.ts","../../src/utilities/errors.ts","../../src/use/UseUniqueId.ts","../../src/use/UseFocusManager.ts","../../src/use/UseI18n.ts","../../src/components/ActionList/components/Item/ContentElement.vue","../../src/components/ActionList/components/Section/Section.vue","../../src/components/ActionList/ActionList.vue","../../src/components/ActionMenu/components/MenuGroup/MenuGroup.vue","../../node_modules/@shopify/polaris-icons/dist/svg/HorizontalDotsMinor.svg","../../src/components/ActionMenu/ActionMenu.vue","../../node_modules/polaris/polaris-react/src/utilities/scroll-lock-manager/scroll-lock-manager.ts","../../node_modules/polaris/polaris-react/src/utilities/unique-id/unique-id-factory.ts","../../node_modules/polaris/polaris-react/src/utilities/merge.ts","../../src/utilities/get.ts","../../src/utilities/i18n/I18n.ts","../../src/utilities/portal-manager.ts","../../src/utilities/focus-manager.ts","../../src/components/Listbox/utils.ts","../../src/components/Label/utils.ts","../../node_modules/@shopify/polaris-icons/dist/svg/CircleCancelMinor.svg","../../src/components/Labelled/utils.ts","../../node_modules/@shopify/polaris-icons/dist/svg/CaretDownMinor.svg","../../node_modules/@shopify/polaris-icons/dist/svg/CaretUpMinor.svg","../../src/components/EventListener/EventListener.vue","../../src/components/Avatar/utils.ts","../../src/components/Badge/utils.ts","../../node_modules/@shopify/polaris-icons/dist/svg/CircleTickMajor.svg","../../node_modules/@shopify/polaris-icons/dist/svg/CircleInformationMajor.svg","../../node_modules/@shopify/polaris-icons/dist/svg/CircleAlertMajor.svg","../../node_modules/@shopify/polaris-icons/dist/svg/DiamondAlertMajor.svg","../../src/utilities/capitalize.ts","../../src/utilities/use-disable-interaction.ts","../../src/components/Popover/utils.ts","../../src/components/PositionedOverlay/math.ts","../../src/components/PositionedOverlay/utils.ts","../../src/components/Scrollable/utils.ts","../../src/components/PositionedOverlay/PositionedOverlay.vue","../../src/components/Popover/Popover.vue","../../src/config/index.ts","../../node_modules/@shopify/polaris-icons/dist/svg/SelectMinor.svg","../../src/assets/spinner-large.svg?component","../../src/assets/spinner-small.svg?component","../../src/components/Button/ButtonMarkup.vue","../../src/components/Button/ButtonFrom.vue","../../src/utilities/extract-fragment.ts","../../src/components/ButtonGroup/components/Item/Item.vue","../../src/components/InlineError/utils.ts","../../src/components/Choice/utils.ts","../../src/utilities/color-transformers.ts","../../src/utilities/frame/hooks.ts","../../node_modules/@shopify/polaris-icons/dist/svg/SortAscendingMajor.svg","../../node_modules/@shopify/polaris-icons/dist/svg/SortDescendingMajor.svg","../../node_modules/@shopify/polaris-icons/dist/svg/ChevronLeftMinor.svg","../../src/components/DataTable/utils.ts","../../node_modules/polaris/polaris-react/src/utilities/dates.ts","../../node_modules/@shopify/polaris-icons/dist/svg/ArrowRightMinor.svg","../../src/components/DatePicker/utils.ts","../../node_modules/@shopify/polaris-icons/dist/svg/UploadMajor.svg","../../node_modules/polaris/polaris-react/src/utilities/capitalize.ts","../../src/components/DropZone/utils.ts","../../node_modules/polaris/polaris-react/src/components/DropZone/images/upload-arrow.svg?component","../../node_modules/polaris/polaris-react/src/components/EmptySearchResult/illustrations/empty-search.svg?component","../../src/utilities/media-query/hooks.ts","../../node_modules/@shopify/polaris-icons/dist/svg/ChevronUpMinor.svg","../../node_modules/@shopify/polaris-icons/dist/svg/ChevronDownMinor.svg","../../src/components/Focus/Focus.vue","../../node_modules/polaris/polaris-react/src/utilities/set-root-property.ts","../../node_modules/@shopify/polaris-icons/dist/svg/MobileCancelMajor.svg","../../node_modules/polaris/polaris-react/src/utilities/is-object.ts","../../node_modules/polaris/polaris-react/src/utilities/pluck-deep.ts","../../node_modules/polaris/polaris-react/src/utilities/get-width.ts","../../node_modules/@shopify/polaris-icons/dist/svg/ExitMajor.svg","../../src/utilities/index-provider/hooks.ts","../../src/utilities/index-provider/types.ts","../../node_modules/@shopify/polaris-icons/dist/svg/EnableSelectionMinor.svg","../../src/utilities/index-table/hooks.ts","../../src/components/IndexTable/utils.ts","../../node_modules/polaris/polaris-react/src/utilities/listbox/utilities.ts","../../src/components/Navigation/context.ts","../../node_modules/polaris/polaris-react/src/utilities/is-input-focused.ts","../../node_modules/polaris/polaris-react/src/components/RangeSlider/utilities/invertNumber.ts","../../src/utilities/resource-list/types.ts","../../src/components/ScrollLock/ScrollLock.vue","../../src/components/Tabs/utilities.ts","../../src/components/Tooltip/Tooltip.vue","../../node_modules/@shopify/polaris-icons/dist/svg/MobileHamburgerMajor.svg","../../node_modules/polaris/polaris-react/src/utilities/duration.ts","../../node_modules/@shopify/polaris-icons/dist/svg/PlayMinor.svg","../../src/utilities/use-index-resource-state.ts","../../.storybook/preview.js","../../../../../../../../virtual:/@storybook/builder-vite/storybook-stories.js","../../../../../../../../virtual:/@storybook/builder-vite/vite-app.js"],"sourcesContent":["const p = function polyfill() {\n const relList = document.createElement('link').relList;\n if (relList && relList.supports && relList.supports('modulepreload')) {\n return;\n }\n for (const link of document.querySelectorAll('link[rel=\"modulepreload\"]')) {\n processPreload(link);\n }\n new MutationObserver((mutations) => {\n for (const mutation of mutations) {\n if (mutation.type !== 'childList') {\n continue;\n }\n for (const node of mutation.addedNodes) {\n if (node.tagName === 'LINK' && node.rel === 'modulepreload')\n processPreload(node);\n }\n }\n }).observe(document, { childList: true, subtree: true });\n function getFetchOpts(script) {\n const fetchOpts = {};\n if (script.integrity)\n fetchOpts.integrity = script.integrity;\n if (script.referrerpolicy)\n fetchOpts.referrerPolicy = script.referrerpolicy;\n if (script.crossorigin === 'use-credentials')\n fetchOpts.credentials = 'include';\n else if (script.crossorigin === 'anonymous')\n fetchOpts.credentials = 'omit';\n else\n fetchOpts.credentials = 'same-origin';\n return fetchOpts;\n }\n function processPreload(link) {\n if (link.ep)\n // ep marker = processed\n return;\n link.ep = true;\n // prepopulate the load record\n const fetchOpts = getFetchOpts(link);\n fetch(link.href, fetchOpts);\n }\n};__VITE_IS_MODERN__&&p();","import type { Slot } from 'vue';\n\nexport function hasSlot (slot?: Slot) {\n if (!slot) { return false; }\n\n if (slot && slot()[0].children) {\n if (typeof slot()[0].children === 'string') {\n return slot()[0].children !== 'v-if';\n }\n\n if (Array.isArray(slot()[0].children)) {\n return (slot()[0].children as []).length > 0;\n }\n }\n\n return true;\n}\n","import type {BreakpointsAlias} from '@shopify/polaris-tokens';\n\ntype Falsy = boolean | undefined | null | 0;\n\nexport type ResponsiveProp =\n | T\n | {\n [Breakpoint in BreakpointsAlias]?: T;\n };\n\nexport function classNames(...classes: (string | Falsy)[]) {\n return classes.filter(Boolean).join(' ');\n}\n\nexport function variationName(name: string, value: string) {\n return `${name}${value.charAt(0).toUpperCase()}${value.slice(1)}`;\n}\n\nexport function getResponsiveProps(\n componentName: string,\n componentProp: string,\n tokenSubgroup: string,\n responsiveProp:\n | string\n | {\n [Breakpoint in BreakpointsAlias]?: string;\n },\n) {\n if (typeof responsiveProp === 'string') {\n return {\n [`--pc-${componentName}-${componentProp}-xs`]: `var(--p-${tokenSubgroup}-${responsiveProp})`,\n };\n }\n\n return Object.fromEntries(\n Object.entries(responsiveProp).map(([breakpointAlias, aliasOrScale]) => [\n `--pc-${componentName}-${componentProp}-${breakpointAlias}`,\n `var(--p-${tokenSubgroup}-${aliasOrScale})`,\n ]),\n );\n}\n","import { isElementInViewport } from 'polaris/polaris-react/src/utilities/is-element-in-viewport';\n\ntype Filter = (element: Element) => void;\n\nconst KEYBOARD_FOCUSABLE_SELECTORS =\n 'a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]:not([tabindex=\"-1\"])';\nconst FOCUSABLE_SELECTOR =\n 'a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]';\nconst MENUITEM_FOCUSABLE_SELECTORS =\n 'a[role=\"menuitem\"],frame[role=\"menuitem\"],iframe[role=\"menuitem\"],input[role=\"menuitem\"]:not([type=hidden]):not(:disabled),select[role=\"menuitem\"]:not(:disabled),textarea[role=\"menuitem\"]:not(:disabled),button[role=\"menuitem\"]:not(:disabled),*[tabindex]:not([tabindex=\"-1\"])';\n\nfunction matches(node: HTMLElement, selector: string) {\n if (node.matches) {\n return node.matches(selector);\n }\n\n const theMatches = (node.ownerDocument || document).querySelectorAll(selector);\n let i = theMatches.length;\n while (i >= 0 && theMatches.item(i) !== node) {\n i -= 1;\n return i > -1;\n }\n}\n\n// Popover needs to be able to find its activator even\n// if it is disabled, which FOCUSABLE_SELECTOR doesn't support.\nexport function findFirstFocusableNodeIncludingDisabled(element: HTMLElement): HTMLElement | null {\n const focusableSelector = 'a,button,frame,iframe,input:not([type=hidden]),select,textarea,*[tabindex]';\n\n if (matches(element, focusableSelector)) {\n return element;\n }\n\n return element.querySelector(focusableSelector);\n}\n\nexport function nextFocusableNode(node: HTMLElement, filter?: Filter): HTMLElement | Element | null {\n const allFocusableElements = [...document.querySelectorAll(FOCUSABLE_SELECTOR)];\n const sliceLocation = allFocusableElements.indexOf(node) + 1;\n const focusableElementsAfterNode = allFocusableElements.slice(sliceLocation);\n\n // eslint-disable-next-line no-restricted-syntax\n for (const focusableElement of focusableElementsAfterNode) {\n if (isElementInViewport(focusableElement) && (!filter || (filter && filter(focusableElement)))) {\n return focusableElement;\n }\n }\n\n return null;\n}\n\nexport function focusNextFocusableNode(node: HTMLElement, filter?: Filter) {\n const nextFocusable = nextFocusableNode(node, filter);\n if (nextFocusable && nextFocusable instanceof HTMLElement) {\n nextFocusable.focus();\n return true;\n }\n\n return false;\n}\n\nexport function findFirstFocusableNode(element: HTMLElement, onlyDescendants = true): HTMLElement | null {\n if (!onlyDescendants && matches(element, FOCUSABLE_SELECTOR)) {\n return element;\n }\n\n return element.querySelector(FOCUSABLE_SELECTOR);\n}\n\nfunction getMenuFocusableDescendants(element: HTMLElement): NodeListOf {\n return element.querySelectorAll(MENUITEM_FOCUSABLE_SELECTORS) as NodeListOf;\n}\n\nfunction getCurrentFocusedElementIndex(\n allFocusableChildren: NodeListOf,\n currentFocusedElement: HTMLElement,\n): number {\n let currentItemIdx = 0;\n\n // eslint-disable-next-line no-restricted-syntax\n for (const focusableChild of allFocusableChildren) {\n if (focusableChild === currentFocusedElement) {\n break;\n }\n currentItemIdx += 1;\n }\n return currentItemIdx === allFocusableChildren.length ? -1 : currentItemIdx;\n}\n\nexport function wrapFocusPreviousFocusableMenuItem(parentElement: HTMLElement, currentFocusedElement: HTMLElement) {\n const allFocusableChildren = getMenuFocusableDescendants(parentElement);\n const currentItemIdx = getCurrentFocusedElementIndex(allFocusableChildren, currentFocusedElement);\n if (currentItemIdx === -1) {\n allFocusableChildren[0].focus();\n } else {\n allFocusableChildren[(currentItemIdx - 1 + allFocusableChildren.length) % allFocusableChildren.length].focus();\n }\n}\n\nexport function wrapFocusNextFocusableMenuItem(parentElement: HTMLElement, currentFocusedElement: HTMLElement) {\n const allFocusableChildren = getMenuFocusableDescendants(parentElement);\n const currentItemIdx = getCurrentFocusedElementIndex(allFocusableChildren, currentFocusedElement);\n if (currentItemIdx === -1) {\n allFocusableChildren[0].focus();\n } else {\n allFocusableChildren[(currentItemIdx + 1) % allFocusableChildren.length].focus();\n }\n}\n\nexport const handleMouseUpByBlurring = (event: MouseEvent) => {\n const currentTarget = event.currentTarget as HTMLInputElement;\n currentTarget.blur();\n};\n\nexport function focusFirstFocusableNode(element: HTMLElement, onlyDescendants = true) {\n // eslint-disable-next-line no-unused-expressions\n findFirstFocusableNode(element, onlyDescendants)?.focus();\n}\n\nexport function findFirstKeyboardFocusableNode(element: HTMLElement, onlyDescendants = true): HTMLElement | null {\n if (!onlyDescendants && matches(element, KEYBOARD_FOCUSABLE_SELECTORS)) {\n return element;\n }\n return element.querySelector(KEYBOARD_FOCUSABLE_SELECTORS);\n}\n\nexport function findLastKeyboardFocusableNode(element: HTMLElement, onlyDescendants = true) {\n if (!onlyDescendants && matches(element, KEYBOARD_FOCUSABLE_SELECTORS)) {\n return element;\n }\n const allFocusable = element.querySelectorAll(KEYBOARD_FOCUSABLE_SELECTORS);\n return allFocusable[allFocusable.length - 1] as HTMLElement | null;\n}\n\nexport function focusFirstKeyboardFocusableNode(element: HTMLElement, onlyDescendants = true) {\n const firstFocusable = findFirstKeyboardFocusableNode(element, onlyDescendants);\n if (firstFocusable) {\n firstFocusable.focus();\n return true;\n }\n\n return false;\n}\n\nexport function focusLastKeyboardFocusableNode(element: HTMLElement, onlyDescendants = true) {\n const lastFocusable = findLastKeyboardFocusableNode(element, onlyDescendants);\n if (lastFocusable) {\n lastFocusable.focus();\n return true;\n }\n\n return false;\n}\n","\n\n\n","export enum Key {\n Backspace = 'Backspace',\n Tab = 'Tab',\n Enter = 'Enter',\n Shift = 'Shift',\n Ctrl = 'Ctrl',\n Alt = 'Alt',\n Pause = 'Pause',\n CapsLock = 'CapsLock',\n Escape = 'Escape',\n Space = 'Space',\n PageUp = 'PageUp',\n PageDown = 'PageDown',\n End = 'End',\n Home = 'Home',\n ArrowRight = 'ArrowRight',\n ArrowLeft = 'ArrowLeft',\n ArrowUp = 'ArrowUp',\n ArrowDown = 'ArrowDown',\n Insert = 'Insert',\n Delete = 'Delete',\n Key0 = 'Key0',\n Key1 = 'Key1',\n Key2 = 'Key2',\n Key3 = 'Key3',\n Key4 = 'Key4',\n Key5 = 'Key5',\n Key6 = 'Key6',\n Key7 = 'Key7',\n Key8 = 'Key8',\n Key9 = 'Key9',\n KeyA = 'KeyA',\n KeyB = 'KeyB',\n KeyC = 'KeyC',\n KeyD = 'KeyD',\n KeyE = 'KeyE',\n KeyF = 'KeyF',\n KeyG = 'KeyG',\n KeyH = 'KeyH',\n KeyI = 'KeyI',\n KeyJ = 'KeyJ',\n KeyK = 'KeyK',\n KeyL = 'KeyL',\n KeyM = 'KeyM',\n KeyN = 'KeyN',\n KeyO = 'KeyO',\n KeyP = 'KeyP',\n KeyQ = 'KeyQ',\n KeyR = 'KeyR',\n KeyS = 'KeyS',\n KeyT = 'KeyT',\n KeyU = 'KeyU',\n KeyV = 'KeyV',\n KeyW = 'KeyW',\n KeyX = 'KeyX',\n KeyY = 'KeyY',\n KeyZ = 'KeyZ',\n LeftMeta = 'LeftMeta',\n RightMeta = 'RightMeta',\n Select = 'Select',\n Numpad0 = 'Numpad0',\n Numpad1 = 'Numpad1',\n Numpad2 = 'Numpad2',\n Numpad3 = 'Numpad3',\n Numpad4 = 'Numpad4',\n Numpad5 = 'Numpad5',\n Numpad6 = 'Numpad6',\n Numpad7 = 'Numpad7',\n Numpad8 = 'Numpad8',\n Numpad9 = 'Numpad9',\n Multiply = 'Multiply',\n Add = 'Add',\n Subtract = 'Subtract',\n Decimal = 'Decimal',\n Divide = 'Divide',\n F1 = 'F1',\n F2 = 'F2',\n F3 = 'F3',\n F4 = 'F4',\n F5 = 'F5',\n F6 = 'F6',\n F7 = 'F7',\n F8 = 'F8',\n F9 = 'F9',\n F10 = 'F10',\n F11 = 'F11',\n F12 = 'F12',\n NumLock = 'NumLock',\n ScrollLock = 'ScrollLock',\n Semicolon = 'Semicolon',\n Equals = 'Equals',\n Comma = 'Comma',\n Dash = 'Dash',\n Period = 'Period',\n ForwardSlash = 'ForwardSlash',\n GraveAccent = 'GraveAccent',\n OpenBracket = 'OpenBracket',\n BackSlash = 'BackSlash',\n CloseBracket = 'CloseBracket',\n SingleQuote = 'SingleQuote',\n}\n","import type {\n BreakpointsAlias,\n BreakpointsAliasDirection,\n BreakpointsTokenGroup,\n} from '@shopify/polaris-tokens';\n\nimport {\n getMediaConditions,\n breakpoints,\n} from '@shopify/polaris-tokens';\n\nimport {isServer} from 'polaris/polaris-react/src/utilities/target';\n\nconst Breakpoints = {\n navigationBarCollapsed: '767.95px',\n stackedContent: '1039.95px',\n};\n\nconst noWindowMatches: MediaQueryList = {\n media: '',\n addListener: noop,\n removeListener: noop,\n matches: false,\n onchange: noop,\n addEventListener: noop,\n removeEventListener: noop,\n dispatchEvent: (_: Event) => true,\n};\n\nfunction noop() { return; }\n\nexport function navigationBarCollapsed() {\n return typeof window === 'undefined'\n ? noWindowMatches\n : window.matchMedia(`(max-width: ${Breakpoints.navigationBarCollapsed})`);\n}\n\nexport function stackedContent() {\n return typeof window === 'undefined'\n ? noWindowMatches\n : window.matchMedia(`(max-width: ${Breakpoints.stackedContent})`);\n}\n\n/**\n * Directional alias for each Polaris `breakpoints` token.\n *\n * @example 'smUp' | 'smDown' | 'smOnly' | 'mdUp' | etc.\n */\nexport type BreakpointsDirectionAlias =\n `${BreakpointsAlias}${Capitalize}`;\n\n/**\n * Match results for each directional Polaris `breakpoints` alias.\n */\ntype BreakpointsMatches = {\n [DirectionAlias in BreakpointsDirectionAlias]: boolean;\n};\n\nconst breakpointsQueryEntries = getBreakpointsQueryEntries(breakpoints);\n\nfunction getMatches(defaults?: UseBreakpointsOptions['defaults']) {\n if (!isServer) {\n return Object.fromEntries(\n breakpointsQueryEntries.map(([directionAlias, query]) => [\n directionAlias,\n window.matchMedia(query).matches,\n ]),\n ) as BreakpointsMatches;\n }\n\n if (typeof defaults === 'object' && defaults !== null) {\n return Object.fromEntries(\n breakpointsQueryEntries.map(([directionAlias]) => [\n directionAlias,\n defaults[directionAlias] ?? false,\n ]),\n ) as BreakpointsMatches;\n }\n\n return Object.fromEntries(\n breakpointsQueryEntries.map(([directionAlias]) => [\n directionAlias,\n defaults ?? false,\n ]),\n ) as BreakpointsMatches;\n}\n\nexport interface UseBreakpointsOptions {\n /**\n * Default values applied during SSR. Accepts a single value to use for each\n * breakpoint alias, or an object for configuring select breakpoints.\n *\n * @default false\n */\n defaults:\n | boolean\n | {\n [DirectionAlias in BreakpointsDirectionAlias]?: boolean;\n };\n}\n\n/**\n * Retrieves media query matches for each directional Polaris `breakpoints` alias.\n *\n * @example\n * const {smUp} = useBreakpoints();\n * return smUp && 'Hello world';\n *\n * @example\n * const {mdUp} = useBreakpoints({defaults: {mdUp: true}});\n * mdUp //=> `true` during SSR\n *\n * @example\n * const breakpoints = useBreakpoints({defaults: true});\n * breakpoints //=> All values will be `true` during SSR\n */\n// export function useBreakpoints(options?: UseBreakpointsOptions) {\n// const [breakpoints, setBreakpoints] = useState(getMatches(options?.defaults));\n\n// useIsomorphicLayoutEffect(() => {\n// const mediaQueryLists = breakpointsQueryEntries.map(([_, query]) =>\n// window.matchMedia(query),\n// );\n\n// const handler = () => setBreakpoints(getMatches());\n\n// mediaQueryLists.forEach((mql) => {\n// mql.addEventListener('change', handler);\n// });\n\n// return () =>\n// mediaQueryLists.forEach((mql) => {\n// mql.removeEventListener('change', handler);\n// });\n// }, []);\n\n// return breakpoints;\n// }\n\n/**\n * Converts `breakpoints` tokens into directional media query entries.\n *\n * @example\n * const breakpointsQueryEntries = getBreakpointsQueryEntries(breakpoints);\n * breakpointsQueryEntries === [\n * ['xsUp', '(min-width: ...)'],\n * ['xsDown', '(max-width: ...)'],\n * ['xsOnly', '(min-width: ...) and (max-width: ...)'],\n * ['smUp', '(min-width: ...) and (max-width: ...)'],\n * ['mdUp', '(min-width: ...) and (max-width: ...)'],\n * // etc.\n * ]\n */\nexport function getBreakpointsQueryEntries(breakpointsValue: BreakpointsTokenGroup) {\n const mediaConditionEntries = Object.entries(getMediaConditions(breakpointsValue));\n\n return mediaConditionEntries\n .map(([breakpointsToken, mediaConditions]) =>\n Object.entries(mediaConditions).map(([direction, mediaCondition]) => {\n const breakpointsAlias = breakpointsToken.split('-')[1];\n\n // e.g. smUp, smDown, smOnly, etc.\n const directionAlias = `${breakpointsAlias}${capitalize(direction)}`;\n\n return [directionAlias, mediaCondition];\n }),\n )\n .flat() as [BreakpointsDirectionAlias, string][];\n}\n\nfunction capitalize(str: string) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\n","interface RectConfig {\n top?: number;\n left?: number;\n width?: number;\n height?: number;\n}\n\ninterface Point {\n x: number;\n y: number;\n}\n\nexport class Rect {\n static get zero(): Rect {\n return new Rect();\n }\n\n top: number;\n\n left: number;\n\n width: number;\n\n height: number;\n\n constructor({ top = 0, left = 0, width = 0, height = 0 }: RectConfig = {}) {\n this.top = top;\n this.left = left;\n this.width = width;\n this.height = height;\n }\n\n get center(): Point {\n return {\n x: this.left + this.width / 2,\n y: this.top + this.height / 2,\n };\n }\n}\n\nexport function getRectForNode(node: Element | Document | Window | null): Rect {\n if (!(node instanceof Element)) {\n return new Rect({\n width: window.innerWidth,\n height: window.innerHeight,\n });\n }\n\n const rect = node.getBoundingClientRect();\n\n return new Rect({\n top: rect.top,\n left: rect.left,\n width: rect.width,\n height: rect.height,\n });\n}\n","import { debounce } from 'polaris/polaris-react/src/utilities/debounce';\nimport { spacing } from '@shopify/polaris-tokens';\nimport { dataPolarisTopBar, scrollable } from 'polaris/polaris-react/src/components/shared';\nimport { stackedContent } from '@/utilities/breakpoints';\nimport { getRectForNode, Rect } from './geometry';\n\ninterface StickyItem {\n /** Node of the sticky element */\n stickyNode: HTMLElement;\n /** Placeholder element */\n placeHolderNode: HTMLElement;\n /** Element outlining the fixed position boundaries */\n boundingElement?: HTMLElement | null;\n /** Offset vertical spacing from the top of the scrollable container */\n offset: boolean;\n /** Should the element remain in a fixed position when the layout is stacked (smaller screens) */\n disableWhenStacked: boolean;\n /** Method to handle positioning */\n handlePositioning(stick: boolean, top?: number, left?: number, width?: string | number): void;\n}\n\nconst SIXTY_FPS = 1000 / 60;\n\nfunction isDocument(node: HTMLElement | Document): node is Document {\n return node === document;\n}\n\nfunction scrollTopFor(container: HTMLElement | Document) {\n return isDocument(container) ? document.body.scrollTop || document.documentElement.scrollTop : container.scrollTop;\n}\n\nfunction horizontallyOverlaps(rect1: Rect, rect2: Rect) {\n const rect1Left = rect1.left;\n const rect1Right = rect1.left + rect1.width;\n const rect2Left = rect2.left;\n const rect2Right = rect2.left + rect2.width;\n\n return rect2Right < rect1Left || rect1Right < rect2Left;\n}\n\nexport class StickyManager {\n private stickyItems: StickyItem[] = [];\n\n private stuckItems: StickyItem[] = [];\n\n private container: Document | HTMLElement | null = null;\n\n private topBarOffset = 0;\n\n private handleResize = debounce(\n () => {\n this.manageStickyItems();\n },\n SIXTY_FPS,\n { leading: true, trailing: true, maxWait: SIXTY_FPS },\n );\n\n private handleScroll = debounce(\n () => {\n this.manageStickyItems();\n },\n SIXTY_FPS,\n { leading: true, trailing: true, maxWait: SIXTY_FPS },\n );\n\n constructor(container?: Document | HTMLElement) {\n if (container) {\n this.setContainer(container);\n }\n }\n\n registerStickyItem(stickyItem: StickyItem): void {\n this.stickyItems.push(stickyItem);\n }\n\n unregisterStickyItem(nodeToRemove: HTMLElement) {\n const nodeIndex = this.stickyItems.findIndex(({ stickyNode }) => nodeToRemove === stickyNode);\n this.stickyItems.splice(nodeIndex, 1);\n }\n\n setContainer(el: Document | HTMLElement) {\n this.container = el;\n if (isDocument(el)) {\n this.setTopBarOffset(el);\n }\n this.container.addEventListener('scroll', this.handleScroll);\n window.addEventListener('resize', this.handleResize);\n this.manageStickyItems();\n }\n\n removeScrollListener() {\n if (this.container) {\n this.container.removeEventListener('scroll', this.handleScroll);\n window.removeEventListener('resize', this.handleResize);\n }\n }\n\n private manageStickyItems() {\n if (this.stickyItems.length <= 0) {\n return;\n }\n\n const scrollTop = this.container ? scrollTopFor(this.container) : 0;\n const containerTop = getRectForNode(this.container).top + this.topBarOffset;\n\n this.stickyItems.forEach((stickyItem) => {\n const { handlePositioning } = stickyItem;\n\n const { sticky, top, left, width } = this.evaluateStickyItem(stickyItem, scrollTop, containerTop);\n\n this.updateStuckItems(stickyItem, sticky);\n\n handlePositioning(sticky, top, left, width);\n });\n }\n\n private evaluateStickyItem(\n stickyItem: StickyItem,\n scrollTop: number,\n containerTop: number,\n ): {\n sticky: boolean;\n top: number;\n left: number;\n width: string | number;\n } {\n const { stickyNode, placeHolderNode, boundingElement, offset, disableWhenStacked } = stickyItem;\n\n if (disableWhenStacked && stackedContent().matches) {\n return {\n sticky: false,\n top: 0,\n left: 0,\n width: 'auto',\n };\n }\n\n const stickyOffset = offset\n ? this.getOffset(stickyNode) + parseInt(spacing['space-5'], 10)\n : this.getOffset(stickyNode);\n\n const scrollPosition = scrollTop + stickyOffset;\n const placeHolderNodeCurrentTop = placeHolderNode.getBoundingClientRect().top - containerTop + scrollTop;\n const top = containerTop + stickyOffset;\n const { left, width } = placeHolderNode.getBoundingClientRect();\n\n let sticky: boolean;\n\n if (boundingElement == null) {\n sticky = scrollPosition >= placeHolderNodeCurrentTop;\n } else {\n const stickyItemHeight =\n stickyNode.getBoundingClientRect().height || stickyNode.firstElementChild?.getBoundingClientRect().height || 0;\n const stickyItemBottomPosition =\n boundingElement.getBoundingClientRect().bottom - stickyItemHeight + scrollTop - containerTop;\n\n sticky = scrollPosition >= placeHolderNodeCurrentTop && scrollPosition < stickyItemBottomPosition;\n }\n\n return {\n sticky,\n top,\n left,\n width,\n };\n }\n\n private updateStuckItems(item: StickyItem, sticky: boolean) {\n const { stickyNode } = item;\n if (sticky && !this.isNodeStuck(stickyNode)) {\n this.addStuckItem(item);\n } else if (!sticky && this.isNodeStuck(stickyNode)) {\n this.removeStuckItem(item);\n }\n }\n\n private addStuckItem(stickyItem: StickyItem) {\n this.stuckItems.push(stickyItem);\n }\n\n private removeStuckItem(stickyItem: StickyItem) {\n const { stickyNode: nodeToRemove } = stickyItem;\n const nodeIndex = this.stuckItems.findIndex(({ stickyNode }) => nodeToRemove === stickyNode);\n this.stuckItems.splice(nodeIndex, 1);\n }\n\n private getOffset(node: HTMLElement) {\n if (this.stuckItems.length === 0) {\n return 0;\n }\n\n let offset = 0;\n let count = 0;\n const stuckNodesLength = this.stuckItems.length;\n const nodeRect = getRectForNode(node);\n\n while (count < stuckNodesLength) {\n const stuckNode = this.stuckItems[count].stickyNode;\n\n if (stuckNode !== node) {\n const stuckNodeRect = getRectForNode(stuckNode);\n if (!horizontallyOverlaps(nodeRect, stuckNodeRect)) {\n offset += getRectForNode(stuckNode).height;\n }\n } else {\n break;\n }\n\n count += 1;\n }\n\n return offset;\n }\n\n private isNodeStuck(node: HTMLElement): boolean {\n const nodeFound = this.stuckItems.findIndex(({ stickyNode }) => node === stickyNode);\n\n return nodeFound >= 0;\n }\n\n private setTopBarOffset(container: Document) {\n const topbarElement = container.querySelector(`:not(${scrollable.selector}) ${dataPolarisTopBar.selector}`);\n this.topBarOffset = topbarElement ? topbarElement.clientHeight : 0;\n }\n}\n","export class MissingAppProviderError extends Error {\n constructor(message = '') {\n super(\n `${\n message ? `${message} ` : message\n }Your application must be wrapped in an component. See https://ownego.github.io/polaris-vue/?path=/docs/components-app-provider for implementation instructions.`,\n );\n this.name = 'MissingAppProviderError';\n }\n}\n\nexport class MissingFrameError extends Error {\n constructor(message = '') {\n super(\n `${\n message ? `${message} ` : message\n }Your component must be wrapped in a component. See https://ownego.github.io/polaris-vue/?path=/docs/components-frame--page for implementation instructions.`,\n );\n this.name = 'MissingFrameError';\n }\n}\n","import { ref, inject } from 'vue';\nimport type { UniqueIdFactory } from 'polaris/polaris-react/src/utilities/unique-id/unique-id-factory';\nimport { MissingAppProviderError } from '@/utilities/errors';\n\nexport default function UseUniqueId() {\n const idFactory = inject('uniqueIdFactory') as UniqueIdFactory;\n\n const uniqueIdRef = ref('');\n\n function useUniqueId(prefix = '', overrideId = '') {\n if (!idFactory) {\n throw new MissingAppProviderError('No UniqueIdFactory was provided.');\n }\n\n if (overrideId) {\n return overrideId;\n }\n\n // If a unique id has not yet been generated, then get a new one\n if (!uniqueIdRef.value) {\n uniqueIdRef.value = idFactory.nextId(prefix);\n }\n\n return uniqueIdRef.value;\n }\n\n return { uniqueIdRef, useUniqueId };\n}\n","import { computed, inject, onBeforeMount, onBeforeUnmount, onMounted, watch } from 'vue';\nimport { MissingAppProviderError } from '@/utilities/errors';\nimport type { FocusManager } from '@/utilities/focus-manager';\nimport UseUniqueId from './UseUniqueId';\n\nexport default function UseFocusManager(props) {\n const focusManager = inject('focusManager') as FocusManager;\n\n const { useUniqueId, uniqueIdRef } = UseUniqueId();\n\n watch([() => props.trapping], () => {\n if (props.trapping && uniqueIdRef) {\n focusManager.add(uniqueIdRef.value);\n }\n });\n\n const canSafelyFocus = computed(() => {\n return focusManager.trapFocusList[0] === uniqueIdRef.value;\n });\n\n onBeforeMount(() => {\n if (!focusManager) {\n throw new MissingAppProviderError('No FocusManager was provided.');\n }\n });\n\n onMounted(() => {\n const id = useUniqueId();\n\n if (props.trapping) {\n focusManager.add(id);\n }\n });\n\n onBeforeUnmount(() => {\n if (uniqueIdRef.value) {focusManager.remove(uniqueIdRef.value);}\n });\n\n return { canSafelyFocus };\n}\n","import { inject } from 'vue';\nimport { MissingAppProviderError } from '@/utilities/errors';\nimport type { I18n } from '@/utilities/i18n';\n\nexport default function UseI18n() {\n const lang = inject('lang') as Record;\n const i18n = inject('i18n') as I18n;\n\n const translate = (\n id: string,\n replacements?: {[key: string]: string | number},\n ) => {\n if (!lang) {\n throw new MissingAppProviderError('I18n');\n }\n\n return i18n.translate(id, replacements);\n };\n\n return { translate };\n}\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n\n","\n\n\n\n\n\n\n","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n viewBox: \"0 0 20 20\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", { d: \"M6 10a2 2 0 1 1-4.001-.001A2 2 0 0 1 6 10zm6 0a2 2 0 1 1-4.001-.001A2 2 0 0 1 12 10zm6 0a2 2 0 1 1-4.001-.001A2 2 0 0 1 18 10z\" }, null, -1)\nconst _hoisted_3 = [\n _hoisted_2\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, _hoisted_3))\n}\nexport default { render: render }","\n\n\n\n\n\n\n","import {isServer} from '../target';\n\nexport const SCROLL_LOCKING_ATTRIBUTE = 'data-lock-scrolling';\n\nconst SCROLL_LOCKING_HIDDEN_ATTRIBUTE = 'data-lock-scrolling-hidden';\n\nconst SCROLL_LOCKING_WRAPPER_ATTRIBUTE = 'data-lock-scrolling-wrapper';\n\nlet scrollPosition = 0;\n\nfunction isScrollBarVisible() {\n const {body} = document;\n return body.scrollHeight > body.clientHeight;\n}\n\nexport class ScrollLockManager {\n private scrollLocks = 0;\n private locked = false;\n\n registerScrollLock() {\n this.scrollLocks += 1;\n this.handleScrollLocking();\n }\n\n unregisterScrollLock() {\n this.scrollLocks -= 1;\n this.handleScrollLocking();\n }\n\n handleScrollLocking() {\n if (isServer) return;\n\n const {scrollLocks} = this;\n const {body} = document;\n const wrapper = body.firstElementChild;\n\n if (scrollLocks === 0) {\n body.removeAttribute(SCROLL_LOCKING_ATTRIBUTE);\n body.removeAttribute(SCROLL_LOCKING_HIDDEN_ATTRIBUTE);\n if (wrapper) {\n wrapper.removeAttribute(SCROLL_LOCKING_WRAPPER_ATTRIBUTE);\n }\n window.scroll(0, scrollPosition);\n this.locked = false;\n } else if (scrollLocks > 0 && !this.locked) {\n scrollPosition = window.pageYOffset;\n body.setAttribute(SCROLL_LOCKING_ATTRIBUTE, '');\n\n if (!isScrollBarVisible()) {\n body.setAttribute(SCROLL_LOCKING_HIDDEN_ATTRIBUTE, '');\n }\n\n if (wrapper) {\n wrapper.setAttribute(SCROLL_LOCKING_WRAPPER_ATTRIBUTE, '');\n wrapper.scrollTop = scrollPosition;\n }\n this.locked = true;\n }\n }\n\n resetScrollPosition() {\n scrollPosition = 0;\n }\n}\n","type IdGenerator = () => string;\ntype IdGeneratorFactory = (prefix: string) => IdGenerator;\n\nexport class UniqueIdFactory {\n private idGeneratorFactory: IdGeneratorFactory;\n\n private idGenerators: {[key: string]: IdGenerator} = {};\n\n constructor(idGeneratorFactory: IdGeneratorFactory) {\n this.idGeneratorFactory = idGeneratorFactory;\n }\n\n nextId(prefix: string) {\n if (!this.idGenerators[prefix]) {\n this.idGenerators[prefix] = this.idGeneratorFactory(prefix);\n }\n\n return this.idGenerators[prefix]();\n }\n}\n\nexport function globalIdGeneratorFactory(prefix = '') {\n let index = 1;\n return () => `Polaris${prefix}${index++}`;\n}\n","// Unfortunately, this is how we have to type this at the moment.\n// There is currently a proposal to support variadic kinds.\n// https://github.com/Microsoft/TypeScript/issues/5453\nexport function merge(\n source1: TSource1,\n source2: TSource2,\n): TSource1 & TSource2;\nexport function merge(\n source1: TSource1,\n source2: TSource2,\n source3: TSource3,\n): TSource1 & TSource2 & TSource3;\nexport function merge(\n source1: TSource1,\n source2: TSource2,\n source3: TSource3,\n source4: TSource4,\n): TSource1 & TSource2 & TSource3 & TSource4;\nexport function merge(\n source1: TSource1,\n source2: TSource2,\n source3: TSource3,\n source4: TSource4,\n source5: TSource5,\n): TSource1 & TSource2 & TSource3 & TSource4 & TSource5;\nexport function merge(...objs: any[]): TResult;\nexport function merge(\n ...objs: (TSource1 | TSource2 | TSource3 | TSource4 | TSource5)[]\n) {\n let final = {};\n\n for (const obj of objs) {\n final = mergeRecursively(final, obj);\n }\n\n return final;\n}\n\ninterface GeneralObject {\n [key: string]: any;\n}\n\nfunction mergeRecursively(inputObjA: GeneralObject, objB: GeneralObject) {\n const objA: GeneralObject = Array.isArray(inputObjA)\n ? [...inputObjA]\n : {...inputObjA};\n for (const key in objB) {\n if (!Object.prototype.hasOwnProperty.call(objB, key)) {\n continue;\n } else if (isMergeableValue(objB[key]) && isMergeableValue(objA[key])) {\n objA[key] = mergeRecursively(objA[key], objB[key]);\n } else {\n objA[key] = objB[key];\n }\n }\n\n return objA;\n}\n\nfunction isMergeableValue(value: any) {\n return value !== null && typeof value === 'object';\n}\n","const OBJECT_NOTATION_MATCHER = /\\[(.*?)\\]|(\\w+)/g;\n\nexport function get(\n obj: {[key: string]: any} | undefined,\n keypath: string | string[],\n defaultValue?: T,\n): T | any {\n if (obj == null) {\n return undefined;\n }\n\n const keys = Array.isArray(keypath) ? keypath : getKeypath(keypath);\n let acc = obj;\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (let i = 0; i < keys.length; i++) {\n const val = acc[keys[i]];\n if (val === undefined) {\n return defaultValue;\n }\n acc = val;\n }\n\n return acc;\n}\n\nfunction getKeypath(str: string) {\n const path: string[] = [];\n let result: RegExpExecArray | null;\n while ((result = OBJECT_NOTATION_MATCHER.exec(str))) {\n const [, first, second] = result;\n path.push(first || second);\n }\n\n return path;\n}\n","import { merge } from 'polaris/polaris-react/src/utilities/merge';\nimport { get } from '@/utilities/get';\n\nconst REPLACE_REGEX = /{([^}]*)}/g;\n\ninterface TranslationDictionary {\n [key: string]: string | TranslationDictionary;\n}\n\nexport class I18n {\n private translation: TranslationDictionary = {};\n\n /**\n * @param translation A locale object or array of locale objects that overrides default translations. If specifying an array then your desired language dictionary should come first, followed by your fallback language dictionaries\n */\n constructor(translation: TranslationDictionary | TranslationDictionary[]) {\n // slice the array to make a shallow copy of it, so we don't accidentally\n // modify the original translation array\n this.translation = Array.isArray(translation)\n ? merge(...translation.slice().reverse())\n : translation;\n }\n\n translate(\n id: string,\n replacements?: {[key: string]: string | number},\n ): string {\n const text: string = get(this.translation, id, '');\n\n if (!text) {\n return '';\n }\n\n if (replacements) {\n return text.replace(REPLACE_REGEX, (match: string) => {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const replacement: string = match.substring(1, match.length - 1)!;\n\n if (replacements[replacement] === undefined) {\n const replacementData = JSON.stringify(replacements);\n\n throw new Error(\n `Error in translation for key '${id}'. No replacement found for key '${replacement}'. The following replacements were passed: '${replacementData}'`,\n );\n }\n\n // This could be a string or a number, but JS doesn't mind which it gets\n // and can handle that cast internally. So let it, to save us calling\n // toString() on what's already a string in 90% of cases.\n return replacements[replacement] as string;\n });\n }\n\n return text;\n }\n\n translationKeyExists(path: string): boolean {\n return Boolean(get(this.translation, path));\n }\n}\n","export class PortalManager {\n private portalIds: string[] = [];\n\n register(id: string) {\n if (!this.portalIds.includes(id)) {this.portalIds.push(id);}\n }\n\n hasContainer() {\n return this.portalIds.length;\n }\n}\n","export class FocusManager {\n public trapFocusList: string[] = [];\n\n add(id: string) {\n this.trapFocusList = [...this.trapFocusList, id];\n }\n\n remove(id: string) {\n const index = this.trapFocusList.indexOf(id);\n if (index > -1) {\n this.trapFocusList = this.trapFocusList.splice(index, 1);\n }\n return index > -1;\n }\n}\n","export enum AutoSelection {\n /** Default active option is the first selected option. If no options are selected, defaults to first interactive option. */\n FirstSelected = 'FIRST_SELECTED',\n /** Default active option is always the first interactive option. */\n First = 'FIRST',\n /** Default to the manual selection pattern. */\n None = 'NONE',\n}\n","export function labelID(id: string) {\n return `${id}Label`;\n}\n\nexport interface LabelProps {\n /** A unique identifier for the label */\n id: string;\n /** Visually hide the label */\n hidden?: boolean;\n /** Visual required indicator for the label */\n requiredIndicator?: boolean;\n}\n","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n viewBox: \"0 0 20 20\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", {\n \"fill-rule\": \"evenodd\",\n d: \"M10 2a8 8 0 1 0 0 16 8 8 0 0 0 0-16zM7.707 6.293a1 1 0 0 0-1.414 1.414L8.586 10l-2.293 2.293a1 1 0 1 0 1.414 1.414L10 11.414l2.293 2.293a1 1 0 1 0 1.414-1.414L11.414 10l2.293-2.293a1 1 0 0 0-1.414-1.414L10 8.586 7.707 6.293z\"\n}, null, -1)\nconst _hoisted_3 = [\n _hoisted_2\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, _hoisted_3))\n}\nexport default { render: render }","import type { Action, Error } from '@/utilities/type';\nimport { labelID } from '../Label/utils';\nimport type { LabelProps } from \"../Label/utils\";\n\nexport { labelID }\n\nexport function errorID(id: string) {\n return `${id}Error`;\n}\n\nexport function helpTextID(id: string) {\n return `${id}HelpText`;\n}\n\nexport interface LabelledProps {\n /** A unique identifier for the label */\n id: LabelProps['id'];\n /** Error to display beneath the label */\n error?: Error;\n /** An action */\n action?: Action;\n /** Visually hide the label */\n labelHidden?: boolean;\n /** Visual required indicator for the label */\n requiredIndicator?: boolean;\n}\n","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n viewBox: \"0 0 20 20\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", { d: \"M13.098 8H6.902c-.751 0-1.172.754-.708 1.268L9.292 12.7c.36.399 1.055.399 1.416 0l3.098-3.433C14.27 8.754 13.849 8 13.098 8Z\" }, null, -1)\nconst _hoisted_3 = [\n _hoisted_2\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, _hoisted_3))\n}\nexport default { render: render }","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n viewBox: \"0 0 20 20\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", { d: \"M6.902 12h6.196c.751 0 1.172-.754.708-1.268L10.708 7.3c-.36-.399-1.055-.399-1.416 0l-3.098 3.433C5.73 11.246 6.151 12 6.902 12Z\" }, null, -1)\nconst _hoisted_3 = [\n _hoisted_2\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, _hoisted_3))\n}\nexport default { render: render }","\n\n\n","export const STYLE_CLASSES = ['one', 'two', 'three', 'four', 'five'];\n\nexport type Size = 'extraSmall' | 'small' | 'medium' | 'large';\n\nexport type Shape = 'square' | 'round';\n\nexport interface AvatarProps {\n /**\n * Size of avatar\n * @default 'medium'\n */\n size?: Size;\n /** The name of the person */\n name?: string;\n /** Initials of person to display */\n initials?: string;\n /** Whether the avatar is for a customer */\n customer?: boolean;\n /** URL of the avatar image which falls back to initials if the image fails to load */\n source?: string;\n /** Accessible label for the avatar image */\n accessibilityLabel?: string;\n}\n\n/**\n * Computes a rudimentary hash from a string by xoring the character codes\n * of all characters\n */\nexport function xorHash(str: string) {\n let hash = 0;\n\n for (const char of str) {\n hash ^= char.charCodeAt(0);\n }\n\n return hash;\n}\n\nexport function styleClass(name?: string) {\n return name\n ? STYLE_CLASSES[xorHash(name) % STYLE_CLASSES.length]\n : STYLE_CLASSES[0];\n}\n","export type Status = 'info' | 'success' | 'attention' | 'warning' | 'critical' | 'new';\nexport type Progress = 'incomplete' | 'partiallyComplete' | 'complete';\nexport type Size = 'small' | 'medium';\n\nexport interface BadgeProps {\n /** Colors and labels the badge with the given status. */\n status?: Status;\n /** Render a pip showing the progress of a given task. */\n progress?: Progress;\n /**\n * Medium or small size.\n * @default 'medium'\n */\n size?: Size;\n /** Pass a custom accessibilityLabel */\n statusAndProgressLabelOverride?: string;\n}\n\nexport function getDefaultAccessibilityLabel(\n progress?: Progress,\n status?: Status,\n): string {\n let progressLabel = '';\n let statusLabel = '';\n\n if (!progress && !status) {\n return '';\n }\n switch (progress) {\n case 'incomplete':\n progressLabel = 'Incomplete';\n break;\n case 'partiallyComplete':\n progressLabel = 'Partially complete';\n break;\n case 'complete':\n progressLabel = 'Complete';\n break;\n }\n\n switch (status) {\n case 'info':\n statusLabel = 'Info';\n break;\n case 'success':\n statusLabel = 'Success';\n break;\n case 'warning':\n statusLabel = 'Warning';\n break;\n case 'critical':\n statusLabel = 'Critical';\n break;\n case 'attention':\n statusLabel = 'Attention';\n break;\n case 'new':\n statusLabel = 'New';\n break;\n }\n\n return `${statusLabel} ${progressLabel}`;\n}\n","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n viewBox: \"0 0 20 20\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", {\n \"fill-rule\": \"evenodd\",\n d: \"M0 10a10 10 0 1 0 20 0 10 10 0 0 0-20 0zm15.2-1.8a1 1 0 0 0-1.4-1.4L9 11.6 6.7 9.3a1 1 0 0 0-1.4 1.4l3 3c.4.4 1 .4 1.4 0l5.5-5.5z\"\n}, null, -1)\nconst _hoisted_3 = [\n _hoisted_2\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, _hoisted_3))\n}\nexport default { render: render }","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n viewBox: \"0 0 20 20\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", {\n \"fill-rule\": \"evenodd\",\n d: \"M10 20c5.514 0 10-4.486 10-10S15.514 0 10 0 0 4.486 0 10s4.486 10 10 10zm1-6a1 1 0 1 1-2 0v-4a1 1 0 1 1 2 0v4zm-1-9a1 1 0 1 0 0 2 1 1 0 0 0 0-2z\"\n}, null, -1)\nconst _hoisted_3 = [\n _hoisted_2\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, _hoisted_3))\n}\nexport default { render: render }","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n viewBox: \"0 0 20 20\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", {\n \"fill-rule\": \"evenodd\",\n d: \"M10 0C4.486 0 0 4.486 0 10s4.486 10 10 10 10-4.486 10-10S15.514 0 10 0zM9 6a1 1 0 1 1 2 0v4a1 1 0 1 1-2 0V6zm1 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2z\"\n}, null, -1)\nconst _hoisted_3 = [\n _hoisted_2\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, _hoisted_3))\n}\nexport default { render: render }","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 20 20\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", { d: \"M11.768.768a2.5 2.5 0 0 0-3.536 0L.768 8.232a2.5 2.5 0 0 0 0 3.536l7.464 7.464a2.5 2.5 0 0 0 3.536 0l7.464-7.464a2.5 2.5 0 0 0 0-3.536L11.768.768zM9 6a1 1 0 1 1 2 0v4a1 1 0 1 1-2 0V6zm2 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0z\" }, null, -1)\nconst _hoisted_3 = [\n _hoisted_2\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, _hoisted_3))\n}\nexport default { render: render }","export function capitalize(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n}\n","export function useDisableClick(disabled?: boolean, handleClick?: () => void) {\n const handleClickWrapper = (event: MouseEvent) => {\n event.preventDefault();\n event.stopPropagation();\n };\n\n if (!disabled) {\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n const fallbackEvent = () => { };\n return handleClick || fallbackEvent;\n }\n\n return handleClickWrapper;\n}\n\nexport function useDisableKeyboard(\n disabled?: boolean,\n handleKeyDown?: (event: KeyboardEvent) => void,\n) {\n const handleKeyDownWrapper = (event: KeyboardEvent) => {\n if (disabled && (event?.key === ' ' || event.key === 'Enter')) {\n event.preventDefault();\n event.stopPropagation();\n }\n };\n\n if (!disabled) {\n return handleKeyDown;\n }\n\n return handleKeyDownWrapper;\n}\n","/* eslint-disable max-len */\nimport type { PositionedOverlayProps } from '../PositionedOverlay/utils';\n\nexport enum PopoverCloseSource {\n Click,\n EscapeKeypress,\n FocusOut,\n ScrollOut,\n}\n\nexport enum TransitionStatus {\n Entering = 'entering',\n Entered = 'entered',\n Exiting = 'exiting',\n Exited = 'exited',\n}\n\nexport type PopoverAutofocusTarget = 'none' | 'first-node' | 'container';\n\nexport function nodeContainsDescendant(rootNode: HTMLElement, descendant: HTMLElement): boolean {\n if (rootNode === descendant) {\n return true;\n }\n\n let parent = descendant.parentNode;\n\n while (parent != null) {\n if (parent === rootNode) {\n return true;\n }\n parent = parent.parentNode;\n }\n\n return false;\n}\n\nexport function setActivatorAttributes(\n activator: HTMLElement,\n {\n id,\n active = false,\n ariaHaspopup,\n activatorDisabled = false,\n }: {\n id: string;\n active: boolean;\n ariaHaspopup: string;\n activatorDisabled: boolean;\n },\n) {\n if (!activatorDisabled) {\n // eslint-disable-next-line no-param-reassign\n activator.tabIndex = activator.tabIndex || 0;\n }\n\n activator.setAttribute('aria-controls', id);\n activator.setAttribute('aria-owns', id);\n activator.setAttribute('aria-expanded', String(active));\n\n if (ariaHaspopup != null) {\n activator.setAttribute('aria-haspopup', String(ariaHaspopup));\n }\n}\n\nexport interface PopoverOverlayProps {\n fullWidth?: boolean;\n fullHeight?: boolean;\n fluidContent?: boolean;\n preferredPosition?: PositionedOverlayProps['preferredPosition'];\n preferredAlignment?: PositionedOverlayProps['preferredAlignment'];\n active: boolean;\n id: string;\n zIndexOverride?: number;\n activator: HTMLElement;\n preferInputActivator?: PositionedOverlayProps['preferInputActivator'];\n sectioned?: boolean;\n fixed?: boolean;\n hideOnPrint?: boolean;\n autofocusTarget?: PopoverAutofocusTarget;\n}\n\nexport interface PopoverProps {\n /** The preferred direction to open the popover */\n preferredPosition?: PopoverOverlayProps['preferredPosition'];\n /** The preferred alignment of the popover relative to its activator */\n preferredAlignment?: PopoverOverlayProps['preferredAlignment'];\n /** Show or hide the Popover */\n active: boolean;\n /**\n * Use the activator's input element to calculate the Popover position\n * @default true\n */\n preferInputActivator?: PopoverOverlayProps['preferInputActivator'];\n /**\n * The element type to wrap the activator with\n * @default 'div'\n */\n activatorWrapper?: string;\n /** Override on the default z-index of 400 */\n zIndexOverride?: number;\n /** Prevents focusing the activator or the next focusable element when the popover is deactivated */\n preventFocusOnClose?: boolean;\n /** Automatically add wrap content in a section */\n sectioned?: boolean;\n /** Allow popover to stretch to the full width of its activator */\n fullWidth?: boolean;\n /** Allow popover to stretch to fit content vertically */\n fullHeight?: boolean;\n /** Allow popover content to determine the overlay width and height */\n fluidContent?: boolean;\n /** Remains in a fixed position */\n fixed?: boolean;\n /** Used to illustrate the type of popover element */\n ariaHaspopup?: string;\n /** Allow the popover overlay to be hidden when printing */\n hideOnPrint?: boolean;\n /** Accepts a color scheme for the contents of the popover */\n /**\n * The preferred auto focus target defaulting to the popover container\n * @default 'container'\n */\n autofocusTarget?: PopoverAutofocusTarget;\n}\n","import { Rect } from '@/utilities/geometry';\n\nexport type PreferredPosition = 'above' | 'below' | 'mostSpace';\n\nexport type PreferredAlignment = 'left' | 'center' | 'right';\n\nexport interface Margins {\n activator: number;\n container: number;\n horizontal: number;\n}\n\nexport function calculateVerticalPosition(\n activatorRect: Rect,\n overlayRect: Rect,\n overlayMargins: Margins,\n scrollableContainerRect: Rect,\n containerRect: Rect,\n preferredPosition: PreferredPosition,\n fixed: boolean | undefined,\n topBarOffset = 0,\n) {\n const activatorTop = activatorRect.top;\n const activatorBottom = activatorTop + activatorRect.height;\n const spaceAbove = activatorRect.top - topBarOffset;\n const spaceBelow = containerRect.height - activatorRect.top - activatorRect.height;\n\n const desiredHeight = overlayRect.height;\n const verticalMargins = overlayMargins.activator + overlayMargins.container;\n const minimumSpaceToScroll = overlayMargins.container;\n const distanceToTopScroll = activatorRect.top - Math.max(scrollableContainerRect.top, 0);\n const distanceToBottomScroll =\n containerRect.top +\n Math.min(containerRect.height, scrollableContainerRect.top + scrollableContainerRect.height) -\n (activatorRect.top + activatorRect.height);\n const enoughSpaceFromTopScroll = distanceToTopScroll >= minimumSpaceToScroll;\n const enoughSpaceFromBottomScroll = distanceToBottomScroll >= minimumSpaceToScroll;\n const heightIfBelow = Math.min(spaceBelow, desiredHeight);\n const heightIfAbove = Math.min(spaceAbove, desiredHeight);\n const containerRectTop = fixed ? 0 : containerRect.top;\n\n const positionIfAbove = {\n height: heightIfAbove - verticalMargins,\n top: activatorTop + containerRectTop - heightIfAbove,\n positioning: 'above',\n };\n\n const positionIfBelow = {\n height: heightIfBelow - verticalMargins,\n top: activatorBottom + containerRectTop,\n positioning: 'below',\n };\n\n if (preferredPosition === 'above') {\n return (enoughSpaceFromTopScroll ||\n (distanceToTopScroll >= distanceToBottomScroll && !enoughSpaceFromBottomScroll)) &&\n (spaceAbove > desiredHeight || spaceAbove > spaceBelow)\n ? positionIfAbove\n : positionIfBelow;\n }\n\n if (preferredPosition === 'below') {\n return (enoughSpaceFromBottomScroll ||\n (distanceToBottomScroll >= distanceToTopScroll && !enoughSpaceFromTopScroll)) &&\n (spaceBelow > desiredHeight || spaceBelow > spaceAbove)\n ? positionIfBelow\n : positionIfAbove;\n }\n\n if (enoughSpaceFromTopScroll && enoughSpaceFromBottomScroll) {\n return spaceAbove > spaceBelow ? positionIfAbove : positionIfBelow;\n }\n\n return distanceToTopScroll > minimumSpaceToScroll ? positionIfAbove : positionIfBelow;\n}\n\nexport function calculateHorizontalPosition(\n activatorRect: Rect,\n overlayRect: Rect,\n containerRect: Rect,\n overlayMargins: Margins,\n preferredAlignment: PreferredAlignment,\n) {\n const maximum = containerRect.width - overlayRect.width;\n\n if (preferredAlignment === 'left') {\n return Math.min(maximum, Math.max(0, activatorRect.left - overlayMargins.horizontal));\n }\n if (preferredAlignment === 'right') {\n const activatorRight = containerRect.width - (activatorRect.left + activatorRect.width);\n\n return Math.min(maximum, Math.max(0, activatorRight - overlayMargins.horizontal));\n }\n\n return Math.min(maximum, Math.max(0, activatorRect.center.x - overlayRect.width / 2));\n}\n\nexport function rectIsOutsideOfRect(inner: Rect, outer: Rect) {\n const { center } = inner;\n\n return center.y < outer.top || center.y > outer.top + outer.height;\n}\n\nexport function windowRect() {\n return new Rect({\n top: window.scrollY,\n left: window.scrollX,\n height: window.innerHeight,\n width: document.body.clientWidth,\n });\n}\n\nexport function intersectionWithViewport(rect: Rect, viewport: Rect = windowRect()) {\n const top = Math.max(rect.top, 0);\n const left = Math.max(rect.left, 0);\n const bottom = Math.min(rect.top + rect.height, viewport.height);\n const right = Math.min(rect.left + rect.width, viewport.width);\n\n return new Rect({\n top,\n left,\n height: bottom - top,\n width: right - left,\n });\n}\n","import { layer } from 'polaris/polaris-react/src/components/shared';\nimport type { PreferredPosition, PreferredAlignment } from './math';\n\nexport interface PositionedOverlayProps {\n active: boolean;\n activator: HTMLElement;\n preferInputActivator?: boolean;\n preferredPosition?: PreferredPosition;\n preferredAlignment?: PreferredAlignment;\n fullWidth?: boolean;\n fixed?: boolean;\n preventInteraction?: boolean;\n classNames?: string;\n zIndexOverride?: number;\n hideOnPrint?: boolean;\n}\n\nexport function isDocument(node: HTMLElement | Document): node is Document {\n return node === document;\n}\n\nexport function getMarginsForNode(node: HTMLElement) {\n const nodeStyles = window.getComputedStyle(node);\n return {\n activator: parseFloat(nodeStyles.marginTop || '0'),\n container: parseFloat(nodeStyles.marginBottom || '0'),\n horizontal: parseFloat(nodeStyles.marginLeft || '0'),\n };\n}\n\nexport function getZIndexForLayerFromNode(node: HTMLElement) {\n const layerNode = node.closest(layer.selector) || document.body;\n const zIndex = layerNode === document.body ? 'auto' : parseInt(window.getComputedStyle(layerNode).zIndex || '0', 10);\n return zIndex === 'auto' || Number.isNaN(zIndex) ? null : zIndex;\n}\n","import { scrollable } from 'polaris/polaris-react/src/components/shared';\n\nexport function forNode(node: HTMLElement): HTMLElement | Document {\n const closestElement = node.closest(scrollable.selector);\n return closestElement instanceof HTMLElement ? closestElement : document;\n}\n","\n\n\n\n\n\n\n","\n\n\n\n\n\n\n","export default {\n env: import.meta.env.MODE,\n};\n","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n viewBox: \"0 0 20 20\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", { d: \"M7.676 9h4.648c.563 0 .879-.603.53-1.014L10.531 5.24a.708.708 0 0 0-1.062 0L7.145 7.986C6.798 8.397 7.113 9 7.676 9Zm4.648 2H7.676c-.563 0-.878.603-.53 1.014l2.323 2.746c.27.32.792.32 1.062 0l2.323-2.746c.349-.411.033-1.014-.53-1.014Z\" }, null, -1)\nconst _hoisted_3 = [\n _hoisted_2\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, _hoisted_3))\n}\nexport default { render: render }","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n viewBox: \"0 0 44 44\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", { d: \"M15.542 1.487A21.507 21.507 0 0 0 .5 22c0 11.874 9.626 21.5 21.5 21.5 9.847 0 18.364-6.675 20.809-16.072a1.5 1.5 0 0 0-2.904-.756C37.803 34.755 30.473 40.5 22 40.5 11.783 40.5 3.5 32.217 3.5 22c0-8.137 5.3-15.247 12.942-17.65a1.5 1.5 0 1 0-.9-2.863z\" }, null, -1)\nconst _hoisted_3 = [\n _hoisted_2\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, _hoisted_3))\n}\nexport default { render: render }","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n viewBox: \"0 0 20 20\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", { d: \"M7.229 1.173a9.25 9.25 0 1 0 11.655 11.412 1.25 1.25 0 1 0-2.4-.698 6.75 6.75 0 1 1-8.506-8.329 1.25 1.25 0 1 0-.75-2.385z\" }, null, -1)\nconst _hoisted_3 = [\n _hoisted_2\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, _hoisted_3))\n}\nexport default { render: render }","\n\n\n\n\n","\n\n\n\n\n","import type { VNodeArrayChildren } from 'vue';\n\nexport function isFragment(item : any) {\n return item.type.toString() === 'Symbol(Fragment)' || item.type.toString() === 'Symbol()';\n}\n\n// input: Fragment element\n// output: array of pure children elements\nexport function extractElement(elm: any) {\n if (!isFragment(elm)) {\n return [elm];\n }\n\n const children = elm.children as VNodeArrayChildren;\n const items: VNodeArrayChildren = [];\n for (const child of children) {\n if (isFragment(child)) {\n items.push(...extractElement(child));\n } else {\n items.push(child);\n }\n }\n return items;\n}\n","\n\n\n\n\n","export const errorTextID = (id: string): string => `${id}Error`;\n","export const helpTextID = (id: string): string => `${id}HelpText`;\n","import { clamp } from 'polaris/polaris-react/src/utilities/clamp';\nimport type {\n RGBColor,\n RGBAColor,\n HSBColor,\n HSBAColor,\n HSLColor,\n HSLAColor,\n HSBLAColor,\n} from 'polaris/polaris-react/src/utilities/color-types';\nimport { roundNumberToDecimalPlaces } from 'polaris/polaris-react/src/utilities/roundNumberToDecimalPlaces';\n\ntype ColorType = 'hex' | 'rgb' | 'rgba' | 'hsl' | 'hsla' | 'default';\n\nfunction componentToHex(component: number) {\n const hex = component.toString(16);\n return hex.length === 1 ? `0${hex}` : hex;\n}\n\nfunction rgbFromHueAndChroma(hue: number, chroma: number) {\n const huePrime = hue / 60;\n const hueDelta = 1 - Math.abs((huePrime % 2) - 1);\n const intermediateValue = chroma * hueDelta;\n\n let red = 0;\n let green = 0;\n let blue = 0;\n if (huePrime >= 0 && huePrime <= 1) {\n red = chroma;\n green = intermediateValue;\n blue = 0;\n }\n\n if (huePrime >= 1 && huePrime <= 2) {\n red = intermediateValue;\n green = chroma;\n blue = 0;\n }\n\n if (huePrime >= 2 && huePrime <= 3) {\n red = 0;\n green = chroma;\n blue = intermediateValue;\n }\n\n if (huePrime >= 3 && huePrime <= 4) {\n red = 0;\n green = intermediateValue;\n blue = chroma;\n }\n\n if (huePrime >= 4 && huePrime <= 5) {\n red = intermediateValue;\n green = 0;\n blue = chroma;\n }\n\n if (huePrime >= 5 && huePrime <= 6) {\n red = chroma;\n green = 0;\n blue = intermediateValue;\n }\n\n return { red, green, blue };\n}\n\n// ref https://en.wikipedia.org/wiki/HSL_and_HSV\nfunction rgbToHsbl(color: RGBAColor, type: 'b' | 'l' = 'b'): HSBLAColor {\n const { alpha = 1 } = color;\n\n const red = color.red / 255;\n const green = color.green / 255;\n const blue = color.blue / 255;\n\n const largestComponent = Math.max(red, green, blue);\n const smallestComponent = Math.min(red, green, blue);\n\n const delta = largestComponent - smallestComponent;\n const lightness = (largestComponent + smallestComponent) / 2;\n let saturation = 0;\n if (largestComponent === 0) {\n saturation = 0;\n } else if (type === 'b') {\n saturation = delta / largestComponent;\n } else if (type === 'l') {\n const baseSaturation =\n lightness > 0.5\n ? delta / (2 - largestComponent - smallestComponent)\n : delta / (largestComponent + smallestComponent);\n saturation = Number.isNaN(baseSaturation) ? 0 : baseSaturation;\n }\n\n let huePercentage = 0;\n switch (largestComponent) {\n case red:\n huePercentage = (green - blue) / delta + (green < blue ? 6 : 0);\n break;\n case green:\n huePercentage = (blue - red) / delta + 2;\n break;\n case blue:\n huePercentage = (red - green) / delta + 4;\n break;\n default:\n break;\n }\n\n const hue = (huePercentage / 6) * 360;\n const clampedHue = clamp(hue, 0, 360);\n\n return {\n hue: clampedHue ? roundNumberToDecimalPlaces(clampedHue, 2) : 0,\n saturation: roundNumberToDecimalPlaces(clamp(saturation, 0, 1), 4),\n brightness: roundNumberToDecimalPlaces(clamp(largestComponent, 0, 1), 4),\n lightness: roundNumberToDecimalPlaces(lightness, 4),\n alpha: roundNumberToDecimalPlaces(alpha, 4),\n };\n}\n\nfunction getColorType(color: string): ColorType {\n if (color.includes('#')) {\n return 'hex';\n }\n if (color.includes('rgb')) {\n return 'rgb';\n }\n if (color.includes('rgba')) {\n return 'rgba';\n }\n if (color.includes('hsl')) {\n return 'hsl';\n }\n if (color.includes('hsla')) {\n return 'hsla';\n }\n\n return 'default';\n}\n\nfunction rgbToObject(color: string): RGBAColor {\n // eslint-disable-next-line @typescript-eslint/prefer-regexp-exec\n const colorMatch = color.match(/\\(([^)]+)\\)/);\n\n if (!colorMatch) {\n return {\n red: 0,\n green: 0,\n blue: 0,\n alpha: 0,\n };\n }\n\n const [red, green, blue, alpha] = colorMatch[1].split(',');\n const objColor = {\n red: parseInt(red, 10),\n green: parseInt(green, 10),\n blue: parseInt(blue, 10),\n alpha: parseInt(alpha, 10) || 1,\n };\n return objColor;\n}\n\nexport function rgbToHsl(color: RGBAColor): HSLAColor {\n const { hue, saturation: rawSaturation, lightness: rawLightness, alpha = 1 } = rgbToHsbl(color, 'l');\n\n const saturation = roundNumberToDecimalPlaces(rawSaturation * 100, 2);\n const lightness = roundNumberToDecimalPlaces(rawLightness * 100, 2);\n\n return {\n hue,\n saturation,\n lightness,\n alpha,\n };\n}\n\nexport function hexToRgb(color: string) {\n if (color.length === 4) {\n const repeatHex = (hex1: number, hex2: number) => color.slice(hex1, hex2).repeat(2);\n const red = parseInt(repeatHex(1, 2), 16);\n const green = parseInt(repeatHex(2, 3), 16);\n const blue = parseInt(repeatHex(3, 4), 16);\n\n return { red, green, blue };\n }\n\n const red = parseInt(color.slice(1, 3), 16);\n const green = parseInt(color.slice(3, 5), 16);\n const blue = parseInt(color.slice(5, 7), 16);\n\n return { red, green, blue };\n}\n\nfunction hexToHsla(color: string): HSLAColor {\n return rgbToHsl({ ...hexToRgb(color), alpha: 1 });\n}\n\nfunction rbgStringToHsla(color: string): HSLAColor {\n return rgbToHsl(rgbToObject(color));\n}\n\nfunction hslToObject(color: string): HSLAColor {\n // eslint-disable-next-line @typescript-eslint/prefer-regexp-exec\n const colorMatch = color.match(/\\(([^)]+)\\)/);\n\n if (!colorMatch) {\n return {\n hue: 0,\n saturation: 0,\n lightness: 0,\n alpha: 0,\n };\n }\n\n const [hue, saturation, lightness, alpha] = colorMatch[1].split(',');\n const objColor = {\n hue: roundNumberToDecimalPlaces(parseFloat(hue), 2),\n saturation: roundNumberToDecimalPlaces(parseFloat(saturation), 2),\n lightness: roundNumberToDecimalPlaces(parseFloat(lightness), 2),\n alpha: roundNumberToDecimalPlaces(parseFloat(alpha), 2) || 1,\n };\n return objColor;\n}\nexport function rgbString(color: RGBColor | RGBAColor) {\n const { red, green, blue } = color;\n\n if ('alpha' in color) {\n return `rgba(${red}, ${green}, ${blue}, ${color.alpha})`;\n }\n return `rgb(${red}, ${green}, ${blue})`;\n}\n\nexport const rgbaString = rgbString;\n\nexport function rgbToHex({ red, green, blue }: RGBColor) {\n return `#${componentToHex(red)}${componentToHex(green)}${componentToHex(blue)}`;\n}\n\n// implements https://en.wikipedia.org/wiki/HSL_and_HSV#From_HSV\nexport function hsbToRgb(color: HSBColor | HSBAColor): RGBColor | RGBAColor {\n const { hue, saturation, brightness } = color;\n const colorAlpha = color as HSBAColor;\n const alpha = colorAlpha.alpha || 1;\n const chroma = brightness * saturation;\n\n let { red, green, blue } = rgbFromHueAndChroma(hue, chroma);\n\n const chromaBrightnessDelta = brightness - chroma;\n red += chromaBrightnessDelta;\n green += chromaBrightnessDelta;\n blue += chromaBrightnessDelta;\n\n return {\n red: Math.round(red * 255),\n green: Math.round(green * 255),\n blue: Math.round(blue * 255),\n alpha,\n };\n}\n\nexport function hsbToHex(color: HSBColor) {\n return rgbToHex(hsbToRgb({ ...color, alpha: 1 }));\n}\n\n// implements https://en.wikipedia.org/wiki/HSL_and_HSV#From_HSV\nexport function hslToRgb(color: HSLColor | HSLAColor): RGBAColor | RGBColor {\n const { hue, saturation, lightness } = color;\n\n const colorAlpha = color as HSLAColor;\n\n const alpha = colorAlpha.alpha || 1;\n\n const chroma = (1 - Math.abs(2 * (lightness / 100) - 1)) * (saturation / 100);\n\n let { red, green, blue } = rgbFromHueAndChroma(hue, chroma);\n\n const lightnessVal = lightness / 100 - chroma / 2;\n red += lightnessVal;\n green += lightnessVal;\n blue += lightnessVal;\n\n return {\n red: Math.round(red * 255),\n green: Math.round(green * 255),\n blue: Math.round(blue * 255),\n alpha,\n };\n}\n\nexport function rgbToHsb(color: RGBAColor): HSBAColor {\n const { hue, saturation, brightness, alpha = 1 } = rgbToHsbl(color, 'b');\n return {\n hue,\n saturation,\n brightness,\n alpha,\n };\n}\n\nexport function colorToHsla(color: string): HSLAColor {\n const type = getColorType(color);\n switch (type) {\n case 'hex':\n return hexToHsla(color);\n case 'rgb':\n case 'rgba':\n return rbgStringToHsla(color);\n case 'hsl':\n case 'hsla':\n return hslToObject(color);\n case 'default':\n default:\n throw new Error('Accepted color formats are: hex, rgb, rgba, hsl and hsla');\n }\n}\n","import { inject } from 'vue';\nimport type { FrameContextType } from './context';\nimport { MissingFrameError } from '../errors';\n\nexport default function UseFrame() {\n const frame = inject('frameContext', {}) as FrameContextType;\n\n function useFrame() {\n if (!frame) {\n throw new MissingFrameError('No frame context was provided.');\n }\n\n return frame;\n }\n\n return { useFrame };\n}\n","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n viewBox: \"0 0 20 20\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", { d: \"M12.324 9H7.676c-.563 0-.878-.603-.53-1.014L9.469 5.24a.708.708 0 0 1 1.062 0l2.323 2.746c.349.411.033 1.014-.53 1.014Z\" }, null, -1)\nconst _hoisted_3 = /*#__PURE__*/_createElementVNode(\"path\", {\n d: \"M7.676 11h4.648c.563 0 .879.603.53 1.014l-2.323 2.746a.708.708 0 0 1-1.062 0l-2.324-2.746C6.798 11.603 7.113 11 7.676 11Z\",\n \"fill-opacity\": \"50%\"\n}, null, -1)\nconst _hoisted_4 = [\n _hoisted_2,\n _hoisted_3\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, _hoisted_4))\n}\nexport default { render: render }","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n viewBox: \"0 0 20 20\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", {\n d: \"M12.324 9H7.676c-.563 0-.878-.603-.53-1.014L9.469 5.24a.708.708 0 0 1 1.062 0l2.323 2.746c.349.411.033 1.014-.53 1.014Z\",\n \"fill-opacity\": \"50%\"\n}, null, -1)\nconst _hoisted_3 = /*#__PURE__*/_createElementVNode(\"path\", { d: \"M7.676 11h4.648c.563 0 .879.603.53 1.014l-2.323 2.746a.708.708 0 0 1-1.062 0l-2.324-2.746C6.798 11.603 7.113 11 7.676 11Z\" }, null, -1)\nconst _hoisted_4 = [\n _hoisted_2,\n _hoisted_3\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, _hoisted_4))\n}\nexport default { render: render }","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n viewBox: \"0 0 20 20\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", { d: \"M12 16a.997.997 0 0 1-.707-.293l-5-5a.999.999 0 0 1 0-1.414l5-5a.999.999 0 1 1 1.414 1.414L8.414 10l4.293 4.293A.999.999 0 0 1 12 16z\" }, null, -1)\nconst _hoisted_3 = [\n _hoisted_2\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, _hoisted_3))\n}\nexport default { render: render }","import type {ColumnVisibilityData, DataTableState} from './types';\n\nexport interface TableMeasurements {\n firstVisibleColumnIndex: number;\n tableLeftVisibleEdge: number;\n tableRightVisibleEdge: number;\n}\n\nexport function measureColumn(tableData: TableMeasurements) {\n return function (elm: Element, index: number): ColumnVisibilityData {\n const {\n firstVisibleColumnIndex,\n tableLeftVisibleEdge: tableStart,\n tableRightVisibleEdge: tableEnd,\n } = tableData;\n\n const column = elm as HTMLElement;\n\n const leftEdge = column.offsetLeft;\n const rightEdge = leftEdge + column.offsetWidth;\n const isVisibleLeft = isEdgeVisible(leftEdge, tableStart, tableEnd, 'left');\n const isVisibleRight = isEdgeVisible(\n rightEdge,\n tableStart,\n tableEnd,\n 'right',\n );\n const isVisible = isVisibleLeft || isVisibleRight;\n const width = column.offsetWidth;\n\n if (isVisible) {\n tableData.firstVisibleColumnIndex = Math.min(\n firstVisibleColumnIndex,\n index,\n );\n }\n return {leftEdge, rightEdge, isVisible, width, index};\n };\n}\n\nexport function isEdgeVisible(\n position: number,\n start: number,\n end: number,\n edgeType: string,\n) {\n const minVisiblePixels = 30;\n\n return (\n position >= start + (edgeType === 'left' ? 0 : minVisiblePixels) &&\n position <= end - minVisiblePixels\n );\n}\n\nexport function getPrevAndCurrentColumns(\n tableData: TableMeasurements,\n columnData: DataTableState['columnVisibilityData'],\n) {\n const {firstVisibleColumnIndex} = tableData;\n const previousColumnIndex = Math.max(firstVisibleColumnIndex - 1, 0);\n const previousColumn = columnData[previousColumnIndex];\n const currentColumn = columnData[firstVisibleColumnIndex];\n\n return {previousColumn, currentColumn};\n}\n","export interface Range {\n start: Date;\n end: Date;\n}\n\nexport type Week = (Date | null)[];\n\nconst WEEK_LENGTH = 7;\n\nexport function getWeeksForMonth(\n month: number,\n year: number,\n weekStartsOn = 0,\n): Week[] {\n const firstOfMonth = new Date(year, month, 1);\n const firstDayOfWeek = firstOfMonth.getDay();\n const weeks: Week[] = [[]];\n\n let currentWeek = weeks[0];\n let currentDate = firstOfMonth;\n\n const orderedWeekday = getOrderedWeekdays(weekStartsOn);\n for (let i = 0; i < orderedWeekday.indexOf(firstDayOfWeek); i++) {\n currentWeek.push(null);\n }\n\n while (currentDate.getMonth() === month) {\n if (currentWeek.length === WEEK_LENGTH) {\n currentWeek = [];\n weeks.push(currentWeek);\n }\n\n currentWeek.push(currentDate);\n currentDate = new Date(year, month, currentDate.getDate() + 1);\n }\n\n while (currentWeek.length < 7) {\n currentWeek.push(null);\n }\n\n return weeks;\n}\n\nexport function dateIsInRange(day: Date | null, range: Range) {\n if (day == null) {\n return false;\n }\n\n const {start, end} = range;\n\n return Boolean(start && day > start && end && day < end);\n}\n\nexport function dateIsSelected(day: Date | null, range: Range) {\n if (day == null) {\n return false;\n }\n const {start, end} = range;\n\n return Boolean(\n (start && isSameDay(start, day)) || (end && isSameDay(end, day)),\n );\n}\n\nexport function isSameDay(day1: Date, day2: Date) {\n return (\n day1.getDate() === day2.getDate() &&\n day1.getMonth() === day2.getMonth() &&\n day1.getFullYear() === day2.getFullYear()\n );\n}\n\nexport function getNewRange(range: Range | undefined, selected: Date): Range {\n if (range == null) {\n return {start: selected, end: selected};\n }\n\n const {start, end} = range;\n\n if (end && (isDateAfter(start, end) || isDateBefore(start, end))) {\n return {start: selected, end: selected};\n }\n\n if (start) {\n if (isDateBefore(selected, start)) {\n return {start: selected, end: selected};\n }\n return {start, end: selected};\n }\n\n if (end) {\n if (isDateBefore(selected, end)) {\n return {start: selected, end};\n }\n return {start: start || end, end: selected};\n }\n\n return {start: selected, end: selected};\n}\n\nexport function getNextDisplayMonth(month: number): number {\n if (month === 11) {\n return 0;\n }\n return month + 1;\n}\n\nexport function getNextDisplayYear(month: number, year: number): number {\n if (month === 11) {\n return year + 1;\n }\n return year;\n}\n\nexport function getPreviousDisplayMonth(month: number): number {\n if (month === 0) {\n return 11;\n }\n return month - 1;\n}\n\nexport function getPreviousDisplayYear(month: number, year: number): number {\n if (month === 0) {\n return year - 1;\n }\n return year;\n}\n\nexport function isDateAfter(date: Date, dateToCompare: Date) {\n return date.getTime() > dateToCompare.getTime();\n}\n\nexport function isDateBefore(date: Date, dateToCompare: Date) {\n return date.getTime() < dateToCompare.getTime();\n}\n\nexport function isDateDisabled(date: Date, datesToCompare: Date[]) {\n return datesToCompare.some((dateToCompare) => {\n return date.getTime() === dateToCompare.getTime();\n });\n}\n\nconst WEEKDAYS: number[] = [0, 1, 2, 3, 4, 5, 6];\n\nexport function getOrderedWeekdays(weekStartsOn: number): number[] {\n const weekDays = [...WEEKDAYS];\n const restOfDays = weekDays.splice(weekStartsOn);\n return [...restOfDays, ...weekDays];\n}\n","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n viewBox: \"0 0 20 20\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", { d: \"m17.707 9.293-5-5a.999.999 0 1 0-1.414 1.414L14.586 9H3a1 1 0 1 0 0 2h11.586l-3.293 3.293a.999.999 0 1 0 1.414 1.414l5-5a.999.999 0 0 0 0-1.414z\" }, null, -1)\nconst _hoisted_3 = [\n _hoisted_2\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, _hoisted_3))\n}\nexport default { render: render }","export const transformedDate = {\n months: {\n january: 'January',\n february: 'February',\n march: 'March',\n april: 'April',\n may: 'May',\n june: 'June',\n july: 'July',\n august: 'August',\n september: 'September',\n october: 'October',\n november: 'November',\n december: 'December',\n },\n days: {\n monday: 'Monday',\n tuesday: 'Tuesday',\n wednesday: 'Wednesday',\n thursday: 'Thursday',\n friday: 'Friday',\n saturday: 'Saturday',\n sunday: 'Sunday',\n },\n daysAbbreviated: {\n monday: 'Mo',\n tuesday: 'Tu',\n wednesday: 'We',\n thursday: 'Th',\n friday: 'Fr',\n saturday: 'Sa',\n sunday: 'Su',\n },\n};\n\nexport function monthName(month: number) {\n switch (month) {\n case 0:\n return 'january';\n case 1:\n return 'february';\n case 2:\n return 'march';\n case 3:\n return 'april';\n case 4:\n return 'may';\n case 5:\n return 'june';\n case 6:\n return 'july';\n case 7:\n return 'august';\n case 8:\n return 'september';\n case 9:\n return 'october';\n case 10:\n return 'november';\n case 11:\n return 'december';\n default:\n }\n}\n\nexport function weekdayName(weekday: number) {\n switch (weekday) {\n case 0:\n return 'sunday';\n case 1:\n return 'monday';\n case 2:\n return 'tuesday';\n case 3:\n return 'wednesday';\n case 4:\n return 'thursday';\n case 5:\n return 'friday';\n case 6:\n return 'saturday';\n default:\n }\n}\n","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n viewBox: \"0 0 20 20\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", {\n \"fill-rule\": \"evenodd\",\n d: \"M20 10c0 5.523-4.477 10-10 10S0 15.523 0 10 4.477 0 10 0s10 4.477 10 10zM5.293 8.293l4-4a1 1 0 0 1 1.414 0l4 4a1 1 0 0 1-1.414 1.414L11 7.414V15a1 1 0 1 1-2 0V7.414L6.707 9.707a1 1 0 0 1-1.414-1.414z\"\n}, null, -1)\nconst _hoisted_3 = [\n _hoisted_2\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, _hoisted_3))\n}\nexport default { render: render }","export function capitalize(word = '') {\n const wordLower = word.toLowerCase();\n return wordLower.charAt(0).toUpperCase() + wordLower.slice(1);\n}\n","const dragEvents = ['dragover', 'dragenter', 'drop'];\n\nexport function fileAccepted(file: File, accept: string | undefined) {\n return file.type === 'application/x-moz-file' || accepts(file, accept);\n}\n\nexport function getDataTransferFiles(event: DragEvent | Event) {\n if (isDragEvent(event) && event.dataTransfer) {\n const dt = event.dataTransfer;\n\n if (dt.files && dt.files.length) {\n return Array.from(dt.files);\n } else if (dt.items && dt.items.length) {\n // Chrome is the only browser that allows to read the file list on drag\n // events and uses `items` instead of `files` in this case.\n return Array.from(dt.items);\n }\n } else if (isChangeEvent(event) && (event.target as HTMLInputElement).files) {\n // Return files from even when a file was selected from an upload dialog\n const target = (event.target as HTMLInputElement);\n return Array.from(target.files || []);\n }\n\n return [];\n}\n\nfunction accepts(file: File, acceptedFiles: string | string[] | undefined) {\n if (file && acceptedFiles) {\n const fileName = file.name || '';\n const mimeType = file.type || '';\n const baseMimeType = mimeType.replace(/\\/.*$/, '');\n const acceptedFilesArray = Array.isArray(acceptedFiles)\n ? acceptedFiles\n : acceptedFiles.split(',');\n\n return acceptedFilesArray.some((type) => {\n const validType = type.trim();\n if (validType.startsWith('.')) {\n return fileName.toLowerCase().endsWith(validType.toLowerCase());\n } else if (validType.endsWith('/*')) {\n // This is something like a image/* mime type\n return baseMimeType === validType.replace(/\\/.*$/, '');\n }\n return mimeType === validType;\n });\n }\n return true;\n}\n\nfunction isDragEvent(event: DragEvent | Event): event is DragEvent {\n return dragEvents.indexOf(event.type) > 0;\n}\n\nfunction isChangeEvent(event: DragEvent | Event): event is Event {\n return event.type === 'change';\n}\n\nexport const defaultAllowMultiple = true;\n\nexport function createAllowMultipleKey(allowMultiple: boolean) {\n return allowMultiple ? 'allowMultiple' : 'single';\n}\n","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 20 20\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", {\n \"fill-rule\": \"evenodd\",\n \"clip-rule\": \"evenodd\",\n d: \"M20 10a10 10 0 1 1-20 0 10 10 0 0 1 20 0zM5.3 8.3l4-4a1 1 0 0 1 1.4 0l4 4a1 1 0 0 1-1.4 1.4L11 7.4V15a1 1 0 1 1-2 0V7.4L6.7 9.7a1 1 0 0 1-1.4-1.4z\",\n fill: \"#5C5F62\"\n}, null, -1)\nconst _hoisted_3 = [\n _hoisted_2\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, _hoisted_3))\n}\nexport default { render: render }","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n width: \"60\",\n height: \"60\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", {\n \"fill-rule\": \"evenodd\",\n \"clip-rule\": \"evenodd\",\n d: \"M41.87 24a17.87 17.87 0 1 1-35.74 0 17.87 17.87 0 0 1 35.74 0zm-3.15 18.96a24 24 0 1 1 4.24-4.24L59.04 54.8a3 3 0 1 1-4.24 4.24L38.72 42.96z\",\n fill: \"#8C9196\"\n}, null, -1)\nconst _hoisted_3 = [\n _hoisted_2\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, _hoisted_3))\n}\nexport default { render: render }","import { inject } from 'vue';\nimport type { MediaQueryContextType } from './context';\nimport { MissingAppProviderError } from '../errors';\n\nexport default function UseMediaQuery() {\n const mediaQuery = inject('mediaQueryContext', {}) as MediaQueryContextType;\n\n function useMediaQuery() {\n if (!mediaQuery) {\n throw new MissingAppProviderError('No mediaQuery was provided.');\n }\n\n return mediaQuery;\n }\n\n return { useMediaQuery };\n}\n","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n viewBox: \"0 0 20 20\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", { d: \"M15 13a.997.997 0 0 1-.707-.293L10 8.414l-4.293 4.293a.999.999 0 1 1-1.414-1.414l5-5a.999.999 0 0 1 1.414 0l5 5A.999.999 0 0 1 15 13z\" }, null, -1)\nconst _hoisted_3 = [\n _hoisted_2\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, _hoisted_3))\n}\nexport default { render: render }","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n viewBox: \"0 0 20 20\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", { d: \"M10 14a.997.997 0 0 1-.707-.293l-5-5a.999.999 0 1 1 1.414-1.414L10 11.586l4.293-4.293a.999.999 0 1 1 1.414 1.414l-5 5A.997.997 0 0 1 10 14z\" }, null, -1)\nconst _hoisted_3 = [\n _hoisted_2\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, _hoisted_3))\n}\nexport default { render: render }","\n\n\n\n","export function setRootProperty(\n name: string,\n value: string,\n node?: HTMLElement,\n) {\n if (!document) return;\n\n const element = node || document.documentElement;\n element.style.setProperty(name, value);\n}\n","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n viewBox: \"0 0 20 20\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", { d: \"m11.414 10 6.293-6.293a1 1 0 1 0-1.414-1.414L10 8.586 3.707 2.293a1 1 0 0 0-1.414 1.414L8.586 10l-6.293 6.293a1 1 0 1 0 1.414 1.414L10 11.414l6.293 6.293A.998.998 0 0 0 18 17a.999.999 0 0 0-.293-.707L11.414 10z\" }, null, -1)\nconst _hoisted_3 = [\n _hoisted_2\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, _hoisted_3))\n}\nexport default { render: render }","export function isObject(value: any) {\n const type = typeof value;\n return value != null && (type === 'object' || type === 'function');\n}\n","import {isObject} from './is-object';\n\nexport function pluckDeep(obj: {[key: string]: any} | null, key: string): any {\n if (!obj) {\n return null;\n }\n\n const keys = Object.keys(obj);\n for (const currKey of keys) {\n if (currKey === key) {\n return obj[key];\n }\n\n if (isObject(obj[currKey])) {\n const plucked = pluckDeep(obj[currKey], key);\n if (plucked) {\n return plucked;\n }\n }\n }\n\n return null;\n}\n","import {pluckDeep} from './pluck-deep';\n\nexport function getWidth(\n value: {[key: string]: any} | number | null | undefined = {},\n defaultWidth: number | null = 0,\n key = 'width',\n) {\n const width = typeof value === 'number' ? value : pluckDeep(value, key);\n return width ? `${width}px` : `${defaultWidth}px`;\n}\n","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n viewBox: \"0 0 20 20\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", { d: \"M7.703 13.707a.997.997 0 0 0 0-1.414L6.409 11h6.589a1 1 0 1 0 0-2H6.409l1.294-1.293a1 1 0 1 0-1.415-1.414l-3.001 3a.994.994 0 0 0-.198.298c-.013.027-.021.054-.03.082a.944.944 0 0 0-.054.269l-.001.027a.937.937 0 0 0 .062.398l.003.012v.004c.048.112.117.208.197.294l.01.015.01.015 3.002 3a1 1 0 0 0 1.415 0z\" }, null, -1)\nconst _hoisted_3 = /*#__PURE__*/_createElementVNode(\"path\", { d: \"M2 16.5A1.5 1.5 0 0 0 3.5 18h13a1.5 1.5 0 0 0 1.5-1.5v-13A1.5 1.5 0 0 0 16.5 2h-13A1.5 1.5 0 0 0 2 3.5V5a1 1 0 1 0 2 0V4h12v12H4v-1a1 1 0 1 0-2 0v1.5z\" }, null, -1)\nconst _hoisted_4 = [\n _hoisted_2,\n _hoisted_3\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, _hoisted_4))\n}\nexport default { render: render }","import { ref, inject } from 'vue';\n\nimport type { SelectionType } from './types';\n\nimport type {\n HandleBulkSelectionOptions,\n HandleSelectionChange,\n Range,\n} from './types';\n\nimport type { IndexRowContextType, IndexContextType } from './context';\n\nexport function useIndexSelectionChange() {\n const onSelectionChange = inject<\n | ((\n selectionType: SelectionType,\n toggleType: boolean,\n selection?: string | Range,\n position?: number,\n ) => void)\n | undefined\n >('IndexSelectionChangeContext', undefined);\n\n if (!onSelectionChange) {\n throw new Error(`useIndexSelectionChange: Missing IndexProvider context`);\n }\n return onSelectionChange;\n}\n\nexport function useIndexRow() {\n const indexRow = inject('IndexRowContext', undefined);\n if (!indexRow) {\n throw new Error(`useIndexRow: Missing IndexProvider context`);\n }\n return indexRow;\n}\n\nexport function useIndexValue(): IndexContextType {\n const index = inject('IndexContext', undefined);\n if (!index) {\n throw new Error(`useIndexValue: Missing IndexProvider context`);\n }\n return index;\n}\n\nexport function useHandleBulkSelection({\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n onSelectionChange = () => {},\n}: HandleBulkSelectionOptions) {\n const lastSelected = ref(null);\n\n const handleSelectionChange: HandleSelectionChange =\n (\n selectionType: SelectionType,\n toggleType: boolean,\n selection?: string | Range,\n sortOrder?: number,\n ) => {\n const prevSelected = lastSelected.value;\n\n if (selectionType === 'multi' && typeof sortOrder === 'number') {\n lastSelected.value = sortOrder;\n }\n\n if (\n selectionType === 'single' ||\n (selectionType === 'multi' &&\n (typeof prevSelected !== 'number' || typeof sortOrder !== 'number'))\n ) {\n onSelectionChange('single', toggleType, selection);\n } else if (selectionType === 'multi') {\n const min = Math.min(prevSelected as number, sortOrder as number);\n const max = Math.max(prevSelected as number, sortOrder as number);\n onSelectionChange(selectionType, toggleType, [min, max]);\n } else if (\n selectionType === 'page' ||\n selectionType === 'all'\n ) {\n onSelectionChange(selectionType, toggleType);\n }\n };\n\n return handleSelectionChange;\n}\n","export type IndexSelectedItems = string[] | 'All';\n\nexport const SELECT_ALL_ITEMS = 'All';\n\nexport type SelectionType = 'all' | 'page' | 'multi' | 'single';\n\nexport type Range = [number, number];\n\nexport type HandleSelectionChange = (\n selectionType: SelectionType,\n toggleType: boolean,\n selection?: string | Range,\n sortOrder?: number,\n) => void;\n\nexport interface BulkSelectionDataOptions {\n selectedItemsCount: number | typeof SELECT_ALL_ITEMS;\n itemCount: number;\n hasMoreItems?: boolean;\n resourceName?: {\n singular: string;\n plural: string;\n };\n}\n\nexport interface HandleBulkSelectionOptions {\n onSelectionChange?(\n selectionType: SelectionType,\n toggleType: boolean,\n selection?: string | Range,\n ): void;\n}\n","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n viewBox: \"0 0 20 20\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", {\n \"fill-rule\": \"evenodd\",\n d: \"M4.5 3A1.5 1.5 0 0 0 3 4.5v11A1.5 1.5 0 0 0 4.5 17h11a1.5 1.5 0 0 0 1.5-1.5v-11A1.5 1.5 0 0 0 15.5 3h-11zm9.207 5.707a1 1 0 0 0-1.414-1.414L9 10.586 7.707 9.293a1 1 0 0 0-1.414 1.414l2 2a1 1 0 0 0 1.414 0l4-4z\"\n}, null, -1)\nconst _hoisted_3 = [\n _hoisted_2\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, _hoisted_3))\n}\nexport default { render: render }","import type { ComputedRef, Ref } from 'vue';\nimport { inject } from 'vue';\nimport type { RowContextType, ScrollContextType } from './context';\n\nexport function useRowContext() {\n const context = inject>('RowContext', {} as any);\n return context;\n}\n\nexport function useRowHovered() {\n const hovered = inject<(Ref) | undefined>('RowHoveredContext', undefined);\n return hovered;\n}\n\nexport function useRowSelected() {\n const context = inject>('RowContext', {} as any);\n return context.value.selected;\n}\n\nexport function useContainerScroll() {\n const scrolledContainerRef = inject | null>('ScrollContext', null);\n return scrolledContainerRef;\n}\n","export type IndexTableSortDirection = 'ascending' | 'descending';\n\nexport function getTableHeadingsBySelector(\n wrapperElement: HTMLElement | null,\n selector: string,\n) {\n return wrapperElement\n ? Array.from(wrapperElement.querySelectorAll(selector))\n : [];\n}\nexport interface IndexTableHeading {\n title: string;\n flush?: boolean;\n id?: string;\n new?: boolean;\n hidden?: boolean;\n}\n\nexport type IndexTableSortToggleLabel = {\n [key in IndexTableSortDirection]: string;\n};\n\nexport interface IndexTableSortToggleLabels {\n [key: number]: IndexTableSortToggleLabel;\n}\n","export function scrollOptionIntoView(\n option: HTMLElement,\n scrollable: HTMLElement,\n) {\n const listTop = scrollable.scrollTop;\n const listBottom = listTop + scrollable.clientHeight;\n const {offsetHeight: optionHeight} = option;\n const {offsetTop: optionTop} = option;\n const optionBottom = optionTop + optionHeight;\n const isVisible = optionTop > listTop && optionBottom < listBottom;\n\n if (!isVisible) {\n let top = 0;\n if (optionBottom > listBottom) {\n top = optionBottom + optionHeight * 0.85 - listBottom;\n } else if (optionTop < listTop) {\n top = optionTop - optionHeight * 0.15 - listTop;\n }\n\n requestAnimationFrame(() => {\n scrollable.scrollBy({top, behavior: 'auto'});\n });\n }\n}\n","import { inject } from 'vue';\n\nexport interface NavigationContextType {\n location: string;\n onNavigationDismiss?(): void;\n withinContentContainer?: boolean;\n}\n\nexport function UseNavigationContext() {\n const NavigationContext = inject('NavigationContext', { location: '' }) as NavigationContextType;\n\n function useNavigationContext() {\n return NavigationContext;\n }\n\n return { useNavigationContext };\n}\n","enum EditableTarget {\n Input = 'INPUT',\n Textarea = 'TEXTAREA',\n Select = 'SELECT',\n ContentEditable = 'contenteditable',\n}\n\nexport function isInputFocused() {\n if (document == null || document.activeElement == null) {\n return false;\n }\n\n const {tagName} = document.activeElement;\n return (\n tagName === EditableTarget.Input ||\n tagName === EditableTarget.Textarea ||\n tagName === EditableTarget.Select ||\n document.activeElement.hasAttribute(EditableTarget.ContentEditable)\n );\n}\n","export function invertNumber(number: number) {\n if (Math.sign(number) === 1) {\n return -Math.abs(number);\n } else if (Math.sign(number) === -1) {\n return Math.abs(number);\n } else {\n return 0;\n }\n}\n","import type { CheckboxHandles } from '../interface';\n\nexport type ResourceListSelectedItems = string[] | 'All';\nexport type CheckableButtonKey = 'plain' | 'bulkSm' | 'bulkLg';\nexport type CheckableButtons = Map;\n\nexport const SELECT_ALL_ITEMS = 'All';\n","\n\n\n\n\n","import type { TabDescriptor } from './types';\n\nexport function getVisibleAndHiddenTabIndices(\n tabs: TabDescriptor[],\n selected: number,\n disclosureWidth: number,\n tabWidths: number[],\n containerWidth: number,\n) {\n const sumTabWidths = tabWidths.reduce((sum, width) => sum + width, 0);\n const arrayOfTabIndices = tabs.map((_, index) => {\n return index;\n });\n\n const visibleTabs: number[] = [];\n const hiddenTabs: number[] = [];\n\n if (containerWidth > sumTabWidths) {\n visibleTabs.push(...arrayOfTabIndices);\n } else {\n visibleTabs.push(selected);\n\n let tabListWidth = tabWidths[selected];\n\n arrayOfTabIndices.forEach((currentTabIndex) => {\n if (currentTabIndex !== selected) {\n const currentTabWidth = tabWidths[currentTabIndex];\n\n if (\n tabListWidth + currentTabWidth >=\n containerWidth - disclosureWidth\n ) {\n hiddenTabs.push(currentTabIndex);\n return;\n }\n\n visibleTabs.push(currentTabIndex);\n tabListWidth += currentTabWidth;\n }\n });\n }\n\n return {\n visibleTabs,\n hiddenTabs,\n };\n}\n","\n\n\n\n\n","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n viewBox: \"0 0 20 20\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", { d: \"M19 11H1a1 1 0 0 1 0-2h18a1 1 0 1 1 0 2zm0-7H1a1 1 0 0 1 0-2h18a1 1 0 1 1 0 2zm0 14H1a1 1 0 0 1 0-2h18a1 1 0 0 1 0 2z\" }, null, -1)\nconst _hoisted_3 = [\n _hoisted_2\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, _hoisted_3))\n}\nexport default { render: render }","const MINUTE = 60;\nconst HOUR = MINUTE * 60;\n\nexport function ensureTwoDigits(num: number): string {\n return num > 9 ? String(num) : `0${num}`;\n}\n\nexport function secondsToTimeComponents(seconds: number): {\n hours: number;\n minutes: number;\n seconds: number;\n} {\n return {\n hours: Math.floor(seconds / HOUR),\n minutes: Math.floor((seconds % HOUR) / MINUTE),\n seconds: seconds % MINUTE,\n };\n}\n\nexport function secondsToTimestamp(numSeconds: number) {\n const {hours, minutes, seconds} = secondsToTimeComponents(numSeconds);\n const hasHours = numSeconds > HOUR;\n const hoursText = hasHours ? `${hours}:` : '';\n const minutesText = `${hasHours ? ensureTwoDigits(minutes) : minutes}:`;\n const secondsText = `${ensureTwoDigits(seconds)}`;\n\n return `${hoursText}${minutesText}${secondsText}`;\n}\n\nexport function secondsToDurationTranslationKey(numSeconds: number) {\n const {hours, minutes, seconds} = secondsToTimeComponents(numSeconds);\n let durationKey = 'Polaris.VideoThumbnail.playButtonA11yLabel.duration';\n\n if (hours) {\n durationKey += `.hours.${hours > 1 ? 'other' : 'one'}`;\n\n if (seconds) {\n if (minutes > 1) {\n durationKey += `${\n seconds > 1 ? '.minutesAndSeconds' : '.minutesAndSecond'\n }`;\n } else if (minutes === 1) {\n durationKey += `${\n seconds > 1 ? '.minuteAndSeconds' : '.minuteAndSecond'\n }`;\n } else {\n durationKey += `${seconds > 1 ? '.andSeconds' : '.andSecond'}`;\n }\n } else if (minutes) {\n durationKey += `${minutes > 1 ? '.andMinutes' : '.andMinute'}`;\n } else {\n durationKey += '.only';\n }\n } else if (minutes) {\n durationKey += `.minutes.${minutes > 1 ? 'other' : 'one'}`;\n\n if (seconds) {\n durationKey += `${seconds > 1 ? '.andSeconds' : '.andSecond'}`;\n } else {\n durationKey += '.only';\n }\n } else if (seconds) {\n durationKey += seconds > 1 ? '.seconds.other' : '.seconds.one';\n }\n\n return durationKey;\n}\n","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n viewBox: \"0 0 20 20\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", { d: \"M16 10a.997.997 0 0 1-.485.857l-10 6a1.004 1.004 0 0 1-1.008.013A1.001 1.001 0 0 1 4 16V4a1.001 1.001 0 0 1 1.515-.857l10 6c.301.18.485.505.485.857z\" }, null, -1)\nconst _hoisted_3 = [\n _hoisted_2\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, _hoisted_3))\n}\nexport default { render: render }","import { ref } from 'vue';\n\nexport enum SelectionType {\n All = 'all',\n Page = 'page',\n Multi = 'multi',\n Single = 'single',\n}\n\ntype Range = [number, number];\ntype ResourceIDResolver = (\n resource: T,\n) => string;\n\nfunction defaultResourceIDResolver(resource: {[key: string]: any}): string {\n if ('id' in resource) {\n return resource.id;\n }\n\n throw new Error(\n 'Your resource does not directly contain an `id`. Pass a `resourceIDResolver` to `useIndexResourceState`',\n );\n}\n\nexport function useIndexResourceState(\n resources: T[],\n {\n selectedResources: initSelectedResources = [],\n allResourcesSelected: initAllResourcesSelected = false,\n resourceIDResolver = defaultResourceIDResolver,\n resourceFilter = undefined,\n }: {\n selectedResources?: string[];\n allResourcesSelected?: boolean;\n resourceIDResolver?: ResourceIDResolver;\n resourceFilter?: (value: T) => boolean;\n } = {\n selectedResources: [],\n allResourcesSelected: false,\n resourceIDResolver: defaultResourceIDResolver,\n resourceFilter: undefined,\n },\n) {\n const selectedResources = ref(initSelectedResources);\n const allResourcesSelected = ref(initAllResourcesSelected);\n\n const handleSelectionChange =\n (\n selectionType: SelectionType,\n isSelecting: boolean,\n selection?: string | Range,\n ) => {\n if (selectionType === SelectionType.All) {\n allResourcesSelected.value = isSelecting;\n } else if (allResourcesSelected.value) {\n allResourcesSelected.value = false;\n }\n\n switch (selectionType) {\n case SelectionType.Single:\n selectedResources.value = isSelecting\n ? [...selectedResources.value, selection as string]\n : selectedResources.value.filter((id) => id !== selection);\n break;\n case SelectionType.All:\n case SelectionType.Page:\n selectedResources.value = isSelecting\n ? resources.map(resourceIDResolver)\n : [];\n if (resourceFilter) {\n const filteredResources = resources.filter(resourceFilter);\n selectedResources.value = isSelecting && selectedResources.value.length < filteredResources.length\n ? filteredResources.map(resourceIDResolver)\n : [];\n } else {\n selectedResources.value = isSelecting ? resources.map(resourceIDResolver) : [];\n }\n break;\n case SelectionType.Multi:\n if (!selection) {\n break;\n }\n selectedResources.value = (() => {\n const ids: string[] = [];\n const filteredResources = resourceFilter\n ? resources.filter(resourceFilter)\n : resources;\n for (let i = selection[0] as number; i <= selection[1]; i++) {\n if (filteredResources.includes(resources[i])) {\n const id = resourceIDResolver(resources[i]);\n\n if (\n (isSelecting && !selectedResources.value.includes(id)) ||\n (!isSelecting && selectedResources.value.includes(id))\n ) {\n ids.push(id);\n }\n }\n }\n\n return isSelecting\n ? [...selectedResources.value, ...ids]\n : selectedResources.value.filter((id) => !ids.includes(id));\n })();\n break;\n }\n };\n\n const clearSelection = () => {\n selectedResources.value = [];\n allResourcesSelected.value = false;\n };\n\n const removeSelectedResources = (removeResources: string[]) => {\n const selectedResourcesCopy = [...selectedResources.value];\n\n const newSelectedResources = selectedResourcesCopy.filter(\n (resource) => !removeResources.includes(resource),\n );\n\n selectedResources.value = newSelectedResources;\n\n if (newSelectedResources.length === 0) {\n allResourcesSelected.value = false;\n }\n };\n\n return {\n selectedResources,\n allResourcesSelected,\n handleSelectionChange,\n clearSelection,\n removeSelectedResources,\n };\n}\n","import { AppProvider } from '@/polaris-vue';\n\nexport const decorators = [(story) => ({\n components: {AppProvider, story},\n template: '',\n})];\n\nexport const parameters = {\n viewMode: 'docs',\n docs: {\n transformSource: (src) => {\n const pattern = /