fix: add checks for timeline allowed blocks and template#81
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the yard/timeline block to only allow/use timeline child blocks that are actually registered, preventing UI options (like the heading selector) from appearing when the collapse item block isn’t available.
Changes:
- Detects whether
yard/timeline-itemand/oryard/timeline-item-collapseare registered and derivesallowedBlocksfrom that. - Updates the default inner-blocks template to fall back to whichever timeline item block is available.
- Regenerates compiled build artifacts (including unrelated bundles like TOC and counting-number) and updates corresponding
.asset.phpversions.
Reviewed changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/Blocks/timeline/edit.js | Dynamically computes allowed inner blocks + fallback template based on registered child blocks. |
| build/Blocks/timeline/index.js | Compiled output reflecting the timeline editor changes. |
| build/Blocks/timeline/index.asset.php | Asset version bump for the timeline editor script. |
| build/Blocks/table-of-contents/view.js | Rebuilt compiled TOC bundle (large diff). |
| build/Blocks/table-of-contents/view.asset.php | Asset version bump for TOC view script. |
| build/Blocks/facetwp/index.asset.php | Asset version bump (suggests facetwp build output changed). |
| build/Blocks/counting-number/frontend.js | Rebuilt compiled counting-number frontend bundle (large diff). |
| build/Blocks/counting-number/frontend.asset.php | Asset version bump for counting-number frontend script. |
Comments suppressed due to low confidence (1)
src/Blocks/timeline/edit.js:60
- When neither 'yard/timeline-item' nor 'yard/timeline-item-collapse' is registered,
ALLOWED_BLOCKSbecomes an empty array and the fallback template stays empty, so<InnerBlocks>ends up with no allowed blocks and no template. This makes the timeline block effectively unusable in the editor without any guidance. Consider rendering a clear placeholder/notice in this case (or otherwise providing a meaningful fallback) so users know why they can’t add items.
const ALLOWED_BLOCKS = [
hasTimelineItemRegistered && 'yard/timeline-item',
hasTimelineItemCollapseRegistered && 'yard/timeline-item-collapse',
].filter( Boolean );
let fallbackTemplate = [];
if ( hasTimelineItemRegistered ) {
fallbackTemplate = [ [ 'yard/timeline-item' ] ];
} else if ( hasTimelineItemCollapseRegistered ) {
fallbackTemplate = [ [ 'yard/timeline-item-collapse' ] ];
}
const TEMPLATE = applyFilters( 'yard.timeline-template', fallbackTemplate );
return (
<List { ...useBlockProps() }>
<Inspector { ...props } allowedBlocks={ ALLOWED_BLOCKS } />
<TimelineButtonBlockAppender
rootClientId={ clientId }
insertionPosition="prepend"
/>
<InnerBlocks
allowedBlocks={ ALLOWED_BLOCKS }
renderAppender={ false }
template={ TEMPLATE }
/>
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| (()=>{var e={694(e,t,n){"use strict";var r=n(925);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},556(e,t,n){e.exports=n(694)()},925(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},887(e,t,n){"use strict";var r=n(305),o=n(994);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=o(n(634)),a=o(n(693)),l=o(n(847)),s=r(n(609)),c=n(556),u=o(n(894));function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach(function(t){(0,a.default)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function p(e){var t=e.isOpen,n=e.onRest,r=e.style,o=e.transition,a=e.className,c=(0,l.default)(e,["isOpen","onRest","style","transition","className"]),d=(0,s.useRef)(null),p=(0,u.default)({isOpen:t,content:d}),m=p.setIsExpandedStyle,h=p.setIsCollapsedStyle,b=p.style,v=f(f({willChange:"height",transition:o},r),b);return s.default.createElement("div",(0,i.default)({ref:d,style:v,className:a,onTransitionEnd:function(e){e.target===d.current&&"height"===e.propertyName&&(t?m():h(),n&&n())}},c))}p.defaultProps={isOpen:!1,onRest:null,style:null,className:"react-css-collapse-transition",transition:"height 250ms cubic-bezier(0.4, 0, 0.2, 1)"},p.propTypes={isOpen:c.bool,onRest:c.func,style:(0,c.shape)({}),className:c.string,transition:c.string};var m=p;t.default=m},906(e,t,n){"use strict";var r=n(994);t.Ay=void 0;var o=r(n(887)),i=(r(n(894)),o.default);t.Ay=i},894(e,t,n){"use strict";var r=n(994);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(715)),i=n(609);function a(e){return e&&e.current&&e.current.scrollHeight?"".concat(e.current.scrollHeight,"px"):"0px"}t.default=function(e){var t=e.isOpen,n=e.content,r=(0,i.useState)("0"),l=(0,o.default)(r,2),s=l[0],c=l[1],u=(0,i.useState)("hidden"),d=(0,o.default)(u,2),f=d[0],p=d[1],m=(0,i.useState)("hidden"),h=(0,o.default)(m,2),b=h[0],v=h[1],y=(0,i.useState)(!0),g=(0,o.default)(y,2),w=g[0],T=g[1];return(0,i.useEffect)(function(){t?(v("visible"),w?(c("auto"),p("visible")):c(a(n))):w||(c(a(n)),window.requestAnimationFrame(function(){setTimeout(function(){c("0"),p("hidden")})}))},[t]),(0,i.useEffect)(function(){T(!1)},[]),{setIsExpandedStyle:function(){c("auto"),p("visible"),v("visible")},setIsCollapsedStyle:function(){v("hidden")},style:{overflow:f,visibility:b,height:s}}}},609(e){"use strict";e.exports=window.React},79(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r},e.exports.__esModule=!0,e.exports.default=e.exports},987(e){e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},693(e,t,n){var r=n(736);e.exports=function(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports},634(e){function t(){return e.exports=t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.exports.__esModule=!0,e.exports.default=e.exports,t.apply(null,arguments)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},994(e){e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},305(e,t,n){var r=n(738).default;function o(t,n){if("function"==typeof WeakMap)var i=new WeakMap,a=new WeakMap;return(e.exports=o=function(e,t){if(!t&&e&&e.__esModule)return e;var n,o,l={__proto__:null,default:e};if(null===e||"object"!=r(e)&&"function"!=typeof e)return l;if(n=t?a:i){if(n.has(e))return n.get(e);n.set(e,l)}for(var s in e)"default"!==s&&{}.hasOwnProperty.call(e,s)&&((o=(n=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,s))&&(o.get||o.set)?n(l,s,o):l[s]=e[s]);return l},e.exports.__esModule=!0,e.exports.default=e.exports)(t,n)}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},156(e){e.exports=function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}},e.exports.__esModule=!0,e.exports.default=e.exports},752(e){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},847(e,t,n){var r=n(893);e.exports=function(e,t){if(null==e)return{};var n,o,i=r(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i},e.exports.__esModule=!0,e.exports.default=e.exports},893(e){e.exports=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n},e.exports.__esModule=!0,e.exports.default=e.exports},715(e,t,n){var r=n(987),o=n(156),i=n(122),a=n(752);e.exports=function(e,t){return r(e)||o(e,t)||i(e,t)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},45(e,t,n){var r=n(738).default;e.exports=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},736(e,t,n){var r=n(738).default,o=n(45);e.exports=function(e){var t=o(e,"string");return"symbol"==r(t)?t:t+""},e.exports.__esModule=!0,e.exports.default=e.exports},738(e){function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},122(e,t,n){var r=n(79);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}(()=>{"use strict";const e=window.wp.element,t=window.ReactJSXRuntime;var r=n(609),o=n(906);const{entries:i,setPrototypeOf:a,isFrozen:l,getPrototypeOf:s,getOwnPropertyDescriptor:c}=Object;let{freeze:u,seal:d,create:f}=Object,{apply:p,construct:m}="undefined"!=typeof Reflect&&Reflect;u||(u=function(e){return e}),d||(d=function(e){return e}),p||(p=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return e.apply(t,r)}),m||(m=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new e(...n)});const h=R(Array.prototype.forEach),b=R(Array.prototype.lastIndexOf),v=R(Array.prototype.pop),y=R(Array.prototype.push),g=R(Array.prototype.splice),w=R(String.prototype.toLowerCase),T=R(String.prototype.toString),S=R(String.prototype.match),x=R(String.prototype.replace),E=R(String.prototype.indexOf),N=R(String.prototype.trim),O=R(Object.prototype.hasOwnProperty),A=R(RegExp.prototype.test),_=(C=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return m(C,t)});var C;function R(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return p(e,t,r)}}function I(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:w;a&&a(e,null);let r=t.length;for(;r--;){let o=t[r];if("string"==typeof o){const e=n(o);e!==o&&(l(t)||(t[r]=e),o=e)}e[o]=!0}return e}function k(e){for(let t=0;t<e.length;t++)O(e,t)||(e[t]=null);return e}function D(e){const t=f(null);for(const[n,r]of i(e))O(e,n)&&(Array.isArray(r)?t[n]=k(r):r&&"object"==typeof r&&r.constructor===Object?t[n]=D(r):t[n]=r);return t}function L(e,t){for(;null!==e;){const n=c(e,t);if(n){if(n.get)return R(n.get);if("function"==typeof n.value)return R(n.value)}e=s(e)}return function(){return null}}const M=u(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),P=u(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),j=u(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),F=u(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),U=u(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),z=u(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),H=u(["#text"]),B=u(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),G=u(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),W=u(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Y=u(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),q=d(/\{\{[\w\W]*|[\w\W]*\}\}/gm),K=d(/<%[\w\W]*|[\w\W]*%>/gm),X=d(/\$\{[\w\W]*/gm),V=d(/^data-[\-\w.\u00B7-\uFFFF]+$/),$=d(/^aria-[\-\w]+$/),J=d(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Z=d(/^(?:\w+script|data):/i),Q=d(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ee=d(/^html$/i),te=d(/^[a-z][.\w]*(-[.\w]+)+$/i);var ne=Object.freeze({__proto__:null,ARIA_ATTR:$,ATTR_WHITESPACE:Q,CUSTOM_ELEMENT:te,DATA_ATTR:V,DOCTYPE_NAME:ee,ERB_EXPR:K,IS_ALLOWED_URI:J,IS_SCRIPT_OR_DATA:Z,MUSTACHE_EXPR:q,TMPLIT_EXPR:X});const re=function(){return"undefined"==typeof window?null:window};var oe=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:re();const n=t=>e(t);if(n.version="3.3.3",n.removed=[],!t||!t.document||9!==t.document.nodeType||!t.Element)return n.isSupported=!1,n;let{document:r}=t;const o=r,a=o.currentScript,{DocumentFragment:l,HTMLTemplateElement:s,Node:c,Element:d,NodeFilter:p,NamedNodeMap:m=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:C,DOMParser:R,trustedTypes:k}=t,q=d.prototype,K=L(q,"cloneNode"),X=L(q,"remove"),V=L(q,"nextSibling"),$=L(q,"childNodes"),Z=L(q,"parentNode");if("function"==typeof s){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let Q,te="";const{implementation:oe,createNodeIterator:ie,createDocumentFragment:ae,getElementsByTagName:le}=r,{importNode:se}=o;let ce={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof i&&"function"==typeof Z&&oe&&void 0!==oe.createHTMLDocument;const{MUSTACHE_EXPR:ue,ERB_EXPR:de,TMPLIT_EXPR:fe,DATA_ATTR:pe,ARIA_ATTR:me,IS_SCRIPT_OR_DATA:he,ATTR_WHITESPACE:be,CUSTOM_ELEMENT:ve}=ne;let{IS_ALLOWED_URI:ye}=ne,ge=null;const we=I({},[...M,...P,...j,...U,...H]);let Te=null;const Se=I({},[...B,...G,...W,...Y]);let xe=Object.seal(f(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ee=null,Ne=null;const Oe=Object.seal(f(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ae=!0,_e=!0,Ce=!1,Re=!0,Ie=!1,ke=!0,De=!1,Le=!1,Me=!1,Pe=!1,je=!1,Fe=!1,Ue=!0,ze=!1,He=!0,Be=!1,Ge={},We=null;const Ye=I({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let qe=null;const Ke=I({},["audio","video","img","source","image","track"]);let Xe=null;const Ve=I({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),$e="http://www.w3.org/1998/Math/MathML",Je="http://www.w3.org/2000/svg",Ze="http://www.w3.org/1999/xhtml";let Qe=Ze,et=!1,tt=null;const nt=I({},[$e,Je,Ze],T);let rt=I({},["mi","mo","mn","ms","mtext"]),ot=I({},["annotation-xml"]);const it=I({},["title","style","font","a","script"]);let at=null;const lt=["application/xhtml+xml","text/html"];let st=null,ct=null;const ut=r.createElement("form"),dt=function(e){return e instanceof RegExp||e instanceof Function},ft=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!ct||ct!==e){if(e&&"object"==typeof e||(e={}),e=D(e),at=-1===lt.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,st="application/xhtml+xml"===at?T:w,ge=O(e,"ALLOWED_TAGS")?I({},e.ALLOWED_TAGS,st):we,Te=O(e,"ALLOWED_ATTR")?I({},e.ALLOWED_ATTR,st):Se,tt=O(e,"ALLOWED_NAMESPACES")?I({},e.ALLOWED_NAMESPACES,T):nt,Xe=O(e,"ADD_URI_SAFE_ATTR")?I(D(Ve),e.ADD_URI_SAFE_ATTR,st):Ve,qe=O(e,"ADD_DATA_URI_TAGS")?I(D(Ke),e.ADD_DATA_URI_TAGS,st):Ke,We=O(e,"FORBID_CONTENTS")?I({},e.FORBID_CONTENTS,st):Ye,Ee=O(e,"FORBID_TAGS")?I({},e.FORBID_TAGS,st):D({}),Ne=O(e,"FORBID_ATTR")?I({},e.FORBID_ATTR,st):D({}),Ge=!!O(e,"USE_PROFILES")&&e.USE_PROFILES,Ae=!1!==e.ALLOW_ARIA_ATTR,_e=!1!==e.ALLOW_DATA_ATTR,Ce=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Re=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Ie=e.SAFE_FOR_TEMPLATES||!1,ke=!1!==e.SAFE_FOR_XML,De=e.WHOLE_DOCUMENT||!1,Pe=e.RETURN_DOM||!1,je=e.RETURN_DOM_FRAGMENT||!1,Fe=e.RETURN_TRUSTED_TYPE||!1,Me=e.FORCE_BODY||!1,Ue=!1!==e.SANITIZE_DOM,ze=e.SANITIZE_NAMED_PROPS||!1,He=!1!==e.KEEP_CONTENT,Be=e.IN_PLACE||!1,ye=e.ALLOWED_URI_REGEXP||J,Qe=e.NAMESPACE||Ze,rt=e.MATHML_TEXT_INTEGRATION_POINTS||rt,ot=e.HTML_INTEGRATION_POINTS||ot,xe=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&dt(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(xe.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&dt(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(xe.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(xe.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ie&&(_e=!1),je&&(Pe=!0),Ge&&(ge=I({},H),Te=f(null),!0===Ge.html&&(I(ge,M),I(Te,B)),!0===Ge.svg&&(I(ge,P),I(Te,G),I(Te,Y)),!0===Ge.svgFilters&&(I(ge,j),I(Te,G),I(Te,Y)),!0===Ge.mathMl&&(I(ge,U),I(Te,W),I(Te,Y))),O(e,"ADD_TAGS")||(Oe.tagCheck=null),O(e,"ADD_ATTR")||(Oe.attributeCheck=null),e.ADD_TAGS&&("function"==typeof e.ADD_TAGS?Oe.tagCheck=e.ADD_TAGS:(ge===we&&(ge=D(ge)),I(ge,e.ADD_TAGS,st))),e.ADD_ATTR&&("function"==typeof e.ADD_ATTR?Oe.attributeCheck=e.ADD_ATTR:(Te===Se&&(Te=D(Te)),I(Te,e.ADD_ATTR,st))),e.ADD_URI_SAFE_ATTR&&I(Xe,e.ADD_URI_SAFE_ATTR,st),e.FORBID_CONTENTS&&(We===Ye&&(We=D(We)),I(We,e.FORBID_CONTENTS,st)),e.ADD_FORBID_CONTENTS&&(We===Ye&&(We=D(We)),I(We,e.ADD_FORBID_CONTENTS,st)),He&&(ge["#text"]=!0),De&&I(ge,["html","head","body"]),ge.table&&(I(ge,["tbody"]),delete Ee.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw _('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw _('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');Q=e.TRUSTED_TYPES_POLICY,te=Q.createHTML("")}else void 0===Q&&(Q=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(k,a)),null!==Q&&"string"==typeof te&&(te=Q.createHTML(""));u&&u(e),ct=e}},pt=I({},[...P,...j,...F]),mt=I({},[...U,...z]),ht=function(e){y(n.removed,{element:e});try{Z(e).removeChild(e)}catch(t){X(e)}},bt=function(e,t){try{y(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){y(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(Pe||je)try{ht(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},vt=function(e){let t=null,n=null;if(Me)e="<remove></remove>"+e;else{const t=S(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===at&&Qe===Ze&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const o=Q?Q.createHTML(e):e;if(Qe===Ze)try{t=(new R).parseFromString(o,at)}catch(e){}if(!t||!t.documentElement){t=oe.createDocument(Qe,"template",null);try{t.documentElement.innerHTML=et?te:o}catch(e){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),Qe===Ze?le.call(t,De?"html":"body")[0]:De?t.documentElement:i},yt=function(e){return ie.call(e.ownerDocument||e,e,p.SHOW_ELEMENT|p.SHOW_COMMENT|p.SHOW_TEXT|p.SHOW_PROCESSING_INSTRUCTION|p.SHOW_CDATA_SECTION,null)},gt=function(e){return e instanceof C&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof m)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},wt=function(e){return"function"==typeof c&&e instanceof c};function Tt(e,t,r){h(e,e=>{e.call(n,t,r,ct)})}const St=function(e){let t=null;if(Tt(ce.beforeSanitizeElements,e,null),gt(e))return ht(e),!0;const r=st(e.nodeName);if(Tt(ce.uponSanitizeElement,e,{tagName:r,allowedTags:ge}),ke&&e.hasChildNodes()&&!wt(e.firstElementChild)&&A(/<[/\w!]/g,e.innerHTML)&&A(/<[/\w!]/g,e.textContent))return ht(e),!0;if(7===e.nodeType)return ht(e),!0;if(ke&&8===e.nodeType&&A(/<[/\w]/g,e.data))return ht(e),!0;if(!(Oe.tagCheck instanceof Function&&Oe.tagCheck(r))&&(!ge[r]||Ee[r])){if(!Ee[r]&&Et(r)){if(xe.tagNameCheck instanceof RegExp&&A(xe.tagNameCheck,r))return!1;if(xe.tagNameCheck instanceof Function&&xe.tagNameCheck(r))return!1}if(He&&!We[r]){const t=Z(e)||e.parentNode,n=$(e)||e.childNodes;if(n&&t)for(let r=n.length-1;r>=0;--r){const o=K(n[r],!0);o.__removalCount=(e.__removalCount||0)+1,t.insertBefore(o,V(e))}}return ht(e),!0}return e instanceof d&&!function(e){let t=Z(e);t&&t.tagName||(t={namespaceURI:Qe,tagName:"template"});const n=w(e.tagName),r=w(t.tagName);return!!tt[e.namespaceURI]&&(e.namespaceURI===Je?t.namespaceURI===Ze?"svg"===n:t.namespaceURI===$e?"svg"===n&&("annotation-xml"===r||rt[r]):Boolean(pt[n]):e.namespaceURI===$e?t.namespaceURI===Ze?"math"===n:t.namespaceURI===Je?"math"===n&&ot[r]:Boolean(mt[n]):e.namespaceURI===Ze?!(t.namespaceURI===Je&&!ot[r])&&!(t.namespaceURI===$e&&!rt[r])&&!mt[n]&&(it[n]||!pt[n]):!("application/xhtml+xml"!==at||!tt[e.namespaceURI]))}(e)?(ht(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!A(/<\/no(script|embed|frames)/i,e.innerHTML)?(Ie&&3===e.nodeType&&(t=e.textContent,h([ue,de,fe],e=>{t=x(t,e," ")}),e.textContent!==t&&(y(n.removed,{element:e.cloneNode()}),e.textContent=t)),Tt(ce.afterSanitizeElements,e,null),!1):(ht(e),!0)},xt=function(e,t,n){if(Ne[t])return!1;if(Ue&&("id"===t||"name"===t)&&(n in r||n in ut))return!1;if(_e&&!Ne[t]&&A(pe,t));else if(Ae&&A(me,t));else if(Oe.attributeCheck instanceof Function&&Oe.attributeCheck(t,e));else if(!Te[t]||Ne[t]){if(!(Et(e)&&(xe.tagNameCheck instanceof RegExp&&A(xe.tagNameCheck,e)||xe.tagNameCheck instanceof Function&&xe.tagNameCheck(e))&&(xe.attributeNameCheck instanceof RegExp&&A(xe.attributeNameCheck,t)||xe.attributeNameCheck instanceof Function&&xe.attributeNameCheck(t,e))||"is"===t&&xe.allowCustomizedBuiltInElements&&(xe.tagNameCheck instanceof RegExp&&A(xe.tagNameCheck,n)||xe.tagNameCheck instanceof Function&&xe.tagNameCheck(n))))return!1}else if(Xe[t]);else if(A(ye,x(n,be,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==E(n,"data:")||!qe[e])if(Ce&&!A(he,x(n,be,"")));else if(n)return!1;return!0},Et=function(e){return"annotation-xml"!==e&&S(e,ve)},Nt=function(e){Tt(ce.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||gt(e))return;const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Te,forceKeepAttr:void 0};let o=t.length;for(;o--;){const i=t[o],{name:a,namespaceURI:l,value:s}=i,c=st(a),u=s;let d="value"===a?u:N(u);if(r.attrName=c,r.attrValue=d,r.keepAttr=!0,r.forceKeepAttr=void 0,Tt(ce.uponSanitizeAttribute,e,r),d=r.attrValue,!ze||"id"!==c&&"name"!==c||(bt(a,e),d="user-content-"+d),ke&&A(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,d)){bt(a,e);continue}if("attributename"===c&&S(d,"href")){bt(a,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){bt(a,e);continue}if(!Re&&A(/\/>/i,d)){bt(a,e);continue}Ie&&h([ue,de,fe],e=>{d=x(d,e," ")});const f=st(e.nodeName);if(xt(f,c,d)){if(Q&&"object"==typeof k&&"function"==typeof k.getAttributeType)if(l);else switch(k.getAttributeType(f,c)){case"TrustedHTML":d=Q.createHTML(d);break;case"TrustedScriptURL":d=Q.createScriptURL(d)}if(d!==u)try{l?e.setAttributeNS(l,a,d):e.setAttribute(a,d),gt(e)?ht(e):v(n.removed)}catch(t){bt(a,e)}}else bt(a,e)}Tt(ce.afterSanitizeAttributes,e,null)},Ot=function e(t){let n=null;const r=yt(t);for(Tt(ce.beforeSanitizeShadowDOM,t,null);n=r.nextNode();)Tt(ce.uponSanitizeShadowNode,n,null),St(n),Nt(n),n.content instanceof l&&e(n.content);Tt(ce.afterSanitizeShadowDOM,t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,i=null,a=null,s=null;if(et=!e,et&&(e="\x3c!--\x3e"),"string"!=typeof e&&!wt(e)){if("function"!=typeof e.toString)throw _("toString is not a function");if("string"!=typeof(e=e.toString()))throw _("dirty is not a string, aborting")}if(!n.isSupported)return e;if(Le||ft(t),n.removed=[],"string"==typeof e&&(Be=!1),Be){if(e.nodeName){const t=st(e.nodeName);if(!ge[t]||Ee[t])throw _("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof c)r=vt("\x3c!----\x3e"),i=r.ownerDocument.importNode(e,!0),1===i.nodeType&&"BODY"===i.nodeName||"HTML"===i.nodeName?r=i:r.appendChild(i);else{if(!Pe&&!Ie&&!De&&-1===e.indexOf("<"))return Q&&Fe?Q.createHTML(e):e;if(r=vt(e),!r)return Pe?null:Fe?te:""}r&&Me&&ht(r.firstChild);const u=yt(Be?e:r);for(;a=u.nextNode();)St(a),Nt(a),a.content instanceof l&&Ot(a.content);if(Be)return e;if(Pe){if(je)for(s=ae.call(r.ownerDocument);r.firstChild;)s.appendChild(r.firstChild);else s=r;return(Te.shadowroot||Te.shadowrootmode)&&(s=se.call(o,s,!0)),s}let d=De?r.outerHTML:r.innerHTML;return De&&ge["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&A(ee,r.ownerDocument.doctype.name)&&(d="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+d),Ie&&h([ue,de,fe],e=>{d=x(d,e," ")}),Q&&Fe?Q.createHTML(d):d},n.setConfig=function(){ft(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Le=!0},n.clearConfig=function(){ct=null,Le=!1},n.isValidAttribute=function(e,t,n){ct||ft({});const r=st(e),o=st(t);return xt(r,o,n)},n.addHook=function(e,t){"function"==typeof t&&y(ce[e],t)},n.removeHook=function(e,t){if(void 0!==t){const n=b(ce[e],t);return-1===n?void 0:g(ce[e],n,1)[0]}return v(ce[e])},n.removeHooks=function(e){ce[e]=[]},n.removeAllHooks=function(){ce={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}(),ie=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],ae=ie.join(","),le="undefined"==typeof Element,se=le?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ce=!le&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},ue=function(e,t){var n;void 0===t&&(t=!0);var r=null==e||null===(n=e.getAttribute)||void 0===n?void 0:n.call(e,"inert");return""===r||"true"===r||t&&e&&("function"==typeof e.closest?e.closest("[inert]"):ue(e.parentNode))},de=function(e,t,n){if(ue(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(ae));return t&&se.call(e,ae)&&r.unshift(e),r.filter(n)},fe=function(e,t,n){for(var r=[],o=Array.from(e);o.length;){var i=o.shift();if(!ue(i,!1))if("SLOT"===i.tagName){var a=i.assignedElements(),l=a.length?a:i.children,s=fe(l,!0,n);n.flatten?r.push.apply(r,s):r.push({scopeParent:i,candidates:s})}else{se.call(i,ae)&&n.filter(i)&&(t||!e.includes(i))&&r.push(i);var c=i.shadowRoot||"function"==typeof n.getShadowRoot&&n.getShadowRoot(i),u=!ue(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(i));if(c&&u){var d=fe(!0===c?i.children:c.children,!0,n);n.flatten?r.push.apply(r,d):r.push({scopeParent:i,candidates:d})}else o.unshift.apply(o,i.children)}}return r},pe=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},me=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!pe(e)?0:e.tabIndex},he=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},be=function(e){return"INPUT"===e.tagName},ve=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},ye=function(e,t){return!(t.disabled||function(e){return be(e)&&"hidden"===e.type}(t)||function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("full-native"===n&&"checkVisibility"in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if("hidden"===getComputedStyle(e).visibility)return!0;var o=se.call(e,"details>summary:first-of-type")?e.parentElement:e;if(se.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"full-native"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return ve(e)}else{if("function"==typeof r){for(var i=e;e;){var a=e.parentElement,l=ce(e);if(a&&!a.shadowRoot&&!0===r(a))return ve(e);e=e.assignedSlot?e.assignedSlot:a||l===e.ownerDocument?a:l.host}e=i}if(function(e){var t,n,r,o,i=e&&ce(e),a=null===(t=i)||void 0===t?void 0:t.host,l=!1;if(i&&i!==e)for(l=!!(null!==(n=a)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(a)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!l&&a;){var s,c,u;l=!(null===(c=a=null===(s=i=ce(a))||void 0===s?void 0:s.host)||void 0===c||null===(u=c.ownerDocument)||void 0===u||!u.contains(a))}return l}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1}(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some(function(e){return"SUMMARY"===e.tagName})}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!se.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},ge=function(e,t){return!(function(e){return function(e){return be(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||ce(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)}(t)||me(t)<0||!ye(e,t))},we=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Te=function(e){var t=[],n=[];return e.forEach(function(e,r){var o=!!e.scopeParent,i=o?e.scopeParent:e,a=function(e,t){var n=me(e);return n<0&&t&&!pe(e)?0:n}(i,o),l=o?Te(e.candidates):i;0===a?o?t.push.apply(t,l):t.push(i):n.push({documentOrder:r,tabIndex:a,item:e,isScope:o,content:l})}),n.sort(he).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},Se=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==se.call(e,ae)&&ge(t,e)},xe=ie.concat("iframe:not([inert]):not([inert] *)").join(","),Ee=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==se.call(e,xe)&&ye(t,e)};function Ne(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Oe(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Re(e))||t){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function Ae(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ce(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_e(Object(n),!0).forEach(function(t){Ae(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_e(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Re(e,t){if(e){if("string"==typeof e)return Ne(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ne(e,t):void 0}}var Ie={getActiveTrap:function(e){return(null==e?void 0:e.length)>0?e[e.length-1]:null},activateTrap:function(e,t){t!==Ie.getActiveTrap(e)&&Ie.pauseTrap(e);var n=e.indexOf(t);-1===n||e.splice(n,1),e.push(t)},deactivateTrap:function(e,t){var n=e.indexOf(t);-1!==n&&e.splice(n,1),Ie.unpauseTrap(e)},pauseTrap:function(e){var t=Ie.getActiveTrap(e);null==t||t._setPausedState(!0)},unpauseTrap:function(e){var t=Ie.getActiveTrap(e);t&&!t._isManuallyPaused()&&t._setPausedState(!1)}},ke=function(e){return"Tab"===(null==e?void 0:e.key)||9===(null==e?void 0:e.keyCode)},De=function(e){return ke(e)&&!e.shiftKey},Le=function(e){return ke(e)&&e.shiftKey},Me=function(e){return setTimeout(e,0)},Pe=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return"function"==typeof e?e.apply(void 0,n):e},je=function(e){return e.target.shadowRoot&&"function"==typeof e.composedPath?e.composedPath()[0]:e.target},Fe=[],Ue=function(e,t){var n,r=(null==t?void 0:t.document)||document,o=(null==t?void 0:t.trapStack)||Fe,i=Ce({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isolateSubtrees:!1,isKeyForward:De,isKeyBackward:Le},t),a={containers:[],containerGroups:[],tabbableGroups:[],adjacentElements:new Set,alreadySilent:new Set,nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},l=function(e,t,n){return e&&void 0!==e[t]?e[t]:i[n||t]},s=function(e,t){var n="function"==typeof(null==t?void 0:t.composedPath)?t.composedPath():void 0;return a.containerGroups.findIndex(function(t){var r=t.container,o=t.tabbableNodes;return r.contains(e)||(null==n?void 0:n.includes(r))||o.find(function(t){return t===e})})},c=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=n.hasFallback,a=void 0!==o&&o,l=n.params,s=void 0===l?[]:l,c=i[e];if("function"==typeof c&&(c=c.apply(void 0,function(e){if(Array.isArray(e))return Ne(e)}(t=s)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||Re(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())),!0===c&&(c=void 0),!c){if(void 0===c||!1===c)return c;throw new Error("`".concat(e,"` was specified but was not a node, or did not return a node"))}var u=c;if("string"==typeof c){try{u=r.querySelector(c)}catch(t){throw new Error("`".concat(e,'` appears to be an invalid selector; error="').concat(t.message,'"'))}if(!u&&!a)throw new Error("`".concat(e,"` as selector refers to no known node"))}return u},u=function(){var e=c("initialFocus",{hasFallback:!0});if(!1===e)return!1;if(void 0===e||e&&!Ee(e,i.tabbableOptions))if(s(r.activeElement)>=0)e=r.activeElement;else{var t=a.tabbableGroups[0];e=t&&t.firstTabbableNode||c("fallbackFocus")}else null===e&&(e=c("fallbackFocus"));if(!e)throw new Error("Your focus-trap needs to have at least one focusable element");return e},d=function(){if(a.containerGroups=a.containers.map(function(e){var t=function(e,t){var n;return n=(t=t||{}).getShadowRoot?fe([e],t.includeContainer,{filter:ge.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:we}):de(e,t.includeContainer,ge.bind(null,t)),Te(n)}(e,i.tabbableOptions),n=function(e,t){return(t=t||{}).getShadowRoot?fe([e],t.includeContainer,{filter:ye.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):de(e,t.includeContainer,ye.bind(null,t))}(e,i.tabbableOptions),r=t.length>0?t[0]:void 0,o=t.length>0?t[t.length-1]:void 0,a=n.find(function(e){return Se(e)}),l=n.slice().reverse().find(function(e){return Se(e)}),s=!!t.find(function(e){return me(e)>0});return{container:e,tabbableNodes:t,focusableNodes:n,posTabIndexesFound:s,firstTabbableNode:r,lastTabbableNode:o,firstDomTabbableNode:a,lastDomTabbableNode:l,nextTabbableNode:function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=t.indexOf(e);return o<0?r?n.slice(n.indexOf(e)+1).find(function(e){return Se(e)}):n.slice(0,n.indexOf(e)).reverse().find(function(e){return Se(e)}):t[o+(r?1:-1)]}}}),a.tabbableGroups=a.containerGroups.filter(function(e){return e.tabbableNodes.length>0}),a.tabbableGroups.length<=0&&!c("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(a.containerGroups.find(function(e){return e.posTabIndexesFound})&&a.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},f=function(e){var t=e.activeElement;if(t)return t.shadowRoot&&null!==t.shadowRoot.activeElement?f(t.shadowRoot):t},p=function(e){!1!==e&&e!==f(document)&&(e&&e.focus?(e.focus({preventScroll:!!i.preventScroll}),a.mostRecentlyFocusedNode=e,function(e){return e.tagName&&"input"===e.tagName.toLowerCase()&&"function"==typeof e.select}(e)&&e.select()):p(u()))},m=function(e){var t=c("setReturnFocus",{params:[e]});return t||!1!==t&&e},h=function(e){var t=e.target,n=e.event,r=e.isBackward,o=void 0!==r&&r;t=t||je(n),d();var l=null;if(a.tabbableGroups.length>0){var u=s(t,n),f=u>=0?a.containerGroups[u]:void 0;if(u<0)l=o?a.tabbableGroups[a.tabbableGroups.length-1].lastTabbableNode:a.tabbableGroups[0].firstTabbableNode;else if(o){var p=a.tabbableGroups.findIndex(function(e){var n=e.firstTabbableNode;return t===n});if(p<0&&(f.container===t||Ee(t,i.tabbableOptions)&&!Se(t,i.tabbableOptions)&&!f.nextTabbableNode(t,!1))&&(p=u),p>=0){var m=0===p?a.tabbableGroups.length-1:p-1,h=a.tabbableGroups[m];l=me(t)>=0?h.lastTabbableNode:h.lastDomTabbableNode}else ke(n)||(l=f.nextTabbableNode(t,!1))}else{var b=a.tabbableGroups.findIndex(function(e){var n=e.lastTabbableNode;return t===n});if(b<0&&(f.container===t||Ee(t,i.tabbableOptions)&&!Se(t,i.tabbableOptions)&&!f.nextTabbableNode(t))&&(b=u),b>=0){var v=b===a.tabbableGroups.length-1?0:b+1,y=a.tabbableGroups[v];l=me(t)>=0?y.firstTabbableNode:y.firstDomTabbableNode}else ke(n)||(l=f.nextTabbableNode(t))}}else l=c("fallbackFocus");return l},b=function(e){var t=je(e);s(t,e)>=0||(Pe(i.clickOutsideDeactivates,e)?n.deactivate({returnFocus:i.returnFocusOnDeactivate}):Pe(i.allowOutsideClick,e)||e.preventDefault())},v=function(e){var t=je(e),n=s(t,e)>=0;if(n||t instanceof Document)n&&(a.mostRecentlyFocusedNode=t);else{var r;e.stopImmediatePropagation();var o=!0;if(a.mostRecentlyFocusedNode)if(me(a.mostRecentlyFocusedNode)>0){var l=s(a.mostRecentlyFocusedNode),c=a.containerGroups[l].tabbableNodes;if(c.length>0){var d=c.findIndex(function(e){return e===a.mostRecentlyFocusedNode});d>=0&&(i.isKeyForward(a.recentNavEvent)?d+1<c.length&&(r=c[d+1],o=!1):d-1>=0&&(r=c[d-1],o=!1))}}else a.containerGroups.some(function(e){return e.tabbableNodes.some(function(e){return me(e)>0})})||(o=!1);else o=!1;o&&(r=h({target:a.mostRecentlyFocusedNode,isBackward:i.isKeyBackward(a.recentNavEvent)})),p(r||a.mostRecentlyFocusedNode||u())}a.recentNavEvent=void 0},y=function(e){(i.isKeyForward(e)||i.isKeyBackward(e))&&function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];a.recentNavEvent=e;var n=h({event:e,isBackward:t});n&&(ke(e)&&e.preventDefault(),p(n))}(e,i.isKeyBackward(e))},g=function(e){var t;"Escape"!==(null==(t=e)?void 0:t.key)&&"Esc"!==(null==t?void 0:t.key)&&27!==(null==t?void 0:t.keyCode)||!1===Pe(i.escapeDeactivates,e)||(e.preventDefault(),n.deactivate())},w=function(e){var t=je(e);s(t,e)>=0||Pe(i.clickOutsideDeactivates,e)||Pe(i.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())},T=function(){if(a.active)return Ie.activateTrap(o,n),a.delayInitialFocusTimer=i.delayInitialFocus?Me(function(){p(u())}):p(u()),r.addEventListener("focusin",v,!0),r.addEventListener("mousedown",b,{capture:!0,passive:!1}),r.addEventListener("touchstart",b,{capture:!0,passive:!1}),r.addEventListener("click",w,{capture:!0,passive:!1}),r.addEventListener("keydown",y,{capture:!0,passive:!1}),r.addEventListener("keydown",g),n},S=function(){if(a.active)return r.removeEventListener("focusin",v,!0),r.removeEventListener("mousedown",b,!0),r.removeEventListener("touchstart",b,!0),r.removeEventListener("click",w,!0),r.removeEventListener("keydown",y,!0),r.removeEventListener("keydown",g),n},x="undefined"!=typeof window&&"MutationObserver"in window?new MutationObserver(function(e){e.some(function(e){return Array.from(e.removedNodes).some(function(e){return e===a.mostRecentlyFocusedNode})})&&p(u())}):void 0,E=function(){x&&(x.disconnect(),a.active&&!a.paused&&a.containers.map(function(e){x.observe(e,{subtree:!0,childList:!0})}))};return n={get active(){return a.active},get paused(){return a.paused},activate:function(e){if(a.active)return this;var t,s=l(e,"onActivate"),c=l(e,"onPostActivate"),u=l(e,"checkCanFocusTrap"),p=Ie.getActiveTrap(o),m=!1;p&&!p.paused&&(null===(t=p._setSubtreeIsolation)||void 0===t||t.call(p,!1),m=!0);try{u||d(),a.active=!0,a.paused=!1,a.nodeFocusedBeforeActivation=f(r),null==s||s();var h=function(){u&&d(),T(),E(),i.isolateSubtrees&&n._setSubtreeIsolation(!0),null==c||c()};if(u)return u(a.containers.concat()).then(h,h),this;h()}catch(e){var b;throw p===Ie.getActiveTrap(o)&&m&&(null===(b=p._setSubtreeIsolation)||void 0===b||b.call(p,!0)),e}return this},deactivate:function(e){if(!a.active)return this;var t=Ce({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},e);clearTimeout(a.delayInitialFocusTimer),a.delayInitialFocusTimer=void 0,a.paused||n._setSubtreeIsolation(!1),a.alreadySilent.clear(),S(),a.active=!1,a.paused=!1,E(),Ie.deactivateTrap(o,n);var r=l(t,"onDeactivate"),s=l(t,"onPostDeactivate"),c=l(t,"checkCanReturnFocus"),u=l(t,"returnFocus","returnFocusOnDeactivate");null==r||r();var d=function(){Me(function(){u&&p(m(a.nodeFocusedBeforeActivation)),null==s||s()})};return u&&c?(c(m(a.nodeFocusedBeforeActivation)).then(d,d),this):(d(),this)},pause:function(e){return a.active?(a.manuallyPaused=!0,this._setPausedState(!0,e)):this},unpause:function(e){return a.active?(a.manuallyPaused=!1,o[o.length-1]!==this?this:this._setPausedState(!1,e)):this},updateContainerElements:function(e){var t=[].concat(e).filter(Boolean);return a.containers=t.map(function(e){return"string"==typeof e?r.querySelector(e):e}),i.isolateSubtrees&&function(e){a.active&&!a.paused&&n._setSubtreeIsolation(!1),a.adjacentElements.clear(),a.alreadySilent.clear();var t,r=new Set,o=new Set,i=Oe(e);try{for(i.s();!(t=i.n()).done;){var l=t.value;r.add(l);for(var s="undefined"!=typeof ShadowRoot&&l.getRootNode()instanceof ShadowRoot,c=l;c;){r.add(c);var u=c.parentElement,d=[];u?d=u.children:!u&&s&&(d=c.getRootNode().children,u=c.getRootNode().host,s="undefined"!=typeof ShadowRoot&&u.getRootNode()instanceof ShadowRoot);var f,p=Oe(d);try{for(p.s();!(f=p.n()).done;){var m=f.value;o.add(m)}}catch(e){p.e(e)}finally{p.f()}c=u}}}catch(e){i.e(e)}finally{i.f()}r.forEach(function(e){o.delete(e)}),a.adjacentElements=o}(a.containers),a.active&&(d(),i.isolateSubtrees&&!a.paused&&n._setSubtreeIsolation(!0)),E(),this}},Object.defineProperties(n,{_isManuallyPaused:{value:function(){return a.manuallyPaused}},_setPausedState:{value:function(e,t){if(a.paused===e)return this;if(a.paused=e,e){var r=l(t,"onPause"),o=l(t,"onPostPause");null==r||r(),S(),E(),n._setSubtreeIsolation(!1),null==o||o()}else{var i=l(t,"onUnpause"),s=l(t,"onPostUnpause");null==i||i(),n._setSubtreeIsolation(!0),d(),T(),E(),null==s||s()}return this}},_setSubtreeIsolation:{value:function(e){i.isolateSubtrees&&a.adjacentElements.forEach(function(t){var n;e?"aria-hidden"===i.isolateSubtrees?("true"!==t.ariaHidden&&"true"!==(null===(n=t.getAttribute("aria-hidden"))||void 0===n?void 0:n.toLowerCase())||a.alreadySilent.add(t),t.setAttribute("aria-hidden","true")):((t.inert||t.hasAttribute("inert"))&&a.alreadySilent.add(t),t.setAttribute("inert",!0)):a.alreadySilent.has(t)||("aria-hidden"===i.isolateSubtrees?t.removeAttribute("aria-hidden"):t.removeAttribute("inert"))})}}}),n.updateContainerElements(e),n};function ze(){return ze=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ze.apply(null,arguments)}var He=function(e){return e?e.toString().normalize("NFKD").toLowerCase().trim().replace(/\s+/g,"-").replace(/[^\w\-]+/g,"").replace(/\-\-+/g,"-"):""},Be=function(e){var n=e.heading,r=e.isActive,o=e.onClick,i=e.content,a=n.id||He(n.textContent||"");return n.id||(n.id=a),(0,t.jsx)("a",{href:"#"+a,className:"yard-toc-link "+(r?"is-active":""),onClick:function(e){e.preventDefault(),o(n)},children:i})},Ge=function(e){var n=e.heading,r=e.h3Elements,i=e.activeHeadingId,a=e.isActive,l=e.isCollapsed,s=e.index,c=e.onClick,u=e.toggleSection,d=e.content,f=e.includeSubheading,p=e.overwriteTextDataAttribute,m=e.subheadingListCollapseIcon,h=e.subheadingListCollapseIconHtml;return(0,t.jsxs)("li",{className:"yard-toc-list-item",children:[(0,t.jsx)(Be,{heading:n,isActive:a,onClick:c,content:d},s),f&&r.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{className:"yard-toc-subheading-list-collapse-button",onClick:function(){return u(s)},"aria-expanded":!l,"aria-controls":"yard-toc-subheading-list-"+s,children:[h?(0,t.jsx)("span",{className:"yard-toc-subheading-list-collapse-button-icon",dangerouslySetInnerHTML:{__html:oe.sanitize(h)}}):m,(0,t.jsx)("span",{className:"yard-toc-subheading-list-collapse-button sr-only",children:l?"Ingeklapt":"Uitgeklapt"})]}),(0,t.jsx)(o.Ay,{isOpen:!l,children:(0,t.jsx)("ul",{id:"yard-toc-subheading-list-"+s,className:"yard-toc-subheading-list",children:r.map(function(e,n){var r=e.getAttribute(null!=p?p:"")||e.textContent,o=e.id||He(e.textContent||"");return(0,t.jsx)("li",{className:"yard-toc-list-item",children:(0,t.jsx)(Be,{heading:e,isActive:o===i,onClick:c,content:r},n)},n)})})})]})]},s)},We=(0,t.jsx)("svg",{className:"yard-toc-mobile-button-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",width:45,height:45,children:(0,t.jsx)("path",{d:"M112 48L16 48l0 96 96 0 0-96zm72 24l-24 0 0 48 24 0 304 0 24 0 0-48-24 0L184 72zm0 160l-24 0 0 48 24 0 304 0 24 0 0-48-24 0-304 0zm0 160l-24 0 0 48 24 0 304 0 24 0 0-48-24 0-304 0zM16 208l0 96 96 0 0-96-96 0zm96 160l-96 0 0 96 96 0 0-96z"})}),Ye=function(e){var n=e.isTOCOpen,r=e.onClick,o=e.buttonRef,i=e.icon,a=e.iconHtml,l=e.text;return(0,t.jsxs)("button",{ref:o,className:"yard-toc-mobile-button","aria-expanded":n,"aria-controls":"yard-toc-container",onClick:r,children:[a?(0,t.jsx)("span",{className:"yard-toc-mobile-button-icon",dangerouslySetInnerHTML:{__html:oe.sanitize(a)}}):i,(0,t.jsx)("span",{className:"yard-toc-mobile-button-text",children:l})]})},qe=(0,t.jsx)("svg",{className:"yard-toc-subheading-list-collapse-button-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",width:18,height:18,children:(0,t.jsx)("path",{d:"M256 417.9l17-17L465 209l17-17L448 158.1l-17 17-175 175L81 175l-17-17L30.1 192l17 17L239 401l17 17z"})}),Ke=function(e){var n=e.contentSelector,o=e.bodyClassName,i=void 0===o?"body-yard-toc-is-open":o,a=e.headingsSelector,l=void 0===a?"h2:not(.yard-toc-is-excluded), h3:not(.yard-toc-is-excluded)":a,s=e.includeSubheading,c=void 0===s||s,u=e.mobileButtonIcon,d=void 0===u?We:u,f=e.mobileButtonIconHtml,p=void 0===f?"":f,m=e.mobileButtonText,h=void 0===m?"Inhoudsopgave":m,b=e.observerOptions,v=void 0===b?{root:null,rootMargin:"-10% 0px -73% 0px",threshold:0}:b,y=e.titleText,g=void 0===y?"Op deze pagina":y,w=e.overwriteTextDataAttribute,T=void 0===w?"data-yard-toc-overwrite-heading":w,S=e.subheadingListCollapseIcon,x=void 0===S?qe:S,E=e.subheadingListCollapseIconHtml,N=void 0===E?"":E,O=e.viewportBreakpoint,A=void 0===O?782:O,_=(0,r.useState)(!1),C=_[0],R=_[1],I=(0,r.useState)({}),k=I[0],D=I[1],L=(0,r.useRef)(null),M=(0,r.useRef)(null),P=function(e,t){var n=(0,r.useState)([]),o=n[0],i=n[1];return(0,r.useEffect)(function(){i(function(){var n=document.querySelector(e);if(!n)return[];var r=Array.from(n.querySelectorAll(t)),o=[],i=null;return r.forEach(function(e){"h2"===e.tagName.toLowerCase()?(i&&o.push(i),i={element:e,children:[]}):"h3"===e.tagName.toLowerCase()&&i&&i.children.push(e)}),i&&o.push(i),o}())},[e,t]),o}(n,l),j=function(e){var t=e.tocElements,n=e.setCollapsedSections,o=e.observerOptions,i=(0,r.useState)(""),a=i[0],l=i[1],s=(0,r.useRef)(null);return(0,r.useEffect)(function(){if(t.length>0){var e=t[0].element.id||He(t[0].element.textContent||"");l(e)}},[t]),(0,r.useEffect)(function(){if(t.length)return s.current=new IntersectionObserver(function(e){e.forEach(function(e){if(e.isIntersecting){var r=e.target,o=r.id,i=r.tagName;if(l(o),"H2"===i){var a=t.findIndex(function(e){return e.element.id===o});-1!==a&&n(function(e){var t=ze({},e);return Object.keys(t).forEach(function(e){t[Number(e)]=!0}),t[a]=!1,JSON.stringify(e)!==JSON.stringify(t)?t:e})}if("H3"===i){var s=t.findIndex(function(t){return t.children.includes(e.target)});-1!==s&&n(function(e){var t=ze({},e);return Object.keys(t).forEach(function(e){t[Number(e)]=!0}),t[s]=!1,JSON.stringify(e)!==JSON.stringify(t)?t:e})}}})},o),t.flatMap(function(e){var t=e.element,n=e.children;return[t].concat(n)}).forEach(function(e){var t;return null==(t=s.current)?void 0:t.observe(e)}),function(){var e;null==(e=s.current)||e.disconnect()}},[t]),a}({tocElements:P,setCollapsedSections:D,observerOptions:v});!function(e,t){(0,r.useEffect)(function(){var n=t.current;if(n){var r=Ue(n,{allowOutsideClick:!0,returnFocusOnDeactivate:!1});return e?r.activate():r.deactivate(),function(){r.deactivate()}}},[e,t])}(C,L),function(e){var t=e.isTOCOpen,n=e.tocRef,o=e.buttonRef,i=e.setIsTOCOpen,a=e.viewportBreakpoint,l=e.bodyClassName;(0,r.useEffect)(function(){var e=function(e){var t=n.current,r=o.current;t&&!t.contains(e.target)&&r&&!r.contains(e.target)&&(i(!1),document.body.classList.remove(l))};return t&&window.innerWidth<a&&document.addEventListener("click",e),function(){document.removeEventListener("click",e)}},[t,n,o,i,a,l])}({isTOCOpen:C,tocRef:L,buttonRef:M,setIsTOCOpen:R,viewportBreakpoint:A,bodyClassName:i}),(0,r.useEffect)(function(){var e={};P.forEach(function(t,n){e[n]=!0}),D(e)},[P]);var F=function(e){var t=void 0!==e?e:!C;R(t),document.body.classList.toggle(i,t)},U=function(e){e.scrollIntoView({behavior:"smooth",block:"start"}),e.classList.add("is-active"),setTimeout(function(){return e.classList.remove("is-active")},2e3),window.innerWidth<A&&F(!1)},z=function(e){D(function(t){var n;return ze({},t,((n={})[e]=!t[e],n))})};return 0===P.length?(0,t.jsx)(t.Fragment,{}):(0,t.jsxs)("div",{ref:L,className:"yard-toc",children:[(0,t.jsx)(Ye,{buttonRef:M,icon:d,iconHtml:p,isTOCOpen:C,onClick:function(){return F()},text:h}),(0,t.jsxs)("div",{className:"yard-toc-container "+(C?"is-open":""),id:"yard-toc-container",children:[g&&(0,t.jsx)("h2",{className:"yard-toc-title",children:g}),(0,t.jsx)("ul",{className:"yard-toc-list",children:P.map(function(e,n){var r=e.element,o=e.children,i=He(r.textContent||"");r.id=i;var a=r.getAttribute(T)||r.textContent,l=k[n];return(0,t.jsx)(Ge,{heading:r,h3Elements:o,activeHeadingId:j,isActive:j===i,isCollapsed:l,index:n,onClick:U,toggleSection:z,content:a,includeSubheading:c,overwriteTextDataAttribute:T,subheadingListCollapseIcon:x,subheadingListCollapseIconHtml:N},n)})})]})]})};const Xe=(e,t,n)=>e.getAttribute(t)||window.yardTOC&&window.yardTOC[n]||void 0,Ve=(e,t,n)=>{const r=e.getAttribute(t);return null!==r?"true"===r:window.yardTOC&&void 0!==window.yardTOC[n]?window.yardTOC[n]:void 0},$e=e=>window.yardTOC&&void 0!==window.yardTOC[e]?window.yardTOC[e]:void 0;document.addEventListener("DOMContentLoaded",()=>{const n=document.getElementById("js-yard-table-of-contents");if(!n||!window.yardTOC)return;const r={contentSelector:Xe(n,"data-content-selector","contentSelector"),headingsSelector:Xe(n,"data-heading-selector","headingsSelector"),includeSubheading:Ve(n,"data-include-subheading","includeSubheading"),bodyClassName:$e("bodyClassName"),mobileButtonIcon:$e("mobileButtonIcon"),mobileButtonIconHtml:$e("mobileButtonIconHtml"),mobileButtonText:$e("mobileButtonText"),observerOptions:$e("observerOptions"),overwriteTextDataAttribute:$e("overwriteTextDataAttribute"),titleText:$e("titleText"),subheadingListCollapseIcon:$e("subheadingListCollapseIcon"),subheadingListCollapseIconHtml:$e("subheadingListCollapseIconHtml"),viewportBreakpoint:$e("viewportBreakpoint")};(0,e.createRoot)(n).render((0,t.jsx)(Ke,{...r}))})})()})(); |
There was a problem hiding this comment.
ugh jonge, ja ik now that een build ook buite de pr kan. Maar uhg dit is prima toch/
| if ( hasTimelineItemRegistered ) { | ||
| fallbackTemplate = [ [ 'yard/timeline-item' ] ]; | ||
| } else if ( hasTimelineItemCollapseRegistered ) { | ||
| fallbackTemplate = [ [ 'yard/timeline-item-collapse' ] ]; | ||
| } |
There was a problem hiding this comment.
ik vraag me af of hier nog niet iets in mogelijk is qua MAND
Misschien iets met een ternairy?
Maybe not omdat de variable namen quite long zijn.
There was a problem hiding this comment.
Als ik dit doe:
const TEMPLATE = applyFilters( 'yard.timeline-template', hasTimelineItemRegistered ? [ [ 'yard/timeline-item' ] ] : hasTimelineItemCollapseRegistered ? [ [ 'yard/timeline-item-collapse' ] ] : [] );
Dan krijg ik een boze eslint "Do not nest ternary expressions"
Er wordt nu gecheckt welke child block geregistreerd zijn, want die koptekst selector in het parent block werd nu altijd getoond terwijl we die alleen willen hebben als de timeline-item-collapse gebruikt wordt. En toen heb ik gelijk ook het standaard template aangepast.