help-layer 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +82 -8
- package/README.md +88 -8
- package/dist/help-layer.esm.js +35 -14
- package/dist/help-layer.esm.js.map +4 -4
- package/dist/help-layer.iife.js +34 -13
- package/dist/help-layer.iife.js.map +4 -4
- package/dist/types/config.d.ts +15 -0
- package/dist/types/floating.d.ts +12 -0
- package/dist/types/safe.d.ts +17 -0
- package/dist/types/toggle.d.ts +15 -15
- package/package.json +8 -3
- package/src/config.js +6 -4
- package/src/floating.js +50 -2
- package/src/observer.js +6 -2
- package/src/popup.js +10 -5
- package/src/safe.js +29 -0
- package/src/state.js +7 -1
- package/src/style.js +31 -10
- package/src/toggle.js +54 -46
package/dist/help-layer.iife.js
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
var HelpLayer=(()=>{var xt=Object.defineProperty;var _e=Object.getOwnPropertyDescriptor;var Ne=Object.getOwnPropertyNames;var Fe=Object.prototype.hasOwnProperty;var Be=(t,e)=>{for(var n in e)xt(t,n,{get:e[n],enumerable:!0})},We=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ne(e))!Fe.call(t,i)&&i!==n&&xt(t,i,{get:()=>e[i],enumerable:!(o=_e(e,i))||o.enumerable});return t};var He=t=>We(xt({},"__esModule",{value:!0}),t);var bn={};Be(bn,{initHelpLayer:()=>vn});var $t="help-layer-popup-title";function _t(){let t=document.createElement("div");return t.className="help-layer-blocking-layer",t}function Nt(t,e="?"){let n=document.createElement("button");return n.type="button",n.className="help-layer-marker",n.textContent=e,n.setAttribute("aria-label",`Help: ${t}`),n}function Ft(){let t=document.createElement("div");t.className="help-layer-popup",t.setAttribute("role","dialog"),t.setAttribute("aria-labelledby",$t),t.tabIndex=-1;let e=document.createElement("div");e.className="help-layer-popup__title",e.id=$t;let n=document.createElement("div");n.className="help-layer-popup__text";let o=document.createElement("button");return o.type="button",o.className="help-layer-popup__close",o.textContent="\xD7",o.setAttribute("aria-label","Close"),t.append(e,n,o),{root:t,titleEl:e,textEl:n,closeEl:o}}var q=Math.min,$=Math.max,tt=Math.round,et=Math.floor,T=t=>({x:t,y:t}),ze={left:"right",right:"left",bottom:"top",top:"bottom"};function yt(t,e,n){return $(t,q(e,n))}function nt(t,e){return typeof t=="function"?t(e):t}function H(t){return t.split("-")[0]}function ot(t){return t.split("-")[1]}function wt(t){return t==="x"?"y":"x"}function vt(t){return t==="y"?"height":"width"}function _(t){let e=t[0];return e==="t"||e==="b"?"y":"x"}function bt(t){return wt(_(t))}function Ht(t,e,n){n===void 0&&(n=!1);let o=ot(t),i=bt(t),r=vt(i),s=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=Q(s)),[s,Q(s)]}function zt(t){let e=Q(t);return[at(t),e,at(e)]}function at(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}var Bt=["left","right"],Wt=["right","left"],Ie=["top","bottom"],Ve=["bottom","top"];function je(t,e,n){switch(t){case"top":case"bottom":return n?e?Wt:Bt:e?Bt:Wt;case"left":case"right":return e?Ie:Ve;default:return[]}}function It(t,e,n,o){let i=ot(t),r=je(H(t),n==="start",o);return i&&(r=r.map(s=>s+"-"+i),e&&(r=r.concat(r.map(at)))),r}function Q(t){let e=H(t);return ze[e]+t.slice(e.length)}function Xe(t){return{top:0,right:0,bottom:0,left:0,...t}}function Vt(t){return typeof t!="number"?Xe(t):{top:t,right:t,bottom:t,left:t}}function I(t){let{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function jt(t,e,n){let{reference:o,floating:i}=t,r=_(e),s=bt(e),l=vt(s),a=H(e),p=r==="y",d=o.x+o.width/2-i.width/2,f=o.y+o.height/2-i.height/2,x=o[l]/2-i[l]/2,c;switch(a){case"top":c={x:d,y:o.y-i.height};break;case"bottom":c={x:d,y:o.y+o.height};break;case"right":c={x:o.x+o.width,y:f};break;case"left":c={x:o.x-i.width,y:f};break;default:c={x:o.x,y:o.y}}switch(ot(e)){case"start":c[s]-=x*(n&&p?-1:1);break;case"end":c[s]+=x*(n&&p?-1:1);break}return c}async function Xt(t,e){var n;e===void 0&&(e={});let{x:o,y:i,platform:r,rects:s,elements:l,strategy:a}=t,{boundary:p="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:x=!1,padding:c=0}=nt(e,t),u=Vt(c),m=l[x?f==="floating"?"reference":"floating":f],h=I(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(m)))==null||n?m:m.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(l.floating)),boundary:p,rootBoundary:d,strategy:a})),y=f==="floating"?{x:o,y:i,width:s.floating.width,height:s.floating.height}:s.reference,w=await(r.getOffsetParent==null?void 0:r.getOffsetParent(l.floating)),v=await(r.isElement==null?void 0:r.isElement(w))?await(r.getScale==null?void 0:r.getScale(w))||{x:1,y:1}:{x:1,y:1},b=I(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:w,strategy:a}):y);return{top:(h.top-b.top+u.top)/v.y,bottom:(b.bottom-h.bottom+u.bottom)/v.y,left:(h.left-b.left+u.left)/v.x,right:(b.right-h.right+u.right)/v.x}}var Ke=50,Kt=async(t,e,n)=>{let{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:s}=n,l=s.detectOverflow?s:{...s,detectOverflow:Xt},a=await(s.isRTL==null?void 0:s.isRTL(e)),p=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:d,y:f}=jt(p,o,a),x=o,c=0,u={};for(let g=0;g<r.length;g++){let m=r[g];if(!m)continue;let{name:h,fn:y}=m,{x:w,y:v,data:b,reset:E}=await y({x:d,y:f,initialPlacement:o,placement:x,strategy:i,middlewareData:u,rects:p,platform:l,elements:{reference:t,floating:e}});d=w??d,f=v??f,u[h]={...u[h],...b},E&&c<Ke&&(c++,typeof E=="object"&&(E.placement&&(x=E.placement),E.rects&&(p=E.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):E.rects),{x:d,y:f}=jt(p,x,a)),g=-1)}return{x:d,y:f,placement:x,strategy:i,middlewareData:u}};var Yt=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;let{placement:i,middlewareData:r,rects:s,initialPlacement:l,platform:a,elements:p}=e,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:x,fallbackStrategy:c="bestFit",fallbackAxisSideDirection:u="none",flipAlignment:g=!0,...m}=nt(t,e);if((n=r.arrow)!=null&&n.alignmentOffset)return{};let h=H(i),y=_(l),w=H(l)===l,v=await(a.isRTL==null?void 0:a.isRTL(p.floating)),b=x||(w||!g?[Q(l)]:zt(l)),E=u!=="none";!x&&E&&b.push(...It(l,g,u,v));let F=[l,...b],J=await a.detectOverflow(e,m),Y=[],R=((o=r.flip)==null?void 0:o.overflows)||[];if(d&&Y.push(J[h]),f){let B=Ht(i,s,v);Y.push(J[B[0]],J[B[1]])}if(R=[...R,{placement:i,overflows:Y}],!Y.every(B=>B<=0)){var L,lt;let B=(((L=r.flip)==null?void 0:L.index)||0)+1,A=F[B];if(A&&(!(f==="alignment"?y!==_(A):!1)||R.every(P=>_(P.placement)===y?P.overflows[0]>0:!0)))return{data:{index:B,overflows:R},reset:{placement:A}};let S=(lt=R.filter(z=>z.overflows[0]<=0).sort((z,P)=>z.overflows[1]-P.overflows[1])[0])==null?void 0:lt.placement;if(!S)switch(c){case"bestFit":{var ct;let z=(ct=R.filter(P=>{if(E){let W=_(P.placement);return W===y||W==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(W=>W>0).reduce((W,$e)=>W+$e,0)]).sort((P,W)=>P[1]-W[1])[0])==null?void 0:ct[0];z&&(S=z);break}case"initialPlacement":S=l;break}if(i!==S)return{reset:{placement:S}}}return{}}}};var Ye=new Set(["left","top"]);async function qe(t,e){let{placement:n,platform:o,elements:i}=t,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),s=H(n),l=ot(n),a=_(n)==="y",p=Ye.has(s)?-1:1,d=r&&a?-1:1,f=nt(e,t),{mainAxis:x,crossAxis:c,alignmentAxis:u}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof u=="number"&&(c=l==="end"?u*-1:u),a?{x:c*d,y:x*p}:{x:x*p,y:c*d}}var qt=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;let{x:i,y:r,placement:s,middlewareData:l}=e,a=await qe(e,t);return s===((n=l.offset)==null?void 0:n.placement)&&(o=l.arrow)!=null&&o.alignmentOffset?{}:{x:i+a.x,y:r+a.y,data:{...a,placement:s}}}}},Ut=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){let{x:n,y:o,placement:i,platform:r}=e,{mainAxis:s=!0,crossAxis:l=!1,limiter:a={fn:h=>{let{x:y,y:w}=h;return{x:y,y:w}}},...p}=nt(t,e),d={x:n,y:o},f=await r.detectOverflow(e,p),x=_(H(i)),c=wt(x),u=d[c],g=d[x];if(s){let h=c==="y"?"top":"left",y=c==="y"?"bottom":"right",w=u+f[h],v=u-f[y];u=yt(w,u,v)}if(l){let h=x==="y"?"top":"left",y=x==="y"?"bottom":"right",w=g+f[h],v=g-f[y];g=yt(w,g,v)}let m=a.fn({...e,[c]:u,[x]:g});return{...m,data:{x:m.x-n,y:m.y-o,enabled:{[c]:s,[x]:l}}}}}};function ft(){return typeof window<"u"}function j(t){return Gt(t)?(t.nodeName||"").toLowerCase():"#document"}function k(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function D(t){var e;return(e=(Gt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Gt(t){return ft()?t instanceof Node||t instanceof k(t).Node:!1}function C(t){return ft()?t instanceof Element||t instanceof k(t).Element:!1}function M(t){return ft()?t instanceof HTMLElement||t instanceof k(t).HTMLElement:!1}function Zt(t){return!ft()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof k(t).ShadowRoot}function Z(t){let{overflow:e,overflowX:n,overflowY:o,display:i}=O(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&i!=="inline"&&i!=="contents"}function Jt(t){return/^(table|td|th)$/.test(j(t))}function it(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}var Ue=/transform|translate|scale|rotate|perspective|filter/,Ze=/paint|layout|strict|content/,V=t=>!!t&&t!=="none",At;function ut(t){let e=C(t)?O(t):t;return V(e.transform)||V(e.translate)||V(e.scale)||V(e.rotate)||V(e.perspective)||!pt()&&(V(e.backdropFilter)||V(e.filter))||Ue.test(e.willChange||"")||Ze.test(e.contain||"")}function Qt(t){let e=N(t);for(;M(e)&&!X(e);){if(ut(e))return e;if(it(e))return null;e=N(e)}return null}function pt(){return At==null&&(At=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),At}function X(t){return/^(html|body|#document)$/.test(j(t))}function O(t){return k(t).getComputedStyle(t)}function rt(t){return C(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function N(t){if(j(t)==="html")return t;let e=t.assignedSlot||t.parentNode||Zt(t)&&t.host||D(t);return Zt(e)?e.host:e}function te(t){let e=N(t);return X(e)?t.ownerDocument?t.ownerDocument.body:t.body:M(e)&&Z(e)?e:te(e)}function U(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);let i=te(t),r=i===((o=t.ownerDocument)==null?void 0:o.body),s=k(i);if(r){let l=dt(s);return e.concat(s,s.visualViewport||[],Z(i)?i:[],l&&n?U(l):[])}else return e.concat(i,U(i,[],n))}function dt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function ie(t){let e=O(t),n=parseFloat(e.width)||0,o=parseFloat(e.height)||0,i=M(t),r=i?t.offsetWidth:n,s=i?t.offsetHeight:o,l=tt(n)!==r||tt(o)!==s;return l&&(n=r,o=s),{width:n,height:o,$:l}}function Rt(t){return C(t)?t:t.contextElement}function G(t){let e=Rt(t);if(!M(e))return T(1);let n=e.getBoundingClientRect(),{width:o,height:i,$:r}=ie(e),s=(r?tt(n.width):n.width)/o,l=(r?tt(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}var Ge=T(0);function re(t){let e=k(t);return!pt()||!e.visualViewport?Ge:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Je(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==k(t)?!1:e}function K(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);let i=t.getBoundingClientRect(),r=Rt(t),s=T(1);e&&(o?C(o)&&(s=G(o)):s=G(t));let l=Je(r,n,o)?re(r):T(0),a=(i.left+l.x)/s.x,p=(i.top+l.y)/s.y,d=i.width/s.x,f=i.height/s.y;if(r){let x=k(r),c=o&&C(o)?k(o):o,u=x,g=dt(u);for(;g&&o&&c!==u;){let m=G(g),h=g.getBoundingClientRect(),y=O(g),w=h.left+(g.clientLeft+parseFloat(y.paddingLeft))*m.x,v=h.top+(g.clientTop+parseFloat(y.paddingTop))*m.y;a*=m.x,p*=m.y,d*=m.x,f*=m.y,a+=w,p+=v,u=k(g),g=dt(u)}}return I({width:d,height:f,x:a,y:p})}function mt(t,e){let n=rt(t).scrollLeft;return e?e.left+n:K(D(t)).left+n}function se(t,e){let n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-mt(t,n),i=n.top+e.scrollTop;return{x:o,y:i}}function Qe(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t,r=i==="fixed",s=D(o),l=e?it(e.floating):!1;if(o===s||l&&r)return n;let a={scrollLeft:0,scrollTop:0},p=T(1),d=T(0),f=M(o);if((f||!f&&!r)&&((j(o)!=="body"||Z(s))&&(a=rt(o)),f)){let c=K(o);p=G(o),d.x=c.x+o.clientLeft,d.y=c.y+o.clientTop}let x=s&&!f&&!r?se(s,a):T(0);return{width:n.width*p.x,height:n.height*p.y,x:n.x*p.x-a.scrollLeft*p.x+d.x+x.x,y:n.y*p.y-a.scrollTop*p.y+d.y+x.y}}function tn(t){return Array.from(t.getClientRects())}function en(t){let e=D(t),n=rt(t),o=t.ownerDocument.body,i=$(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=$(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight),s=-n.scrollLeft+mt(t),l=-n.scrollTop;return O(o).direction==="rtl"&&(s+=$(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:s,y:l}}var ee=25;function nn(t,e){let n=k(t),o=D(t),i=n.visualViewport,r=o.clientWidth,s=o.clientHeight,l=0,a=0;if(i){r=i.width,s=i.height;let d=pt();(!d||d&&e==="fixed")&&(l=i.offsetLeft,a=i.offsetTop)}let p=mt(o);if(p<=0){let d=o.ownerDocument,f=d.body,x=getComputedStyle(f),c=d.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,u=Math.abs(o.clientWidth-f.clientWidth-c);u<=ee&&(r-=u)}else p<=ee&&(r+=p);return{width:r,height:s,x:l,y:a}}function on(t,e){let n=K(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=M(t)?G(t):T(1),s=t.clientWidth*r.x,l=t.clientHeight*r.y,a=i*r.x,p=o*r.y;return{width:s,height:l,x:a,y:p}}function ne(t,e,n){let o;if(e==="viewport")o=nn(t,n);else if(e==="document")o=en(D(t));else if(C(e))o=on(e,n);else{let i=re(t);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return I(o)}function le(t,e){let n=N(t);return n===e||!C(n)||X(n)?!1:O(n).position==="fixed"||le(n,e)}function rn(t,e){let n=e.get(t);if(n)return n;let o=U(t,[],!1).filter(l=>C(l)&&j(l)!=="body"),i=null,r=O(t).position==="fixed",s=r?N(t):t;for(;C(s)&&!X(s);){let l=O(s),a=ut(s);!a&&l.position==="fixed"&&(i=null),(r?!a&&!i:!a&&l.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||Z(s)&&!a&&le(t,s))?o=o.filter(d=>d!==s):i=l,s=N(s)}return e.set(t,o),o}function sn(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t,s=[...n==="clippingAncestors"?it(e)?[]:rn(e,this._c):[].concat(n),o],l=ne(e,s[0],i),a=l.top,p=l.right,d=l.bottom,f=l.left;for(let x=1;x<s.length;x++){let c=ne(e,s[x],i);a=$(c.top,a),p=q(c.right,p),d=q(c.bottom,d),f=$(c.left,f)}return{width:p-f,height:d-a,x:f,y:a}}function ln(t){let{width:e,height:n}=ie(t);return{width:e,height:n}}function cn(t,e,n){let o=M(e),i=D(e),r=n==="fixed",s=K(t,!0,r,e),l={scrollLeft:0,scrollTop:0},a=T(0);function p(){a.x=mt(i)}if(o||!o&&!r)if((j(e)!=="body"||Z(i))&&(l=rt(e)),o){let c=K(e,!0,r,e);a.x=c.x+e.clientLeft,a.y=c.y+e.clientTop}else i&&p();r&&!o&&i&&p();let d=i&&!o&&!r?se(i,l):T(0),f=s.left+l.scrollLeft-a.x-d.x,x=s.top+l.scrollTop-a.y-d.y;return{x:f,y:x,width:s.width,height:s.height}}function Et(t){return O(t).position==="static"}function oe(t,e){if(!M(t)||O(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return D(t)===n&&(n=n.ownerDocument.body),n}function ce(t,e){let n=k(t);if(it(t))return n;if(!M(t)){let i=N(t);for(;i&&!X(i);){if(C(i)&&!Et(i))return i;i=N(i)}return n}let o=oe(t,e);for(;o&&Jt(o)&&Et(o);)o=oe(o,e);return o&&X(o)&&Et(o)&&!ut(o)?n:o||Qt(t)||n}var an=async function(t){let e=this.getOffsetParent||ce,n=this.getDimensions,o=await n(t.floating);return{reference:cn(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function fn(t){return O(t).direction==="rtl"}var un={convertOffsetParentRelativeRectToViewportRelativeRect:Qe,getDocumentElement:D,getClippingRect:sn,getOffsetParent:ce,getElementRects:an,getClientRects:tn,getDimensions:ln,getScale:G,isElement:C,isRTL:fn};function ae(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function pn(t,e){let n=null,o,i=D(t);function r(){var l;clearTimeout(o),(l=n)==null||l.disconnect(),n=null}function s(l,a){l===void 0&&(l=!1),a===void 0&&(a=1),r();let p=t.getBoundingClientRect(),{left:d,top:f,width:x,height:c}=p;if(l||e(),!x||!c)return;let u=et(f),g=et(i.clientWidth-(d+x)),m=et(i.clientHeight-(f+c)),h=et(d),w={rootMargin:-u+"px "+-g+"px "+-m+"px "+-h+"px",threshold:$(0,q(1,a))||1},v=!0;function b(E){let F=E[0].intersectionRatio;if(F!==a){if(!v)return s();F?s(!1,F):o=setTimeout(()=>{s(!1,1e-7)},1e3)}F===1&&!ae(p,t.getBoundingClientRect())&&s(),v=!1}try{n=new IntersectionObserver(b,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,w)}n.observe(t)}return s(!0),r}function ht(t,e,n,o){o===void 0&&(o={});let{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:a=!1}=o,p=Rt(t),d=i||r?[...p?U(p):[],...e?U(e):[]]:[];d.forEach(h=>{i&&h.addEventListener("scroll",n,{passive:!0}),r&&h.addEventListener("resize",n)});let f=p&&l?pn(p,n):null,x=-1,c=null;s&&(c=new ResizeObserver(h=>{let[y]=h;y&&y.target===p&&c&&e&&(c.unobserve(e),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var w;(w=c)==null||w.observe(e)})),n()}),p&&!a&&c.observe(p),e&&c.observe(e));let u,g=a?K(t):null;a&&m();function m(){let h=K(t);g&&!ae(g,h)&&n(),g=h,u=requestAnimationFrame(m)}return n(),()=>{var h;d.forEach(y=>{i&&y.removeEventListener("scroll",n),r&&y.removeEventListener("resize",n)}),f?.(),(h=c)==null||h.disconnect(),c=null,a&&cancelAnimationFrame(u)}}var kt=qt;var fe=Ut,ue=Yt;var Ct=(t,e,n)=>{let o=new Map,i={platform:un,...n},r={...i.platform,_c:o};return Kt(t,e,{...i,platform:r})};function pe(t,e){let n=t.width||0,o=t.height||0,i=t.left-e.x,r=t.top-e.y;return{x:i,y:r,left:i,top:r,right:i+n,bottom:r+o,width:n,height:o}}function de(t){return{contextElement:document.body,getBoundingClientRect(){return pe(t(),{x:window.scrollX,y:window.scrollY})}}}function me(t,e,n){t.style.left=`${e}px`,t.style.top=`${n}px`}var Ot=11;function dn(t){let e=t.endsWith("-start");return{mainAxis:-Ot,crossAxis:e?Ot:-Ot}}function he(t,e,n,o="top-end"){return ht(t,e,()=>{Ct(t,e,{placement:o,middleware:[kt(dn(o))]}).then(({x:r,y:s})=>{me(e,r,s),n&&n()})},{animationFrame:!0})}function ge(t,e,n="bottom-start"){let o=()=>{Ct(t,e,{placement:n,middleware:[kt(8),ue({padding:8}),fe({padding:8})]}).then(({x:r,y:s})=>{me(e,r,s)})},i=ht(t,e,o,{animationFrame:!0});return{update:o,cleanup:i}}function xe(t,e,n){return ht(t,e,n)}function mn(t){let e=t.left,n=t.top,o=t.right,i=t.bottom;return`polygon(
|
|
1
|
+
var HelpLayer=(()=>{var wt=Object.defineProperty;var Fe=Object.getOwnPropertyDescriptor;var Be=Object.getOwnPropertyNames;var He=Object.prototype.hasOwnProperty;var We=(t,e)=>{for(var n in e)wt(t,n,{get:e[n],enumerable:!0})},Ie=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Be(e))!He.call(t,i)&&i!==n&&wt(t,i,{get:()=>e[i],enumerable:!(o=Fe(e,i))||o.enumerable});return t};var ze=t=>Ie(wt({},"__esModule",{value:!0}),t);var kn={};We(kn,{initHelpLayer:()=>En});var _t="help-layer-popup-title";function Nt(){let t=document.createElement("div");return t.className="help-layer-blocking-layer",t}function Ft(t,e="?"){let n=document.createElement("button");return n.type="button",n.className="help-layer-marker",n.textContent=e,n.setAttribute("aria-label",`Help: ${t}`),n}function Bt(){let t=document.createElement("div");t.className="help-layer-popup",t.setAttribute("role","dialog"),t.setAttribute("aria-labelledby",_t),t.tabIndex=-1;let e=document.createElement("div");e.className="help-layer-popup__title",e.id=_t;let n=document.createElement("div");n.className="help-layer-popup__text";let o=document.createElement("button");return o.type="button",o.className="help-layer-popup__close",o.textContent="\xD7",o.setAttribute("aria-label","Close"),t.append(e,n,o),{root:t,titleEl:e,textEl:n,closeEl:o}}var U=Math.min,F=Math.max,et=Math.round,nt=Math.floor,P=t=>({x:t,y:t}),Ve={left:"right",right:"left",bottom:"top",top:"bottom"};function vt(t,e,n){return F(t,U(e,n))}function ot(t,e){return typeof t=="function"?t(e):t}function z(t){return t.split("-")[0]}function it(t){return t.split("-")[1]}function bt(t){return t==="x"?"y":"x"}function At(t){return t==="y"?"height":"width"}function B(t){let e=t[0];return e==="t"||e==="b"?"y":"x"}function Et(t){return bt(B(t))}function It(t,e,n){n===void 0&&(n=!1);let o=it(t),i=Et(t),r=At(i),s=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=tt(s)),[s,tt(s)]}function zt(t){let e=tt(t);return[ut(t),e,ut(e)]}function ut(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}var Ht=["left","right"],Wt=["right","left"],je=["top","bottom"],Ke=["bottom","top"];function Xe(t,e,n){switch(t){case"top":case"bottom":return n?e?Wt:Ht:e?Ht:Wt;case"left":case"right":return e?je:Ke;default:return[]}}function Vt(t,e,n,o){let i=it(t),r=Xe(z(t),n==="start",o);return i&&(r=r.map(s=>s+"-"+i),e&&(r=r.concat(r.map(ut)))),r}function tt(t){let e=z(t);return Ve[e]+t.slice(e.length)}function Ye(t){return{top:0,right:0,bottom:0,left:0,...t}}function jt(t){return typeof t!="number"?Ye(t):{top:t,right:t,bottom:t,left:t}}function V(t){let{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function Kt(t,e,n){let{reference:o,floating:i}=t,r=B(e),s=Et(e),l=At(s),a=z(e),u=r==="y",p=o.x+o.width/2-i.width/2,f=o.y+o.height/2-i.height/2,g=o[l]/2-i[l]/2,c;switch(a){case"top":c={x:p,y:o.y-i.height};break;case"bottom":c={x:p,y:o.y+o.height};break;case"right":c={x:o.x+o.width,y:f};break;case"left":c={x:o.x-i.width,y:f};break;default:c={x:o.x,y:o.y}}switch(it(e)){case"start":c[s]-=g*(n&&u?-1:1);break;case"end":c[s]+=g*(n&&u?-1:1);break}return c}async function Xt(t,e){var n;e===void 0&&(e={});let{x:o,y:i,platform:r,rects:s,elements:l,strategy:a}=t,{boundary:u="clippingAncestors",rootBoundary:p="viewport",elementContext:f="floating",altBoundary:g=!1,padding:c=0}=ot(e,t),d=jt(c),h=l[g?f==="floating"?"reference":"floating":f],m=V(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(h)))==null||n?h:h.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(l.floating)),boundary:u,rootBoundary:p,strategy:a})),x=f==="floating"?{x:o,y:i,width:s.floating.width,height:s.floating.height}:s.reference,w=await(r.getOffsetParent==null?void 0:r.getOffsetParent(l.floating)),v=await(r.isElement==null?void 0:r.isElement(w))?await(r.getScale==null?void 0:r.getScale(w))||{x:1,y:1}:{x:1,y:1},A=V(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:x,offsetParent:w,strategy:a}):x);return{top:(m.top-A.top+d.top)/v.y,bottom:(A.bottom-m.bottom+d.bottom)/v.y,left:(m.left-A.left+d.left)/v.x,right:(A.right-m.right+d.right)/v.x}}var qe=50,Yt=async(t,e,n)=>{let{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:s}=n,l=s.detectOverflow?s:{...s,detectOverflow:Xt},a=await(s.isRTL==null?void 0:s.isRTL(e)),u=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:p,y:f}=Kt(u,o,a),g=o,c=0,d={};for(let y=0;y<r.length;y++){let h=r[y];if(!h)continue;let{name:m,fn:x}=h,{x:w,y:v,data:A,reset:E}=await x({x:p,y:f,initialPlacement:o,placement:g,strategy:i,middlewareData:d,rects:u,platform:l,elements:{reference:t,floating:e}});p=w??p,f=v??f,d[m]={...d[m],...A},E&&c<qe&&(c++,typeof E=="object"&&(E.placement&&(g=E.placement),E.rects&&(u=E.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):E.rects),{x:p,y:f}=Kt(u,g,a)),y=-1)}return{x:p,y:f,placement:g,strategy:i,middlewareData:d}};var qt=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;let{placement:i,middlewareData:r,rects:s,initialPlacement:l,platform:a,elements:u}=e,{mainAxis:p=!0,crossAxis:f=!0,fallbackPlacements:g,fallbackStrategy:c="bestFit",fallbackAxisSideDirection:d="none",flipAlignment:y=!0,...h}=ot(t,e);if((n=r.arrow)!=null&&n.alignmentOffset)return{};let m=z(i),x=B(l),w=z(l)===l,v=await(a.isRTL==null?void 0:a.isRTL(u.floating)),A=g||(w||!y?[tt(l)]:zt(l)),E=d!=="none";!g&&E&&A.push(...Vt(l,y,d,v));let M=[l,...A],Q=await a.detectOverflow(e,h),q=[],W=((o=r.flip)==null?void 0:o.overflows)||[];if(p&&q.push(Q[m]),f){let N=It(i,s,v);q.push(Q[N[0]],Q[N[1]])}if(W=[...W,{placement:i,overflows:q}],!q.every(N=>N<=0)){var $,S;let N=((($=r.flip)==null?void 0:$.index)||0)+1,ft=M[N];if(ft&&(!(f==="alignment"?x!==B(ft):!1)||W.every(L=>B(L.placement)===x?L.overflows[0]>0:!0)))return{data:{index:N,overflows:W},reset:{placement:ft}};let b=(S=W.filter(O=>O.overflows[0]<=0).sort((O,L)=>O.overflows[1]-L.overflows[1])[0])==null?void 0:S.placement;if(!b)switch(c){case"bestFit":{var at;let O=(at=W.filter(L=>{if(E){let I=B(L.placement);return I===x||I==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(I=>I>0).reduce((I,Ne)=>I+Ne,0)]).sort((L,I)=>L[1]-I[1])[0])==null?void 0:at[0];O&&(b=O);break}case"initialPlacement":b=l;break}if(i!==b)return{reset:{placement:b}}}return{}}}};var Ue=new Set(["left","top"]);async function Ze(t,e){let{placement:n,platform:o,elements:i}=t,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),s=z(n),l=it(n),a=B(n)==="y",u=Ue.has(s)?-1:1,p=r&&a?-1:1,f=ot(e,t),{mainAxis:g,crossAxis:c,alignmentAxis:d}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof d=="number"&&(c=l==="end"?d*-1:d),a?{x:c*p,y:g*u}:{x:g*u,y:c*p}}var Ut=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;let{x:i,y:r,placement:s,middlewareData:l}=e,a=await Ze(e,t);return s===((n=l.offset)==null?void 0:n.placement)&&(o=l.arrow)!=null&&o.alignmentOffset?{}:{x:i+a.x,y:r+a.y,data:{...a,placement:s}}}}},Zt=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){let{x:n,y:o,placement:i,platform:r}=e,{mainAxis:s=!0,crossAxis:l=!1,limiter:a={fn:m=>{let{x,y:w}=m;return{x,y:w}}},...u}=ot(t,e),p={x:n,y:o},f=await r.detectOverflow(e,u),g=B(z(i)),c=bt(g),d=p[c],y=p[g];if(s){let m=c==="y"?"top":"left",x=c==="y"?"bottom":"right",w=d+f[m],v=d-f[x];d=vt(w,d,v)}if(l){let m=g==="y"?"top":"left",x=g==="y"?"bottom":"right",w=y+f[m],v=y-f[x];y=vt(w,y,v)}let h=a.fn({...e,[c]:d,[g]:y});return{...h,data:{x:h.x-n,y:h.y-o,enabled:{[c]:s,[g]:l}}}}}};function pt(){return typeof window<"u"}function K(t){return Jt(t)?(t.nodeName||"").toLowerCase():"#document"}function k(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function T(t){var e;return(e=(Jt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Jt(t){return pt()?t instanceof Node||t instanceof k(t).Node:!1}function R(t){return pt()?t instanceof Element||t instanceof k(t).Element:!1}function _(t){return pt()?t instanceof HTMLElement||t instanceof k(t).HTMLElement:!1}function Gt(t){return!pt()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof k(t).ShadowRoot}function G(t){let{overflow:e,overflowX:n,overflowY:o,display:i}=C(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&i!=="inline"&&i!=="contents"}function Qt(t){return/^(table|td|th)$/.test(K(t))}function rt(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}var Ge=/transform|translate|scale|rotate|perspective|filter/,Je=/paint|layout|strict|content/,j=t=>!!t&&t!=="none",kt;function dt(t){let e=R(t)?C(t):t;return j(e.transform)||j(e.translate)||j(e.scale)||j(e.rotate)||j(e.perspective)||!mt()&&(j(e.backdropFilter)||j(e.filter))||Ge.test(e.willChange||"")||Je.test(e.contain||"")}function te(t){let e=H(t);for(;_(e)&&!X(e);){if(dt(e))return e;if(rt(e))return null;e=H(e)}return null}function mt(){return kt==null&&(kt=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),kt}function X(t){return/^(html|body|#document)$/.test(K(t))}function C(t){return k(t).getComputedStyle(t)}function st(t){return R(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function H(t){if(K(t)==="html")return t;let e=t.assignedSlot||t.parentNode||Gt(t)&&t.host||T(t);return Gt(e)?e.host:e}function ee(t){let e=H(t);return X(e)?t.ownerDocument?t.ownerDocument.body:t.body:_(e)&&G(e)?e:ee(e)}function Z(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);let i=ee(t),r=i===((o=t.ownerDocument)==null?void 0:o.body),s=k(i);if(r){let l=ht(s);return e.concat(s,s.visualViewport||[],G(i)?i:[],l&&n?Z(l):[])}else return e.concat(i,Z(i,[],n))}function ht(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function re(t){let e=C(t),n=parseFloat(e.width)||0,o=parseFloat(e.height)||0,i=_(t),r=i?t.offsetWidth:n,s=i?t.offsetHeight:o,l=et(n)!==r||et(o)!==s;return l&&(n=r,o=s),{width:n,height:o,$:l}}function Rt(t){return R(t)?t:t.contextElement}function J(t){let e=Rt(t);if(!_(e))return P(1);let n=e.getBoundingClientRect(),{width:o,height:i,$:r}=re(e),s=(r?et(n.width):n.width)/o,l=(r?et(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}var Qe=P(0);function se(t){let e=k(t);return!mt()||!e.visualViewport?Qe:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function tn(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==k(t)?!1:e}function Y(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);let i=t.getBoundingClientRect(),r=Rt(t),s=P(1);e&&(o?R(o)&&(s=J(o)):s=J(t));let l=tn(r,n,o)?se(r):P(0),a=(i.left+l.x)/s.x,u=(i.top+l.y)/s.y,p=i.width/s.x,f=i.height/s.y;if(r){let g=k(r),c=o&&R(o)?k(o):o,d=g,y=ht(d);for(;y&&o&&c!==d;){let h=J(y),m=y.getBoundingClientRect(),x=C(y),w=m.left+(y.clientLeft+parseFloat(x.paddingLeft))*h.x,v=m.top+(y.clientTop+parseFloat(x.paddingTop))*h.y;a*=h.x,u*=h.y,p*=h.x,f*=h.y,a+=w,u+=v,d=k(y),y=ht(d)}}return V({width:p,height:f,x:a,y:u})}function gt(t,e){let n=st(t).scrollLeft;return e?e.left+n:Y(T(t)).left+n}function le(t,e){let n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-gt(t,n),i=n.top+e.scrollTop;return{x:o,y:i}}function en(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t,r=i==="fixed",s=T(o),l=e?rt(e.floating):!1;if(o===s||l&&r)return n;let a={scrollLeft:0,scrollTop:0},u=P(1),p=P(0),f=_(o);if((f||!f&&!r)&&((K(o)!=="body"||G(s))&&(a=st(o)),f)){let c=Y(o);u=J(o),p.x=c.x+o.clientLeft,p.y=c.y+o.clientTop}let g=s&&!f&&!r?le(s,a):P(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-a.scrollLeft*u.x+p.x+g.x,y:n.y*u.y-a.scrollTop*u.y+p.y+g.y}}function nn(t){return Array.from(t.getClientRects())}function on(t){let e=T(t),n=st(t),o=t.ownerDocument.body,i=F(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=F(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight),s=-n.scrollLeft+gt(t),l=-n.scrollTop;return C(o).direction==="rtl"&&(s+=F(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:s,y:l}}var ne=25;function rn(t,e){let n=k(t),o=T(t),i=n.visualViewport,r=o.clientWidth,s=o.clientHeight,l=0,a=0;if(i){r=i.width,s=i.height;let p=mt();(!p||p&&e==="fixed")&&(l=i.offsetLeft,a=i.offsetTop)}let u=gt(o);if(u<=0){let p=o.ownerDocument,f=p.body,g=getComputedStyle(f),c=p.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,d=Math.abs(o.clientWidth-f.clientWidth-c);d<=ne&&(r-=d)}else u<=ne&&(r+=u);return{width:r,height:s,x:l,y:a}}function sn(t,e){let n=Y(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=_(t)?J(t):P(1),s=t.clientWidth*r.x,l=t.clientHeight*r.y,a=i*r.x,u=o*r.y;return{width:s,height:l,x:a,y:u}}function oe(t,e,n){let o;if(e==="viewport")o=rn(t,n);else if(e==="document")o=on(T(t));else if(R(e))o=sn(e,n);else{let i=se(t);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return V(o)}function ce(t,e){let n=H(t);return n===e||!R(n)||X(n)?!1:C(n).position==="fixed"||ce(n,e)}function ln(t,e){let n=e.get(t);if(n)return n;let o=Z(t,[],!1).filter(l=>R(l)&&K(l)!=="body"),i=null,r=C(t).position==="fixed",s=r?H(t):t;for(;R(s)&&!X(s);){let l=C(s),a=dt(s);!a&&l.position==="fixed"&&(i=null),(r?!a&&!i:!a&&l.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||G(s)&&!a&&ce(t,s))?o=o.filter(p=>p!==s):i=l,s=H(s)}return e.set(t,o),o}function cn(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t,s=[...n==="clippingAncestors"?rt(e)?[]:ln(e,this._c):[].concat(n),o],l=oe(e,s[0],i),a=l.top,u=l.right,p=l.bottom,f=l.left;for(let g=1;g<s.length;g++){let c=oe(e,s[g],i);a=F(c.top,a),u=U(c.right,u),p=U(c.bottom,p),f=F(c.left,f)}return{width:u-f,height:p-a,x:f,y:a}}function an(t){let{width:e,height:n}=re(t);return{width:e,height:n}}function fn(t,e,n){let o=_(e),i=T(e),r=n==="fixed",s=Y(t,!0,r,e),l={scrollLeft:0,scrollTop:0},a=P(0);function u(){a.x=gt(i)}if(o||!o&&!r)if((K(e)!=="body"||G(i))&&(l=st(e)),o){let c=Y(e,!0,r,e);a.x=c.x+e.clientLeft,a.y=c.y+e.clientTop}else i&&u();r&&!o&&i&&u();let p=i&&!o&&!r?le(i,l):P(0),f=s.left+l.scrollLeft-a.x-p.x,g=s.top+l.scrollTop-a.y-p.y;return{x:f,y:g,width:s.width,height:s.height}}function Ot(t){return C(t).position==="static"}function ie(t,e){if(!_(t)||C(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return T(t)===n&&(n=n.ownerDocument.body),n}function ae(t,e){let n=k(t);if(rt(t))return n;if(!_(t)){let i=H(t);for(;i&&!X(i);){if(R(i)&&!Ot(i))return i;i=H(i)}return n}let o=ie(t,e);for(;o&&Qt(o)&&Ot(o);)o=ie(o,e);return o&&X(o)&&Ot(o)&&!dt(o)?n:o||te(t)||n}var un=async function(t){let e=this.getOffsetParent||ae,n=this.getDimensions,o=await n(t.floating);return{reference:fn(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function pn(t){return C(t).direction==="rtl"}var dn={convertOffsetParentRelativeRectToViewportRelativeRect:en,getDocumentElement:T,getClippingRect:cn,getOffsetParent:ae,getElementRects:un,getClientRects:nn,getDimensions:an,getScale:J,isElement:R,isRTL:pn};function fe(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function mn(t,e){let n=null,o,i=T(t);function r(){var l;clearTimeout(o),(l=n)==null||l.disconnect(),n=null}function s(l,a){l===void 0&&(l=!1),a===void 0&&(a=1),r();let u=t.getBoundingClientRect(),{left:p,top:f,width:g,height:c}=u;if(l||e(),!g||!c)return;let d=nt(f),y=nt(i.clientWidth-(p+g)),h=nt(i.clientHeight-(f+c)),m=nt(p),w={rootMargin:-d+"px "+-y+"px "+-h+"px "+-m+"px",threshold:F(0,U(1,a))||1},v=!0;function A(E){let M=E[0].intersectionRatio;if(M!==a){if(!v)return s();M?s(!1,M):o=setTimeout(()=>{s(!1,1e-7)},1e3)}M===1&&!fe(u,t.getBoundingClientRect())&&s(),v=!1}try{n=new IntersectionObserver(A,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(A,w)}n.observe(t)}return s(!0),r}function yt(t,e,n,o){o===void 0&&(o={});let{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:a=!1}=o,u=Rt(t),p=i||r?[...u?Z(u):[],...e?Z(e):[]]:[];p.forEach(m=>{i&&m.addEventListener("scroll",n,{passive:!0}),r&&m.addEventListener("resize",n)});let f=u&&l?mn(u,n):null,g=-1,c=null;s&&(c=new ResizeObserver(m=>{let[x]=m;x&&x.target===u&&c&&e&&(c.unobserve(e),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var w;(w=c)==null||w.observe(e)})),n()}),u&&!a&&c.observe(u),e&&c.observe(e));let d,y=a?Y(t):null;a&&h();function h(){let m=Y(t);y&&!fe(y,m)&&n(),y=m,d=requestAnimationFrame(h)}return n(),()=>{var m;p.forEach(x=>{i&&x.removeEventListener("scroll",n),r&&x.removeEventListener("resize",n)}),f?.(),(m=c)==null||m.disconnect(),c=null,a&&cancelAnimationFrame(d)}}var Ct=Ut;var ue=Zt,pe=qt;var St=(t,e,n)=>{let o=new Map,i={platform:dn,...n},r={...i.platform,_c:o};return Yt(t,e,{...i,platform:r})};function de(t,e){let n=t.width||0,o=t.height||0,i=t.left-e.x,r=t.top-e.y;return{x:i,y:r,left:i,top:r,right:i+n,bottom:r+o,width:n,height:o}}function me(t){return{contextElement:document.body,getBoundingClientRect(){return de(t(),{x:window.scrollX,y:window.scrollY})}}}function he(t,e,n){t.style.left=`${e}px`,t.style.top=`${n}px`}function ge(t){if(!(t instanceof Element))return!1;let e=t;for(;e;){if(getComputedStyle(e).position==="fixed")return!0;let n=e.parentElement;if(n)e=n;else{let o=e.getRootNode();e=o instanceof ShadowRoot?o.host:null}}return!1}var Lt=11;function hn(t){let e=t.endsWith("-start");return{mainAxis:-Lt,crossAxis:e?Lt:-Lt}}function ye(t,e,n,o="top-end"){let i=ge(t)?"fixed":"absolute";return i==="fixed"&&e.style.setProperty("position","fixed","important"),yt(t,e,()=>{St(t,e,{placement:o,strategy:i,middleware:[Ct(hn(o))]}).then(({x:s,y:l})=>{he(e,s,l),n&&n()}).catch(()=>{})},{animationFrame:!0})}function xe(t,e,n="bottom-start"){let o=ge(t)?"fixed":"absolute";e.style.setProperty("position",o,"important");let i=()=>{St(t,e,{placement:n,strategy:o,middleware:[Ct(8),pe({padding:8}),ue({padding:8})]}).then(({x:s,y:l})=>{he(e,s,l)}).catch(()=>{})},r=yt(t,e,i,{animationFrame:!0});return{update:i,cleanup:r}}function we(t,e,n){return yt(t,e,n)}function gn(t){let e=t.left,n=t.top,o=t.right,i=t.bottom;return`polygon(
|
|
2
2
|
0px 0px, 100% 0px, 100% 100%, 0px 100%, 0px 0px,
|
|
3
3
|
${e}px ${n}px, ${e}px ${i}px, ${o}px ${i}px, ${o}px ${n}px, ${e}px ${n}px
|
|
4
|
-
)`}function
|
|
4
|
+
)`}function ve(t,{toggleEl:e,onBackgroundClick:n,isLibraryElement:o,onEscape:i}){let r=Nt();if(document.body.appendChild(r),t.track(()=>r.remove()),e){let g=we(e,r,()=>{r.style.clipPath=gn(e.getBoundingClientRect())});t.track(g)}n&&(r.addEventListener("click",n),t.track(()=>r.removeEventListener("click",n)));let s=document.activeElement;s instanceof HTMLElement&&s!==document.body&&s!==e&&s.blur();let l=f=>{o(f.target)||(f.stopPropagation(),e?e.focus({preventScroll:!0}):f.target instanceof HTMLElement&&f.target.blur())};document.addEventListener("focusin",l,!0),t.track(()=>document.removeEventListener("focusin",l,!0));let a=f=>{o(f.target)||(f.stopPropagation(),f.preventDefault())},u=f=>{if(f.key==="Escape"){f.stopPropagation(),f.preventDefault();return}a(f)},p=f=>{if(f.key==="Escape"){f.stopPropagation(),f.preventDefault(),i&&i();return}a(f)};return document.addEventListener("keydown",p,!0),document.addEventListener("keyup",u,!0),document.addEventListener("keypress",u,!0),t.track(()=>{document.removeEventListener("keydown",p,!0),document.removeEventListener("keyup",u,!0),document.removeEventListener("keypress",u,!0)}),r}function lt(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function be(t){return lt(t)&&Number.isFinite(t.top)&&Number.isFinite(t.left)}function Pt(t){if(!lt(t))throw new Error("helpConfig must be a plain object");for(let[e,n]of Object.entries(t)){if(!lt(n))throw new Error(`helpConfig["${e}"] must be an object`);if(typeof n.title!="string"||n.title==="")throw new Error(`helpConfig["${e}"].title must be a non-empty string`);if(typeof n.text!="string"||n.text==="")throw new Error(`helpConfig["${e}"].text must be a non-empty string`);if(n.position!==void 0&&!be(n.position))throw new Error(`helpConfig["${e}"].position must be { top: finite number, left: finite number }`)}}function Ae(t){return Object.entries(t).map(([e,n])=>be(n.position)?{key:e,title:n.title,text:n.text,kind:"free",target:null,position:{top:n.position.top,left:n.position.left}}:{key:e,title:n.title,text:n.text,kind:"element",target:null,position:null})}function Ee(t,e={}){let n=e.minDistance??26,o=e.iterations??6,i=t.map(r=>({x:r.x,y:r.y}));for(let r=0;r<o;r++){let s=!1;for(let l=0;l<i.length;l++)for(let a=l+1;a<i.length;a++){let u=i[l],p=i[a],f=p.x-u.x,g=p.y-u.y,c=Math.hypot(f,g);if(c>=n)continue;c===0&&(f=1,g=0,c=1);let d=(n-c)/2,y=f/c,h=g/c;u.x-=y*d,u.y-=h*d,p.x+=y*d,p.y+=h*d,s=!0}if(!s)break}return i.map((r,s)=>({dx:r.x-t[s].x,dy:r.y-t[s].y}))}var ke="help-layer-target-highlight";function yn(t){return t.kind==="free"?me(()=>({top:t.position.top,left:t.position.left,width:0,height:0})):t.target}function Oe(t,{onMarkerClick:e,onOverlapResolved:n,markerLabel:o="?",markerPlacement:i="top-end"}){let r=new Map,s=null,l=!1;function a(){s=null;let c=[...r.values()];if(c.length<=1){let h=c.length===1?c[0].el:null;h&&h.style.transform&&(h.style.transform="",n&&n());return}c.forEach(h=>{h.el.style.transform=""});let d=c.map(h=>{let m=h.el.getBoundingClientRect();return{x:m.left+m.width/2,y:m.top+m.height/2}}),y=Ee(d);c.forEach((h,m)=>{let{dx:x,dy:w}=y[m];h.el.style.transform=x||w?`translate(${x}px, ${w}px)`:""}),n&&n()}function u(){s!==null||l||(s=requestAnimationFrame(a))}function p(c){if(r.has(c.id))return;let d=Ft(c.title,o);document.body.appendChild(d);let y=()=>e(c,d);d.addEventListener("click",y);let h=ye(yn(c),d,u,i),m=c.kind==="element"?c.target:null,x=()=>m&&m.classList.add(ke),w=()=>m&&m.classList.remove(ke);m&&(d.addEventListener("mouseenter",x),d.addEventListener("mouseleave",w),d.addEventListener("focus",x),d.addEventListener("blur",w));let v=!1,A=()=>{v||(v=!0,h(),d.removeEventListener("click",y),m&&(d.removeEventListener("mouseenter",x),d.removeEventListener("mouseleave",w),d.removeEventListener("focus",x),d.removeEventListener("blur",w),w()),d.remove(),r.delete(c.id),u())};r.set(c.id,{record:c,el:d,cleanup:A})}function f(c){let d=r.get(c);d&&d.cleanup()}function g(c){c.forEach(p)}return t.track(()=>{l=!0,s!==null&&(cancelAnimationFrame(s),s=null),[...r.values()].forEach(c=>c.cleanup())}),{mount:p,unmount:f,mountAll:g,has(c){return r.has(c)},findByKey(c){for(let d of r.values())if(d.record.key===c)return d;return null}}}function D(t,e,...n){if(e)try{return e(...n)}catch(o){console.error(`[help-layer] ${t} threw:`,o);return}}var xn=1;function ct(t,e,n,o){typeof t.querySelectorAll=="function"&&t.querySelectorAll("*").forEach(i=>{n&&i.matches(e)&&n(i),i.shadowRoot&&(o&&o(i.shadowRoot),ct(i.shadowRoot,e,n,o))})}function Ce(t,e){let n=[];return ct(t,e,o=>n.push(o)),n}function wn(t){let e=[];return ct(t,"*",null,n=>e.push(n)),e}function Re(t,e){let n=[],o=[];if(t.nodeType!==xn)return{matches:n,shadowRoots:o};let i=t;return typeof i.matches=="function"&&i.matches(e)&&n.push(i),i.shadowRoot&&(o.push(i.shadowRoot),ct(i.shadowRoot,e,r=>n.push(r),r=>o.push(r))),ct(i,e,r=>n.push(r),r=>o.push(r)),{matches:n,shadowRoots:o}}function Se({root:t=document,selector:e,onAdded:n,onRemoved:o}){let i=new Set,r=a=>{for(let u of a)u.addedNodes.forEach(p=>{let{matches:f,shadowRoots:g}=Re(p,e);f.forEach(c=>D("observer onAdded",n,c)),g.forEach(l)}),u.removedNodes.forEach(p=>{Re(p,e).matches.forEach(f=>D("observer onRemoved",o,f))})},s=new MutationObserver(r);function l(a){i.has(a)||(i.add(a),s.observe(a,{childList:!0,subtree:!0}))}return l(t),wn(t).forEach(l),{disconnect(){s.disconnect(),i.clear()}}}var xt="data-help-title",Tt="data-help-text";function Dt(t="data-help-id"){return`[${t}], [${xt}]`}function Mt(t){let e=new Map;for(let n of t)n.kind==="element"&&e.set(n.key,n);return e}function Le(t){return t.filter(e=>e.kind==="free").map(e=>({id:e.key,kind:"free",key:e.key,title:e.title,text:e.text,position:e.position}))}function $t(t,e,n="data-help-id"){let o=t.getAttribute(n),i=o!=null?e.get(o):void 0,r=i?i.title:t.getAttribute(xt),s=i?i.text:t.getAttribute(Tt);return!r||!s?null:{id:t,kind:"element",key:o,title:r,text:s,target:t}}function Pe(t,e=document,{silent:n=!1,attribute:o="data-help-id"}={}){let i=Mt(t),r=[];return Ce(e,Dt(o)).forEach(s=>{let l=$t(s,i,o);if(!l){if(!n){let a=s.getAttribute(o);console.warn(a!=null?`[help-layer] element with ${o}="${a}" has no matching helpConfig entry or inline ${xt}/${Tt}`:`[help-layer] element needs both ${xt} and ${Tt} (or a ${o} matching helpConfig)`)}return}r.push(l)}),r}function Te(t,{onClose:e,render:n,popupPlacement:o="bottom-start"}={}){let{root:i,titleEl:r,textEl:s,closeEl:l}=Bt();i.style.setProperty("display","none","important"),document.body.appendChild(i),l.addEventListener("click",()=>y());let a=null,u=null,p=null;function f(){p&&(p.cleanup(),p=null)}function g(h,m){r.textContent=h.title;let x=D("render",n,h);s.textContent="",x?s.appendChild(x):s.textContent=h.text,i.style.setProperty("display","block","important"),a=h.id,u=m,f(),p=xe(m,i,o),i.focus({preventScroll:!0})}function c(){p&&p.update()}function d(){let h=a!==null;f(),a=null,u=null,i.style.setProperty("display","none","important"),h&&D("onClose",e)}function y(h){let m=h??u;d(),m&&m.isConnected&&typeof m.focus=="function"&&m.focus({preventScroll:!0})}return t.track(()=>{d(),i.remove()}),{root:i,isOpen(h){return a===h},getOpenId(){return a},open:g,close:y,reposition:c}}function De(){let t=[];return{track(e){t.push(e)},teardownAll(){for(;t.length>0;){let e=t.pop();try{e()}catch(n){console.error("[help-layer] teardown step threw:",n)}}}}}var vn="data-help-layer-style",bn=`
|
|
5
5
|
.help-layer-blocking-layer {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
/* Structural properties !important so a host can't accidentally un-fix or restack the layer and
|
|
7
|
+
defeat the blocking guarantee. */
|
|
8
|
+
position: fixed !important;
|
|
9
|
+
inset: 0 !important;
|
|
10
|
+
pointer-events: auto !important;
|
|
8
11
|
/* Default transparent (unchanged). Set --help-layer-overlay-bg to tint it into a scrim that signals
|
|
9
12
|
"the host app is inactive". The clip-path hole isn't painted, so the toggle stays untinted. */
|
|
10
13
|
background: var(--help-layer-overlay-bg, transparent);
|
|
11
14
|
/* Cursor over the blocked area only (the toggle shows through the hole and keeps its own cursor).
|
|
12
15
|
e.g. not-allowed / help makes "this won't respond" obvious without needing a tint. */
|
|
13
16
|
cursor: var(--help-layer-overlay-cursor, default);
|
|
14
|
-
z-index: 2147483000;
|
|
17
|
+
z-index: 2147483000 !important;
|
|
15
18
|
}
|
|
16
19
|
|
|
17
20
|
.help-layer-marker {
|
|
@@ -21,11 +24,20 @@ var HelpLayer=(()=>{var xt=Object.defineProperty;var _e=Object.getOwnPropertyDes
|
|
|
21
24
|
margin: 0;
|
|
22
25
|
padding: 0;
|
|
23
26
|
border: none;
|
|
24
|
-
|
|
27
|
+
/* Structural properties are !important so a host's broad rules (e.g. button { display:none }) can't
|
|
28
|
+
hide or distort the marker. top/left stay non-important because place() writes them inline per
|
|
29
|
+
frame; !important there would override that and pin the marker to 0,0. Theme stays var()-driven.
|
|
30
|
+
Note: for targets in a position:fixed subtree, floating.js overrides this with an inline
|
|
31
|
+
position:fixed !important (inline important beats this rule) so the marker doesn't jitter. */
|
|
32
|
+
position: absolute !important;
|
|
33
|
+
display: block !important;
|
|
34
|
+
visibility: visible !important;
|
|
35
|
+
opacity: 1 !important;
|
|
36
|
+
pointer-events: auto !important;
|
|
25
37
|
top: 0;
|
|
26
38
|
left: 0;
|
|
27
|
-
width: var(--help-layer-marker-size, 22px);
|
|
28
|
-
height: var(--help-layer-marker-size, 22px);
|
|
39
|
+
width: var(--help-layer-marker-size, 22px) !important;
|
|
40
|
+
height: var(--help-layer-marker-size, 22px) !important;
|
|
29
41
|
border-radius: 50%;
|
|
30
42
|
background: var(--help-layer-marker-bg, #2563eb);
|
|
31
43
|
color: var(--help-layer-marker-color, #fff);
|
|
@@ -37,7 +49,7 @@ var HelpLayer=(()=>{var xt=Object.defineProperty;var _e=Object.getOwnPropertyDes
|
|
|
37
49
|
cursor: pointer;
|
|
38
50
|
user-select: none;
|
|
39
51
|
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
|
|
40
|
-
z-index: 2147483001;
|
|
52
|
+
z-index: 2147483001 !important;
|
|
41
53
|
}
|
|
42
54
|
|
|
43
55
|
.help-layer-marker:focus-visible {
|
|
@@ -46,7 +58,13 @@ var HelpLayer=(()=>{var xt=Object.defineProperty;var _e=Object.getOwnPropertyDes
|
|
|
46
58
|
}
|
|
47
59
|
|
|
48
60
|
.help-layer-popup {
|
|
49
|
-
|
|
61
|
+
/* Structural !important guards against host resets; top/left stay inline (place()), and display is
|
|
62
|
+
deliberately NOT !important here \u2014 popup.js toggles it via an inline !important declaration so the
|
|
63
|
+
open/close state itself can also beat a host rule without this stylesheet fighting the toggle. */
|
|
64
|
+
position: absolute !important;
|
|
65
|
+
visibility: visible !important;
|
|
66
|
+
opacity: 1 !important;
|
|
67
|
+
pointer-events: auto !important;
|
|
50
68
|
top: 0;
|
|
51
69
|
left: 0;
|
|
52
70
|
display: none;
|
|
@@ -59,7 +77,7 @@ var HelpLayer=(()=>{var xt=Object.defineProperty;var _e=Object.getOwnPropertyDes
|
|
|
59
77
|
font-family: sans-serif;
|
|
60
78
|
font-size: 13px;
|
|
61
79
|
line-height: 1.5;
|
|
62
|
-
z-index: 2147483002;
|
|
80
|
+
z-index: 2147483002 !important;
|
|
63
81
|
}
|
|
64
82
|
|
|
65
83
|
.help-layer-popup:focus {
|
|
@@ -91,7 +109,10 @@ var HelpLayer=(()=>{var xt=Object.defineProperty;var _e=Object.getOwnPropertyDes
|
|
|
91
109
|
/* reset of the button element */
|
|
92
110
|
appearance: none;
|
|
93
111
|
-webkit-appearance: none;
|
|
94
|
-
|
|
112
|
+
/* Keep the close affordance visible/placed even under host button { ... } rules. */
|
|
113
|
+
display: block !important;
|
|
114
|
+
position: absolute !important;
|
|
115
|
+
pointer-events: auto !important;
|
|
95
116
|
top: 6px;
|
|
96
117
|
right: 6px;
|
|
97
118
|
width: 22px;
|
|
@@ -135,5 +156,5 @@ var HelpLayer=(()=>{var xt=Object.defineProperty;var _e=Object.getOwnPropertyDes
|
|
|
135
156
|
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.55);
|
|
136
157
|
}
|
|
137
158
|
}
|
|
138
|
-
`;function
|
|
159
|
+
`;function Me(t){let e=document.createElement("style");return e.setAttribute(vn,""),t&&e.setAttribute("nonce",t),e.textContent=bn,document.head.appendChild(e),e}function $e(t){t.remove()}function An(t){if(typeof t=="string"){let e=document.querySelector(t);if(!e)throw new Error(`help-layer: toggle element not found for selector "${t}"`);return e}if(t instanceof HTMLElement)return t;throw new Error("help-layer: toggle must be a CSS selector string or a DOM element")}function _e(t){if(!lt(t))throw new Error("help-layer: initHelpLayer requires an options object");let{config:e,toggle:n,onEnable:o,onDisable:i,onOpen:r,onClose:s,silent:l=!1,attribute:a="data-help-id",render:u,markerLabel:p="?",markerPlacement:f="top-end",popupPlacement:g="bottom-start",nonce:c}=t,d=e;Pt(d);let y=n!=null?An(n):null,h=null,m=null,x=null;function w(){if(h)return;h=De(),y&&h.track(()=>{y.isConnected&&typeof y.focus=="function"&&y.focus({preventScroll:!0})});let $=Me(c);h.track(()=>$e($));let S=Ae(d),at=Mt(S);m=Te(h,{onClose:s,render:u,popupPlacement:g}),x=Oe(h,{markerLabel:p,markerPlacement:f,onMarkerClick:(b,O)=>{if(m.isOpen(b.id)){m.close();return}m.open(b,O),D("onOpen",r,b)},onOverlapResolved:()=>m.reposition()}),x.mountAll(Le(S)),x.mountAll(Pe(S,document,{silent:l,attribute:a}));let N=Se({selector:Dt(a),onAdded:b=>{let O=$t(b,at,a);O&&!x.has(O.id)&&x.mount(O)},onRemoved:b=>{m.isOpen(b)&&m.close(y??void 0),x.unmount(b)}});h.track(()=>N.disconnect()),ve(h,{toggleEl:y,onBackgroundClick:()=>m.close(),isLibraryElement:b=>!!b&&((y?y.contains(b):!1)||m.root.contains(b)||typeof b.closest=="function"&&!!b.closest(".help-layer-marker")),onEscape:()=>{m.getOpenId()!==null?m.close():E()}})}function v(){h&&(h.teardownAll(),h=null,m=null,x=null)}function A(){h||(w(),D("onEnable",o))}function E(){h&&(v(),D("onDisable",i))}function M(){h?E():A()}function Q($){if(h||A(),!x||!m)return;let S=x.findByKey($);if(!S){l||console.warn(`[help-layer] open(): no help marker for key "${$}"`);return}m.open(S.record,S.el),D("onOpen",r,S.record)}function q(){m&&m.close()}function W($){Pt($),d=$,h&&(v(),w())}return y&&y.addEventListener("click",M),{enable:A,disable:E,toggle:M,isActive(){return h!==null},open:Q,close:q,update:W,destroy(){E(),y&&y.removeEventListener("click",M)}}}function En(t){return _e(t)}return ze(kn);})();
|
|
139
160
|
//# sourceMappingURL=help-layer.iife.js.map
|