@warp-ds/elements 1.2.1-next.1 → 1.2.1-next.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -4
- package/dist/api.js +52 -1
- package/dist/api.js.map +2 -2
- package/dist/index.js +3357 -3812
- package/dist/index.js.map +7 -0
- package/dist/packages/affix/index.js +1748 -8
- package/dist/packages/affix/index.js.map +4 -4
- package/dist/packages/alert/index.js +1881 -9
- package/dist/packages/alert/index.js.map +4 -4
- package/dist/packages/attention/index.js +2364 -17
- package/dist/packages/attention/index.js.map +4 -4
- package/dist/packages/badge/index.js +289 -2
- package/dist/packages/badge/index.js.map +4 -4
- package/dist/packages/box/index.js +279 -3
- package/dist/packages/box/index.js.map +4 -4
- package/dist/packages/breadcrumbs/index.js +1703 -10
- package/dist/packages/breadcrumbs/index.js.map +4 -4
- package/dist/packages/broadcast/index.js +93 -8
- package/dist/packages/broadcast/index.js.map +2 -2
- package/dist/packages/button/index.js +1778 -8
- package/dist/packages/button/index.js.map +4 -4
- package/dist/packages/card/index.js +318 -9
- package/dist/packages/card/index.js.map +4 -4
- package/dist/packages/expandable/index.d.ts +0 -2
- package/dist/packages/expandable/index.js +1822 -55
- package/dist/packages/expandable/index.js.map +4 -4
- package/dist/packages/select/index.js +1841 -19
- package/dist/packages/select/index.js.map +4 -4
- package/dist/packages/textfield/index.js +383 -17
- package/dist/packages/textfield/index.js.map +4 -4
- package/dist/packages/toast/index.js +2165 -23
- package/dist/packages/toast/index.js.map +4 -4
- package/package.json +17 -19
- package/dist/elements.min.js +0 -5
- package/dist/packages/expandable/locales/en/messages.d.mts +0 -1
- package/dist/packages/expandable/locales/fi/messages.d.mts +0 -1
- package/dist/packages/expandable/locales/nb/messages.d.mts +0 -1
|
@@ -1,46 +1,2386 @@
|
|
|
1
|
-
var
|
|
2
|
-
`],["r","\r"],["t"," "],["v","\v"],["0","\0"]]);function ko(e){return wo.get(e)||e}var _o=/\\(?:(\\)|x([\s\S]{0,2})|u(\{[^}]*\}?)|u([\s\S]{4})\\u([^{][\s\S]{0,3})|u([\s\S]{0,4})|([0-3]?[0-7]{1,2})|([\s\S])|$)/g;function $t(e,t=!1){return e.replace(_o,function(o,r,a,n,l,i,s,d,p){if(r!==void 0)return"\\";if(a!==void 0)return xo(a);if(n!==void 0)return $o(n);if(l!==void 0)return vt(l,i);if(s!==void 0)return vt(s);if(d==="0")return"\0";if(d!==void 0)return yo(d,!t);if(p!==void 0)return ko(p);throw new SyntaxError(E.errorMessages.get(E.ErrorType.EndOfString))})}j.unraw=$t;j.default=$t});import{css as hr,html as ae,nothing as Qt}from"lit";import Ft from"@warp-ds/elements-core";import{ifDefined as mr}from"lit/directives/if-defined.js";import{classMap as $r}from"lit/directives/class-map.js";var eo=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();function Ge(e){return class extends e{static createProperty(t,o){let r=o;(typeof(o==null?void 0:o.attribute)=="undefined"||(o==null?void 0:o.attribute)===!0)&&(r=Object.assign({},o,{attribute:eo(t.toString())})),super.createProperty(t,r)}}}function Oe(e){let t=[];for(let[o,r]of Object.entries(e))r&&t.push(o);return t.join(" ")}function Xe(){return`m${Math.random().toString(36).slice(2)}`}var Se={box:"group block relative break-words last-child:mb-0 p-16 rounded-8",bleed:"-mx-16 sm:mx-0 rounded-l-0 rounded-r-0 sm:rounded-8",info:"i-bg-$color-box-info-background i-text-$color-box-info-text",neutral:"i-bg-$color-box-neutral-background i-text-$color-box-neutral-text",bordered:"border-2 i-border-$color-box-bordered-border i-bg-$color-box-bordered-background i-text-$color-box-bordered-text",infoClickable:"hover:i-bg-$color-box-info-background-hover active:i-bg-$color-box-info-background-hover",neutralClickable:"hover:i-bg-$color-box-neutral-background-hover active:i-bg-$color-box-neutral-background-hover",borderedClickable:"hover:i-bg-$color-box-bordered-background-hover active:i-bg-$color-box-bordered-background-hover hover:i-border-$color-box-bordered-border-hover active:i-border-$color-box-bordered-border-hover"};var to="focus:outline-none appearance-none cursor-pointer bg-transparent border-0 m-0 p-0 inline-block",kr={expandable:"will-change-height",expandableTitle:"font-bold i-text-$color-expandable-title-text",expandableBox:"i-bg-$color-expandable-background hover:i-bg-$color-expandable-background-hover py-0 px-0 "+Se.box,expandableBleed:Se.bleed,chevron:"inline-block align-middle i-text-$color-expandable-icon",chevronNonBox:"relative left-8",chevronBox:"absolute right-16",chevronTransform:"transform transition-transform transform-gpu ease-in-out",chevronExpand:"-rotate-180",chevronCollapse:"rotate-180",expansion:"overflow-hidden",expansionNotExpanded:"h-0 invisible",button:to+" hover:underline focus:underline",buttonBox:"w-full text-left relative inline-flex items-center "+Se.box,paddingTop:"pt-0",title:"flex justify-between items-center",titleType:"h4"},q="font-bold focusable justify-center transition-colors ease-in-out",y={primary:"i-text-$color-button-primary-text hover:i-text-$color-button-primary-text i-bg-$color-button-primary-background hover:i-bg-$color-button-primary-background-hover active:i-bg-$color-button-primary-background-active",secondary:"i-text-$color-button-secondary-text hover:i-text-$color-button-secondary-text i-border-$color-button-secondary-border i-bg-$color-button-secondary-background hover:i-bg-$color-button-secondary-background-hover hover:i-border-$color-button-secondary-border-hover active:i-bg-$color-button-secondary-background-active",utility:"i-text-$color-button-utility-text hover:i-text-$color-button-utility-text i-bg-$color-button-utility-background i-border-$color-button-utility-border hover:i-bg-$color-button-utility-background hover:i-border-$color-button-utility-border-hover active:i-border-$color-button-utility-border-active",destructive:"i-bg-$color-button-negative-background i-text-$color-button-negative-text hover:i-text-$color-button-negative-text hover:i-bg-$color-button-negative-background-hover active:i-bg-$color-button-negative-background-active",pill:"i-text-$color-button-pill-icon hover:i-text-$color-button-pill-icon-hover active:i-text-$color-button-pill-icon-active i-bg-$color-button-pill-background hover:i-bg-$color-button-pill-background-hover active:i-bg-$color-button-pill-background-active",disabled:"i-text-$color-button-disabled-text i-bg-$color-button-disabled-background",quiet:"i-bg-$color-button-quiet-background i-text-$color-button-quiet-text hover:i-bg-$color-button-quiet-background-hover active:i-bg-$color-button-quiet-background-active",utilityQuiet:"i-text-$color-button-utility-quiet-text i-bg-$color-button-utility-quiet-background hover:i-bg-$color-button-utility-quiet-background-hover",negativeQuiet:"i-bg-$color-button-negative-quiet-background i-text-$color-button-negative-quiet-text hover:i-bg-$color-button-negative-quiet-background-hover active:i-bg-$color-button-negative-quiet-background-active",loading:"i-text-$color-button-loading-text i-bg-$color-button-loading-background",link:"i-text-$color-button-link-text"},x={primary:`border-0 rounded-8 ${q}`,secondary:`border-2 rounded-8 ${q}`,utility:`border rounded-4 ${q}`,negative:`border-0 rounded-8 ${q}`,pill:`p-4 rounded-full border-0 inline-flex items-center justify-center hover:bg-clip-padding ${q}`,link:`bg-transparent focusable ease-in-out inline active:underline hover:underline ${y.link}`},g={xsmall:"py-6 px-16",small:"py-8 px-16",medium:"py-10 px-14",large:"py-12 px-16",utility:"py-[11px] px-[15px]",smallUtility:"py-[7px] px-[15px]",pill:"min-h-[44px] min-w-[44px]",pillSmall:"min-h-32 min-w-32",link:"p-0"},b={medium:"text-m leading-[24]",xsmall:"text-xs"},u={inProgress:`border-transparent animate-inprogress pointer-events-none ${y.loading}`,quiet:`border-0 rounded-8 ${q}`,utilityQuiet:`border-0 rounded-4 ${q}`,negativeQuiet:`border-0 rounded-8 ${q}`,isDisabled:`font-bold justify-center transition-colors ease-in-out cursor-default pointer-events-none ${y.disabled}`},_r={secondary:`${g.medium} ${b.medium} ${x.secondary} ${y.secondary}`,secondaryHref:`${g.medium} ${b.medium} ${x.secondary} ${y.secondary}`,secondaryDisabled:`${g.medium} ${b.medium} ${x.secondary} ${u.isDisabled}`,secondarySmall:`${b.xsmall} ${g.xsmall} ${x.secondary} ${y.secondary}`,secondarySmallDisabled:`${b.xsmall} ${g.xsmall} ${x.secondary} ${u.isDisabled}`,secondaryQuiet:`${g.medium} ${b.medium} ${u.quiet} ${y.quiet}`,secondaryQuietDisabled:`${g.medium} ${b.medium} ${u.quiet} ${u.isDisabled}`,secondarySmallQuiet:`${b.xsmall} ${g.xsmall} ${u.quiet} ${y.quiet}`,secondarySmallQuietDisabled:`${b.xsmall} ${g.xsmall} ${u.quiet} ${u.isDisabled}`,secondaryLoading:`${g.medium} ${b.medium} ${x.secondary} ${u.inProgress}`,secondarySmallLoading:`${b.xsmall} ${g.xsmall} ${x.secondary} ${u.inProgress}`,secondarySmallQuietLoading:`${b.xsmall} ${g.xsmall} ${u.quiet} ${u.inProgress}`,secondaryQuietLoading:`${g.medium} ${b.medium} ${u.quiet} ${u.inProgress}`,primary:`${g.large} ${b.medium} ${x.primary} ${y.primary}`,primaryDisabled:`${g.large} ${b.medium} ${u.isDisabled} ${x.primary}`,primarySmall:`${g.small} ${b.xsmall} ${x.primary} ${y.primary}`,primarySmallDisabled:`${g.small} ${b.xsmall} ${u.isDisabled} ${x.primary} `,primaryQuiet:`${g.large} ${b.medium} ${u.quiet} ${y.quiet}`,primaryQuietDisabled:`${g.large} ${b.medium} ${u.quiet} ${u.isDisabled}`,primarySmallQuiet:`${g.small} ${b.xsmall} ${u.quiet} ${y.quiet}`,primarySmallQuietDisabled:`${g.small} ${b.xsmall} ${u.quiet} ${u.isDisabled}`,primaryLoading:`${g.large} ${b.medium} ${u.inProgress} ${x.primary}`,primarySmallLoading:`${g.small} ${b.xsmall} ${u.inProgress} ${x.primary}`,primarySmallQuietLoading:`${g.small} ${b.xsmall} ${u.quiet} ${u.inProgress} ${x.primary}`,primaryQuietLoading:`${g.large} ${b.medium} ${u.quiet} ${u.inProgress}`,utility:`${g.utility} ${b.medium} ${x.utility} ${y.utility}`,utilityDisabled:`${g.utility} ${b.medium} ${x.utility} ${u.isDisabled}`,utilityQuiet:`${g.large} ${b.medium} ${u.utilityQuiet} ${y.utilityQuiet}`,utilityQuietDisabled:`${g.large} ${b.medium} ${u.utilityQuiet} ${u.isDisabled}`,utilitySmall:`${g.smallUtility} ${b.xsmall} ${x.utility} ${y.utility}`,utilitySmallDisabled:`${g.smallUtility} ${b.xsmall} ${x.utility} ${u.isDisabled}`,utilitySmallQuiet:`${g.smallUtility} ${b.xsmall} ${u.utilityQuiet} ${y.utilityQuiet}`,utilitySmallQuietDisabled:`${g.smallUtility} ${b.xsmall} ${u.utilityQuiet} ${u.isDisabled}`,utilityLoading:`${g.large} ${b.medium} ${x.utility} ${u.inProgress}`,utilitySmallLoading:`${g.smallUtility} ${b.xsmall} ${x.utility} ${u.inProgress}`,utilityQuietLoading:`${g.large} ${b.medium} ${u.inProgress} ${u.utilityQuiet}`,utilitySmallQuietLoading:`${g.smallUtility} ${b.xsmall} ${u.inProgress} ${u.utilityQuiet}`,negative:`${g.large} ${b.medium} ${x.negative} ${y.destructive}`,negativeDisabled:`${g.large} ${b.medium} ${x.negative} ${u.isDisabled}`,negativeQuiet:`${g.large} ${b.medium} ${u.negativeQuiet} ${y.negativeQuiet}`,negativeQuietDisabled:`${g.large} ${b.medium} ${u.negativeQuiet}${u.isDisabled}`,negativeSmall:`${g.small} ${b.xsmall} ${x.negative} ${y.destructive}`,negativeSmallDisabled:`${g.small} ${b.xsmall} ${x.negative} ${u.isDisabled}`,negativeSmallQuiet:`${g.small} ${b.xsmall} ${u.negativeQuiet} ${y.negativeQuiet}`,negativeSmallQuietDisabled:`${g.small} ${b.xsmall} ${u.negativeQuiet} ${u.isDisabled}`,negativeLoading:`${g.large} ${b.medium} ${x.negative} ${u.inProgress}`,negativeSmallLoading:`${g.small} ${b.xsmall} ${u.inProgress} ${x.negative}`,negativeQuietLoading:`${g.large} ${b.medium} ${u.negativeQuiet} ${x.negative} ${u.inProgress}`,negativeSmallQuietLoading:`${g.small} ${b.xsmall} ${u.negativeQuiet} ${u.inProgress}`,pill:`${g.pill} ${b.medium} ${x.pill} ${y.pill}`,pillSmall:`${g.pillSmall} ${b.xsmall} ${x.pill} ${y.pill}`,pillLoading:`${g.pill} ${b.medium} ${x.pill} ${u.inProgress}`,pillSmallLoading:`${g.pillSmall} ${b.xsmall} ${x.pill} ${u.inProgress}`,link:`${g.link} ${b.medium} ${x.link}`,linkSmall:`${g.link} ${b.xsmall} ${x.link}`,linkAsButton:"inline-block hover:no-underline text-center",a11y:"sr-only",fullWidth:"w-full max-w-full",contentWidth:"max-w-max"};var Dr={transparentBg:'before:i-bg-$color-modal-backdrop-background before:content-[""] before:absolute before:top-0 before:bottom-0 before:left-0 before:right-0 before:opacity-25',backdrop:"fixed inset-0 flex sm:place-content-center sm:place-items-center items-end z-20 [--w-modal-max-height:80%] [--w-modal-width:640px]",modal:"pb-safe-[32] i-shadow-$shadow-modal max-h-[--w-modal-max-height] min-h-[--w-modal-min-height] w-[--w-modal-width] h-[--w-modal-height] relative transition-300 ease-in-out backface-hidden will-change-height rounded-8 mx-0 sm:mx-16 i-bg-$color-modal-background flex flex-col overflow-hidden outline-none space-y-16 pt-8 sm:pt-32 sm:pb-32 rounded-b-0 sm:rounded-b-8",content:"block overflow-y-auto overflow-x-hidden last-child:mb-0 grow shrink px-16 sm:px-32 relative",footer:"flex justify-end shrink-0 px-16 sm:px-32",transitionTitle:"transition-all duration-300",transitionTitleCenter:"justify-self-center",transitionTitleColSpan:"col-span-2",title:"-mt-4 sm:-mt-8 h-40 sm:h-48 grid gap-8 sm:gap-16 grid-cols-[auto_1fr_auto] items-center px-16 sm:px-32 border-b sm:border-b-0 shrink-0",titleText:"mb-0 h4 sm:h3",titleButton:`${b.medium} ${x.pill} ${y.pill} sm:min-h-[44px] sm:min-w-[44px] min-h-[32px] min-w-[32px]`,titleButtonLeft:"-ml-8 sm:-ml-12 justify-self-start",titleButtonRight:"-mr-8 sm:-mr-12 justify-self-end",titleButtonIcon:"h-16 w-16 sm:h-24 sm:w-24",titleButtonIconRotated:"transform rotate-90"};var oo={label:"antialiased block relative text-s font-bold pb-4 cursor-pointer i-text-$color-label-text",labelInvalid:"i-text-$color-label-text-negative",optional:"pl-8 font-normal text-s i-text-$color-label-optional-text"};var Ke="absolute top-0 bottom-0 flex justify-center items-center focusable focus:[--w-outline-offset:-2px] bg-transparent ",Er={wrapper:Ke+"right-0",wrapperWithLabel:"w-max pr-12",wrapperWithIcon:"w-40",label:"antialiased block relative cursor-default pb-0 font-bold text-xs i-text-$color-label-text"},Lr={wrapper:Ke+"left-0",wrapperWithLabel:"w-max pl-12",wrapperWithIcon:"w-40",label:"antialiased block relative cursor-default pb-0 font-bold text-xs i-text-$color-label-text"};var Or={toggle:"absolute inset-0 h-full w-full appearance-none cursor-pointer focusable focusable-inset",label:`px-12 ${oo.label} py-8! cursor-pointer focusable focusable-inset`,buttonOrLink:"bg-transparent focusable",buttonOrLinkStretch:"inset-0 absolute"};var F={base:"border-2 relative flex items-start",tooltip:"i-bg-$color-tooltip-background i-border-$color-tooltip-background i-shadow-$shadow-tooltip i-text-$color-tooltip-text rounded-4 py-6 px-8",callout:"i-bg-$color-callout-background i-border-$color-callout-border i-text-$color-callout-text py-8 px-16 rounded-8",highlight:"i-bg-$color-callout-background i-border-$color-callout-border i-text-$color-callout-text py-8 px-16 rounded-8 drop-shadow-m",popover:"i-bg-$color-popover-background i-border-$color-popover-background i-text-$color-popover-paragraph-text rounded-8 p-16 drop-shadow-m",arrowBase:"absolute h-[14px] w-[14px] border-2 border-b-0 border-r-0 rounded-tl-4 transform",arrowDirectionLeft:"-left-[8px]",arrowDirectionRight:"-right-[8px]",arrowDirectionBottom:"-bottom-[8px]",arrowDirectionTop:"-top-[8px]",arrowTooltip:"i-bg-$color-tooltip-background i-border-$color-tooltip-background",arrowCallout:"i-bg-$color-callout-background i-border-$color-callout-border",arrowPopover:"i-bg-$color-popover-background i-border-$color-popover-background",arrowHighlight:"i-bg-$color-callout-background i-border-$color-callout-border",content:"last-child:mb-0",notCallout:"absolute z-50",closeBtn:`${b.medium} ${x.pill} ${y.pill} justify-self-end -mr-8 ml-8`};function ee(e){return e.split("-")[0]}function pe(e){return e.split("-")[1]}function te(e){return["top","bottom"].includes(ee(e))?"x":"y"}function Te(e){return e==="y"?"height":"width"}function Ye(e,t,o){let{reference:r,floating:a}=e,n=r.x+r.width/2-a.width/2,l=r.y+r.height/2-a.height/2,i=te(t),s=Te(i),d=r[s]/2-a[s]/2,p=i==="x",f;switch(ee(t)){case"top":f={x:n,y:r.y-a.height};break;case"bottom":f={x:n,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:l};break;case"left":f={x:r.x-a.width,y:l};break;default:f={x:r.x,y:r.y}}switch(pe(t)){case"start":f[i]-=d*(o&&p?-1:1);break;case"end":f[i]+=d*(o&&p?-1:1)}return f}var et=async(e,t,o)=>{let{placement:r="bottom",strategy:a="absolute",middleware:n=[],platform:l}=o,i=await(l.isRTL==null?void 0:l.isRTL(t)),s=await l.getElementRects({reference:e,floating:t,strategy:a}),{x:d,y:p}=Ye(s,r,i),f=r,$={},c=0;for(let h=0;h<n.length;h++){let{name:m,fn:v}=n[h],{x:w,y:D,data:k,reset:_}=await v({x:d,y:p,initialPlacement:r,placement:f,strategy:a,middlewareData:$,rects:s,platform:l,elements:{reference:e,floating:t}});d=w!=null?w:d,p=D!=null?D:p,$=R(L({},$),{[m]:L(L({},$[m]),k)}),_&&c<=50&&(c++,typeof _=="object"&&(_.placement&&(f=_.placement),_.rects&&(s=_.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:a}):_.rects),{x:d,y:p}=Ye(s,f,i)),h=-1)}return{x:d,y:p,placement:f,strategy:a,middlewareData:$}};function tt(e){return typeof e!="number"?function(t){return L({top:0,right:0,bottom:0,left:0},t)}(e):{top:e,right:e,bottom:e,left:e}}function Z(e){return R(L({},e),{top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height})}async function Ae(e,t){var o;t===void 0&&(t={});let{x:r,y:a,platform:n,rects:l,elements:i,strategy:s}=e,{boundary:d="clippingAncestors",rootBoundary:p="viewport",elementContext:f="floating",altBoundary:$=!1,padding:c=0}=t,h=tt(c),m=i[$?f==="floating"?"reference":"floating":f],v=Z(await n.getClippingRect({element:(o=await(n.isElement==null?void 0:n.isElement(m)))==null||o?m:m.contextElement||await(n.getDocumentElement==null?void 0:n.getDocumentElement(i.floating)),boundary:d,rootBoundary:p,strategy:s})),w=Z(n.convertOffsetParentRelativeRectToViewportRelativeRect?await n.convertOffsetParentRelativeRectToViewportRelativeRect({rect:f==="floating"?R(L({},l.floating),{x:r,y:a}):l.reference,offsetParent:await(n.getOffsetParent==null?void 0:n.getOffsetParent(i.floating)),strategy:s}):l[f]);return{top:v.top-w.top+h.top,bottom:w.bottom-v.bottom+h.bottom,left:v.left-w.left+h.left,right:w.right-v.right+h.right}}var ro=Math.min,io=Math.max;function Ce(e,t,o){return io(e,ro(t,o))}var Pe=e=>({name:"arrow",options:e,async fn(t){let{element:o,padding:r=0}=e!=null?e:{},{x:a,y:n,placement:l,rects:i,platform:s}=t;if(o==null)return{};let d=tt(r),p={x:a,y:n},f=te(l),$=pe(l),c=Te(f),h=await s.getDimensions(o),m=f==="y"?"top":"left",v=f==="y"?"bottom":"right",w=i.reference[c]+i.reference[f]-p[f]-i.floating[c],D=p[f]-i.reference[f],k=await(s.getOffsetParent==null?void 0:s.getOffsetParent(o)),_=k?f==="y"?k.clientHeight||0:k.clientWidth||0:0;_===0&&(_=i.floating[c]);let Q=w/2-D/2,C=d[m],B=_-h[c]-d[v],A=_/2-h[c]/2+Q,O=Ce(C,A,B),P=($==="start"?d[m]:d[v])>0&&A!==O&&i.reference[c]<=i.floating[c];return{[f]:p[f]-(P?A<C?C-A:B-A:0),data:{[f]:O,centerOffset:A-O}}}}),no={left:"right",right:"left",bottom:"top",top:"bottom"};function be(e){return e.replace(/left|right|bottom|top/g,t=>no[t])}function lo(e,t,o){o===void 0&&(o=!1);let r=pe(e),a=te(e),n=Te(a),l=a==="x"?r===(o?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[n]>t.floating[n]&&(l=be(l)),{main:l,cross:be(l)}}var ao={start:"end",end:"start"};function Ze(e){return e.replace(/start|end/g,t=>ao[t])}var so=["top","right","bottom","left"],Cr=so.reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);var Re=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var o;let{placement:r,middlewareData:a,rects:n,initialPlacement:l,platform:i,elements:s}=t,A=e,{mainAxis:d=!0,crossAxis:p=!0,fallbackPlacements:f,fallbackStrategy:$="bestFit",flipAlignment:c=!0}=A,h=Y(A,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","flipAlignment"]),m=ee(r),v=f||(m===l||!c?[be(l)]:function(O){let P=be(O);return[Ze(O),P,Ze(P)]}(l)),w=[l,...v],D=await Ae(t,h),k=[],_=((o=a.flip)==null?void 0:o.overflows)||[];if(d&&k.push(D[m]),p){let{main:O,cross:P}=lo(r,n,await(i.isRTL==null?void 0:i.isRTL(s.floating)));k.push(D[O],D[P])}if(_=[..._,{placement:r,overflows:k}],!k.every(O=>O<=0)){var Q,C;let O=((Q=(C=a.flip)==null?void 0:C.index)!=null?Q:0)+1,P=w[O];if(P)return{data:{index:O,overflows:_},reset:{placement:P}};let ce="bottom";switch($){case"bestFit":{var B;let Ve=(B=_.map(de=>[de,de.overflows.filter(K=>K>0).reduce((K,zt)=>K+zt,0)]).sort((de,K)=>de[1]-K[1])[0])==null?void 0:B[0].placement;Ve&&(ce=Ve);break}case"initialPlacement":ce=l}if(r!==ce)return{reset:{placement:ce}}}return{}}}};var Me=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){let{x:o,y:r}=t,a=await async function(n,l){let{placement:i,platform:s,elements:d}=n,p=await(s.isRTL==null?void 0:s.isRTL(d.floating)),f=ee(i),$=pe(i),c=te(i)==="x",h=["left","top"].includes(f)?-1:1,m=p&&c?-1:1,v=typeof l=="function"?l(n):l,{mainAxis:w,crossAxis:D,alignmentAxis:k}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:L({mainAxis:0,crossAxis:0,alignmentAxis:null},v);return $&&typeof k=="number"&&(D=$==="end"?-1*k:k),c?{x:D*m,y:w*h}:{x:w*h,y:D*m}}(t,e);return{x:o+a.x,y:r+a.y,data:a}}}};function co(e){return e==="x"?"y":"x"}var Ne=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:o,y:r,placement:a}=t,v=e,{mainAxis:n=!0,crossAxis:l=!1,limiter:i={fn:w=>{let{x:D,y:k}=w;return{x:D,y:k}}}}=v,s=Y(v,["mainAxis","crossAxis","limiter"]),d={x:o,y:r},p=await Ae(t,s),f=te(ee(a)),$=co(f),c=d[f],h=d[$];if(n){let w=f==="y"?"bottom":"right";c=Ce(c+p[f==="y"?"top":"left"],c,c-p[w])}if(l){let w=$==="y"?"bottom":"right";h=Ce(h+p[$==="y"?"top":"left"],h,h-p[w])}let m=i.fn(R(L({},t),{[f]:c,[$]:h}));return R(L({},m),{data:{x:m.x-o,y:m.y-r}})}}};function at(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function N(e){if(e==null)return window;if(!at(e)){let t=e.ownerDocument;return t&&t.defaultView||window}return e}function re(e){return N(e).getComputedStyle(e)}function M(e){return at(e)?"":e?(e.nodeName||"").toLowerCase():""}function st(){let e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(t=>t.brand+"/"+t.version).join(" "):navigator.userAgent}function T(e){return e instanceof N(e).HTMLElement}function W(e){return e instanceof N(e).Element}function Ie(e){return typeof ShadowRoot=="undefined"?!1:e instanceof N(e).ShadowRoot||e instanceof ShadowRoot}function fe(e){let{overflow:t,overflowX:o,overflowY:r}=re(e);return/auto|scroll|overlay|hidden/.test(t+r+o)}function uo(e){return["table","td","th"].includes(M(e))}function ot(e){let t=/firefox/i.test(st()),o=re(e);return o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].includes(o.willChange)||t&&o.willChange==="filter"||t&&!!o.filter&&o.filter!=="none"}function ct(){return!/^((?!chrome|android).)*safari/i.test(st())}var rt=Math.min,oe=Math.max,ge=Math.round;function z(e,t,o){var r,a,n,l;t===void 0&&(t=!1),o===void 0&&(o=!1);let i=e.getBoundingClientRect(),s=1,d=1;t&&T(e)&&(s=e.offsetWidth>0&&ge(i.width)/e.offsetWidth||1,d=e.offsetHeight>0&&ge(i.height)/e.offsetHeight||1);let p=W(e)?N(e):window,f=!ct()&&o,$=(i.left+(f&&(r=(a=p.visualViewport)==null?void 0:a.offsetLeft)!=null?r:0))/s,c=(i.top+(f&&(n=(l=p.visualViewport)==null?void 0:l.offsetTop)!=null?n:0))/d,h=i.width/s,m=i.height/d;return{width:h,height:m,top:c,right:$+h,bottom:c+m,left:$,x:$,y:c}}function U(e){return(t=e,(t instanceof N(t).Node?e.ownerDocument:e.document)||window.document).documentElement;var t}function he(e){return W(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function dt(e){return z(U(e)).left+he(e).scrollLeft}function bo(e,t,o){let r=T(t),a=U(t),n=z(e,r&&function(s){let d=z(s);return ge(d.width)!==s.offsetWidth||ge(d.height)!==s.offsetHeight}(t),o==="fixed"),l={scrollLeft:0,scrollTop:0},i={x:0,y:0};if(r||!r&&o!=="fixed")if((M(t)!=="body"||fe(a))&&(l=he(t)),T(t)){let s=z(t,!0);i.x=s.x+t.clientLeft,i.y=s.y+t.clientTop}else a&&(i.x=dt(a));return{x:n.left+l.scrollLeft-i.x,y:n.top+l.scrollTop-i.y,width:n.width,height:n.height}}function ut(e){return M(e)==="html"?e:e.assignedSlot||e.parentNode||(Ie(e)?e.host:null)||U(e)}function it(e){return T(e)&&getComputedStyle(e).position!=="fixed"?e.offsetParent:null}function je(e){let t=N(e),o=it(e);for(;o&&uo(o)&&getComputedStyle(o).position==="static";)o=it(o);return o&&(M(o)==="html"||M(o)==="body"&&getComputedStyle(o).position==="static"&&!ot(o))?t:o||function(r){let a=ut(r);for(Ie(a)&&(a=a.host);T(a)&&!["html","body"].includes(M(a));){if(ot(a))return a;a=a.parentNode}return null}(e)||t}function nt(e){if(T(e))return{width:e.offsetWidth,height:e.offsetHeight};let t=z(e);return{width:t.width,height:t.height}}function bt(e){let t=ut(e);return["html","body","#document"].includes(M(t))?e.ownerDocument.body:T(t)&&fe(t)?t:bt(t)}function pt(e,t){var o;t===void 0&&(t=[]);let r=bt(e),a=r===((o=e.ownerDocument)==null?void 0:o.body),n=N(r),l=a?[n].concat(n.visualViewport||[],fe(r)?r:[]):r,i=t.concat(l);return a?i:i.concat(pt(l))}function lt(e,t,o){return t==="viewport"?Z(function(r,a){let n=N(r),l=U(r),i=n.visualViewport,s=l.clientWidth,d=l.clientHeight,p=0,f=0;if(i){s=i.width,d=i.height;let $=ct();($||!$&&a==="fixed")&&(p=i.offsetLeft,f=i.offsetTop)}return{width:s,height:d,x:p,y:f}}(e,o)):W(t)?function(r,a){let n=z(r,!1,a==="fixed"),l=n.top+r.clientTop,i=n.left+r.clientLeft;return{top:l,left:i,x:i,y:l,right:i+r.clientWidth,bottom:l+r.clientHeight,width:r.clientWidth,height:r.clientHeight}}(t,o):Z(function(r){var a;let n=U(r),l=he(r),i=(a=r.ownerDocument)==null?void 0:a.body,s=oe(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),d=oe(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),p=-l.scrollLeft+dt(r),f=-l.scrollTop;return re(i||n).direction==="rtl"&&(p+=oe(n.clientWidth,i?i.clientWidth:0)-s),{width:s,height:d,x:p,y:f}}(U(e)))}function po(e){let t=pt(e),o=["absolute","fixed"].includes(re(e).position)&&T(e)?je(e):e;return W(o)?t.filter(r=>W(r)&&function(a,n){let l=n.getRootNode==null?void 0:n.getRootNode();if(a.contains(n))return!0;if(l&&Ie(l)){let i=n;do{if(i&&a===i)return!0;i=i.parentNode||i.host}while(i)}return!1}(r,o)&&M(r)!=="body"):[]}var go={getClippingRect:function(e){let{element:t,boundary:o,rootBoundary:r,strategy:a}=e,n=[...o==="clippingAncestors"?po(t):[].concat(o),r],l=n[0],i=n.reduce((s,d)=>{let p=lt(t,d,a);return s.top=oe(p.top,s.top),s.right=rt(p.right,s.right),s.bottom=rt(p.bottom,s.bottom),s.left=oe(p.left,s.left),s},lt(t,l,a));return{width:i.right-i.left,height:i.bottom-i.top,x:i.left,y:i.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:o,strategy:r}=e,a=T(o),n=U(o);if(o===n)return t;let l={scrollLeft:0,scrollTop:0},i={x:0,y:0};if((a||!a&&r!=="fixed")&&((M(o)!=="body"||fe(n))&&(l=he(o)),T(o))){let s=z(o,!0);i.x=s.x+o.clientLeft,i.y=s.y+o.clientTop}return R(L({},t),{x:t.x-l.scrollLeft+i.x,y:t.y-l.scrollTop+i.y})},isElement:W,getDimensions:nt,getOffsetParent:je,getDocumentElement:U,getElementRects:e=>{let{reference:t,floating:o,strategy:r}=e;return{reference:bo(t,je(o),r),floating:R(L({},nt(o)),{x:0,y:0})}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>re(e).direction==="rtl"};var gt=(e,t,o)=>et(e,t,L({platform:go},o));var ie="top",ne="bottom",me="left",xe="right",le={[ie]:ne,[ne]:ie,[me]:xe,[xe]:me},Qr={[ie]:"\u2191",[ne]:"\u2193",[me]:"\u2190",[xe]:"\u2192"};var ht={[me]:-45,[ie]:45,[xe]:135,[ne]:-135},ft="calc(50% - 7px)",fo=e=>[ie,ne].includes(e);function ho({actualDirection:e,directionName:t,arrowEl:o}){if(!o)return;e=t;let r=fo(t);o.style.left=r?ft:"",o.style.top=r?"":ft}async function mt(e){var a,n;if(!e.isShowing)return;if(await((a=e==null?void 0:e.waitForDOM)==null?void 0:a.call(e)),e.isCallout)return ho(e);let t=await gt(e.targetEl,e.attentionEl,{placement:e.directionName,middleware:[Re(),Me(8),Ne({padding:16}),Pe({element:e.noArrow?void 0:e.arrowEl})]});e.actualDirection=t.placement,Object.assign(((n=e.attentionEl)==null?void 0:n.style)||{},{left:"0",top:"0",transform:`translate3d(${Math.round(t.x)}px, ${Math.round(t.y)}px, 0)`});let{x:o,y:r}=t.middlewareData.arrow;e.arrowEl&&(e.arrowEl.style.left=o?o+"px":"",e.arrowEl.style.top=r?r+"px":"")}var _t=Zt(yt(),1);var I=e=>typeof e=="string",Do=e=>typeof e=="function",wt=new Map;function Ue(e){return[...Array.isArray(e)?e:[e],"en"]}function Dt(e,t,o){let r=Ue(e);return $e(()=>ye("date",r,o),()=>new Intl.DateTimeFormat(r,o)).format(I(t)?new Date(t):t)}function He(e,t,o){let r=Ue(e);return $e(()=>ye("number",r,o),()=>new Intl.NumberFormat(r,o)).format(t)}function kt(e,t,o,n){var l=n,{offset:r=0}=l,a=Y(l,["offset"]);var d,p;let i=Ue(e),s=t?$e(()=>ye("plural-ordinal",i),()=>new Intl.PluralRules(i,{type:"ordinal"})):$e(()=>ye("plural-cardinal",i),()=>new Intl.PluralRules(i,{type:"cardinal"}));return(p=(d=a[o])!=null?d:a[s.select(o-r)])!=null?p:a.other}function $e(e,t){let o=e(),r=wt.get(o);return r||(r=t(),wt.set(o,r)),r}function ye(e,t,o){let r=t.join("-");return`${e}-${r}-${JSON.stringify(o)}`}var Et=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/g,Eo=(e,t,o={})=>{t=t||e;let r=n=>I(n)?o[n]||{style:n}:n,a=(n,l)=>{let i=Object.keys(o).length?r("number"):{},s=He(t,n,i);return l.replace("#",s)};return{plural:(n,l)=>{let{offset:i=0}=l,s=kt(t,!1,n,l);return a(n-i,s)},selectordinal:(n,l)=>{let{offset:i=0}=l,s=kt(t,!0,n,l);return a(n-i,s)},select:(n,l)=>{var i;return(i=l[n])!=null?i:l.other},number:(n,l)=>He(t,n,r(l)),date:(n,l)=>Dt(t,n,r(l)),undefined:n=>n}};function Lo(e,t,o){return(r,a={})=>{let n=Eo(t,o,a),l=s=>Array.isArray(s)?s.reduce((d,p)=>{if(I(p))return d+p;let[f,$,c]=p,h={};c!=null&&!I(c)?Object.keys(c).forEach(v=>{h[v]=l(c[v])}):h=c;let m=n[$](r[f],h);return m==null?d:d+m},""):s,i=l(e);return I(i)&&Et.test(i)?(0,_t.default)(i.trim()):I(i)?i.trim():i}}var Oo=Object.defineProperty,So=(e,t,o)=>t in e?Oo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,Co=(e,t,o)=>(So(e,typeof t!="symbol"?t+"":t,o),o),Be=class{constructor(){Co(this,"_events",{})}on(t,o){return this._hasEvent(t)||(this._events[t]=[]),this._events[t].push(o),()=>this.removeListener(t,o)}removeListener(t,o){if(!this._hasEvent(t))return;let r=this._events[t].indexOf(o);~r&&this._events[t].splice(r,1)}emit(t,...o){this._hasEvent(t)&&this._events[t].map(r=>r.apply(this,o))}_hasEvent(t){return Array.isArray(this._events[t])}},To=Object.defineProperty,Ao=(e,t,o)=>t in e?To(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,G=(e,t,o)=>(Ao(e,typeof t!="symbol"?t+"":t,o),o),qe=class extends Be{constructor(t){super(),G(this,"_locale"),G(this,"_locales"),G(this,"_localeData"),G(this,"_messages"),G(this,"_missing"),G(this,"t",this._.bind(this)),this._messages={},this._localeData={},t.missing!=null&&(this._missing=t.missing),t.messages!=null&&this.load(t.messages),t.localeData!=null&&this.loadLocaleData(t.localeData),(t.locale!=null||t.locales!=null)&&this.activate(t.locale,t.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){var t;return(t=this._messages[this._locale])!=null?t:{}}get localeData(){var t;return(t=this._localeData[this._locale])!=null?t:{}}_loadLocaleData(t,o){this._localeData[t]==null?this._localeData[t]=o:Object.assign(this._localeData[t],o)}loadLocaleData(t,o){o!=null?this._loadLocaleData(t,o):Object.keys(t).forEach(r=>this._loadLocaleData(r,t[r])),this.emit("change")}_load(t,o){this._messages[t]==null?this._messages[t]=o:Object.assign(this._messages[t],o)}load(t,o){o!=null?this._load(t,o):Object.keys(t).forEach(r=>this._load(r,t[r])),this.emit("change")}loadAndActivate({locale:t,locales:o,messages:r}){this._locale=t,this._locales=o||void 0,this._messages[this._locale]=r,this.emit("change")}activate(t,o){this._locale=t,this._locales=o,this.emit("change")}_(t,o={},{message:r,formats:a}={}){I(t)||(o=t.values||o,r=t.message,t=t.id);let n=!this.messages[t],l=this._missing;if(l&&n)return Do(l)?l(this._locale,t):l;n&&this.emit("missing",{id:t,locale:this._locale});let i=this.messages[t]||r||t;return I(i)&&Et.test(i)?JSON.parse(`"${i}"`):I(i)?i:Lo(i,this._locale,this._locales)(o,a)}date(t,o){return Dt(this._locales||this._locale,t,o)}number(t,o){return He(this._locales||this._locale,t,o)}};function Po(e={}){return new qe(e)}var S=Po();var Lt=JSON.parse('{"attention.aria.callout":"callout speech bubble","attention.aria.close":"Close","attention.aria.highlight":"highlighted speech bubble","attention.aria.pointingDown":"pointing down","attention.aria.pointingLeft":"pointing left","attention.aria.pointingRight":"pointing right","attention.aria.pointingUp":"pointing up","attention.aria.popover":"popover speech bubble","attention.aria.tooltip":"tooltip"}');var Ot=JSON.parse('{"attention.aria.callout":"callout speech bubble","attention.aria.close":"Lukk","attention.aria.highlight":"highlighted speech bubble","attention.aria.pointingDown":"pointing down","attention.aria.pointingLeft":"pointing left","attention.aria.pointingRight":"pointing right","attention.aria.pointingUp":"pointing up","attention.aria.popover":"popover speech bubble","attention.aria.tooltip":"tooltip"}');var St=JSON.parse('{"attention.aria.callout":"callout speech bubble","attention.aria.close":"Sulje","attention.aria.highlight":"highlighted speech bubble","attention.aria.pointingDown":"pointing down","attention.aria.pointingLeft":"pointing left","attention.aria.pointingRight":"pointing right","attention.aria.pointingUp":"pointing up","attention.aria.popover":"popover speech bubble","attention.aria.tooltip":"tooltip"}');var Ro=["en","nb","fi"],Tt="en",Ct=e=>Ro.find(t=>e===t||e.toLowerCase().includes(t))||Tt;function Mo(){if(typeof window=="undefined"){let e=process.env.NMP_LANGUAGE||Intl.DateTimeFormat().resolvedOptions().locale;return Ct(e)}try{let e=document.documentElement.lang;return Ct(e)}catch(e){return console.warn("could not detect locale, falling back to source locale",e),Tt}}var No=(e,t,o,r)=>e==="nb"?o:e==="fi"?r:t,At=(e,t,o)=>{let r=Mo(),a=No(r,e,t,o);S.load(r,a),S.activate(r)};import{LitElement as Wo}from"lit";import{unsafeStatic as Jo,html as Go}from"lit/static-html.js";var jo=Object.create,jt=Object.defineProperty,Io=Object.getOwnPropertyDescriptor,Ho=Object.getOwnPropertyNames,Pt=Object.getOwnPropertySymbols,Bo=Object.getPrototypeOf,It=Object.prototype.hasOwnProperty,qo=Object.prototype.propertyIsEnumerable,Uo=(e,t)=>{var o={};for(var r in e)It.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&Pt)for(var r of Pt(e))t.indexOf(r)<0&&qo.call(e,r)&&(o[r]=e[r]);return o},Ht=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Qo=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Ho(t))!It.call(e,a)&&a!==o&&jt(e,a,{get:()=>t[a],enumerable:!(r=Io(t,a))||r.enumerable});return e},Fo=(e,t,o)=>(o=e!=null?jo(Bo(e)):{},Qo(t||!e||!e.__esModule?jt(o,"default",{value:e,enumerable:!0}):o,e)),zo=Ht(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.errorMessages=e.ErrorType=void 0;var t;(function(o){o.MalformedUnicode="MALFORMED_UNICODE",o.MalformedHexadecimal="MALFORMED_HEXADECIMAL",o.CodePointLimit="CODE_POINT_LIMIT",o.OctalDeprecation="OCTAL_DEPRECATION",o.EndOfString="END_OF_STRING"})(t=e.ErrorType||(e.ErrorType={})),e.errorMessages=new Map([[t.MalformedUnicode,"malformed Unicode character escape sequence"],[t.MalformedHexadecimal,"malformed hexadecimal character escape sequence"],[t.CodePointLimit,"Unicode codepoint must not be greater than 0x10FFFF in escape sequence"],[t.OctalDeprecation,'"0"-prefixed octal literals and octal escape sequences are deprecated; for octal literals use the "0o" prefix instead'],[t.EndOfString,"malformed escape sequence at end of string"]])}),Vo=Ht(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.unraw=e.errorMessages=e.ErrorType=void 0;var t=zo();Object.defineProperty(e,"ErrorType",{enumerable:!0,get:function(){return t.ErrorType}}),Object.defineProperty(e,"errorMessages",{enumerable:!0,get:function(){return t.errorMessages}});function o(c){return c.match(/[^a-f0-9]/i)?NaN:parseInt(c,16)}function r(c,h,m){let v=o(c);if(Number.isNaN(v)||m!==void 0&&m!==c.length)throw new SyntaxError(t.errorMessages.get(h));return v}function a(c){let h=r(c,t.ErrorType.MalformedHexadecimal,2);return String.fromCharCode(h)}function n(c,h){let m=r(c,t.ErrorType.MalformedUnicode,4);if(h!==void 0){let v=r(h,t.ErrorType.MalformedUnicode,4);return String.fromCharCode(m,v)}return String.fromCharCode(m)}function l(c){return c.charAt(0)==="{"&&c.charAt(c.length-1)==="}"}function i(c){if(!l(c))throw new SyntaxError(t.errorMessages.get(t.ErrorType.MalformedUnicode));let h=c.slice(1,-1),m=r(h,t.ErrorType.MalformedUnicode);try{return String.fromCodePoint(m)}catch(v){throw v instanceof RangeError?new SyntaxError(t.errorMessages.get(t.ErrorType.CodePointLimit)):v}}function s(c,h=!1){if(h)throw new SyntaxError(t.errorMessages.get(t.ErrorType.OctalDeprecation));let m=parseInt(c,8);return String.fromCharCode(m)}var d=new Map([["b","\b"],["f","\f"],["n",`
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
+
var __spreadValues = (a3, b3) => {
|
|
13
|
+
for (var prop in b3 || (b3 = {}))
|
|
14
|
+
if (__hasOwnProp.call(b3, prop))
|
|
15
|
+
__defNormalProp(a3, prop, b3[prop]);
|
|
16
|
+
if (__getOwnPropSymbols)
|
|
17
|
+
for (var prop of __getOwnPropSymbols(b3)) {
|
|
18
|
+
if (__propIsEnum.call(b3, prop))
|
|
19
|
+
__defNormalProp(a3, prop, b3[prop]);
|
|
20
|
+
}
|
|
21
|
+
return a3;
|
|
22
|
+
};
|
|
23
|
+
var __spreadProps = (a3, b3) => __defProps(a3, __getOwnPropDescs(b3));
|
|
24
|
+
var __objRest = (source, exclude) => {
|
|
25
|
+
var target = {};
|
|
26
|
+
for (var prop in source)
|
|
27
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
if (source != null && __getOwnPropSymbols)
|
|
30
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
31
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
32
|
+
target[prop] = source[prop];
|
|
33
|
+
}
|
|
34
|
+
return target;
|
|
35
|
+
};
|
|
36
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
37
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
38
|
+
};
|
|
39
|
+
var __copyProps = (to, from, except, desc) => {
|
|
40
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
41
|
+
for (let key of __getOwnPropNames(from))
|
|
42
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
43
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
44
|
+
}
|
|
45
|
+
return to;
|
|
46
|
+
};
|
|
47
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
48
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
49
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
50
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
51
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
52
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
53
|
+
mod
|
|
54
|
+
));
|
|
55
|
+
var __publicField = (obj, key, value) => {
|
|
56
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
57
|
+
return value;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
// node_modules/.pnpm/unraw@3.0.0/node_modules/unraw/dist/errors.js
|
|
61
|
+
var require_errors = __commonJS({
|
|
62
|
+
"node_modules/.pnpm/unraw@3.0.0/node_modules/unraw/dist/errors.js"(exports) {
|
|
63
|
+
"use strict";
|
|
64
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
65
|
+
exports.errorMessages = exports.ErrorType = void 0;
|
|
66
|
+
var ErrorType;
|
|
67
|
+
(function(ErrorType2) {
|
|
68
|
+
ErrorType2["MalformedUnicode"] = "MALFORMED_UNICODE";
|
|
69
|
+
ErrorType2["MalformedHexadecimal"] = "MALFORMED_HEXADECIMAL";
|
|
70
|
+
ErrorType2["CodePointLimit"] = "CODE_POINT_LIMIT";
|
|
71
|
+
ErrorType2["OctalDeprecation"] = "OCTAL_DEPRECATION";
|
|
72
|
+
ErrorType2["EndOfString"] = "END_OF_STRING";
|
|
73
|
+
})(ErrorType = exports.ErrorType || (exports.ErrorType = {}));
|
|
74
|
+
exports.errorMessages = /* @__PURE__ */ new Map([
|
|
75
|
+
[ErrorType.MalformedUnicode, "malformed Unicode character escape sequence"],
|
|
76
|
+
[
|
|
77
|
+
ErrorType.MalformedHexadecimal,
|
|
78
|
+
"malformed hexadecimal character escape sequence"
|
|
79
|
+
],
|
|
80
|
+
[
|
|
81
|
+
ErrorType.CodePointLimit,
|
|
82
|
+
"Unicode codepoint must not be greater than 0x10FFFF in escape sequence"
|
|
83
|
+
],
|
|
84
|
+
[
|
|
85
|
+
ErrorType.OctalDeprecation,
|
|
86
|
+
'"0"-prefixed octal literals and octal escape sequences are deprecated; for octal literals use the "0o" prefix instead'
|
|
87
|
+
],
|
|
88
|
+
[ErrorType.EndOfString, "malformed escape sequence at end of string"]
|
|
89
|
+
]);
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
// node_modules/.pnpm/unraw@3.0.0/node_modules/unraw/dist/index.js
|
|
94
|
+
var require_dist = __commonJS({
|
|
95
|
+
"node_modules/.pnpm/unraw@3.0.0/node_modules/unraw/dist/index.js"(exports) {
|
|
96
|
+
"use strict";
|
|
97
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
98
|
+
exports.unraw = exports.errorMessages = exports.ErrorType = void 0;
|
|
99
|
+
var errors_1 = require_errors();
|
|
100
|
+
Object.defineProperty(exports, "ErrorType", { enumerable: true, get: function() {
|
|
101
|
+
return errors_1.ErrorType;
|
|
102
|
+
} });
|
|
103
|
+
Object.defineProperty(exports, "errorMessages", { enumerable: true, get: function() {
|
|
104
|
+
return errors_1.errorMessages;
|
|
105
|
+
} });
|
|
106
|
+
function parseHexToInt(hex) {
|
|
107
|
+
const isOnlyHexChars = !hex.match(/[^a-f0-9]/i);
|
|
108
|
+
return isOnlyHexChars ? parseInt(hex, 16) : NaN;
|
|
109
|
+
}
|
|
110
|
+
function validateAndParseHex(hex, errorName, enforcedLength) {
|
|
111
|
+
const parsedHex = parseHexToInt(hex);
|
|
112
|
+
if (Number.isNaN(parsedHex) || enforcedLength !== void 0 && enforcedLength !== hex.length) {
|
|
113
|
+
throw new SyntaxError(errors_1.errorMessages.get(errorName));
|
|
114
|
+
}
|
|
115
|
+
return parsedHex;
|
|
116
|
+
}
|
|
117
|
+
function parseHexadecimalCode(code) {
|
|
118
|
+
const parsedCode = validateAndParseHex(code, errors_1.ErrorType.MalformedHexadecimal, 2);
|
|
119
|
+
return String.fromCharCode(parsedCode);
|
|
120
|
+
}
|
|
121
|
+
function parseUnicodeCode(code, surrogateCode) {
|
|
122
|
+
const parsedCode = validateAndParseHex(code, errors_1.ErrorType.MalformedUnicode, 4);
|
|
123
|
+
if (surrogateCode !== void 0) {
|
|
124
|
+
const parsedSurrogateCode = validateAndParseHex(surrogateCode, errors_1.ErrorType.MalformedUnicode, 4);
|
|
125
|
+
return String.fromCharCode(parsedCode, parsedSurrogateCode);
|
|
126
|
+
}
|
|
127
|
+
return String.fromCharCode(parsedCode);
|
|
128
|
+
}
|
|
129
|
+
function isCurlyBraced(text) {
|
|
130
|
+
return text.charAt(0) === "{" && text.charAt(text.length - 1) === "}";
|
|
131
|
+
}
|
|
132
|
+
function parseUnicodeCodePointCode(codePoint) {
|
|
133
|
+
if (!isCurlyBraced(codePoint)) {
|
|
134
|
+
throw new SyntaxError(errors_1.errorMessages.get(errors_1.ErrorType.MalformedUnicode));
|
|
135
|
+
}
|
|
136
|
+
const withoutBraces = codePoint.slice(1, -1);
|
|
137
|
+
const parsedCode = validateAndParseHex(withoutBraces, errors_1.ErrorType.MalformedUnicode);
|
|
138
|
+
try {
|
|
139
|
+
return String.fromCodePoint(parsedCode);
|
|
140
|
+
} catch (err) {
|
|
141
|
+
throw err instanceof RangeError ? new SyntaxError(errors_1.errorMessages.get(errors_1.ErrorType.CodePointLimit)) : err;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
function parseOctalCode(code, error = false) {
|
|
145
|
+
if (error) {
|
|
146
|
+
throw new SyntaxError(errors_1.errorMessages.get(errors_1.ErrorType.OctalDeprecation));
|
|
147
|
+
}
|
|
148
|
+
const parsedCode = parseInt(code, 8);
|
|
149
|
+
return String.fromCharCode(parsedCode);
|
|
150
|
+
}
|
|
151
|
+
var singleCharacterEscapes = /* @__PURE__ */ new Map([
|
|
152
|
+
["b", "\b"],
|
|
153
|
+
["f", "\f"],
|
|
154
|
+
["n", "\n"],
|
|
155
|
+
["r", "\r"],
|
|
156
|
+
["t", " "],
|
|
157
|
+
["v", "\v"],
|
|
158
|
+
["0", "\0"]
|
|
159
|
+
]);
|
|
160
|
+
function parseSingleCharacterCode(code) {
|
|
161
|
+
return singleCharacterEscapes.get(code) || code;
|
|
162
|
+
}
|
|
163
|
+
var escapeMatch = /\\(?:(\\)|x([\s\S]{0,2})|u(\{[^}]*\}?)|u([\s\S]{4})\\u([^{][\s\S]{0,3})|u([\s\S]{0,4})|([0-3]?[0-7]{1,2})|([\s\S])|$)/g;
|
|
164
|
+
function unraw2(raw, allowOctals = false) {
|
|
165
|
+
return raw.replace(escapeMatch, function(_, backslash, hex, codePoint, unicodeWithSurrogate, surrogate, unicode, octal, singleCharacter) {
|
|
166
|
+
if (backslash !== void 0) {
|
|
167
|
+
return "\\";
|
|
168
|
+
}
|
|
169
|
+
if (hex !== void 0) {
|
|
170
|
+
return parseHexadecimalCode(hex);
|
|
171
|
+
}
|
|
172
|
+
if (codePoint !== void 0) {
|
|
173
|
+
return parseUnicodeCodePointCode(codePoint);
|
|
174
|
+
}
|
|
175
|
+
if (unicodeWithSurrogate !== void 0) {
|
|
176
|
+
return parseUnicodeCode(unicodeWithSurrogate, surrogate);
|
|
177
|
+
}
|
|
178
|
+
if (unicode !== void 0) {
|
|
179
|
+
return parseUnicodeCode(unicode);
|
|
180
|
+
}
|
|
181
|
+
if (octal === "0") {
|
|
182
|
+
return "\0";
|
|
183
|
+
}
|
|
184
|
+
if (octal !== void 0) {
|
|
185
|
+
return parseOctalCode(octal, !allowOctals);
|
|
186
|
+
}
|
|
187
|
+
if (singleCharacter !== void 0) {
|
|
188
|
+
return parseSingleCharacterCode(singleCharacter);
|
|
189
|
+
}
|
|
190
|
+
throw new SyntaxError(errors_1.errorMessages.get(errors_1.ErrorType.EndOfString));
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
exports.unraw = unraw2;
|
|
194
|
+
exports.default = unraw2;
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
// node_modules/.pnpm/moo@0.5.2/node_modules/moo/moo.js
|
|
199
|
+
var require_moo = __commonJS({
|
|
200
|
+
"node_modules/.pnpm/moo@0.5.2/node_modules/moo/moo.js"(exports, module) {
|
|
201
|
+
(function(root, factory) {
|
|
202
|
+
if (typeof define === "function" && define.amd) {
|
|
203
|
+
define([], factory);
|
|
204
|
+
} else if (typeof module === "object" && module.exports) {
|
|
205
|
+
module.exports = factory();
|
|
206
|
+
} else {
|
|
207
|
+
root.moo = factory();
|
|
208
|
+
}
|
|
209
|
+
})(exports, function() {
|
|
210
|
+
"use strict";
|
|
211
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
212
|
+
var toString = Object.prototype.toString;
|
|
213
|
+
var hasSticky = typeof new RegExp().sticky === "boolean";
|
|
214
|
+
function isRegExp(o3) {
|
|
215
|
+
return o3 && toString.call(o3) === "[object RegExp]";
|
|
216
|
+
}
|
|
217
|
+
function isObject(o3) {
|
|
218
|
+
return o3 && typeof o3 === "object" && !isRegExp(o3) && !Array.isArray(o3);
|
|
219
|
+
}
|
|
220
|
+
function reEscape(s3) {
|
|
221
|
+
return s3.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
|
|
222
|
+
}
|
|
223
|
+
function reGroups(s3) {
|
|
224
|
+
var re = new RegExp("|" + s3);
|
|
225
|
+
return re.exec("").length - 1;
|
|
226
|
+
}
|
|
227
|
+
function reCapture(s3) {
|
|
228
|
+
return "(" + s3 + ")";
|
|
229
|
+
}
|
|
230
|
+
function reUnion(regexps) {
|
|
231
|
+
if (!regexps.length)
|
|
232
|
+
return "(?!)";
|
|
233
|
+
var source = regexps.map(function(s3) {
|
|
234
|
+
return "(?:" + s3 + ")";
|
|
235
|
+
}).join("|");
|
|
236
|
+
return "(?:" + source + ")";
|
|
237
|
+
}
|
|
238
|
+
function regexpOrLiteral(obj) {
|
|
239
|
+
if (typeof obj === "string") {
|
|
240
|
+
return "(?:" + reEscape(obj) + ")";
|
|
241
|
+
} else if (isRegExp(obj)) {
|
|
242
|
+
if (obj.ignoreCase)
|
|
243
|
+
throw new Error("RegExp /i flag not allowed");
|
|
244
|
+
if (obj.global)
|
|
245
|
+
throw new Error("RegExp /g flag is implied");
|
|
246
|
+
if (obj.sticky)
|
|
247
|
+
throw new Error("RegExp /y flag is implied");
|
|
248
|
+
if (obj.multiline)
|
|
249
|
+
throw new Error("RegExp /m flag is implied");
|
|
250
|
+
return obj.source;
|
|
251
|
+
} else {
|
|
252
|
+
throw new Error("Not a pattern: " + obj);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
function pad(s3, length) {
|
|
256
|
+
if (s3.length > length) {
|
|
257
|
+
return s3;
|
|
258
|
+
}
|
|
259
|
+
return Array(length - s3.length + 1).join(" ") + s3;
|
|
260
|
+
}
|
|
261
|
+
function lastNLines(string, numLines) {
|
|
262
|
+
var position = string.length;
|
|
263
|
+
var lineBreaks = 0;
|
|
264
|
+
while (true) {
|
|
265
|
+
var idx = string.lastIndexOf("\n", position - 1);
|
|
266
|
+
if (idx === -1) {
|
|
267
|
+
break;
|
|
268
|
+
} else {
|
|
269
|
+
lineBreaks++;
|
|
270
|
+
}
|
|
271
|
+
position = idx;
|
|
272
|
+
if (lineBreaks === numLines) {
|
|
273
|
+
break;
|
|
274
|
+
}
|
|
275
|
+
if (position === 0) {
|
|
276
|
+
break;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
var startPosition = lineBreaks < numLines ? 0 : position + 1;
|
|
280
|
+
return string.substring(startPosition).split("\n");
|
|
281
|
+
}
|
|
282
|
+
function objectToRules(object) {
|
|
283
|
+
var keys = Object.getOwnPropertyNames(object);
|
|
284
|
+
var result = [];
|
|
285
|
+
for (var i3 = 0; i3 < keys.length; i3++) {
|
|
286
|
+
var key = keys[i3];
|
|
287
|
+
var thing = object[key];
|
|
288
|
+
var rules = [].concat(thing);
|
|
289
|
+
if (key === "include") {
|
|
290
|
+
for (var j = 0; j < rules.length; j++) {
|
|
291
|
+
result.push({ include: rules[j] });
|
|
292
|
+
}
|
|
293
|
+
continue;
|
|
294
|
+
}
|
|
295
|
+
var match = [];
|
|
296
|
+
rules.forEach(function(rule) {
|
|
297
|
+
if (isObject(rule)) {
|
|
298
|
+
if (match.length)
|
|
299
|
+
result.push(ruleOptions(key, match));
|
|
300
|
+
result.push(ruleOptions(key, rule));
|
|
301
|
+
match = [];
|
|
302
|
+
} else {
|
|
303
|
+
match.push(rule);
|
|
304
|
+
}
|
|
305
|
+
});
|
|
306
|
+
if (match.length)
|
|
307
|
+
result.push(ruleOptions(key, match));
|
|
308
|
+
}
|
|
309
|
+
return result;
|
|
310
|
+
}
|
|
311
|
+
function arrayToRules(array) {
|
|
312
|
+
var result = [];
|
|
313
|
+
for (var i3 = 0; i3 < array.length; i3++) {
|
|
314
|
+
var obj = array[i3];
|
|
315
|
+
if (obj.include) {
|
|
316
|
+
var include = [].concat(obj.include);
|
|
317
|
+
for (var j = 0; j < include.length; j++) {
|
|
318
|
+
result.push({ include: include[j] });
|
|
319
|
+
}
|
|
320
|
+
continue;
|
|
321
|
+
}
|
|
322
|
+
if (!obj.type) {
|
|
323
|
+
throw new Error("Rule has no type: " + JSON.stringify(obj));
|
|
324
|
+
}
|
|
325
|
+
result.push(ruleOptions(obj.type, obj));
|
|
326
|
+
}
|
|
327
|
+
return result;
|
|
328
|
+
}
|
|
329
|
+
function ruleOptions(type, obj) {
|
|
330
|
+
if (!isObject(obj)) {
|
|
331
|
+
obj = { match: obj };
|
|
332
|
+
}
|
|
333
|
+
if (obj.include) {
|
|
334
|
+
throw new Error("Matching rules cannot also include states");
|
|
335
|
+
}
|
|
336
|
+
var options = {
|
|
337
|
+
defaultType: type,
|
|
338
|
+
lineBreaks: !!obj.error || !!obj.fallback,
|
|
339
|
+
pop: false,
|
|
340
|
+
next: null,
|
|
341
|
+
push: null,
|
|
342
|
+
error: false,
|
|
343
|
+
fallback: false,
|
|
344
|
+
value: null,
|
|
345
|
+
type: null,
|
|
346
|
+
shouldThrow: false
|
|
347
|
+
};
|
|
348
|
+
for (var key in obj) {
|
|
349
|
+
if (hasOwnProperty.call(obj, key)) {
|
|
350
|
+
options[key] = obj[key];
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
if (typeof options.type === "string" && type !== options.type) {
|
|
354
|
+
throw new Error("Type transform cannot be a string (type '" + options.type + "' for token '" + type + "')");
|
|
355
|
+
}
|
|
356
|
+
var match = options.match;
|
|
357
|
+
options.match = Array.isArray(match) ? match : match ? [match] : [];
|
|
358
|
+
options.match.sort(function(a3, b3) {
|
|
359
|
+
return isRegExp(a3) && isRegExp(b3) ? 0 : isRegExp(b3) ? -1 : isRegExp(a3) ? 1 : b3.length - a3.length;
|
|
360
|
+
});
|
|
361
|
+
return options;
|
|
362
|
+
}
|
|
363
|
+
function toRules(spec) {
|
|
364
|
+
return Array.isArray(spec) ? arrayToRules(spec) : objectToRules(spec);
|
|
365
|
+
}
|
|
366
|
+
var defaultErrorRule = ruleOptions("error", { lineBreaks: true, shouldThrow: true });
|
|
367
|
+
function compileRules(rules, hasStates) {
|
|
368
|
+
var errorRule = null;
|
|
369
|
+
var fast = /* @__PURE__ */ Object.create(null);
|
|
370
|
+
var fastAllowed = true;
|
|
371
|
+
var unicodeFlag = null;
|
|
372
|
+
var groups = [];
|
|
373
|
+
var parts = [];
|
|
374
|
+
for (var i3 = 0; i3 < rules.length; i3++) {
|
|
375
|
+
if (rules[i3].fallback) {
|
|
376
|
+
fastAllowed = false;
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
for (var i3 = 0; i3 < rules.length; i3++) {
|
|
380
|
+
var options = rules[i3];
|
|
381
|
+
if (options.include) {
|
|
382
|
+
throw new Error("Inheritance is not allowed in stateless lexers");
|
|
383
|
+
}
|
|
384
|
+
if (options.error || options.fallback) {
|
|
385
|
+
if (errorRule) {
|
|
386
|
+
if (!options.fallback === !errorRule.fallback) {
|
|
387
|
+
throw new Error("Multiple " + (options.fallback ? "fallback" : "error") + " rules not allowed (for token '" + options.defaultType + "')");
|
|
388
|
+
} else {
|
|
389
|
+
throw new Error("fallback and error are mutually exclusive (for token '" + options.defaultType + "')");
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
errorRule = options;
|
|
393
|
+
}
|
|
394
|
+
var match = options.match.slice();
|
|
395
|
+
if (fastAllowed) {
|
|
396
|
+
while (match.length && typeof match[0] === "string" && match[0].length === 1) {
|
|
397
|
+
var word = match.shift();
|
|
398
|
+
fast[word.charCodeAt(0)] = options;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
if (options.pop || options.push || options.next) {
|
|
402
|
+
if (!hasStates) {
|
|
403
|
+
throw new Error("State-switching options are not allowed in stateless lexers (for token '" + options.defaultType + "')");
|
|
404
|
+
}
|
|
405
|
+
if (options.fallback) {
|
|
406
|
+
throw new Error("State-switching options are not allowed on fallback tokens (for token '" + options.defaultType + "')");
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
if (match.length === 0) {
|
|
410
|
+
continue;
|
|
411
|
+
}
|
|
412
|
+
fastAllowed = false;
|
|
413
|
+
groups.push(options);
|
|
414
|
+
for (var j = 0; j < match.length; j++) {
|
|
415
|
+
var obj = match[j];
|
|
416
|
+
if (!isRegExp(obj)) {
|
|
417
|
+
continue;
|
|
418
|
+
}
|
|
419
|
+
if (unicodeFlag === null) {
|
|
420
|
+
unicodeFlag = obj.unicode;
|
|
421
|
+
} else if (unicodeFlag !== obj.unicode && options.fallback === false) {
|
|
422
|
+
throw new Error("If one rule is /u then all must be");
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
var pat = reUnion(match.map(regexpOrLiteral));
|
|
426
|
+
var regexp = new RegExp(pat);
|
|
427
|
+
if (regexp.test("")) {
|
|
428
|
+
throw new Error("RegExp matches empty string: " + regexp);
|
|
429
|
+
}
|
|
430
|
+
var groupCount = reGroups(pat);
|
|
431
|
+
if (groupCount > 0) {
|
|
432
|
+
throw new Error("RegExp has capture groups: " + regexp + "\nUse (?: \u2026 ) instead");
|
|
433
|
+
}
|
|
434
|
+
if (!options.lineBreaks && regexp.test("\n")) {
|
|
435
|
+
throw new Error("Rule should declare lineBreaks: " + regexp);
|
|
436
|
+
}
|
|
437
|
+
parts.push(reCapture(pat));
|
|
438
|
+
}
|
|
439
|
+
var fallbackRule = errorRule && errorRule.fallback;
|
|
440
|
+
var flags = hasSticky && !fallbackRule ? "ym" : "gm";
|
|
441
|
+
var suffix2 = hasSticky || fallbackRule ? "" : "|";
|
|
442
|
+
if (unicodeFlag === true)
|
|
443
|
+
flags += "u";
|
|
444
|
+
var combined = new RegExp(reUnion(parts) + suffix2, flags);
|
|
445
|
+
return { regexp: combined, groups, fast, error: errorRule || defaultErrorRule };
|
|
446
|
+
}
|
|
447
|
+
function compile(rules) {
|
|
448
|
+
var result = compileRules(toRules(rules));
|
|
449
|
+
return new Lexer({ start: result }, "start");
|
|
450
|
+
}
|
|
451
|
+
function checkStateGroup(g3, name, map) {
|
|
452
|
+
var state = g3 && (g3.push || g3.next);
|
|
453
|
+
if (state && !map[state]) {
|
|
454
|
+
throw new Error("Missing state '" + state + "' (in token '" + g3.defaultType + "' of state '" + name + "')");
|
|
455
|
+
}
|
|
456
|
+
if (g3 && g3.pop && +g3.pop !== 1) {
|
|
457
|
+
throw new Error("pop must be 1 (in token '" + g3.defaultType + "' of state '" + name + "')");
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
function compileStates(states, start) {
|
|
461
|
+
var all = states.$all ? toRules(states.$all) : [];
|
|
462
|
+
delete states.$all;
|
|
463
|
+
var keys = Object.getOwnPropertyNames(states);
|
|
464
|
+
if (!start)
|
|
465
|
+
start = keys[0];
|
|
466
|
+
var ruleMap = /* @__PURE__ */ Object.create(null);
|
|
467
|
+
for (var i3 = 0; i3 < keys.length; i3++) {
|
|
468
|
+
var key = keys[i3];
|
|
469
|
+
ruleMap[key] = toRules(states[key]).concat(all);
|
|
470
|
+
}
|
|
471
|
+
for (var i3 = 0; i3 < keys.length; i3++) {
|
|
472
|
+
var key = keys[i3];
|
|
473
|
+
var rules = ruleMap[key];
|
|
474
|
+
var included = /* @__PURE__ */ Object.create(null);
|
|
475
|
+
for (var j = 0; j < rules.length; j++) {
|
|
476
|
+
var rule = rules[j];
|
|
477
|
+
if (!rule.include)
|
|
478
|
+
continue;
|
|
479
|
+
var splice = [j, 1];
|
|
480
|
+
if (rule.include !== key && !included[rule.include]) {
|
|
481
|
+
included[rule.include] = true;
|
|
482
|
+
var newRules = ruleMap[rule.include];
|
|
483
|
+
if (!newRules) {
|
|
484
|
+
throw new Error("Cannot include nonexistent state '" + rule.include + "' (in state '" + key + "')");
|
|
485
|
+
}
|
|
486
|
+
for (var k2 = 0; k2 < newRules.length; k2++) {
|
|
487
|
+
var newRule = newRules[k2];
|
|
488
|
+
if (rules.indexOf(newRule) !== -1)
|
|
489
|
+
continue;
|
|
490
|
+
splice.push(newRule);
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
rules.splice.apply(rules, splice);
|
|
494
|
+
j--;
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
var map = /* @__PURE__ */ Object.create(null);
|
|
498
|
+
for (var i3 = 0; i3 < keys.length; i3++) {
|
|
499
|
+
var key = keys[i3];
|
|
500
|
+
map[key] = compileRules(ruleMap[key], true);
|
|
501
|
+
}
|
|
502
|
+
for (var i3 = 0; i3 < keys.length; i3++) {
|
|
503
|
+
var name = keys[i3];
|
|
504
|
+
var state = map[name];
|
|
505
|
+
var groups = state.groups;
|
|
506
|
+
for (var j = 0; j < groups.length; j++) {
|
|
507
|
+
checkStateGroup(groups[j], name, map);
|
|
508
|
+
}
|
|
509
|
+
var fastKeys = Object.getOwnPropertyNames(state.fast);
|
|
510
|
+
for (var j = 0; j < fastKeys.length; j++) {
|
|
511
|
+
checkStateGroup(state.fast[fastKeys[j]], name, map);
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
return new Lexer(map, start);
|
|
515
|
+
}
|
|
516
|
+
function keywordTransform(map) {
|
|
517
|
+
var isMap = typeof Map !== "undefined";
|
|
518
|
+
var reverseMap = isMap ? /* @__PURE__ */ new Map() : /* @__PURE__ */ Object.create(null);
|
|
519
|
+
var types = Object.getOwnPropertyNames(map);
|
|
520
|
+
for (var i3 = 0; i3 < types.length; i3++) {
|
|
521
|
+
var tokenType = types[i3];
|
|
522
|
+
var item = map[tokenType];
|
|
523
|
+
var keywordList = Array.isArray(item) ? item : [item];
|
|
524
|
+
keywordList.forEach(function(keyword) {
|
|
525
|
+
if (typeof keyword !== "string") {
|
|
526
|
+
throw new Error("keyword must be string (in keyword '" + tokenType + "')");
|
|
527
|
+
}
|
|
528
|
+
if (isMap) {
|
|
529
|
+
reverseMap.set(keyword, tokenType);
|
|
530
|
+
} else {
|
|
531
|
+
reverseMap[keyword] = tokenType;
|
|
532
|
+
}
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
return function(k2) {
|
|
536
|
+
return isMap ? reverseMap.get(k2) : reverseMap[k2];
|
|
537
|
+
};
|
|
538
|
+
}
|
|
539
|
+
var Lexer = function(states, state) {
|
|
540
|
+
this.startState = state;
|
|
541
|
+
this.states = states;
|
|
542
|
+
this.buffer = "";
|
|
543
|
+
this.stack = [];
|
|
544
|
+
this.reset();
|
|
545
|
+
};
|
|
546
|
+
Lexer.prototype.reset = function(data, info) {
|
|
547
|
+
this.buffer = data || "";
|
|
548
|
+
this.index = 0;
|
|
549
|
+
this.line = info ? info.line : 1;
|
|
550
|
+
this.col = info ? info.col : 1;
|
|
551
|
+
this.queuedToken = info ? info.queuedToken : null;
|
|
552
|
+
this.queuedText = info ? info.queuedText : "";
|
|
553
|
+
this.queuedThrow = info ? info.queuedThrow : null;
|
|
554
|
+
this.setState(info ? info.state : this.startState);
|
|
555
|
+
this.stack = info && info.stack ? info.stack.slice() : [];
|
|
556
|
+
return this;
|
|
557
|
+
};
|
|
558
|
+
Lexer.prototype.save = function() {
|
|
559
|
+
return {
|
|
560
|
+
line: this.line,
|
|
561
|
+
col: this.col,
|
|
562
|
+
state: this.state,
|
|
563
|
+
stack: this.stack.slice(),
|
|
564
|
+
queuedToken: this.queuedToken,
|
|
565
|
+
queuedText: this.queuedText,
|
|
566
|
+
queuedThrow: this.queuedThrow
|
|
567
|
+
};
|
|
568
|
+
};
|
|
569
|
+
Lexer.prototype.setState = function(state) {
|
|
570
|
+
if (!state || this.state === state)
|
|
571
|
+
return;
|
|
572
|
+
this.state = state;
|
|
573
|
+
var info = this.states[state];
|
|
574
|
+
this.groups = info.groups;
|
|
575
|
+
this.error = info.error;
|
|
576
|
+
this.re = info.regexp;
|
|
577
|
+
this.fast = info.fast;
|
|
578
|
+
};
|
|
579
|
+
Lexer.prototype.popState = function() {
|
|
580
|
+
this.setState(this.stack.pop());
|
|
581
|
+
};
|
|
582
|
+
Lexer.prototype.pushState = function(state) {
|
|
583
|
+
this.stack.push(this.state);
|
|
584
|
+
this.setState(state);
|
|
585
|
+
};
|
|
586
|
+
var eat = hasSticky ? function(re, buffer) {
|
|
587
|
+
return re.exec(buffer);
|
|
588
|
+
} : function(re, buffer) {
|
|
589
|
+
var match = re.exec(buffer);
|
|
590
|
+
if (match[0].length === 0) {
|
|
591
|
+
return null;
|
|
592
|
+
}
|
|
593
|
+
return match;
|
|
594
|
+
};
|
|
595
|
+
Lexer.prototype._getGroup = function(match) {
|
|
596
|
+
var groupCount = this.groups.length;
|
|
597
|
+
for (var i3 = 0; i3 < groupCount; i3++) {
|
|
598
|
+
if (match[i3 + 1] !== void 0) {
|
|
599
|
+
return this.groups[i3];
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
throw new Error("Cannot find token type for matched text");
|
|
603
|
+
};
|
|
604
|
+
function tokenToString() {
|
|
605
|
+
return this.value;
|
|
606
|
+
}
|
|
607
|
+
Lexer.prototype.next = function() {
|
|
608
|
+
var index = this.index;
|
|
609
|
+
if (this.queuedGroup) {
|
|
610
|
+
var token = this._token(this.queuedGroup, this.queuedText, index);
|
|
611
|
+
this.queuedGroup = null;
|
|
612
|
+
this.queuedText = "";
|
|
613
|
+
return token;
|
|
614
|
+
}
|
|
615
|
+
var buffer = this.buffer;
|
|
616
|
+
if (index === buffer.length) {
|
|
617
|
+
return;
|
|
618
|
+
}
|
|
619
|
+
var group = this.fast[buffer.charCodeAt(index)];
|
|
620
|
+
if (group) {
|
|
621
|
+
return this._token(group, buffer.charAt(index), index);
|
|
622
|
+
}
|
|
623
|
+
var re = this.re;
|
|
624
|
+
re.lastIndex = index;
|
|
625
|
+
var match = eat(re, buffer);
|
|
626
|
+
var error = this.error;
|
|
627
|
+
if (match == null) {
|
|
628
|
+
return this._token(error, buffer.slice(index, buffer.length), index);
|
|
629
|
+
}
|
|
630
|
+
var group = this._getGroup(match);
|
|
631
|
+
var text = match[0];
|
|
632
|
+
if (error.fallback && match.index !== index) {
|
|
633
|
+
this.queuedGroup = group;
|
|
634
|
+
this.queuedText = text;
|
|
635
|
+
return this._token(error, buffer.slice(index, match.index), index);
|
|
636
|
+
}
|
|
637
|
+
return this._token(group, text, index);
|
|
638
|
+
};
|
|
639
|
+
Lexer.prototype._token = function(group, text, offset) {
|
|
640
|
+
var lineBreaks = 0;
|
|
641
|
+
if (group.lineBreaks) {
|
|
642
|
+
var matchNL = /\n/g;
|
|
643
|
+
var nl = 1;
|
|
644
|
+
if (text === "\n") {
|
|
645
|
+
lineBreaks = 1;
|
|
646
|
+
} else {
|
|
647
|
+
while (matchNL.exec(text)) {
|
|
648
|
+
lineBreaks++;
|
|
649
|
+
nl = matchNL.lastIndex;
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
var token = {
|
|
654
|
+
type: typeof group.type === "function" && group.type(text) || group.defaultType,
|
|
655
|
+
value: typeof group.value === "function" ? group.value(text) : text,
|
|
656
|
+
text,
|
|
657
|
+
toString: tokenToString,
|
|
658
|
+
offset,
|
|
659
|
+
lineBreaks,
|
|
660
|
+
line: this.line,
|
|
661
|
+
col: this.col
|
|
662
|
+
};
|
|
663
|
+
var size = text.length;
|
|
664
|
+
this.index += size;
|
|
665
|
+
this.line += lineBreaks;
|
|
666
|
+
if (lineBreaks !== 0) {
|
|
667
|
+
this.col = size - nl + 1;
|
|
668
|
+
} else {
|
|
669
|
+
this.col += size;
|
|
670
|
+
}
|
|
671
|
+
if (group.shouldThrow) {
|
|
672
|
+
var err = new Error(this.formatError(token, "invalid syntax"));
|
|
673
|
+
throw err;
|
|
674
|
+
}
|
|
675
|
+
if (group.pop)
|
|
676
|
+
this.popState();
|
|
677
|
+
else if (group.push)
|
|
678
|
+
this.pushState(group.push);
|
|
679
|
+
else if (group.next)
|
|
680
|
+
this.setState(group.next);
|
|
681
|
+
return token;
|
|
682
|
+
};
|
|
683
|
+
if (typeof Symbol !== "undefined" && Symbol.iterator) {
|
|
684
|
+
var LexerIterator = function(lexer) {
|
|
685
|
+
this.lexer = lexer;
|
|
686
|
+
};
|
|
687
|
+
LexerIterator.prototype.next = function() {
|
|
688
|
+
var token = this.lexer.next();
|
|
689
|
+
return { value: token, done: !token };
|
|
690
|
+
};
|
|
691
|
+
LexerIterator.prototype[Symbol.iterator] = function() {
|
|
692
|
+
return this;
|
|
693
|
+
};
|
|
694
|
+
Lexer.prototype[Symbol.iterator] = function() {
|
|
695
|
+
return new LexerIterator(this);
|
|
696
|
+
};
|
|
697
|
+
}
|
|
698
|
+
Lexer.prototype.formatError = function(token, message) {
|
|
699
|
+
if (token == null) {
|
|
700
|
+
var text = this.buffer.slice(this.index);
|
|
701
|
+
var token = {
|
|
702
|
+
text,
|
|
703
|
+
offset: this.index,
|
|
704
|
+
lineBreaks: text.indexOf("\n") === -1 ? 0 : 1,
|
|
705
|
+
line: this.line,
|
|
706
|
+
col: this.col
|
|
707
|
+
};
|
|
708
|
+
}
|
|
709
|
+
var numLinesAround = 2;
|
|
710
|
+
var firstDisplayedLine = Math.max(token.line - numLinesAround, 1);
|
|
711
|
+
var lastDisplayedLine = token.line + numLinesAround;
|
|
712
|
+
var lastLineDigits = String(lastDisplayedLine).length;
|
|
713
|
+
var displayedLines = lastNLines(
|
|
714
|
+
this.buffer,
|
|
715
|
+
this.line - token.line + numLinesAround + 1
|
|
716
|
+
).slice(0, 5);
|
|
717
|
+
var errorLines = [];
|
|
718
|
+
errorLines.push(message + " at line " + token.line + " col " + token.col + ":");
|
|
719
|
+
errorLines.push("");
|
|
720
|
+
for (var i3 = 0; i3 < displayedLines.length; i3++) {
|
|
721
|
+
var line = displayedLines[i3];
|
|
722
|
+
var lineNo = firstDisplayedLine + i3;
|
|
723
|
+
errorLines.push(pad(String(lineNo), lastLineDigits) + " " + line);
|
|
724
|
+
if (lineNo === token.line) {
|
|
725
|
+
errorLines.push(pad("", lastLineDigits + token.col + 1) + "^");
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
return errorLines.join("\n");
|
|
729
|
+
};
|
|
730
|
+
Lexer.prototype.clone = function() {
|
|
731
|
+
return new Lexer(this.states, this.state);
|
|
732
|
+
};
|
|
733
|
+
Lexer.prototype.has = function(tokenType) {
|
|
734
|
+
return true;
|
|
735
|
+
};
|
|
736
|
+
return {
|
|
737
|
+
compile,
|
|
738
|
+
states: compileStates,
|
|
739
|
+
error: Object.freeze({ error: true }),
|
|
740
|
+
fallback: Object.freeze({ fallback: true }),
|
|
741
|
+
keywords: keywordTransform
|
|
742
|
+
};
|
|
743
|
+
});
|
|
744
|
+
}
|
|
745
|
+
});
|
|
746
|
+
|
|
747
|
+
// node_modules/.pnpm/@messageformat+parser@5.1.0/node_modules/@messageformat/parser/lib/lexer.js
|
|
748
|
+
var require_lexer = __commonJS({
|
|
749
|
+
"node_modules/.pnpm/@messageformat+parser@5.1.0/node_modules/@messageformat/parser/lib/lexer.js"(exports) {
|
|
750
|
+
"use strict";
|
|
751
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
752
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
753
|
+
};
|
|
754
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
755
|
+
exports.lexer = exports.states = void 0;
|
|
756
|
+
var moo_1 = __importDefault(require_moo());
|
|
757
|
+
exports.states = {
|
|
758
|
+
body: {
|
|
759
|
+
doubleapos: { match: "''", value: () => "'" },
|
|
760
|
+
quoted: {
|
|
761
|
+
lineBreaks: true,
|
|
762
|
+
match: /'[{}#](?:[^]*?[^'])?'(?!')/u,
|
|
763
|
+
value: (src) => src.slice(1, -1).replace(/''/g, "'")
|
|
764
|
+
},
|
|
765
|
+
argument: {
|
|
766
|
+
lineBreaks: true,
|
|
767
|
+
match: /\{\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*/u,
|
|
768
|
+
push: "arg",
|
|
769
|
+
value: (src) => src.substring(1).trim()
|
|
770
|
+
},
|
|
771
|
+
octothorpe: "#",
|
|
772
|
+
end: { match: "}", pop: 1 },
|
|
773
|
+
content: { lineBreaks: true, match: /[^][^{}#']*/u }
|
|
774
|
+
},
|
|
775
|
+
arg: {
|
|
776
|
+
select: {
|
|
777
|
+
lineBreaks: true,
|
|
778
|
+
match: /,\s*(?:plural|select|selectordinal)\s*,\s*/u,
|
|
779
|
+
next: "select",
|
|
780
|
+
value: (src) => src.split(",")[1].trim()
|
|
781
|
+
},
|
|
782
|
+
"func-args": {
|
|
783
|
+
lineBreaks: true,
|
|
784
|
+
match: /,\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*,/u,
|
|
785
|
+
next: "body",
|
|
786
|
+
value: (src) => src.split(",")[1].trim()
|
|
787
|
+
},
|
|
788
|
+
"func-simple": {
|
|
789
|
+
lineBreaks: true,
|
|
790
|
+
match: /,\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*/u,
|
|
791
|
+
value: (src) => src.substring(1).trim()
|
|
792
|
+
},
|
|
793
|
+
end: { match: "}", pop: 1 }
|
|
794
|
+
},
|
|
795
|
+
select: {
|
|
796
|
+
offset: {
|
|
797
|
+
lineBreaks: true,
|
|
798
|
+
match: /\s*offset\s*:\s*\d+\s*/u,
|
|
799
|
+
value: (src) => src.split(":")[1].trim()
|
|
800
|
+
},
|
|
801
|
+
case: {
|
|
802
|
+
lineBreaks: true,
|
|
803
|
+
match: /\s*(?:=\d+|[^\p{Pat_Syn}\p{Pat_WS}]+)\s*\{/u,
|
|
804
|
+
push: "body",
|
|
805
|
+
value: (src) => src.substring(0, src.indexOf("{")).trim()
|
|
806
|
+
},
|
|
807
|
+
end: { match: /\s*\}/u, pop: 1 }
|
|
808
|
+
}
|
|
809
|
+
};
|
|
810
|
+
exports.lexer = moo_1.default.states(exports.states);
|
|
811
|
+
}
|
|
812
|
+
});
|
|
813
|
+
|
|
814
|
+
// node_modules/.pnpm/@messageformat+parser@5.1.0/node_modules/@messageformat/parser/lib/parser.js
|
|
815
|
+
var require_parser = __commonJS({
|
|
816
|
+
"node_modules/.pnpm/@messageformat+parser@5.1.0/node_modules/@messageformat/parser/lib/parser.js"(exports) {
|
|
817
|
+
"use strict";
|
|
818
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
819
|
+
exports.parse = exports.ParseError = void 0;
|
|
820
|
+
var lexer_js_1 = require_lexer();
|
|
821
|
+
var getContext = (lt) => ({
|
|
822
|
+
offset: lt.offset,
|
|
823
|
+
line: lt.line,
|
|
824
|
+
col: lt.col,
|
|
825
|
+
text: lt.text,
|
|
826
|
+
lineBreaks: lt.lineBreaks
|
|
827
|
+
});
|
|
828
|
+
var isSelectType = (type) => type === "plural" || type === "select" || type === "selectordinal";
|
|
829
|
+
function strictArgStyleParam(lt, param) {
|
|
830
|
+
let value = "";
|
|
831
|
+
let text = "";
|
|
832
|
+
for (const p3 of param) {
|
|
833
|
+
const pText = p3.ctx.text;
|
|
834
|
+
text += pText;
|
|
835
|
+
switch (p3.type) {
|
|
836
|
+
case "content":
|
|
837
|
+
value += p3.value;
|
|
838
|
+
break;
|
|
839
|
+
case "argument":
|
|
840
|
+
case "function":
|
|
841
|
+
case "octothorpe":
|
|
842
|
+
value += pText;
|
|
843
|
+
break;
|
|
844
|
+
default:
|
|
845
|
+
throw new ParseError(lt, `Unsupported part in strict mode function arg style: ${pText}`);
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
const c3 = {
|
|
849
|
+
type: "content",
|
|
850
|
+
value: value.trim(),
|
|
851
|
+
ctx: Object.assign({}, param[0].ctx, { text })
|
|
852
|
+
};
|
|
853
|
+
return [c3];
|
|
854
|
+
}
|
|
855
|
+
var strictArgTypes = [
|
|
856
|
+
"number",
|
|
857
|
+
"date",
|
|
858
|
+
"time",
|
|
859
|
+
"spellout",
|
|
860
|
+
"ordinal",
|
|
861
|
+
"duration"
|
|
862
|
+
];
|
|
863
|
+
var defaultPluralKeys = ["zero", "one", "two", "few", "many", "other"];
|
|
864
|
+
var ParseError = class extends Error {
|
|
865
|
+
/** @internal */
|
|
866
|
+
constructor(lt, msg) {
|
|
867
|
+
super(lexer_js_1.lexer.formatError(lt, msg));
|
|
868
|
+
}
|
|
869
|
+
};
|
|
870
|
+
exports.ParseError = ParseError;
|
|
871
|
+
var Parser = class {
|
|
872
|
+
constructor(src, opt) {
|
|
873
|
+
var _a, _b, _c, _d;
|
|
874
|
+
this.lexer = lexer_js_1.lexer.reset(src);
|
|
875
|
+
this.cardinalKeys = (_a = opt === null || opt === void 0 ? void 0 : opt.cardinal) !== null && _a !== void 0 ? _a : defaultPluralKeys;
|
|
876
|
+
this.ordinalKeys = (_b = opt === null || opt === void 0 ? void 0 : opt.ordinal) !== null && _b !== void 0 ? _b : defaultPluralKeys;
|
|
877
|
+
this.strict = (_c = opt === null || opt === void 0 ? void 0 : opt.strict) !== null && _c !== void 0 ? _c : false;
|
|
878
|
+
this.strictPluralKeys = (_d = opt === null || opt === void 0 ? void 0 : opt.strictPluralKeys) !== null && _d !== void 0 ? _d : true;
|
|
879
|
+
}
|
|
880
|
+
parse() {
|
|
881
|
+
return this.parseBody(false, true);
|
|
882
|
+
}
|
|
883
|
+
checkSelectKey(lt, type, key) {
|
|
884
|
+
if (key[0] === "=") {
|
|
885
|
+
if (type === "select")
|
|
886
|
+
throw new ParseError(lt, `The case ${key} is not valid with select`);
|
|
887
|
+
} else if (type !== "select") {
|
|
888
|
+
const keys = type === "plural" ? this.cardinalKeys : this.ordinalKeys;
|
|
889
|
+
if (this.strictPluralKeys && keys.length > 0 && !keys.includes(key)) {
|
|
890
|
+
const msg = `The ${type} case ${key} is not valid in this locale`;
|
|
891
|
+
throw new ParseError(lt, msg);
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
parseSelect({ value: arg }, inPlural, ctx, type) {
|
|
896
|
+
const sel = { type, arg, cases: [], ctx };
|
|
897
|
+
if (type === "plural" || type === "selectordinal")
|
|
898
|
+
inPlural = true;
|
|
899
|
+
else if (this.strict)
|
|
900
|
+
inPlural = false;
|
|
901
|
+
for (const lt of this.lexer) {
|
|
902
|
+
switch (lt.type) {
|
|
903
|
+
case "offset":
|
|
904
|
+
if (type === "select")
|
|
905
|
+
throw new ParseError(lt, "Unexpected plural offset for select");
|
|
906
|
+
if (sel.cases.length > 0)
|
|
907
|
+
throw new ParseError(lt, "Plural offset must be set before cases");
|
|
908
|
+
sel.pluralOffset = Number(lt.value);
|
|
909
|
+
ctx.text += lt.text;
|
|
910
|
+
ctx.lineBreaks += lt.lineBreaks;
|
|
911
|
+
break;
|
|
912
|
+
case "case": {
|
|
913
|
+
this.checkSelectKey(lt, type, lt.value);
|
|
914
|
+
sel.cases.push({
|
|
915
|
+
key: lt.value,
|
|
916
|
+
tokens: this.parseBody(inPlural),
|
|
917
|
+
ctx: getContext(lt)
|
|
918
|
+
});
|
|
919
|
+
break;
|
|
920
|
+
}
|
|
921
|
+
case "end":
|
|
922
|
+
return sel;
|
|
923
|
+
default:
|
|
924
|
+
throw new ParseError(lt, `Unexpected lexer token: ${lt.type}`);
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
throw new ParseError(null, "Unexpected message end");
|
|
928
|
+
}
|
|
929
|
+
parseArgToken(lt, inPlural) {
|
|
930
|
+
const ctx = getContext(lt);
|
|
931
|
+
const argType = this.lexer.next();
|
|
932
|
+
if (!argType)
|
|
933
|
+
throw new ParseError(null, "Unexpected message end");
|
|
934
|
+
ctx.text += argType.text;
|
|
935
|
+
ctx.lineBreaks += argType.lineBreaks;
|
|
936
|
+
if (this.strict && (argType.type === "func-simple" || argType.type === "func-args") && !strictArgTypes.includes(argType.value)) {
|
|
937
|
+
const msg = `Invalid strict mode function arg type: ${argType.value}`;
|
|
938
|
+
throw new ParseError(lt, msg);
|
|
939
|
+
}
|
|
940
|
+
switch (argType.type) {
|
|
941
|
+
case "end":
|
|
942
|
+
return { type: "argument", arg: lt.value, ctx };
|
|
943
|
+
case "func-simple": {
|
|
944
|
+
const end = this.lexer.next();
|
|
945
|
+
if (!end)
|
|
946
|
+
throw new ParseError(null, "Unexpected message end");
|
|
947
|
+
if (end.type !== "end")
|
|
948
|
+
throw new ParseError(end, `Unexpected lexer token: ${end.type}`);
|
|
949
|
+
ctx.text += end.text;
|
|
950
|
+
if (isSelectType(argType.value.toLowerCase()))
|
|
951
|
+
throw new ParseError(argType, `Invalid type identifier: ${argType.value}`);
|
|
952
|
+
return {
|
|
953
|
+
type: "function",
|
|
954
|
+
arg: lt.value,
|
|
955
|
+
key: argType.value,
|
|
956
|
+
ctx
|
|
957
|
+
};
|
|
958
|
+
}
|
|
959
|
+
case "func-args": {
|
|
960
|
+
if (isSelectType(argType.value.toLowerCase())) {
|
|
961
|
+
const msg = `Invalid type identifier: ${argType.value}`;
|
|
962
|
+
throw new ParseError(argType, msg);
|
|
963
|
+
}
|
|
964
|
+
let param = this.parseBody(this.strict ? false : inPlural);
|
|
965
|
+
if (this.strict && param.length > 0)
|
|
966
|
+
param = strictArgStyleParam(lt, param);
|
|
967
|
+
return {
|
|
968
|
+
type: "function",
|
|
969
|
+
arg: lt.value,
|
|
970
|
+
key: argType.value,
|
|
971
|
+
param,
|
|
972
|
+
ctx
|
|
973
|
+
};
|
|
974
|
+
}
|
|
975
|
+
case "select":
|
|
976
|
+
if (isSelectType(argType.value))
|
|
977
|
+
return this.parseSelect(lt, inPlural, ctx, argType.value);
|
|
978
|
+
else
|
|
979
|
+
throw new ParseError(argType, `Unexpected select type ${argType.value}`);
|
|
980
|
+
default:
|
|
981
|
+
throw new ParseError(argType, `Unexpected lexer token: ${argType.type}`);
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
parseBody(inPlural, atRoot) {
|
|
985
|
+
const tokens = [];
|
|
986
|
+
let content = null;
|
|
987
|
+
for (const lt of this.lexer) {
|
|
988
|
+
if (lt.type === "argument") {
|
|
989
|
+
if (content)
|
|
990
|
+
content = null;
|
|
991
|
+
tokens.push(this.parseArgToken(lt, inPlural));
|
|
992
|
+
} else if (lt.type === "octothorpe" && inPlural) {
|
|
993
|
+
if (content)
|
|
994
|
+
content = null;
|
|
995
|
+
tokens.push({ type: "octothorpe", ctx: getContext(lt) });
|
|
996
|
+
} else if (lt.type === "end" && !atRoot) {
|
|
997
|
+
return tokens;
|
|
998
|
+
} else {
|
|
999
|
+
let value = lt.value;
|
|
1000
|
+
if (!inPlural && lt.type === "quoted" && value[0] === "#") {
|
|
1001
|
+
if (value.includes("{")) {
|
|
1002
|
+
const errMsg = `Unsupported escape pattern: ${value}`;
|
|
1003
|
+
throw new ParseError(lt, errMsg);
|
|
1004
|
+
}
|
|
1005
|
+
value = lt.text;
|
|
1006
|
+
}
|
|
1007
|
+
if (content) {
|
|
1008
|
+
content.value += value;
|
|
1009
|
+
content.ctx.text += lt.text;
|
|
1010
|
+
content.ctx.lineBreaks += lt.lineBreaks;
|
|
1011
|
+
} else {
|
|
1012
|
+
content = { type: "content", value, ctx: getContext(lt) };
|
|
1013
|
+
tokens.push(content);
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
if (atRoot)
|
|
1018
|
+
return tokens;
|
|
1019
|
+
throw new ParseError(null, "Unexpected message end");
|
|
1020
|
+
}
|
|
1021
|
+
};
|
|
1022
|
+
function parse2(src, options = {}) {
|
|
1023
|
+
const parser = new Parser(src, options);
|
|
1024
|
+
return parser.parse();
|
|
1025
|
+
}
|
|
1026
|
+
exports.parse = parse2;
|
|
1027
|
+
}
|
|
1028
|
+
});
|
|
1029
|
+
|
|
1030
|
+
// packages/attention/index.js
|
|
1031
|
+
import { css, html as html2, nothing } from "lit";
|
|
1032
|
+
import WarpElement from "@warp-ds/elements-core";
|
|
1033
|
+
import { ifDefined } from "lit/directives/if-defined.js";
|
|
1034
|
+
|
|
1035
|
+
// packages/utils/index.js
|
|
1036
|
+
import { classMap } from "lit/directives/class-map.js";
|
|
1037
|
+
var camelCaseToKebabCase = (str) => str.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
1038
|
+
function kebabCaseAttributes(constructor) {
|
|
1039
|
+
return class extends constructor {
|
|
1040
|
+
static createProperty(name, options) {
|
|
1041
|
+
let customOptions = options;
|
|
1042
|
+
if (typeof (options == null ? void 0 : options.attribute) === "undefined" || (options == null ? void 0 : options.attribute) === true) {
|
|
1043
|
+
customOptions = Object.assign({}, options, {
|
|
1044
|
+
attribute: camelCaseToKebabCase(name.toString())
|
|
1045
|
+
});
|
|
1046
|
+
}
|
|
1047
|
+
super.createProperty(name, customOptions);
|
|
1048
|
+
}
|
|
1049
|
+
};
|
|
1050
|
+
}
|
|
1051
|
+
function classes(defn) {
|
|
1052
|
+
const classes2 = [];
|
|
1053
|
+
for (const [key, value] of Object.entries(defn)) {
|
|
1054
|
+
if (value)
|
|
1055
|
+
classes2.push(key);
|
|
1056
|
+
}
|
|
1057
|
+
return classes2.join(" ");
|
|
1058
|
+
}
|
|
1059
|
+
function generateRandomId() {
|
|
1060
|
+
return `m${Math.random().toString(36).slice(2)}`;
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
// node_modules/.pnpm/@warp-ds+css@1.4.2/node_modules/@warp-ds/css/component-classes/index.js
|
|
1064
|
+
var box = {
|
|
1065
|
+
box: "group block relative break-words last-child:mb-0 p-16 rounded-8",
|
|
1066
|
+
// Relative here enables w-clickable
|
|
1067
|
+
bleed: "-mx-16 sm:mx-0 rounded-l-0 rounded-r-0 sm:rounded-8",
|
|
1068
|
+
// We target L and R to override the default rounded-8
|
|
1069
|
+
info: "i-bg-$color-box-info-background i-text-$color-box-info-text",
|
|
1070
|
+
neutral: "i-bg-$color-box-neutral-background i-text-$color-box-neutral-text",
|
|
1071
|
+
bordered: "border-2 i-border-$color-box-bordered-border i-bg-$color-box-bordered-background i-text-$color-box-bordered-text",
|
|
1072
|
+
infoClickable: "hover:i-bg-$color-box-info-background-hover active:i-bg-$color-box-info-background-hover",
|
|
1073
|
+
neutralClickable: "hover:i-bg-$color-box-neutral-background-hover active:i-bg-$color-box-neutral-background-hover",
|
|
1074
|
+
borderedClickable: "hover:i-bg-$color-box-bordered-background-hover active:i-bg-$color-box-bordered-background-hover hover:i-border-$color-box-bordered-border-hover active:i-border-$color-box-bordered-border-hover"
|
|
1075
|
+
};
|
|
1076
|
+
var buttonReset = "focus:outline-none appearance-none cursor-pointer bg-transparent border-0 m-0 p-0 inline-block";
|
|
1077
|
+
var expandable = {
|
|
1078
|
+
expandable: "will-change-height",
|
|
1079
|
+
expandableTitle: "font-bold i-text-$color-expandable-title-text",
|
|
1080
|
+
expandableBox: "i-bg-$color-expandable-background hover:i-bg-$color-expandable-background-hover py-0 px-0 " + box.box,
|
|
1081
|
+
expandableBleed: box.bleed,
|
|
1082
|
+
chevron: "inline-block align-middle i-text-$color-expandable-icon",
|
|
1083
|
+
chevronNonBox: "ml-8",
|
|
1084
|
+
chevronBox: "",
|
|
1085
|
+
chevronTransform: "transform transition-transform transform-gpu ease-in-out",
|
|
1086
|
+
chevronExpand: "-rotate-180",
|
|
1087
|
+
chevronCollapse: "rotate-180",
|
|
1088
|
+
elementsTransformChevronDownPart: "part-[w-icon-chevron-down-16-part]:transform part-[w-icon-chevron-down-16-part]:transition-transform part-[w-icon-chevron-down-16-part]:transform-gpu part-[w-icon-chevron-down-16-part]:ease-in-out",
|
|
1089
|
+
elementsChevronDownExpandPart: "part-[w-icon-chevron-down-16-part]:-rotate-180",
|
|
1090
|
+
elementsTransformChevronUpPart: "part-[w-icon-chevron-up-16-part]:transform part-[w-icon-chevron-up-16-part]:transition-transform part-[w-icon-chevron-up-16-part]:transform-gpu part-[w-icon-chevron-up-16-part]:ease-in-out",
|
|
1091
|
+
elementsChevronUpCollapsePart: "part-[w-icon-chevron-up-16-part]:rotate-180",
|
|
1092
|
+
expansion: "overflow-hidden",
|
|
1093
|
+
expansionNotExpanded: "h-0 invisible",
|
|
1094
|
+
button: buttonReset + " hover:underline focus-visible:underline",
|
|
1095
|
+
buttonBox: "w-full text-left relative inline-flex items-center justify-between " + box.box,
|
|
1096
|
+
paddingTop: "pt-0",
|
|
1097
|
+
title: "flex w-full justify-between items-center",
|
|
1098
|
+
titleType: "h4"
|
|
1099
|
+
};
|
|
1100
|
+
var buttonDefaultStyling = "font-bold focusable justify-center transition-colors ease-in-out";
|
|
1101
|
+
var buttonColors = {
|
|
1102
|
+
primary: "i-text-$color-button-primary-text hover:i-text-$color-button-primary-text i-bg-$color-button-primary-background hover:i-bg-$color-button-primary-background-hover active:i-bg-$color-button-primary-background-active",
|
|
1103
|
+
secondary: "i-text-$color-button-secondary-text hover:i-text-$color-button-secondary-text i-border-$color-button-secondary-border i-bg-$color-button-secondary-background hover:i-bg-$color-button-secondary-background-hover hover:i-border-$color-button-secondary-border-hover active:i-bg-$color-button-secondary-background-active",
|
|
1104
|
+
utility: "i-text-$color-button-utility-text hover:i-text-$color-button-utility-text i-bg-$color-button-utility-background i-border-$color-button-utility-border hover:i-bg-$color-button-utility-background hover:i-border-$color-button-utility-border-hover active:i-border-$color-button-utility-border-active",
|
|
1105
|
+
destructive: "i-bg-$color-button-negative-background i-text-$color-button-negative-text hover:i-text-$color-button-negative-text hover:i-bg-$color-button-negative-background-hover active:i-bg-$color-button-negative-background-active",
|
|
1106
|
+
pill: "i-text-$color-button-pill-icon hover:i-text-$color-button-pill-icon-hover active:i-text-$color-button-pill-icon-active i-bg-$color-button-pill-background hover:i-bg-$color-button-pill-background-hover active:i-bg-$color-button-pill-background-active",
|
|
1107
|
+
disabled: "i-text-$color-button-disabled-text i-bg-$color-button-disabled-background",
|
|
1108
|
+
quiet: "i-bg-$color-button-quiet-background i-text-$color-button-quiet-text hover:i-bg-$color-button-quiet-background-hover active:i-bg-$color-button-quiet-background-active",
|
|
1109
|
+
utilityQuiet: "i-text-$color-button-utility-quiet-text i-bg-$color-button-utility-quiet-background hover:i-bg-$color-button-utility-quiet-background-hover",
|
|
1110
|
+
negativeQuiet: "i-bg-$color-button-negative-quiet-background i-text-$color-button-negative-quiet-text hover:i-bg-$color-button-negative-quiet-background-hover active:i-bg-$color-button-negative-quiet-background-active",
|
|
1111
|
+
loading: "i-text-$color-button-loading-text i-bg-$color-button-loading-background",
|
|
1112
|
+
link: "i-text-$color-button-link-text"
|
|
1113
|
+
};
|
|
1114
|
+
var buttonTypes = {
|
|
1115
|
+
primary: `border-0 rounded-8 ${buttonDefaultStyling}`,
|
|
1116
|
+
secondary: `border-2 rounded-8 ${buttonDefaultStyling}`,
|
|
1117
|
+
utility: `border rounded-4 ${buttonDefaultStyling}`,
|
|
1118
|
+
negative: `border-0 rounded-8 ${buttonDefaultStyling}`,
|
|
1119
|
+
pill: `p-4 rounded-full border-0 inline-flex items-center justify-center hover:bg-clip-padding ${buttonDefaultStyling}`,
|
|
1120
|
+
link: `bg-transparent focusable ease-in-out inline active:underline hover:underline ${buttonColors.link}`
|
|
1121
|
+
};
|
|
1122
|
+
var buttonSizes = {
|
|
1123
|
+
xsmall: "py-6 px-16",
|
|
1124
|
+
small: "py-8 px-16",
|
|
1125
|
+
medium: "py-10 px-14",
|
|
1126
|
+
large: "py-12 px-16",
|
|
1127
|
+
utility: "py-[11px] px-[15px]",
|
|
1128
|
+
smallUtility: "py-[7px] px-[15px]",
|
|
1129
|
+
pill: "min-h-[44px] min-w-[44px]",
|
|
1130
|
+
pillSmall: "min-h-32 min-w-32",
|
|
1131
|
+
link: "p-0"
|
|
1132
|
+
};
|
|
1133
|
+
var buttonTextSizes = {
|
|
1134
|
+
medium: "text-m leading-[24]",
|
|
1135
|
+
xsmall: "text-xs"
|
|
1136
|
+
};
|
|
1137
|
+
var buttonVariants = {
|
|
1138
|
+
inProgress: `border-transparent animate-inprogress pointer-events-none ${buttonColors.loading}`,
|
|
1139
|
+
// .button--in-progress, a.button--in-progress:visited
|
|
1140
|
+
quiet: `border-0 rounded-8 ${buttonDefaultStyling}`,
|
|
1141
|
+
utilityQuiet: `border-0 rounded-4 ${buttonDefaultStyling}`,
|
|
1142
|
+
negativeQuiet: `border-0 rounded-8 ${buttonDefaultStyling}`,
|
|
1143
|
+
isDisabled: `font-bold justify-center transition-colors ease-in-out cursor-default pointer-events-none ${buttonColors.disabled}`
|
|
1144
|
+
// .button:disabled, .button--is-disabled
|
|
1145
|
+
};
|
|
1146
|
+
var button = {
|
|
1147
|
+
// Buttontypes
|
|
1148
|
+
secondary: `${buttonSizes.medium} ${buttonTextSizes.medium} ${buttonTypes.secondary} ${buttonColors.secondary}`,
|
|
1149
|
+
// .button--secondary, .button--default, .button
|
|
1150
|
+
secondaryHref: `${buttonSizes.medium} ${buttonTextSizes.medium} ${buttonTypes.secondary} ${buttonColors.secondary}`,
|
|
1151
|
+
secondaryDisabled: `${buttonSizes.medium} ${buttonTextSizes.medium} ${buttonTypes.secondary} ${buttonVariants.isDisabled}`,
|
|
1152
|
+
secondarySmall: `${buttonTextSizes.xsmall} ${buttonSizes.xsmall} ${buttonTypes.secondary} ${buttonColors.secondary}`,
|
|
1153
|
+
secondarySmallDisabled: `${buttonTextSizes.xsmall} ${buttonSizes.xsmall} ${buttonTypes.secondary} ${buttonVariants.isDisabled}`,
|
|
1154
|
+
secondaryQuiet: `${buttonSizes.medium} ${buttonTextSizes.medium} ${buttonVariants.quiet} ${buttonColors.quiet}`,
|
|
1155
|
+
secondaryQuietDisabled: `${buttonSizes.medium} ${buttonTextSizes.medium} ${buttonVariants.quiet} ${buttonVariants.isDisabled}`,
|
|
1156
|
+
secondarySmallQuiet: `${buttonTextSizes.xsmall} ${buttonSizes.xsmall} ${buttonVariants.quiet} ${buttonColors.quiet}`,
|
|
1157
|
+
secondarySmallQuietDisabled: `${buttonTextSizes.xsmall} ${buttonSizes.xsmall} ${buttonVariants.quiet} ${buttonVariants.isDisabled}`,
|
|
1158
|
+
secondaryLoading: `${buttonSizes.medium} ${buttonTextSizes.medium} ${buttonTypes.secondary} ${buttonVariants.inProgress}`,
|
|
1159
|
+
secondarySmallLoading: `${buttonTextSizes.xsmall} ${buttonSizes.xsmall} ${buttonTypes.secondary} ${buttonVariants.inProgress}`,
|
|
1160
|
+
secondarySmallQuietLoading: `${buttonTextSizes.xsmall} ${buttonSizes.xsmall} ${buttonVariants.quiet} ${buttonVariants.inProgress}`,
|
|
1161
|
+
secondaryQuietLoading: `${buttonSizes.medium} ${buttonTextSizes.medium} ${buttonVariants.quiet} ${buttonVariants.inProgress}`,
|
|
1162
|
+
primary: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonTypes.primary} ${buttonColors.primary}`,
|
|
1163
|
+
// .button--primary, .button--cta
|
|
1164
|
+
primaryDisabled: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.isDisabled} ${buttonTypes.primary}`,
|
|
1165
|
+
primarySmall: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonTypes.primary} ${buttonColors.primary}`,
|
|
1166
|
+
primarySmallDisabled: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.isDisabled} ${buttonTypes.primary} `,
|
|
1167
|
+
primaryQuiet: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.quiet} ${buttonColors.quiet}`,
|
|
1168
|
+
primaryQuietDisabled: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.quiet} ${buttonVariants.isDisabled}`,
|
|
1169
|
+
primarySmallQuiet: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.quiet} ${buttonColors.quiet}`,
|
|
1170
|
+
primarySmallQuietDisabled: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.quiet} ${buttonVariants.isDisabled}`,
|
|
1171
|
+
primaryLoading: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.inProgress} ${buttonTypes.primary}`,
|
|
1172
|
+
primarySmallLoading: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.inProgress} ${buttonTypes.primary}`,
|
|
1173
|
+
primarySmallQuietLoading: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.quiet} ${buttonVariants.inProgress} ${buttonTypes.primary}`,
|
|
1174
|
+
primaryQuietLoading: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.quiet} ${buttonVariants.inProgress}`,
|
|
1175
|
+
utility: `${buttonSizes.utility} ${buttonTextSizes.medium} ${buttonTypes.utility} ${buttonColors.utility}`,
|
|
1176
|
+
// .button--utility
|
|
1177
|
+
utilityDisabled: `${buttonSizes.utility} ${buttonTextSizes.medium} ${buttonTypes.utility} ${buttonVariants.isDisabled}`,
|
|
1178
|
+
utilityQuiet: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.utilityQuiet} ${buttonColors.utilityQuiet}`,
|
|
1179
|
+
// .button--utility-flat
|
|
1180
|
+
utilityQuietDisabled: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.utilityQuiet} ${buttonVariants.isDisabled}`,
|
|
1181
|
+
utilitySmall: `${buttonSizes.smallUtility} ${buttonTextSizes.xsmall} ${buttonTypes.utility} ${buttonColors.utility}`,
|
|
1182
|
+
utilitySmallDisabled: `${buttonSizes.smallUtility} ${buttonTextSizes.xsmall} ${buttonTypes.utility} ${buttonVariants.isDisabled}`,
|
|
1183
|
+
utilitySmallQuiet: `${buttonSizes.smallUtility} ${buttonTextSizes.xsmall} ${buttonVariants.utilityQuiet} ${buttonColors.utilityQuiet}`,
|
|
1184
|
+
utilitySmallQuietDisabled: `${buttonSizes.smallUtility} ${buttonTextSizes.xsmall} ${buttonVariants.utilityQuiet} ${buttonVariants.isDisabled}`,
|
|
1185
|
+
utilityLoading: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonTypes.utility} ${buttonVariants.inProgress}`,
|
|
1186
|
+
utilitySmallLoading: `${buttonSizes.smallUtility} ${buttonTextSizes.xsmall} ${buttonTypes.utility} ${buttonVariants.inProgress}`,
|
|
1187
|
+
utilityQuietLoading: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.inProgress} ${buttonVariants.utilityQuiet}`,
|
|
1188
|
+
utilitySmallQuietLoading: `${buttonSizes.smallUtility} ${buttonTextSizes.xsmall} ${buttonVariants.inProgress} ${buttonVariants.utilityQuiet}`,
|
|
1189
|
+
negative: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonTypes.negative} ${buttonColors.destructive}`,
|
|
1190
|
+
// .button--destructive
|
|
1191
|
+
negativeDisabled: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonTypes.negative} ${buttonVariants.isDisabled}`,
|
|
1192
|
+
negativeQuiet: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.negativeQuiet} ${buttonColors.negativeQuiet}`,
|
|
1193
|
+
// .button--destructive-flat
|
|
1194
|
+
negativeQuietDisabled: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.negativeQuiet}${buttonVariants.isDisabled}`,
|
|
1195
|
+
negativeSmall: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonTypes.negative} ${buttonColors.destructive}`,
|
|
1196
|
+
negativeSmallDisabled: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonTypes.negative} ${buttonVariants.isDisabled}`,
|
|
1197
|
+
negativeSmallQuiet: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.negativeQuiet} ${buttonColors.negativeQuiet}`,
|
|
1198
|
+
negativeSmallQuietDisabled: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.negativeQuiet} ${buttonVariants.isDisabled}`,
|
|
1199
|
+
negativeLoading: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonTypes.negative} ${buttonVariants.inProgress}`,
|
|
1200
|
+
negativeSmallLoading: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.inProgress} ${buttonTypes.negative}`,
|
|
1201
|
+
negativeQuietLoading: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.negativeQuiet} ${buttonTypes.negative} ${buttonVariants.inProgress}`,
|
|
1202
|
+
negativeSmallQuietLoading: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.negativeQuiet} ${buttonVariants.inProgress}`,
|
|
1203
|
+
pill: `${buttonSizes.pill} ${buttonTextSizes.medium} ${buttonTypes.pill} ${buttonColors.pill}`,
|
|
1204
|
+
// .button--pill
|
|
1205
|
+
pillSmall: `${buttonSizes.pillSmall} ${buttonTextSizes.xsmall} ${buttonTypes.pill} ${buttonColors.pill}`,
|
|
1206
|
+
pillLoading: `${buttonSizes.pill} ${buttonTextSizes.medium} ${buttonTypes.pill} ${buttonVariants.inProgress}`,
|
|
1207
|
+
pillSmallLoading: `${buttonSizes.pillSmall} ${buttonTextSizes.xsmall} ${buttonTypes.pill} ${buttonVariants.inProgress}`,
|
|
1208
|
+
link: `${buttonSizes.link} ${buttonTextSizes.medium} ${buttonTypes.link}`,
|
|
1209
|
+
linkSmall: `${buttonSizes.link} ${buttonTextSizes.xsmall} ${buttonTypes.link}`,
|
|
1210
|
+
linkAsButton: "inline-block hover:no-underline text-center",
|
|
1211
|
+
a11y: "sr-only",
|
|
1212
|
+
fullWidth: "w-full max-w-full",
|
|
1213
|
+
contentWidth: "max-w-max"
|
|
1214
|
+
};
|
|
1215
|
+
var modal = {
|
|
1216
|
+
//TODO: this class can be removed when we have the solution for opacity and we can add rgba values to the background of the backdrop
|
|
1217
|
+
transparentBg: `before:i-bg-$color-modal-backdrop-background before:content-[""] before:absolute before:top-0 before:bottom-0 before:left-0 before:right-0 before:opacity-25`,
|
|
1218
|
+
backdrop: "fixed inset-0 flex sm:place-content-center sm:place-items-center items-end z-30 [--w-modal-max-height:80%] [--w-modal-width:640px]",
|
|
1219
|
+
modal: "pb-safe-[32] i-shadow-$shadow-modal max-h-[--w-modal-max-height] min-h-[--w-modal-min-height] w-[--w-modal-width] h-[--w-modal-height] relative transition-300 ease-in-out backface-hidden will-change-height rounded-8 mx-0 sm:mx-16 i-bg-$color-modal-background flex flex-col overflow-hidden outline-none space-y-16 pt-8 sm:pt-32 sm:pb-32 rounded-b-0 sm:rounded-b-8",
|
|
1220
|
+
content: "block overflow-y-auto overflow-x-hidden last-child:mb-0 grow shrink px-16 sm:px-32 relative",
|
|
1221
|
+
footer: "flex justify-end shrink-0 px-16 sm:px-32",
|
|
1222
|
+
transitionTitle: "transition-all duration-300",
|
|
1223
|
+
transitionTitleCenter: "justify-self-center",
|
|
1224
|
+
transitionTitleColSpan: "col-span-2",
|
|
1225
|
+
title: "-mt-4 sm:-mt-8 h-40 sm:h-48 grid gap-8 sm:gap-16 grid-cols-[auto_1fr_auto] items-center px-16 sm:px-32 border-b sm:border-b-0 shrink-0",
|
|
1226
|
+
titleText: "mb-0 h4 sm:h3",
|
|
1227
|
+
titleButton: `${buttonTextSizes.medium} ${buttonTypes.pill} ${buttonColors.pill} sm:min-h-[44px] sm:min-w-[44px] min-h-[32px] min-w-[32px]`,
|
|
1228
|
+
titleButtonLeft: "-ml-8 sm:-ml-12 justify-self-start",
|
|
1229
|
+
titleButtonRight: "-mr-8 sm:-mr-12 justify-self-end",
|
|
1230
|
+
titleButtonIcon: "h-16 w-16 sm:h-24 sm:w-24",
|
|
1231
|
+
titleButtonIconRotated: "transform rotate-90"
|
|
1232
|
+
};
|
|
1233
|
+
var label = {
|
|
1234
|
+
label: "antialiased block relative text-s font-bold pb-4 cursor-pointer i-text-$color-label-text",
|
|
1235
|
+
labelInvalid: "i-text-$color-label-text-negative",
|
|
1236
|
+
optional: "pl-8 font-normal text-s i-text-$color-label-optional-text"
|
|
1237
|
+
};
|
|
1238
|
+
var prefixSuffixWrapperBase = "absolute top-0 bottom-0 flex justify-center items-center focusable focus:[--w-outline-offset:-2px] bg-transparent ";
|
|
1239
|
+
var suffix = {
|
|
1240
|
+
wrapper: prefixSuffixWrapperBase + "right-0",
|
|
1241
|
+
wrapperWithLabel: "w-max pr-12",
|
|
1242
|
+
wrapperWithIcon: "w-40",
|
|
1243
|
+
label: "antialiased block relative cursor-default pb-0 font-bold text-xs i-text-$color-label-text"
|
|
1244
|
+
};
|
|
1245
|
+
var prefix = {
|
|
1246
|
+
wrapper: prefixSuffixWrapperBase + "left-0",
|
|
1247
|
+
wrapperWithLabel: "w-max pl-12",
|
|
1248
|
+
wrapperWithIcon: "w-40",
|
|
1249
|
+
label: "antialiased block relative cursor-default pb-0 font-bold text-xs i-text-$color-label-text"
|
|
1250
|
+
};
|
|
1251
|
+
var clickable = {
|
|
1252
|
+
toggle: "absolute inset-0 h-full w-full appearance-none cursor-pointer focusable focusable-inset",
|
|
1253
|
+
label: `px-12 ${label.label} py-8! cursor-pointer focusable focusable-inset`,
|
|
1254
|
+
buttonOrLink: "bg-transparent focusable",
|
|
1255
|
+
buttonOrLinkStretch: "inset-0 absolute"
|
|
1256
|
+
};
|
|
1257
|
+
var attention = {
|
|
1258
|
+
base: "border-2 relative flex items-start",
|
|
1259
|
+
tooltip: "i-bg-$color-tooltip-background i-border-$color-tooltip-background i-shadow-$shadow-tooltip i-text-$color-tooltip-text rounded-4 py-6 px-8",
|
|
1260
|
+
callout: "i-bg-$color-callout-background i-border-$color-callout-border i-text-$color-callout-text py-8 px-16 rounded-8",
|
|
1261
|
+
highlight: "i-bg-$color-callout-background i-border-$color-callout-border i-text-$color-callout-text py-8 px-16 rounded-8 drop-shadow-m",
|
|
1262
|
+
popover: "i-bg-$color-popover-background i-border-$color-popover-background i-text-$color-popover-paragraph-text rounded-8 p-16 drop-shadow-m",
|
|
1263
|
+
arrowBase: "absolute h-[14px] w-[14px] border-2 border-b-0 border-r-0 rounded-tl-4 transform",
|
|
1264
|
+
arrowDirectionLeft: "-left-[8px]",
|
|
1265
|
+
arrowDirectionRight: "-right-[8px]",
|
|
1266
|
+
arrowDirectionBottom: "-bottom-[8px]",
|
|
1267
|
+
arrowDirectionTop: "-top-[8px]",
|
|
1268
|
+
arrowTooltip: "i-bg-$color-tooltip-background i-border-$color-tooltip-background",
|
|
1269
|
+
arrowCallout: "i-bg-$color-callout-background i-border-$color-callout-border",
|
|
1270
|
+
arrowPopover: "i-bg-$color-popover-background i-border-$color-popover-background",
|
|
1271
|
+
arrowHighlight: "i-bg-$color-callout-background i-border-$color-callout-border",
|
|
1272
|
+
content: "last-child:mb-0",
|
|
1273
|
+
notCallout: "absolute z-50",
|
|
1274
|
+
closeBtn: `${buttonTextSizes.medium} ${buttonTypes.pill} ${buttonColors.pill} justify-self-end -mr-8 ml-8`
|
|
1275
|
+
};
|
|
1276
|
+
|
|
1277
|
+
// node_modules/.pnpm/@floating-ui+core@0.7.3/node_modules/@floating-ui/core/dist/floating-ui.core.browser.min.mjs
|
|
1278
|
+
function t(t2) {
|
|
1279
|
+
return t2.split("-")[0];
|
|
1280
|
+
}
|
|
1281
|
+
function e(t2) {
|
|
1282
|
+
return t2.split("-")[1];
|
|
1283
|
+
}
|
|
1284
|
+
function n(e2) {
|
|
1285
|
+
return ["top", "bottom"].includes(t(e2)) ? "x" : "y";
|
|
1286
|
+
}
|
|
1287
|
+
function r(t2) {
|
|
1288
|
+
return "y" === t2 ? "height" : "width";
|
|
1289
|
+
}
|
|
1290
|
+
function i(i3, o3, a3) {
|
|
1291
|
+
let { reference: l3, floating: s3 } = i3;
|
|
1292
|
+
const c3 = l3.x + l3.width / 2 - s3.width / 2, f3 = l3.y + l3.height / 2 - s3.height / 2, u3 = n(o3), m3 = r(u3), g3 = l3[m3] / 2 - s3[m3] / 2, d3 = "x" === u3;
|
|
1293
|
+
let p3;
|
|
1294
|
+
switch (t(o3)) {
|
|
1295
|
+
case "top":
|
|
1296
|
+
p3 = { x: c3, y: l3.y - s3.height };
|
|
1297
|
+
break;
|
|
1298
|
+
case "bottom":
|
|
1299
|
+
p3 = { x: c3, y: l3.y + l3.height };
|
|
1300
|
+
break;
|
|
1301
|
+
case "right":
|
|
1302
|
+
p3 = { x: l3.x + l3.width, y: f3 };
|
|
1303
|
+
break;
|
|
1304
|
+
case "left":
|
|
1305
|
+
p3 = { x: l3.x - s3.width, y: f3 };
|
|
1306
|
+
break;
|
|
1307
|
+
default:
|
|
1308
|
+
p3 = { x: l3.x, y: l3.y };
|
|
1309
|
+
}
|
|
1310
|
+
switch (e(o3)) {
|
|
1311
|
+
case "start":
|
|
1312
|
+
p3[u3] -= g3 * (a3 && d3 ? -1 : 1);
|
|
1313
|
+
break;
|
|
1314
|
+
case "end":
|
|
1315
|
+
p3[u3] += g3 * (a3 && d3 ? -1 : 1);
|
|
1316
|
+
}
|
|
1317
|
+
return p3;
|
|
1318
|
+
}
|
|
1319
|
+
var o = async (t2, e2, n3) => {
|
|
1320
|
+
const { placement: r3 = "bottom", strategy: o3 = "absolute", middleware: a3 = [], platform: l3 } = n3, s3 = await (null == l3.isRTL ? void 0 : l3.isRTL(e2));
|
|
1321
|
+
let c3 = await l3.getElementRects({ reference: t2, floating: e2, strategy: o3 }), { x: f3, y: u3 } = i(c3, r3, s3), m3 = r3, g3 = {}, d3 = 0;
|
|
1322
|
+
for (let n4 = 0; n4 < a3.length; n4++) {
|
|
1323
|
+
const { name: p3, fn: h3 } = a3[n4], { x: y3, y: x3, data: w3, reset: v3 } = await h3({ x: f3, y: u3, initialPlacement: r3, placement: m3, strategy: o3, middlewareData: g3, rects: c3, platform: l3, elements: { reference: t2, floating: e2 } });
|
|
1324
|
+
f3 = null != y3 ? y3 : f3, u3 = null != x3 ? x3 : u3, g3 = __spreadProps(__spreadValues({}, g3), { [p3]: __spreadValues(__spreadValues({}, g3[p3]), w3) }), v3 && d3 <= 50 && (d3++, "object" == typeof v3 && (v3.placement && (m3 = v3.placement), v3.rects && (c3 = true === v3.rects ? await l3.getElementRects({ reference: t2, floating: e2, strategy: o3 }) : v3.rects), { x: f3, y: u3 } = i(c3, m3, s3)), n4 = -1);
|
|
1325
|
+
}
|
|
1326
|
+
return { x: f3, y: u3, placement: m3, strategy: o3, middlewareData: g3 };
|
|
1327
|
+
};
|
|
1328
|
+
function a(t2) {
|
|
1329
|
+
return "number" != typeof t2 ? function(t3) {
|
|
1330
|
+
return __spreadValues({ top: 0, right: 0, bottom: 0, left: 0 }, t3);
|
|
1331
|
+
}(t2) : { top: t2, right: t2, bottom: t2, left: t2 };
|
|
1332
|
+
}
|
|
1333
|
+
function l(t2) {
|
|
1334
|
+
return __spreadProps(__spreadValues({}, t2), { top: t2.y, left: t2.x, right: t2.x + t2.width, bottom: t2.y + t2.height });
|
|
1335
|
+
}
|
|
1336
|
+
async function s(t2, e2) {
|
|
1337
|
+
var n3;
|
|
1338
|
+
void 0 === e2 && (e2 = {});
|
|
1339
|
+
const { x: r3, y: i3, platform: o3, rects: s3, elements: c3, strategy: f3 } = t2, { boundary: u3 = "clippingAncestors", rootBoundary: m3 = "viewport", elementContext: g3 = "floating", altBoundary: d3 = false, padding: p3 = 0 } = e2, h3 = a(p3), y3 = c3[d3 ? "floating" === g3 ? "reference" : "floating" : g3], x3 = l(await o3.getClippingRect({ element: null == (n3 = await (null == o3.isElement ? void 0 : o3.isElement(y3))) || n3 ? y3 : y3.contextElement || await (null == o3.getDocumentElement ? void 0 : o3.getDocumentElement(c3.floating)), boundary: u3, rootBoundary: m3, strategy: f3 })), w3 = l(o3.convertOffsetParentRelativeRectToViewportRelativeRect ? await o3.convertOffsetParentRelativeRectToViewportRelativeRect({ rect: "floating" === g3 ? __spreadProps(__spreadValues({}, s3.floating), { x: r3, y: i3 }) : s3.reference, offsetParent: await (null == o3.getOffsetParent ? void 0 : o3.getOffsetParent(c3.floating)), strategy: f3 }) : s3[g3]);
|
|
1340
|
+
return { top: x3.top - w3.top + h3.top, bottom: w3.bottom - x3.bottom + h3.bottom, left: x3.left - w3.left + h3.left, right: w3.right - x3.right + h3.right };
|
|
1341
|
+
}
|
|
1342
|
+
var c = Math.min;
|
|
1343
|
+
var f = Math.max;
|
|
1344
|
+
function u(t2, e2, n3) {
|
|
1345
|
+
return f(t2, c(e2, n3));
|
|
1346
|
+
}
|
|
1347
|
+
var m = (t2) => ({ name: "arrow", options: t2, async fn(i3) {
|
|
1348
|
+
const { element: o3, padding: l3 = 0 } = null != t2 ? t2 : {}, { x: s3, y: c3, placement: f3, rects: m3, platform: g3 } = i3;
|
|
1349
|
+
if (null == o3)
|
|
1350
|
+
return {};
|
|
1351
|
+
const d3 = a(l3), p3 = { x: s3, y: c3 }, h3 = n(f3), y3 = e(f3), x3 = r(h3), w3 = await g3.getDimensions(o3), v3 = "y" === h3 ? "top" : "left", b3 = "y" === h3 ? "bottom" : "right", R2 = m3.reference[x3] + m3.reference[h3] - p3[h3] - m3.floating[x3], A = p3[h3] - m3.reference[h3], P2 = await (null == g3.getOffsetParent ? void 0 : g3.getOffsetParent(o3));
|
|
1352
|
+
let T3 = P2 ? "y" === h3 ? P2.clientHeight || 0 : P2.clientWidth || 0 : 0;
|
|
1353
|
+
0 === T3 && (T3 = m3.floating[x3]);
|
|
1354
|
+
const O2 = R2 / 2 - A / 2, D3 = d3[v3], L3 = T3 - w3[x3] - d3[b3], k2 = T3 / 2 - w3[x3] / 2 + O2, E3 = u(D3, k2, L3), C2 = ("start" === y3 ? d3[v3] : d3[b3]) > 0 && k2 !== E3 && m3.reference[x3] <= m3.floating[x3];
|
|
1355
|
+
return { [h3]: p3[h3] - (C2 ? k2 < D3 ? D3 - k2 : L3 - k2 : 0), data: { [h3]: E3, centerOffset: k2 - E3 } };
|
|
1356
|
+
} });
|
|
1357
|
+
var g = { left: "right", right: "left", bottom: "top", top: "bottom" };
|
|
1358
|
+
function d(t2) {
|
|
1359
|
+
return t2.replace(/left|right|bottom|top/g, (t3) => g[t3]);
|
|
1360
|
+
}
|
|
1361
|
+
function p(t2, i3, o3) {
|
|
1362
|
+
void 0 === o3 && (o3 = false);
|
|
1363
|
+
const a3 = e(t2), l3 = n(t2), s3 = r(l3);
|
|
1364
|
+
let c3 = "x" === l3 ? a3 === (o3 ? "end" : "start") ? "right" : "left" : "start" === a3 ? "bottom" : "top";
|
|
1365
|
+
return i3.reference[s3] > i3.floating[s3] && (c3 = d(c3)), { main: c3, cross: d(c3) };
|
|
1366
|
+
}
|
|
1367
|
+
var h = { start: "end", end: "start" };
|
|
1368
|
+
function y(t2) {
|
|
1369
|
+
return t2.replace(/start|end/g, (t3) => h[t3]);
|
|
1370
|
+
}
|
|
1371
|
+
var x = ["top", "right", "bottom", "left"];
|
|
1372
|
+
var w = x.reduce((t2, e2) => t2.concat(e2, e2 + "-start", e2 + "-end"), []);
|
|
1373
|
+
var b = function(e2) {
|
|
1374
|
+
return void 0 === e2 && (e2 = {}), { name: "flip", options: e2, async fn(n3) {
|
|
1375
|
+
var r3;
|
|
1376
|
+
const { placement: i3, middlewareData: o3, rects: a3, initialPlacement: l3, platform: c3, elements: f3 } = n3, _a = e2, { mainAxis: u3 = true, crossAxis: m3 = true, fallbackPlacements: g3, fallbackStrategy: h3 = "bestFit", flipAlignment: x3 = true } = _a, w3 = __objRest(_a, ["mainAxis", "crossAxis", "fallbackPlacements", "fallbackStrategy", "flipAlignment"]), v3 = t(i3), b3 = g3 || (v3 === l3 || !x3 ? [d(l3)] : function(t2) {
|
|
1377
|
+
const e3 = d(t2);
|
|
1378
|
+
return [y(t2), e3, y(e3)];
|
|
1379
|
+
}(l3)), R2 = [l3, ...b3], A = await s(n3, w3), P2 = [];
|
|
1380
|
+
let T3 = (null == (r3 = o3.flip) ? void 0 : r3.overflows) || [];
|
|
1381
|
+
if (u3 && P2.push(A[v3]), m3) {
|
|
1382
|
+
const { main: t2, cross: e3 } = p(i3, a3, await (null == c3.isRTL ? void 0 : c3.isRTL(f3.floating)));
|
|
1383
|
+
P2.push(A[t2], A[e3]);
|
|
1384
|
+
}
|
|
1385
|
+
if (T3 = [...T3, { placement: i3, overflows: P2 }], !P2.every((t2) => t2 <= 0)) {
|
|
1386
|
+
var O2, D3;
|
|
1387
|
+
const t2 = (null != (O2 = null == (D3 = o3.flip) ? void 0 : D3.index) ? O2 : 0) + 1, e3 = R2[t2];
|
|
1388
|
+
if (e3)
|
|
1389
|
+
return { data: { index: t2, overflows: T3 }, reset: { placement: e3 } };
|
|
1390
|
+
let n4 = "bottom";
|
|
1391
|
+
switch (h3) {
|
|
1392
|
+
case "bestFit": {
|
|
1393
|
+
var L3;
|
|
1394
|
+
const t3 = null == (L3 = T3.map((t4) => [t4, t4.overflows.filter((t5) => t5 > 0).reduce((t5, e4) => t5 + e4, 0)]).sort((t4, e4) => t4[1] - e4[1])[0]) ? void 0 : L3[0].placement;
|
|
1395
|
+
t3 && (n4 = t3);
|
|
1396
|
+
break;
|
|
1397
|
+
}
|
|
1398
|
+
case "initialPlacement":
|
|
1399
|
+
n4 = l3;
|
|
1400
|
+
}
|
|
1401
|
+
if (i3 !== n4)
|
|
1402
|
+
return { reset: { placement: n4 } };
|
|
1403
|
+
}
|
|
1404
|
+
return {};
|
|
1405
|
+
} };
|
|
1406
|
+
};
|
|
1407
|
+
var T = function(r3) {
|
|
1408
|
+
return void 0 === r3 && (r3 = 0), { name: "offset", options: r3, async fn(i3) {
|
|
1409
|
+
const { x: o3, y: a3 } = i3, l3 = await async function(r4, i4) {
|
|
1410
|
+
const { placement: o4, platform: a4, elements: l4 } = r4, s3 = await (null == a4.isRTL ? void 0 : a4.isRTL(l4.floating)), c3 = t(o4), f3 = e(o4), u3 = "x" === n(o4), m3 = ["left", "top"].includes(c3) ? -1 : 1, g3 = s3 && u3 ? -1 : 1, d3 = "function" == typeof i4 ? i4(r4) : i4;
|
|
1411
|
+
let { mainAxis: p3, crossAxis: h3, alignmentAxis: y3 } = "number" == typeof d3 ? { mainAxis: d3, crossAxis: 0, alignmentAxis: null } : __spreadValues({ mainAxis: 0, crossAxis: 0, alignmentAxis: null }, d3);
|
|
1412
|
+
return f3 && "number" == typeof y3 && (h3 = "end" === f3 ? -1 * y3 : y3), u3 ? { x: h3 * g3, y: p3 * m3 } : { x: p3 * m3, y: h3 * g3 };
|
|
1413
|
+
}(i3, r3);
|
|
1414
|
+
return { x: o3 + l3.x, y: a3 + l3.y, data: l3 };
|
|
1415
|
+
} };
|
|
1416
|
+
};
|
|
1417
|
+
function O(t2) {
|
|
1418
|
+
return "x" === t2 ? "y" : "x";
|
|
1419
|
+
}
|
|
1420
|
+
var D = function(e2) {
|
|
1421
|
+
return void 0 === e2 && (e2 = {}), { name: "shift", options: e2, async fn(r3) {
|
|
1422
|
+
const { x: i3, y: o3, placement: a3 } = r3, _a = e2, { mainAxis: l3 = true, crossAxis: c3 = false, limiter: f3 = { fn: (t2) => {
|
|
1423
|
+
let { x: e3, y: n3 } = t2;
|
|
1424
|
+
return { x: e3, y: n3 };
|
|
1425
|
+
} } } = _a, m3 = __objRest(_a, ["mainAxis", "crossAxis", "limiter"]), g3 = { x: i3, y: o3 }, d3 = await s(r3, m3), p3 = n(t(a3)), h3 = O(p3);
|
|
1426
|
+
let y3 = g3[p3], x3 = g3[h3];
|
|
1427
|
+
if (l3) {
|
|
1428
|
+
const t2 = "y" === p3 ? "bottom" : "right";
|
|
1429
|
+
y3 = u(y3 + d3["y" === p3 ? "top" : "left"], y3, y3 - d3[t2]);
|
|
1430
|
+
}
|
|
1431
|
+
if (c3) {
|
|
1432
|
+
const t2 = "y" === h3 ? "bottom" : "right";
|
|
1433
|
+
x3 = u(x3 + d3["y" === h3 ? "top" : "left"], x3, x3 - d3[t2]);
|
|
1434
|
+
}
|
|
1435
|
+
const w3 = f3.fn(__spreadProps(__spreadValues({}, r3), { [p3]: y3, [h3]: x3 }));
|
|
1436
|
+
return __spreadProps(__spreadValues({}, w3), { data: { x: w3.x - i3, y: w3.y - o3 } });
|
|
1437
|
+
} };
|
|
1438
|
+
};
|
|
1439
|
+
|
|
1440
|
+
// node_modules/.pnpm/@floating-ui+dom@0.5.4/node_modules/@floating-ui/dom/dist/floating-ui.dom.browser.min.mjs
|
|
1441
|
+
function n2(t2) {
|
|
1442
|
+
return t2 && t2.document && t2.location && t2.alert && t2.setInterval;
|
|
1443
|
+
}
|
|
1444
|
+
function o2(t2) {
|
|
1445
|
+
if (null == t2)
|
|
1446
|
+
return window;
|
|
1447
|
+
if (!n2(t2)) {
|
|
1448
|
+
const e2 = t2.ownerDocument;
|
|
1449
|
+
return e2 && e2.defaultView || window;
|
|
1450
|
+
}
|
|
1451
|
+
return t2;
|
|
1452
|
+
}
|
|
1453
|
+
function i2(t2) {
|
|
1454
|
+
return o2(t2).getComputedStyle(t2);
|
|
1455
|
+
}
|
|
1456
|
+
function r2(t2) {
|
|
1457
|
+
return n2(t2) ? "" : t2 ? (t2.nodeName || "").toLowerCase() : "";
|
|
1458
|
+
}
|
|
1459
|
+
function l2() {
|
|
1460
|
+
const t2 = navigator.userAgentData;
|
|
1461
|
+
return null != t2 && t2.brands ? t2.brands.map((t3) => t3.brand + "/" + t3.version).join(" ") : navigator.userAgent;
|
|
1462
|
+
}
|
|
1463
|
+
function c2(t2) {
|
|
1464
|
+
return t2 instanceof o2(t2).HTMLElement;
|
|
1465
|
+
}
|
|
1466
|
+
function f2(t2) {
|
|
1467
|
+
return t2 instanceof o2(t2).Element;
|
|
1468
|
+
}
|
|
1469
|
+
function s2(t2) {
|
|
1470
|
+
if ("undefined" == typeof ShadowRoot)
|
|
1471
|
+
return false;
|
|
1472
|
+
return t2 instanceof o2(t2).ShadowRoot || t2 instanceof ShadowRoot;
|
|
1473
|
+
}
|
|
1474
|
+
function u2(t2) {
|
|
1475
|
+
const { overflow: e2, overflowX: n3, overflowY: o3 } = i2(t2);
|
|
1476
|
+
return /auto|scroll|overlay|hidden/.test(e2 + o3 + n3);
|
|
1477
|
+
}
|
|
1478
|
+
function d2(t2) {
|
|
1479
|
+
return ["table", "td", "th"].includes(r2(t2));
|
|
1480
|
+
}
|
|
1481
|
+
function h2(t2) {
|
|
1482
|
+
const e2 = /firefox/i.test(l2()), n3 = i2(t2);
|
|
1483
|
+
return "none" !== n3.transform || "none" !== n3.perspective || "paint" === n3.contain || ["transform", "perspective"].includes(n3.willChange) || e2 && "filter" === n3.willChange || e2 && !!n3.filter && "none" !== n3.filter;
|
|
1484
|
+
}
|
|
1485
|
+
function a2() {
|
|
1486
|
+
return !/^((?!chrome|android).)*safari/i.test(l2());
|
|
1487
|
+
}
|
|
1488
|
+
var g2 = Math.min;
|
|
1489
|
+
var p2 = Math.max;
|
|
1490
|
+
var m2 = Math.round;
|
|
1491
|
+
function w2(t2, e2, n3) {
|
|
1492
|
+
var i3, r3, l3, s3;
|
|
1493
|
+
void 0 === e2 && (e2 = false), void 0 === n3 && (n3 = false);
|
|
1494
|
+
const u3 = t2.getBoundingClientRect();
|
|
1495
|
+
let d3 = 1, h3 = 1;
|
|
1496
|
+
e2 && c2(t2) && (d3 = t2.offsetWidth > 0 && m2(u3.width) / t2.offsetWidth || 1, h3 = t2.offsetHeight > 0 && m2(u3.height) / t2.offsetHeight || 1);
|
|
1497
|
+
const g3 = f2(t2) ? o2(t2) : window, p3 = !a2() && n3, w3 = (u3.left + (p3 && null != (i3 = null == (r3 = g3.visualViewport) ? void 0 : r3.offsetLeft) ? i3 : 0)) / d3, v3 = (u3.top + (p3 && null != (l3 = null == (s3 = g3.visualViewport) ? void 0 : s3.offsetTop) ? l3 : 0)) / h3, y3 = u3.width / d3, x3 = u3.height / h3;
|
|
1498
|
+
return { width: y3, height: x3, top: v3, right: w3 + y3, bottom: v3 + x3, left: w3, x: w3, y: v3 };
|
|
1499
|
+
}
|
|
1500
|
+
function v2(t2) {
|
|
1501
|
+
return (e2 = t2, (e2 instanceof o2(e2).Node ? t2.ownerDocument : t2.document) || window.document).documentElement;
|
|
1502
|
+
var e2;
|
|
1503
|
+
}
|
|
1504
|
+
function y2(t2) {
|
|
1505
|
+
return f2(t2) ? { scrollLeft: t2.scrollLeft, scrollTop: t2.scrollTop } : { scrollLeft: t2.pageXOffset, scrollTop: t2.pageYOffset };
|
|
1506
|
+
}
|
|
1507
|
+
function x2(t2) {
|
|
1508
|
+
return w2(v2(t2)).left + y2(t2).scrollLeft;
|
|
1509
|
+
}
|
|
1510
|
+
function b2(t2, e2, n3) {
|
|
1511
|
+
const o3 = c2(e2), i3 = v2(e2), l3 = w2(t2, o3 && function(t3) {
|
|
1512
|
+
const e3 = w2(t3);
|
|
1513
|
+
return m2(e3.width) !== t3.offsetWidth || m2(e3.height) !== t3.offsetHeight;
|
|
1514
|
+
}(e2), "fixed" === n3);
|
|
1515
|
+
let f3 = { scrollLeft: 0, scrollTop: 0 };
|
|
1516
|
+
const s3 = { x: 0, y: 0 };
|
|
1517
|
+
if (o3 || !o3 && "fixed" !== n3)
|
|
1518
|
+
if (("body" !== r2(e2) || u2(i3)) && (f3 = y2(e2)), c2(e2)) {
|
|
1519
|
+
const t3 = w2(e2, true);
|
|
1520
|
+
s3.x = t3.x + e2.clientLeft, s3.y = t3.y + e2.clientTop;
|
|
1521
|
+
} else
|
|
1522
|
+
i3 && (s3.x = x2(i3));
|
|
1523
|
+
return { x: l3.left + f3.scrollLeft - s3.x, y: l3.top + f3.scrollTop - s3.y, width: l3.width, height: l3.height };
|
|
1524
|
+
}
|
|
1525
|
+
function L2(t2) {
|
|
1526
|
+
return "html" === r2(t2) ? t2 : t2.assignedSlot || t2.parentNode || (s2(t2) ? t2.host : null) || v2(t2);
|
|
1527
|
+
}
|
|
1528
|
+
function R(t2) {
|
|
1529
|
+
return c2(t2) && "fixed" !== getComputedStyle(t2).position ? t2.offsetParent : null;
|
|
1530
|
+
}
|
|
1531
|
+
function T2(t2) {
|
|
1532
|
+
const e2 = o2(t2);
|
|
1533
|
+
let n3 = R(t2);
|
|
1534
|
+
for (; n3 && d2(n3) && "static" === getComputedStyle(n3).position; )
|
|
1535
|
+
n3 = R(n3);
|
|
1536
|
+
return n3 && ("html" === r2(n3) || "body" === r2(n3) && "static" === getComputedStyle(n3).position && !h2(n3)) ? e2 : n3 || function(t3) {
|
|
1537
|
+
let e3 = L2(t3);
|
|
1538
|
+
for (s2(e3) && (e3 = e3.host); c2(e3) && !["html", "body"].includes(r2(e3)); ) {
|
|
1539
|
+
if (h2(e3))
|
|
1540
|
+
return e3;
|
|
1541
|
+
e3 = e3.parentNode;
|
|
1542
|
+
}
|
|
1543
|
+
return null;
|
|
1544
|
+
}(t2) || e2;
|
|
1545
|
+
}
|
|
1546
|
+
function W(t2) {
|
|
1547
|
+
if (c2(t2))
|
|
1548
|
+
return { width: t2.offsetWidth, height: t2.offsetHeight };
|
|
1549
|
+
const e2 = w2(t2);
|
|
1550
|
+
return { width: e2.width, height: e2.height };
|
|
1551
|
+
}
|
|
1552
|
+
function E2(t2) {
|
|
1553
|
+
const e2 = L2(t2);
|
|
1554
|
+
return ["html", "body", "#document"].includes(r2(e2)) ? t2.ownerDocument.body : c2(e2) && u2(e2) ? e2 : E2(e2);
|
|
1555
|
+
}
|
|
1556
|
+
function H(t2, e2) {
|
|
1557
|
+
var n3;
|
|
1558
|
+
void 0 === e2 && (e2 = []);
|
|
1559
|
+
const i3 = E2(t2), r3 = i3 === (null == (n3 = t2.ownerDocument) ? void 0 : n3.body), l3 = o2(i3), c3 = r3 ? [l3].concat(l3.visualViewport || [], u2(i3) ? i3 : []) : i3, f3 = e2.concat(c3);
|
|
1560
|
+
return r3 ? f3 : f3.concat(H(c3));
|
|
1561
|
+
}
|
|
1562
|
+
function C(e2, n3, r3) {
|
|
1563
|
+
return "viewport" === n3 ? l(function(t2, e3) {
|
|
1564
|
+
const n4 = o2(t2), i3 = v2(t2), r4 = n4.visualViewport;
|
|
1565
|
+
let l3 = i3.clientWidth, c3 = i3.clientHeight, f3 = 0, s3 = 0;
|
|
1566
|
+
if (r4) {
|
|
1567
|
+
l3 = r4.width, c3 = r4.height;
|
|
1568
|
+
const t3 = a2();
|
|
1569
|
+
(t3 || !t3 && "fixed" === e3) && (f3 = r4.offsetLeft, s3 = r4.offsetTop);
|
|
1570
|
+
}
|
|
1571
|
+
return { width: l3, height: c3, x: f3, y: s3 };
|
|
1572
|
+
}(e2, r3)) : f2(n3) ? function(t2, e3) {
|
|
1573
|
+
const n4 = w2(t2, false, "fixed" === e3), o3 = n4.top + t2.clientTop, i3 = n4.left + t2.clientLeft;
|
|
1574
|
+
return { top: o3, left: i3, x: i3, y: o3, right: i3 + t2.clientWidth, bottom: o3 + t2.clientHeight, width: t2.clientWidth, height: t2.clientHeight };
|
|
1575
|
+
}(n3, r3) : l(function(t2) {
|
|
1576
|
+
var e3;
|
|
1577
|
+
const n4 = v2(t2), o3 = y2(t2), r4 = null == (e3 = t2.ownerDocument) ? void 0 : e3.body, l3 = p2(n4.scrollWidth, n4.clientWidth, r4 ? r4.scrollWidth : 0, r4 ? r4.clientWidth : 0), c3 = p2(n4.scrollHeight, n4.clientHeight, r4 ? r4.scrollHeight : 0, r4 ? r4.clientHeight : 0);
|
|
1578
|
+
let f3 = -o3.scrollLeft + x2(t2);
|
|
1579
|
+
const s3 = -o3.scrollTop;
|
|
1580
|
+
return "rtl" === i2(r4 || n4).direction && (f3 += p2(n4.clientWidth, r4 ? r4.clientWidth : 0) - l3), { width: l3, height: c3, x: f3, y: s3 };
|
|
1581
|
+
}(v2(e2)));
|
|
1582
|
+
}
|
|
1583
|
+
function S(t2) {
|
|
1584
|
+
const e2 = H(t2), n3 = ["absolute", "fixed"].includes(i2(t2).position) && c2(t2) ? T2(t2) : t2;
|
|
1585
|
+
return f2(n3) ? e2.filter((t3) => f2(t3) && function(t4, e3) {
|
|
1586
|
+
const n4 = null == e3.getRootNode ? void 0 : e3.getRootNode();
|
|
1587
|
+
if (t4.contains(e3))
|
|
1588
|
+
return true;
|
|
1589
|
+
if (n4 && s2(n4)) {
|
|
1590
|
+
let n5 = e3;
|
|
1591
|
+
do {
|
|
1592
|
+
if (n5 && t4 === n5)
|
|
1593
|
+
return true;
|
|
1594
|
+
n5 = n5.parentNode || n5.host;
|
|
1595
|
+
} while (n5);
|
|
1596
|
+
}
|
|
1597
|
+
return false;
|
|
1598
|
+
}(t3, n3) && "body" !== r2(t3)) : [];
|
|
1599
|
+
}
|
|
1600
|
+
var D2 = { getClippingRect: function(t2) {
|
|
1601
|
+
let { element: e2, boundary: n3, rootBoundary: o3, strategy: i3 } = t2;
|
|
1602
|
+
const r3 = [..."clippingAncestors" === n3 ? S(e2) : [].concat(n3), o3], l3 = r3[0], c3 = r3.reduce((t3, n4) => {
|
|
1603
|
+
const o4 = C(e2, n4, i3);
|
|
1604
|
+
return t3.top = p2(o4.top, t3.top), t3.right = g2(o4.right, t3.right), t3.bottom = g2(o4.bottom, t3.bottom), t3.left = p2(o4.left, t3.left), t3;
|
|
1605
|
+
}, C(e2, l3, i3));
|
|
1606
|
+
return { width: c3.right - c3.left, height: c3.bottom - c3.top, x: c3.left, y: c3.top };
|
|
1607
|
+
}, convertOffsetParentRelativeRectToViewportRelativeRect: function(t2) {
|
|
1608
|
+
let { rect: e2, offsetParent: n3, strategy: o3 } = t2;
|
|
1609
|
+
const i3 = c2(n3), l3 = v2(n3);
|
|
1610
|
+
if (n3 === l3)
|
|
1611
|
+
return e2;
|
|
1612
|
+
let f3 = { scrollLeft: 0, scrollTop: 0 };
|
|
1613
|
+
const s3 = { x: 0, y: 0 };
|
|
1614
|
+
if ((i3 || !i3 && "fixed" !== o3) && (("body" !== r2(n3) || u2(l3)) && (f3 = y2(n3)), c2(n3))) {
|
|
1615
|
+
const t3 = w2(n3, true);
|
|
1616
|
+
s3.x = t3.x + n3.clientLeft, s3.y = t3.y + n3.clientTop;
|
|
1617
|
+
}
|
|
1618
|
+
return __spreadProps(__spreadValues({}, e2), { x: e2.x - f3.scrollLeft + s3.x, y: e2.y - f3.scrollTop + s3.y });
|
|
1619
|
+
}, isElement: f2, getDimensions: W, getOffsetParent: T2, getDocumentElement: v2, getElementRects: (t2) => {
|
|
1620
|
+
let { reference: e2, floating: n3, strategy: o3 } = t2;
|
|
1621
|
+
return { reference: b2(e2, T2(n3), o3), floating: __spreadProps(__spreadValues({}, W(n3)), { x: 0, y: 0 }) };
|
|
1622
|
+
}, getClientRects: (t2) => Array.from(t2.getClientRects()), isRTL: (t2) => "rtl" === i2(t2).direction };
|
|
1623
|
+
var z = (t2, n3, o3) => o(t2, n3, __spreadValues({ platform: D2 }, o3));
|
|
1624
|
+
|
|
1625
|
+
// node_modules/.pnpm/@warp-ds+core@1.0.0/node_modules/@warp-ds/core/dist/attention/utils/helpers.js
|
|
1626
|
+
var TOP = "top";
|
|
1627
|
+
var BOTTOM = "bottom";
|
|
1628
|
+
var LEFT = "left";
|
|
1629
|
+
var RIGHT = "right";
|
|
1630
|
+
var opposites = {
|
|
1631
|
+
[TOP]: BOTTOM,
|
|
1632
|
+
[BOTTOM]: TOP,
|
|
1633
|
+
[LEFT]: RIGHT,
|
|
1634
|
+
[RIGHT]: LEFT
|
|
1635
|
+
};
|
|
1636
|
+
var arrowLabels = {
|
|
1637
|
+
[TOP]: "\u2191",
|
|
1638
|
+
[BOTTOM]: "\u2193",
|
|
1639
|
+
[LEFT]: "\u2190",
|
|
1640
|
+
[RIGHT]: "\u2192"
|
|
1641
|
+
};
|
|
1642
|
+
var rotation = {
|
|
1643
|
+
[LEFT]: -45,
|
|
1644
|
+
[TOP]: 45,
|
|
1645
|
+
[RIGHT]: 135,
|
|
1646
|
+
[BOTTOM]: -135
|
|
1647
|
+
};
|
|
1648
|
+
var middlePosition = "calc(50% - 7px)";
|
|
1649
|
+
var isDirectionVertical = (name) => [TOP, BOTTOM].includes(name);
|
|
1650
|
+
function computeCalloutArrow({ actualDirection, directionName, arrowEl }) {
|
|
1651
|
+
if (!arrowEl)
|
|
1652
|
+
return;
|
|
1653
|
+
actualDirection = directionName;
|
|
1654
|
+
const directionIsVertical = isDirectionVertical(directionName);
|
|
1655
|
+
arrowEl.style.left = directionIsVertical ? middlePosition : "";
|
|
1656
|
+
arrowEl.style.top = !directionIsVertical ? middlePosition : "";
|
|
1657
|
+
}
|
|
1658
|
+
async function useRecompute(state) {
|
|
1659
|
+
var _a, _b;
|
|
1660
|
+
if (!state.isShowing)
|
|
1661
|
+
return;
|
|
1662
|
+
await ((_a = state == null ? void 0 : state.waitForDOM) == null ? void 0 : _a.call(state));
|
|
1663
|
+
if (state.isCallout)
|
|
1664
|
+
return computeCalloutArrow(state);
|
|
1665
|
+
const position = await z(state.targetEl, state.attentionEl, {
|
|
1666
|
+
placement: state.directionName,
|
|
1667
|
+
middleware: [
|
|
1668
|
+
// Should we make this configurable, but have these as sane defaults?
|
|
1669
|
+
b(),
|
|
1670
|
+
T(8),
|
|
1671
|
+
D({ padding: 16 }),
|
|
1672
|
+
// @ts-ignore
|
|
1673
|
+
m({ element: state.noArrow ? void 0 : state.arrowEl })
|
|
1674
|
+
// FIXME
|
|
1675
|
+
]
|
|
1676
|
+
});
|
|
1677
|
+
state.actualDirection = position.placement;
|
|
1678
|
+
Object.assign(((_b = state.attentionEl) == null ? void 0 : _b.style) || {}, {
|
|
1679
|
+
left: "0",
|
|
1680
|
+
top: "0",
|
|
1681
|
+
transform: `translate3d(${Math.round(position.x)}px, ${Math.round(position.y)}px, 0)`
|
|
1682
|
+
});
|
|
1683
|
+
let { x: x3, y: y3 } = position.middlewareData.arrow;
|
|
1684
|
+
if (state.arrowEl) {
|
|
1685
|
+
state.arrowEl.style.left = x3 ? x3 + "px" : "";
|
|
1686
|
+
state.arrowEl.style.top = y3 ? y3 + "px" : "";
|
|
1687
|
+
}
|
|
1688
|
+
}
|
|
1689
|
+
|
|
1690
|
+
// node_modules/.pnpm/@lingui+core@4.5.0/node_modules/@lingui/core/dist/index.mjs
|
|
1691
|
+
var import_unraw = __toESM(require_dist(), 1);
|
|
1692
|
+
|
|
1693
|
+
// node_modules/.pnpm/@lingui+message-utils@4.5.0/node_modules/@lingui/message-utils/dist/compileMessage.mjs
|
|
1694
|
+
var import_parser = __toESM(require_parser(), 1);
|
|
1695
|
+
function processTokens(tokens, mapText) {
|
|
1696
|
+
if (!tokens.filter((token) => token.type !== "content").length) {
|
|
1697
|
+
return tokens.map((token) => mapText(token.value)).join("");
|
|
1698
|
+
}
|
|
1699
|
+
return tokens.map((token) => {
|
|
1700
|
+
var _a;
|
|
1701
|
+
if (token.type === "content") {
|
|
1702
|
+
return mapText(token.value);
|
|
1703
|
+
} else if (token.type === "octothorpe") {
|
|
1704
|
+
return "#";
|
|
1705
|
+
} else if (token.type === "argument") {
|
|
1706
|
+
return [token.arg];
|
|
1707
|
+
} else if (token.type === "function") {
|
|
1708
|
+
const _param = (_a = token == null ? void 0 : token.param) == null ? void 0 : _a[0];
|
|
1709
|
+
if (_param) {
|
|
1710
|
+
return [token.arg, token.key, _param.value.trim()];
|
|
1711
|
+
} else {
|
|
1712
|
+
return [token.arg, token.key];
|
|
1713
|
+
}
|
|
1714
|
+
}
|
|
1715
|
+
const offset = token.pluralOffset;
|
|
1716
|
+
const formatProps = {};
|
|
1717
|
+
token.cases.forEach((item) => {
|
|
1718
|
+
formatProps[item.key.replace(/^=(.)+/, "$1")] = processTokens(
|
|
1719
|
+
item.tokens,
|
|
1720
|
+
mapText
|
|
1721
|
+
);
|
|
1722
|
+
});
|
|
1723
|
+
return [
|
|
1724
|
+
token.arg,
|
|
1725
|
+
token.type,
|
|
1726
|
+
__spreadValues({
|
|
1727
|
+
offset
|
|
1728
|
+
}, formatProps)
|
|
1729
|
+
];
|
|
1730
|
+
});
|
|
1731
|
+
}
|
|
1732
|
+
function compileMessage(message, mapText = (v3) => v3) {
|
|
1733
|
+
try {
|
|
1734
|
+
return processTokens((0, import_parser.parse)(message), mapText);
|
|
1735
|
+
} catch (e2) {
|
|
1736
|
+
console.error(`${e2.message}
|
|
1737
|
+
|
|
1738
|
+
Message: ${message}`);
|
|
1739
|
+
return message;
|
|
1740
|
+
}
|
|
1741
|
+
}
|
|
1742
|
+
|
|
1743
|
+
// node_modules/.pnpm/@lingui+core@4.5.0/node_modules/@lingui/core/dist/index.mjs
|
|
1744
|
+
var isString = (s3) => typeof s3 === "string";
|
|
1745
|
+
var isFunction = (f3) => typeof f3 === "function";
|
|
1746
|
+
var cache = /* @__PURE__ */ new Map();
|
|
1747
|
+
function normalizeLocales(locales) {
|
|
1748
|
+
const out = Array.isArray(locales) ? locales : [locales];
|
|
1749
|
+
return [...out, "en"];
|
|
1750
|
+
}
|
|
1751
|
+
function date(locales, value, format) {
|
|
1752
|
+
const _locales = normalizeLocales(locales);
|
|
1753
|
+
const formatter = getMemoized(
|
|
1754
|
+
() => cacheKey("date", _locales, format),
|
|
1755
|
+
() => new Intl.DateTimeFormat(_locales, format)
|
|
1756
|
+
);
|
|
1757
|
+
return formatter.format(isString(value) ? new Date(value) : value);
|
|
1758
|
+
}
|
|
1759
|
+
function number(locales, value, format) {
|
|
1760
|
+
const _locales = normalizeLocales(locales);
|
|
1761
|
+
const formatter = getMemoized(
|
|
1762
|
+
() => cacheKey("number", _locales, format),
|
|
1763
|
+
() => new Intl.NumberFormat(_locales, format)
|
|
1764
|
+
);
|
|
1765
|
+
return formatter.format(value);
|
|
1766
|
+
}
|
|
1767
|
+
function plural(locales, ordinal, value, _a) {
|
|
1768
|
+
var _b = _a, { offset = 0 } = _b, rules = __objRest(_b, ["offset"]);
|
|
1769
|
+
var _a2, _b2;
|
|
1770
|
+
const _locales = normalizeLocales(locales);
|
|
1771
|
+
const plurals = ordinal ? getMemoized(
|
|
1772
|
+
() => cacheKey("plural-ordinal", _locales),
|
|
1773
|
+
() => new Intl.PluralRules(_locales, { type: "ordinal" })
|
|
1774
|
+
) : getMemoized(
|
|
1775
|
+
() => cacheKey("plural-cardinal", _locales),
|
|
1776
|
+
() => new Intl.PluralRules(_locales, { type: "cardinal" })
|
|
1777
|
+
);
|
|
1778
|
+
return (_b2 = (_a2 = rules[value]) != null ? _a2 : rules[plurals.select(value - offset)]) != null ? _b2 : rules.other;
|
|
1779
|
+
}
|
|
1780
|
+
function getMemoized(getKey, construct) {
|
|
1781
|
+
const key = getKey();
|
|
1782
|
+
let formatter = cache.get(key);
|
|
1783
|
+
if (!formatter) {
|
|
1784
|
+
formatter = construct();
|
|
1785
|
+
cache.set(key, formatter);
|
|
1786
|
+
}
|
|
1787
|
+
return formatter;
|
|
1788
|
+
}
|
|
1789
|
+
function cacheKey(type, locales, options) {
|
|
1790
|
+
const localeKey = locales.join("-");
|
|
1791
|
+
return `${type}-${localeKey}-${JSON.stringify(options)}`;
|
|
1792
|
+
}
|
|
1793
|
+
var UNICODE_REGEX = /\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/g;
|
|
1794
|
+
var getDefaultFormats = (locale, locales, formats = {}) => {
|
|
1795
|
+
locales = locales || locale;
|
|
1796
|
+
const style = (format) => isString(format) ? formats[format] || { style: format } : format;
|
|
1797
|
+
const replaceOctothorpe = (value, message) => {
|
|
1798
|
+
const numberFormat = Object.keys(formats).length ? style("number") : {};
|
|
1799
|
+
const valueStr = number(locales, value, numberFormat);
|
|
1800
|
+
return message.replace("#", valueStr);
|
|
1801
|
+
};
|
|
1802
|
+
return {
|
|
1803
|
+
plural: (value, cases) => {
|
|
1804
|
+
const { offset = 0 } = cases;
|
|
1805
|
+
const message = plural(locales, false, value, cases);
|
|
1806
|
+
return replaceOctothorpe(value - offset, message);
|
|
1807
|
+
},
|
|
1808
|
+
selectordinal: (value, cases) => {
|
|
1809
|
+
const { offset = 0 } = cases;
|
|
1810
|
+
const message = plural(locales, true, value, cases);
|
|
1811
|
+
return replaceOctothorpe(value - offset, message);
|
|
1812
|
+
},
|
|
1813
|
+
select: (value, rules) => {
|
|
1814
|
+
var _a;
|
|
1815
|
+
return (_a = rules[value]) != null ? _a : rules.other;
|
|
1816
|
+
},
|
|
1817
|
+
number: (value, format) => number(locales, value, style(format)),
|
|
1818
|
+
date: (value, format) => date(locales, value, style(format)),
|
|
1819
|
+
undefined: (value) => value
|
|
1820
|
+
};
|
|
1821
|
+
};
|
|
1822
|
+
function interpolate(translation, locale, locales) {
|
|
1823
|
+
return (values, formats = {}) => {
|
|
1824
|
+
const formatters = getDefaultFormats(locale, locales, formats);
|
|
1825
|
+
const formatMessage = (message) => {
|
|
1826
|
+
if (!Array.isArray(message))
|
|
1827
|
+
return message;
|
|
1828
|
+
return message.reduce((message2, token) => {
|
|
1829
|
+
if (isString(token))
|
|
1830
|
+
return message2 + token;
|
|
1831
|
+
const [name, type, format] = token;
|
|
1832
|
+
let interpolatedFormat = {};
|
|
1833
|
+
if (format != null && !isString(format)) {
|
|
1834
|
+
Object.keys(format).forEach((key) => {
|
|
1835
|
+
interpolatedFormat[key] = formatMessage(format[key]);
|
|
1836
|
+
});
|
|
1837
|
+
} else {
|
|
1838
|
+
interpolatedFormat = format;
|
|
1839
|
+
}
|
|
1840
|
+
const value = formatters[type](values[name], interpolatedFormat);
|
|
1841
|
+
if (value == null)
|
|
1842
|
+
return message2;
|
|
1843
|
+
return message2 + value;
|
|
1844
|
+
}, "");
|
|
1845
|
+
};
|
|
1846
|
+
const result = formatMessage(translation);
|
|
1847
|
+
if (isString(result) && UNICODE_REGEX.test(result)) {
|
|
1848
|
+
return (0, import_unraw.default)(result.trim());
|
|
1849
|
+
}
|
|
1850
|
+
if (isString(result))
|
|
1851
|
+
return result.trim();
|
|
1852
|
+
return result;
|
|
1853
|
+
};
|
|
1854
|
+
}
|
|
1855
|
+
var __defProp$1 = Object.defineProperty;
|
|
1856
|
+
var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1857
|
+
var __publicField$1 = (obj, key, value) => {
|
|
1858
|
+
__defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1859
|
+
return value;
|
|
1860
|
+
};
|
|
1861
|
+
var EventEmitter = class {
|
|
1862
|
+
constructor() {
|
|
1863
|
+
__publicField$1(this, "_events", {});
|
|
1864
|
+
}
|
|
1865
|
+
on(event, listener) {
|
|
1866
|
+
if (!this._hasEvent(event))
|
|
1867
|
+
this._events[event] = [];
|
|
1868
|
+
this._events[event].push(listener);
|
|
1869
|
+
return () => this.removeListener(event, listener);
|
|
1870
|
+
}
|
|
1871
|
+
removeListener(event, listener) {
|
|
1872
|
+
if (!this._hasEvent(event))
|
|
1873
|
+
return;
|
|
1874
|
+
const index = this._events[event].indexOf(listener);
|
|
1875
|
+
if (~index)
|
|
1876
|
+
this._events[event].splice(index, 1);
|
|
1877
|
+
}
|
|
1878
|
+
emit(event, ...args) {
|
|
1879
|
+
if (!this._hasEvent(event))
|
|
1880
|
+
return;
|
|
1881
|
+
this._events[event].map((listener) => listener.apply(this, args));
|
|
1882
|
+
}
|
|
1883
|
+
_hasEvent(event) {
|
|
1884
|
+
return Array.isArray(this._events[event]);
|
|
1885
|
+
}
|
|
1886
|
+
};
|
|
1887
|
+
var __defProp2 = Object.defineProperty;
|
|
1888
|
+
var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1889
|
+
var __publicField2 = (obj, key, value) => {
|
|
1890
|
+
__defNormalProp2(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1891
|
+
return value;
|
|
1892
|
+
};
|
|
1893
|
+
var I18n = class extends EventEmitter {
|
|
1894
|
+
constructor(params) {
|
|
1895
|
+
super();
|
|
1896
|
+
__publicField2(this, "_locale");
|
|
1897
|
+
__publicField2(this, "_locales");
|
|
1898
|
+
__publicField2(this, "_localeData");
|
|
1899
|
+
__publicField2(this, "_messages");
|
|
1900
|
+
__publicField2(this, "_missing");
|
|
1901
|
+
__publicField2(this, "t", this._.bind(this));
|
|
1902
|
+
this._messages = {};
|
|
1903
|
+
this._localeData = {};
|
|
1904
|
+
if (params.missing != null)
|
|
1905
|
+
this._missing = params.missing;
|
|
1906
|
+
if (params.messages != null)
|
|
1907
|
+
this.load(params.messages);
|
|
1908
|
+
if (params.localeData != null)
|
|
1909
|
+
this.loadLocaleData(params.localeData);
|
|
1910
|
+
if (params.locale != null || params.locales != null) {
|
|
1911
|
+
this.activate(params.locale, params.locales);
|
|
1912
|
+
}
|
|
1913
|
+
}
|
|
1914
|
+
get locale() {
|
|
1915
|
+
return this._locale;
|
|
1916
|
+
}
|
|
1917
|
+
get locales() {
|
|
1918
|
+
return this._locales;
|
|
1919
|
+
}
|
|
1920
|
+
get messages() {
|
|
1921
|
+
var _a;
|
|
1922
|
+
return (_a = this._messages[this._locale]) != null ? _a : {};
|
|
1923
|
+
}
|
|
1924
|
+
/**
|
|
1925
|
+
* @deprecated this has no effect. Please remove this from the code. Deprecated in v4
|
|
1926
|
+
*/
|
|
1927
|
+
get localeData() {
|
|
1928
|
+
var _a;
|
|
1929
|
+
return (_a = this._localeData[this._locale]) != null ? _a : {};
|
|
1930
|
+
}
|
|
1931
|
+
_loadLocaleData(locale, localeData) {
|
|
1932
|
+
if (this._localeData[locale] == null) {
|
|
1933
|
+
this._localeData[locale] = localeData;
|
|
1934
|
+
} else {
|
|
1935
|
+
Object.assign(this._localeData[locale], localeData);
|
|
1936
|
+
}
|
|
1937
|
+
}
|
|
1938
|
+
/**
|
|
1939
|
+
* @deprecated Plurals automatically used from Intl.PluralRules you can safely remove this call. Deprecated in v4
|
|
1940
|
+
*/
|
|
1941
|
+
loadLocaleData(localeOrAllData, localeData) {
|
|
1942
|
+
if (localeData != null) {
|
|
1943
|
+
this._loadLocaleData(localeOrAllData, localeData);
|
|
1944
|
+
} else {
|
|
1945
|
+
Object.keys(localeOrAllData).forEach(
|
|
1946
|
+
(locale) => this._loadLocaleData(locale, localeOrAllData[locale])
|
|
1947
|
+
);
|
|
1948
|
+
}
|
|
1949
|
+
this.emit("change");
|
|
1950
|
+
}
|
|
1951
|
+
_load(locale, messages5) {
|
|
1952
|
+
if (this._messages[locale] == null) {
|
|
1953
|
+
this._messages[locale] = messages5;
|
|
1954
|
+
} else {
|
|
1955
|
+
Object.assign(this._messages[locale], messages5);
|
|
1956
|
+
}
|
|
1957
|
+
}
|
|
1958
|
+
load(localeOrMessages, messages5) {
|
|
1959
|
+
if (messages5 != null) {
|
|
1960
|
+
this._load(localeOrMessages, messages5);
|
|
1961
|
+
} else {
|
|
1962
|
+
Object.keys(localeOrMessages).forEach(
|
|
1963
|
+
(locale) => this._load(locale, localeOrMessages[locale])
|
|
1964
|
+
);
|
|
1965
|
+
}
|
|
1966
|
+
this.emit("change");
|
|
1967
|
+
}
|
|
1968
|
+
/**
|
|
1969
|
+
* @param options {@link LoadAndActivateOptions}
|
|
1970
|
+
*/
|
|
1971
|
+
loadAndActivate({ locale, locales, messages: messages5 }) {
|
|
1972
|
+
this._locale = locale;
|
|
1973
|
+
this._locales = locales || void 0;
|
|
1974
|
+
this._messages[this._locale] = messages5;
|
|
1975
|
+
this.emit("change");
|
|
1976
|
+
}
|
|
1977
|
+
activate(locale, locales) {
|
|
1978
|
+
if (true) {
|
|
1979
|
+
if (!this._messages[locale]) {
|
|
1980
|
+
console.warn(`Messages for locale "${locale}" not loaded.`);
|
|
1981
|
+
}
|
|
1982
|
+
}
|
|
1983
|
+
this._locale = locale;
|
|
1984
|
+
this._locales = locales;
|
|
1985
|
+
this.emit("change");
|
|
1986
|
+
}
|
|
1987
|
+
_(id, values = {}, { message, formats } = {}) {
|
|
1988
|
+
if (!isString(id)) {
|
|
1989
|
+
values = id.values || values;
|
|
1990
|
+
message = id.message;
|
|
1991
|
+
id = id.id;
|
|
1992
|
+
}
|
|
1993
|
+
const messageMissing = !this.messages[id];
|
|
1994
|
+
const missing = this._missing;
|
|
1995
|
+
if (missing && messageMissing) {
|
|
1996
|
+
return isFunction(missing) ? missing(this._locale, id) : missing;
|
|
1997
|
+
}
|
|
1998
|
+
if (messageMissing) {
|
|
1999
|
+
this.emit("missing", { id, locale: this._locale });
|
|
2000
|
+
}
|
|
2001
|
+
let translation = this.messages[id] || message || id;
|
|
2002
|
+
if (true) {
|
|
2003
|
+
translation = isString(translation) ? compileMessage(translation) : translation;
|
|
2004
|
+
}
|
|
2005
|
+
if (isString(translation) && UNICODE_REGEX.test(translation))
|
|
2006
|
+
return JSON.parse(`"${translation}"`);
|
|
2007
|
+
if (isString(translation))
|
|
2008
|
+
return translation;
|
|
2009
|
+
return interpolate(
|
|
2010
|
+
translation,
|
|
2011
|
+
this._locale,
|
|
2012
|
+
this._locales
|
|
2013
|
+
)(values, formats);
|
|
2014
|
+
}
|
|
2015
|
+
date(value, format) {
|
|
2016
|
+
return date(this._locales || this._locale, value, format);
|
|
2017
|
+
}
|
|
2018
|
+
number(value, format) {
|
|
2019
|
+
return number(this._locales || this._locale, value, format);
|
|
2020
|
+
}
|
|
2021
|
+
};
|
|
2022
|
+
function setupI18n(params = {}) {
|
|
2023
|
+
return new I18n(params);
|
|
2024
|
+
}
|
|
2025
|
+
var i18n = setupI18n();
|
|
2026
|
+
|
|
2027
|
+
// packages/attention/locales/en/messages.mjs
|
|
2028
|
+
var messages = JSON.parse('{"attention.aria.callout":"callout speech bubble","attention.aria.close":"Close","attention.aria.highlight":"highlighted speech bubble","attention.aria.pointingDown":"pointing down","attention.aria.pointingLeft":"pointing left","attention.aria.pointingRight":"pointing right","attention.aria.pointingUp":"pointing up","attention.aria.popover":"popover speech bubble","attention.aria.tooltip":"tooltip"}');
|
|
2029
|
+
|
|
2030
|
+
// packages/attention/locales/nb/messages.mjs
|
|
2031
|
+
var messages2 = JSON.parse('{"attention.aria.callout":"callout speech bubble","attention.aria.close":"Lukk","attention.aria.highlight":"highlighted speech bubble","attention.aria.pointingDown":"pointing down","attention.aria.pointingLeft":"pointing left","attention.aria.pointingRight":"pointing right","attention.aria.pointingUp":"pointing up","attention.aria.popover":"popover speech bubble","attention.aria.tooltip":"tooltip"}');
|
|
2032
|
+
|
|
2033
|
+
// packages/attention/locales/fi/messages.mjs
|
|
2034
|
+
var messages3 = JSON.parse('{"attention.aria.callout":"callout speech bubble","attention.aria.close":"Sulje","attention.aria.highlight":"highlighted speech bubble","attention.aria.pointingDown":"pointing down","attention.aria.pointingLeft":"pointing left","attention.aria.pointingRight":"pointing right","attention.aria.pointingUp":"pointing up","attention.aria.popover":"popover speech bubble","attention.aria.tooltip":"tooltip"}');
|
|
2035
|
+
|
|
2036
|
+
// packages/i18n.ts
|
|
2037
|
+
var supportedLocales = ["en", "nb", "fi"];
|
|
2038
|
+
var defaultLocale = "en";
|
|
2039
|
+
var getSupportedLocale = (usedLocale) => {
|
|
2040
|
+
return supportedLocales.find(
|
|
2041
|
+
(locale) => usedLocale === locale || usedLocale.toLowerCase().includes(locale)
|
|
2042
|
+
) || defaultLocale;
|
|
2043
|
+
};
|
|
2044
|
+
function detectLocale() {
|
|
2045
|
+
if (typeof window === "undefined") {
|
|
2046
|
+
const serverLocale = process.env.NMP_LANGUAGE || Intl.DateTimeFormat().resolvedOptions().locale;
|
|
2047
|
+
return getSupportedLocale(serverLocale);
|
|
2048
|
+
}
|
|
2049
|
+
try {
|
|
2050
|
+
const htmlLocale = document.documentElement.lang;
|
|
2051
|
+
return getSupportedLocale(htmlLocale);
|
|
2052
|
+
} catch (e2) {
|
|
2053
|
+
console.warn("could not detect locale, falling back to source locale", e2);
|
|
2054
|
+
return defaultLocale;
|
|
2055
|
+
}
|
|
2056
|
+
}
|
|
2057
|
+
var getMessages = (locale, enMsg, nbMsg, fiMsg) => {
|
|
2058
|
+
if (locale === "nb")
|
|
2059
|
+
return nbMsg;
|
|
2060
|
+
if (locale === "fi")
|
|
2061
|
+
return fiMsg;
|
|
2062
|
+
return enMsg;
|
|
2063
|
+
};
|
|
2064
|
+
var activateI18n = (enMessages, nbMessages, fiMessages) => {
|
|
2065
|
+
const locale = detectLocale();
|
|
2066
|
+
const messages5 = getMessages(locale, enMessages, nbMessages, fiMessages);
|
|
2067
|
+
i18n.load(locale, messages5);
|
|
2068
|
+
i18n.activate(locale);
|
|
2069
|
+
};
|
|
2070
|
+
|
|
2071
|
+
// node_modules/.pnpm/@warp-ds+icons@1.3.0/node_modules/@warp-ds/icons/dist/elements/close-16.js
|
|
2072
|
+
import { LitElement } from "lit";
|
|
2073
|
+
import { unsafeStatic, html } from "lit/static-html.js";
|
|
2074
|
+
var messages4 = JSON.parse('{"icon.title.close":"Kryss"}');
|
|
2075
|
+
var messages22 = JSON.parse('{"icon.title.close":"Cross"}');
|
|
2076
|
+
var messages32 = JSON.parse('{"icon.title.close":"Rasti"}');
|
|
2077
|
+
var supportedLocales2 = ["en", "nb", "fi"];
|
|
2078
|
+
var defaultLocale2 = "en";
|
|
2079
|
+
var getSupportedLocale2 = (usedLocale) => {
|
|
2080
|
+
return supportedLocales2.find(
|
|
2081
|
+
(locale) => usedLocale === locale || usedLocale.toLowerCase().includes(locale)
|
|
2082
|
+
) || defaultLocale2;
|
|
2083
|
+
};
|
|
2084
|
+
function detectLocale2() {
|
|
2085
|
+
if (typeof window === "undefined") {
|
|
2086
|
+
const serverLocale = process.env.NMP_LANGUAGE || Intl.DateTimeFormat().resolvedOptions().locale;
|
|
2087
|
+
return getSupportedLocale2(serverLocale);
|
|
2088
|
+
}
|
|
2089
|
+
try {
|
|
2090
|
+
const htmlLocale = document.documentElement.lang;
|
|
2091
|
+
return getSupportedLocale2(htmlLocale);
|
|
2092
|
+
} catch (e2) {
|
|
2093
|
+
console.warn("could not detect locale, falling back to source locale", e2);
|
|
2094
|
+
return defaultLocale2;
|
|
2095
|
+
}
|
|
2096
|
+
}
|
|
2097
|
+
var getMessages2 = (locale, enMsg, nbMsg, fiMsg) => {
|
|
2098
|
+
if (locale === "nb")
|
|
2099
|
+
return nbMsg;
|
|
2100
|
+
if (locale === "fi")
|
|
2101
|
+
return fiMsg;
|
|
2102
|
+
return enMsg;
|
|
2103
|
+
};
|
|
2104
|
+
var activateI18n2 = (enMessages, nbMessages, fiMessages) => {
|
|
2105
|
+
const locale = detectLocale2();
|
|
2106
|
+
const messages42 = getMessages2(locale, enMessages, nbMessages, fiMessages);
|
|
2107
|
+
i18n.load(locale, messages42);
|
|
2108
|
+
i18n.activate(locale);
|
|
2109
|
+
};
|
|
2110
|
+
activateI18n2(messages22, messages4, messages32);
|
|
2111
|
+
var IconClose16 = class extends LitElement {
|
|
2112
|
+
render() {
|
|
2113
|
+
const title = i18n.t({ message: `Cross`, id: "icon.title.close", comment: "Title for close icon" });
|
|
2114
|
+
return html`<svg xmlns="http://www.w3.org/2000/svg"width="16"height="16"fill="none"viewBox="0 0 16 16" part="w-icon-close-16-part">${unsafeStatic(`<title>${title}</title>`)}<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="m12.5 3.5-9 9M3.5 3.5l9 9"></path></svg>`;
|
|
2115
|
+
}
|
|
2116
|
+
};
|
|
2117
|
+
if (!customElements.get("w-icon-close-16")) {
|
|
2118
|
+
customElements.define("w-icon-close-16", IconClose16);
|
|
2119
|
+
}
|
|
2120
|
+
|
|
2121
|
+
// packages/attention/index.js
|
|
2122
|
+
var WarpAttention = class extends kebabCaseAttributes(WarpElement) {
|
|
2123
|
+
constructor() {
|
|
2124
|
+
super();
|
|
2125
|
+
activateI18n(messages, messages2, messages3);
|
|
2126
|
+
this.show = false;
|
|
2127
|
+
this.tooltip = false;
|
|
2128
|
+
this.callout = false;
|
|
2129
|
+
this.popover = false;
|
|
2130
|
+
this.highlight = false;
|
|
2131
|
+
this.canClose = false;
|
|
2132
|
+
this.noArrow = false;
|
|
2133
|
+
}
|
|
2134
|
+
connectedCallback() {
|
|
2135
|
+
super.connectedCallback();
|
|
2136
|
+
if (!this.placement || !Object.keys(opposites).includes(this.placement)) {
|
|
2137
|
+
throw new Error(
|
|
2138
|
+
`Invalid "placement" attribute. Set its value to one of the following:
|
|
2139
|
+
${JSON.stringify(
|
|
2140
|
+
Object.keys(opposites)
|
|
2141
|
+
)}`
|
|
2142
|
+
);
|
|
2143
|
+
}
|
|
2144
|
+
setTimeout(() => this.requestUpdate(), 0);
|
|
2145
|
+
}
|
|
2146
|
+
get _actualDirection() {
|
|
2147
|
+
return this.placement;
|
|
2148
|
+
}
|
|
2149
|
+
set _actualDirection(v3) {
|
|
2150
|
+
this.placement = v3;
|
|
2151
|
+
}
|
|
2152
|
+
get _arrowDirection() {
|
|
2153
|
+
return opposites[this.placement];
|
|
2154
|
+
}
|
|
2155
|
+
updated() {
|
|
2156
|
+
if (!this.callout) {
|
|
2157
|
+
this._attentionEl.style.setProperty(
|
|
2158
|
+
"--attention-visibility",
|
|
2159
|
+
this.show ? "" : "hidden"
|
|
2160
|
+
);
|
|
2161
|
+
}
|
|
2162
|
+
if (!this.tooltip) {
|
|
2163
|
+
this._attentionEl.style.setProperty(
|
|
2164
|
+
"--attention-display",
|
|
2165
|
+
this.show ? "flex" : "none"
|
|
2166
|
+
);
|
|
2167
|
+
}
|
|
2168
|
+
this.attentionState = {
|
|
2169
|
+
isShowing: this.show,
|
|
2170
|
+
isCallout: this.callout,
|
|
2171
|
+
actualDirection: this._actualDirection,
|
|
2172
|
+
directionName: this.placement,
|
|
2173
|
+
arrowEl: this.renderRoot.querySelector("#arrow"),
|
|
2174
|
+
attentionEl: this._attentionEl,
|
|
2175
|
+
targetEl: this._targetEl,
|
|
2176
|
+
noArrow: this.noArrow
|
|
2177
|
+
};
|
|
2178
|
+
useRecompute(this.attentionState);
|
|
2179
|
+
}
|
|
2180
|
+
pointingAtDirection() {
|
|
2181
|
+
switch (opposites[this._actualDirection]) {
|
|
2182
|
+
case "top":
|
|
2183
|
+
return i18n._({
|
|
2184
|
+
id: "attention.aria.pointingUp",
|
|
2185
|
+
message: "pointing up",
|
|
2186
|
+
comment: "Default screenreader message for top direction in the attention component"
|
|
2187
|
+
});
|
|
2188
|
+
case "right":
|
|
2189
|
+
return i18n._({
|
|
2190
|
+
id: "attention.aria.pointingRight",
|
|
2191
|
+
message: "pointing right",
|
|
2192
|
+
comment: "Default screenreader message for right direction in the attention component"
|
|
2193
|
+
});
|
|
2194
|
+
case "bottom":
|
|
2195
|
+
return i18n._({
|
|
2196
|
+
id: "attention.aria.pointingDown",
|
|
2197
|
+
message: "pointing down",
|
|
2198
|
+
comment: "Default screenreader message for bottom direction in the attention component"
|
|
2199
|
+
});
|
|
2200
|
+
case "left":
|
|
2201
|
+
return i18n._({
|
|
2202
|
+
id: "attention.aria.pointingLeft",
|
|
2203
|
+
message: "pointing left",
|
|
2204
|
+
comment: "Default screenreader message for left direction in the attention component"
|
|
2205
|
+
});
|
|
2206
|
+
default:
|
|
2207
|
+
return "";
|
|
2208
|
+
}
|
|
2209
|
+
}
|
|
2210
|
+
activeAttentionType() {
|
|
2211
|
+
switch (true) {
|
|
2212
|
+
case this.tooltip:
|
|
2213
|
+
return i18n._({
|
|
2214
|
+
id: "attention.aria.tooltip",
|
|
2215
|
+
message: "tooltip",
|
|
2216
|
+
comment: "Default screenreader message for tooltip in the attention component"
|
|
2217
|
+
});
|
|
2218
|
+
case this.callout:
|
|
2219
|
+
return i18n._({
|
|
2220
|
+
id: "attention.aria.callout",
|
|
2221
|
+
message: "callout speech bubble",
|
|
2222
|
+
comment: "Default screenreader message for callout speech bubble in the attention component"
|
|
2223
|
+
});
|
|
2224
|
+
case this.popover:
|
|
2225
|
+
return i18n._({
|
|
2226
|
+
id: "attention.aria.popover",
|
|
2227
|
+
message: "popover speech bubble",
|
|
2228
|
+
comment: "Default screenreader message for popover speech bubble in the attention component"
|
|
2229
|
+
});
|
|
2230
|
+
case this.highlight:
|
|
2231
|
+
return i18n._({
|
|
2232
|
+
id: "attention.aria.highlight",
|
|
2233
|
+
message: "highlighted speech bubble",
|
|
2234
|
+
comment: "Default screenreader message for highlighted speech bubble in the attention component"
|
|
2235
|
+
});
|
|
2236
|
+
default:
|
|
2237
|
+
return "";
|
|
2238
|
+
}
|
|
2239
|
+
}
|
|
2240
|
+
defaultAriaLabel() {
|
|
2241
|
+
return `${this.activeAttentionType()} ${!this.noArrow ? this.pointingAtDirection() : ""}`;
|
|
2242
|
+
}
|
|
2243
|
+
setAriaLabels() {
|
|
2244
|
+
if (this._targetEl && !this._targetEl.getAttribute("aria-details")) {
|
|
2245
|
+
const attentionMessageId = this._messageEl.id || (this._messageEl.id = generateRandomId());
|
|
2246
|
+
this._targetEl.setAttribute("aria-details", attentionMessageId);
|
|
2247
|
+
}
|
|
2248
|
+
}
|
|
2249
|
+
get _activeVariantClasses() {
|
|
2250
|
+
const variantProps = {
|
|
2251
|
+
callout: this.callout,
|
|
2252
|
+
popover: this.popover,
|
|
2253
|
+
tooltip: this.tooltip,
|
|
2254
|
+
highlight: this.highlight
|
|
2255
|
+
};
|
|
2256
|
+
const activeVariant = Object.keys(variantProps).find((b3) => !!variantProps[b3]) || "";
|
|
2257
|
+
return {
|
|
2258
|
+
wrapper: attention[activeVariant],
|
|
2259
|
+
arrow: attention[`arrow${activeVariant.charAt(0).toUpperCase() + activeVariant.slice(1)}`]
|
|
2260
|
+
};
|
|
2261
|
+
}
|
|
2262
|
+
get _ariaClose() {
|
|
2263
|
+
return i18n._({
|
|
2264
|
+
id: "attention.aria.close",
|
|
2265
|
+
message: "Close",
|
|
2266
|
+
comment: "Aria label for the close button in attention"
|
|
2267
|
+
});
|
|
2268
|
+
}
|
|
2269
|
+
firstUpdated() {
|
|
2270
|
+
this.setAriaLabels();
|
|
2271
|
+
if (this.callout) {
|
|
2272
|
+
this._attentionEl.style.position = "relative";
|
|
2273
|
+
}
|
|
2274
|
+
}
|
|
2275
|
+
get _attentionEl() {
|
|
2276
|
+
return this.renderRoot.querySelector("#attention");
|
|
2277
|
+
}
|
|
2278
|
+
get _targetEl() {
|
|
2279
|
+
return this.renderRoot.querySelector("slot[name='target']").assignedNodes()[0];
|
|
2280
|
+
}
|
|
2281
|
+
get _messageEl() {
|
|
2282
|
+
return this.renderRoot.querySelector("slot[name='message']").assignedNodes()[0];
|
|
2283
|
+
}
|
|
2284
|
+
get _wrapperClasses() {
|
|
2285
|
+
return classes({
|
|
2286
|
+
[attention.base]: true,
|
|
2287
|
+
[this._activeVariantClasses.wrapper]: true
|
|
2288
|
+
});
|
|
2289
|
+
}
|
|
2290
|
+
get _arrowClasses() {
|
|
2291
|
+
return classes({
|
|
2292
|
+
[attention.arrowBase]: true,
|
|
2293
|
+
[attention[`arrowDirection${this._arrowDirection.charAt(0).toUpperCase() + this._arrowDirection.slice(1)}`]]: true,
|
|
2294
|
+
[this._activeVariantClasses.arrow]: true
|
|
2295
|
+
});
|
|
2296
|
+
}
|
|
2297
|
+
get _arrowHtml() {
|
|
2298
|
+
return this.noArrow ? "" : html2`<div
|
|
5
2299
|
id="arrow"
|
|
6
2300
|
role="img"
|
|
7
2301
|
class="${this._arrowClasses}"
|
|
8
|
-
style="transform:rotate(${
|
|
9
|
-
margin-${this
|
|
10
|
-
|
|
2302
|
+
style="transform:rotate(${rotation[this._arrowDirection]}deg);
|
|
2303
|
+
margin-${// border alignment is off by a fraction of a pixel, this fixes it
|
|
2304
|
+
this._arrowDirection.charAt(0).toLowerCase() + this._arrowDirection.slice(1)}:-0.5px;"
|
|
2305
|
+
/>`;
|
|
2306
|
+
}
|
|
2307
|
+
close() {
|
|
2308
|
+
const event = new CustomEvent("close", {
|
|
2309
|
+
bubbles: true,
|
|
2310
|
+
composed: true
|
|
2311
|
+
});
|
|
2312
|
+
this.updateComplete.then(() => this.dispatchEvent(event));
|
|
2313
|
+
}
|
|
2314
|
+
keypressed(e2) {
|
|
2315
|
+
if (!this.canClose)
|
|
2316
|
+
return;
|
|
2317
|
+
if (e2.key === "Escape") {
|
|
2318
|
+
e2.preventDefault();
|
|
2319
|
+
this.close();
|
|
2320
|
+
}
|
|
2321
|
+
}
|
|
2322
|
+
get _closeBtnHtml() {
|
|
2323
|
+
return html2`
|
|
11
2324
|
<button
|
|
12
2325
|
aria-label="${this._ariaClose}"
|
|
13
2326
|
@click="${this.close}"
|
|
14
2327
|
@keydown=${this.keypressed}
|
|
15
|
-
class="${
|
|
2328
|
+
class="${attention.closeBtn}"
|
|
16
2329
|
>
|
|
17
2330
|
<w-icon-close-16 />
|
|
18
2331
|
</button>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
2332
|
+
`;
|
|
2333
|
+
}
|
|
2334
|
+
render() {
|
|
2335
|
+
return html2`
|
|
2336
|
+
<div class=${ifDefined(this.className ? this.className : void 0)}>
|
|
2337
|
+
${this.placement === "right" || this.placement === "bottom" ? html2`
|
|
22
2338
|
<slot name="target"></slot>
|
|
23
2339
|
|
|
24
2340
|
<div
|
|
25
2341
|
id="attention"
|
|
26
|
-
role="${this.tooltip?"tooltip":"img"}"
|
|
2342
|
+
role="${this.tooltip ? "tooltip" : "img"}"
|
|
27
2343
|
aria-label="${this.defaultAriaLabel()}"
|
|
28
2344
|
class="${this._wrapperClasses}"
|
|
29
2345
|
>
|
|
30
2346
|
${this._arrowHtml}
|
|
31
2347
|
<slot name="message"></slot>
|
|
32
|
-
${this.canClose?this._closeBtnHtml:
|
|
2348
|
+
${this.canClose ? this._closeBtnHtml : nothing}
|
|
33
2349
|
</div>
|
|
34
|
-
|
|
2350
|
+
` : html2`
|
|
35
2351
|
<div id="attention" class="${this._wrapperClasses}">
|
|
36
2352
|
<slot name="message"></slot>
|
|
37
2353
|
${this._arrowHtml}
|
|
38
|
-
${this.canClose?this._closeBtnHtml:
|
|
2354
|
+
${this.canClose ? this._closeBtnHtml : nothing}
|
|
39
2355
|
</div>
|
|
40
2356
|
<slot name="target"></slot>
|
|
41
2357
|
`}
|
|
42
2358
|
</div>
|
|
43
|
-
|
|
2359
|
+
`;
|
|
2360
|
+
}
|
|
2361
|
+
};
|
|
2362
|
+
__publicField(WarpAttention, "properties", {
|
|
2363
|
+
// Whether Attention element should be visible.
|
|
2364
|
+
show: { type: Boolean, reflect: true },
|
|
2365
|
+
// Placement according to the target element
|
|
2366
|
+
// Arrow would be on the opposite side of this position
|
|
2367
|
+
placement: { type: String },
|
|
2368
|
+
// Whether Attention element is rendered as a tooltip
|
|
2369
|
+
tooltip: { type: Boolean, reflect: true },
|
|
2370
|
+
// Whether Attention element is rendered as an inline callout
|
|
2371
|
+
callout: { type: Boolean, reflect: true },
|
|
2372
|
+
// Whether Attention element is rendered as a popover
|
|
2373
|
+
popover: { type: Boolean, reflect: true },
|
|
2374
|
+
// Whether Attention element is rendered as a highlight
|
|
2375
|
+
highlight: { type: Boolean, reflect: true },
|
|
2376
|
+
// Render Attention element with a close button
|
|
2377
|
+
canClose: { type: Boolean, reflect: true },
|
|
2378
|
+
// Render Attention element without an arrow
|
|
2379
|
+
noArrow: { type: Boolean, reflect: true }
|
|
2380
|
+
});
|
|
2381
|
+
__publicField(WarpAttention, "styles", [
|
|
2382
|
+
WarpElement.styles,
|
|
2383
|
+
css`
|
|
44
2384
|
#attention {
|
|
45
2385
|
position: absolute;
|
|
46
2386
|
z-index: 50;
|
|
@@ -56,5 +2396,12 @@ ${JSON.stringify(Object.keys(le))}`);setTimeout(()=>this.requestUpdate(),0)}get
|
|
|
56
2396
|
border-top-left-radius: 4px;
|
|
57
2397
|
z-index: 1;
|
|
58
2398
|
}
|
|
59
|
-
`
|
|
2399
|
+
`
|
|
2400
|
+
]);
|
|
2401
|
+
if (!customElements.get("w-attention")) {
|
|
2402
|
+
customElements.define("w-attention", WarpAttention);
|
|
2403
|
+
}
|
|
2404
|
+
export {
|
|
2405
|
+
WarpAttention
|
|
2406
|
+
};
|
|
60
2407
|
//# sourceMappingURL=index.js.map
|