orejime
Version:
A lightweight and accessible consent manager
1 lines • 42.9 kB
JavaScript
!function(){"use strict";var e,t,n={},o={};function r(e){var t=o[e];if(void 0!==t)return t.exports;var i=o[e]={exports:{}};return n[e](i,i.exports,r),i.exports}r.rv=function(){return"1.0.4"},r.ruid="bundler=rspack@1.0.4";var i,l,a,s,c,u,d,_,p,f,h,m={},v=[],y=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,g=Array.isArray;function b(e,t){for(var n in t)e[n]=t[n];return e}function C(e){var t=e.parentNode;t&&t.removeChild(e)}function j(e,t,n,o,r){var i={type:e,props:t,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==r?++a:r,__i:-1,__u:0};return null==r&&null!=l.vnode&&l.vnode(i),i}function w(e){return e.children}function k(e,t){this.props=e,this.context=t}function N(e,t){if(null==t)return e.__?N(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?N(e):null}function E(e){(!e.__d&&(e.__d=!0)&&s.push(e)&&!x.__r++||c!==l.debounceRendering)&&((c=l.debounceRendering)||u)(x)}function x(){var e,t,n,o,r,i,a,c;for(s.sort(d);e=s.shift();)e.__d&&(t=s.length,o=void 0,i=(r=(n=e).__v).__e,a=[],c=[],n.__P&&((o=b({},r)).__v=r.__v+1,l.vnode&&l.vnode(o),T(n.__P,o,r,n.__n,n.__P.namespaceURI,32&r.__u?[i]:null,a,null==i?N(r):i,!!(32&r.__u),c),o.__v=r.__v,o.__.__k[o.__i]=o,I(a,o,c),o.__e!=i&&function e(t){var n,o;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,n=0;n<t.__k.length;n++)if(null!=(o=t.__k[n])&&null!=o.__e){t.__e=t.__c.base=o.__e;break}return e(t)}}(o)),s.length>t&&s.sort(d));x.__r=0}function A(e,t,n,o,r,i,l,a,s,c,u){var d,_,p,f,h,y=o&&o.__k||v,b=t.length;for(n.__d=s,function(e,t,n){var o,r,i,l,a,s=t.length,c=n.length,u=c,d=0;for(e.__k=[],o=0;o<s;o++)l=o+d,null!=(r=e.__k[o]=null==(r=t[o])||"boolean"==typeof r||"function"==typeof r?null:"string"==typeof r||"number"==typeof r||"bigint"==typeof r||r.constructor==String?j(null,r,null,null,null):g(r)?j(w,{children:r},null,null,null):void 0===r.constructor&&r.__b>0?j(r.type,r.props,r.key,r.ref?r.ref:null,r.__v):r)?(r.__=e,r.__b=e.__b+1,a=function(e,t,n,o){var r=e.key,i=e.type,l=n-1,a=n+1,s=t[n];if(null===s||s&&r==s.key&&i===s.type&&0==(131072&s.__u))return n;if(o>(null!=s&&0==(131072&s.__u)?1:0))for(;l>=0||a<t.length;){if(l>=0){if((s=t[l])&&0==(131072&s.__u)&&r==s.key&&i===s.type)return l;l--}if(a<t.length){if((s=t[a])&&0==(131072&s.__u)&&r==s.key&&i===s.type)return a;a++}}return -1}(r,n,l,u),r.__i=a,i=null,-1!==a&&(u--,(i=n[a])&&(i.__u|=131072)),null==i||null===i.__v?(-1==a&&d--,"function"!=typeof r.type&&(r.__u|=65536)):a!==l&&(a==l-1?d--:a==l+1?d++:a>l?u>s-l?d+=a-l:d--:a<l&&(a==l-d?d-=a-l:d++),a!==o+d&&(r.__u|=65536))):(i=n[l])&&null==i.key&&i.__e&&0==(131072&i.__u)&&(i.__e==e.__d&&(e.__d=N(i)),S(i,i,!1),n[l]=null,u--);if(u)for(o=0;o<c;o++)null!=(i=n[o])&&0==(131072&i.__u)&&(i.__e==e.__d&&(e.__d=N(i)),S(i,i))}(n,t,y),s=n.__d,d=0;d<b;d++)null!=(p=n.__k[d])&&"boolean"!=typeof p&&"function"!=typeof p&&(_=-1===p.__i?m:y[p.__i]||m,p.__i=d,T(e,p,_,r,i,l,a,s,c,u),f=p.__e,p.ref&&_.ref!=p.ref&&(_.ref&&L(_.ref,null,p),u.push(p.ref,p.__c||f,p)),null==h&&null!=f&&(h=f),65536&p.__u||_.__k===p.__k?s=function e(t,n,o){var r,i;if("function"==typeof t.type){for(r=t.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=t,n=e(r[i],n,o));return n}t.__e!=n&&(n&&t.type&&!o.contains(n)&&(n=N(t)),o.insertBefore(t.__e,n||null),n=t.__e);do n=n&&n.nextSibling;while(null!=n&&8===n.nodeType);return n}(p,s,e):"function"==typeof p.type&&void 0!==p.__d?s=p.__d:f&&(s=f.nextSibling),p.__d=void 0,p.__u&=-196609);n.__d=s,n.__e=h}function P(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||y.test(t)?n:n+"px"}function B(e,t,n,o,r){var i;e:if("style"===t){if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof o&&(e.style.cssText=o=""),o)for(t in o)n&&t in n||P(e.style,t,"");if(n)for(t in n)o&&n[t]===o[t]||P(e.style,t,n[t])}}else if("o"===t[0]&&"n"===t[1])i=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase() in e||"onFocusOut"===t||"onFocusIn"===t?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?o?n.u=o.u:(n.u=_,e.addEventListener(t,i?f:p,i)):e.removeEventListener(t,i?f:p,i);else{if("http://www.w3.org/2000/svg"==r)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function M(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t.t)t.t=_++;else if(t.t<n.u)return;return n(l.event?l.event(t):t)}}}function T(e,t,n,o,r,a,s,c,u,d){var _,p,f,h,v,y,j,E,x,P,M,T,I,L,S,U,D=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(u=!!(32&n.__u),a=[c=t.__e=n.__e]),(_=l.__b)&&_(t);e:if("function"==typeof D)try{if(E=t.props,x="prototype"in D&&D.prototype.render,P=(_=D.contextType)&&o[_.__c],M=_?P?P.props.value:_.__:o,n.__c?j=(p=t.__c=n.__c).__=p.__E:(x?t.__c=p=new D(E,M):(t.__c=p=new k(E,M),p.constructor=D,p.render=O),P&&P.sub(p),p.props=E,p.state||(p.state={}),p.context=M,p.__n=o,f=p.__d=!0,p.__h=[],p._sb=[]),x&&null==p.__s&&(p.__s=p.state),x&&null!=D.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=b({},p.__s)),b(p.__s,D.getDerivedStateFromProps(E,p.__s))),h=p.props,v=p.state,p.__v=t,f)x&&null==D.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),x&&null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(x&&null==D.getDerivedStateFromProps&&E!==h&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(E,M),!p.__e&&(null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(E,p.__s,M)||t.__v===n.__v)){for(t.__v!==n.__v&&(p.props=E,p.state=p.__s,p.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(e){e&&(e.__=t)}),T=0;T<p._sb.length;T++)p.__h.push(p._sb[T]);p._sb=[],p.__h.length&&s.push(p);break e}null!=p.componentWillUpdate&&p.componentWillUpdate(E,p.__s,M),x&&null!=p.componentDidUpdate&&p.__h.push(function(){p.componentDidUpdate(h,v,y)})}if(p.context=M,p.props=E,p.__P=e,p.__e=!1,I=l.__r,L=0,x){for(p.state=p.__s,p.__d=!1,I&&I(t),_=p.render(p.props,p.state,p.context),S=0;S<p._sb.length;S++)p.__h.push(p._sb[S]);p._sb=[]}else do p.__d=!1,I&&I(t),_=p.render(p.props,p.state,p.context),p.state=p.__s;while(p.__d&&++L<25);p.state=p.__s,null!=p.getChildContext&&(o=b(b({},o),p.getChildContext())),x&&!f&&null!=p.getSnapshotBeforeUpdate&&(y=p.getSnapshotBeforeUpdate(h,v)),A(e,g(U=null!=_&&_.type===w&&null==_.key?_.props.children:_)?U:[U],t,n,o,r,a,s,c,u,d),p.base=t.__e,t.__u&=-161,p.__h.length&&s.push(p),j&&(p.__E=p.__=null)}catch(e){if(t.__v=null,u||null!=a){for(t.__u|=u?160:32;c&&8===c.nodeType&&c.nextSibling;)c=c.nextSibling;a[a.indexOf(c)]=null,t.__e=c}else t.__e=n.__e,t.__k=n.__k;l.__e(e,t,n)}else null==a&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=function(e,t,n,o,r,l,a,s,c){var u,d,_,p,f,h,v,y=n.props,b=t.props,j=t.type;if("svg"===j?r="http://www.w3.org/2000/svg":"math"===j?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),null!=l){for(u=0;u<l.length;u++)if((f=l[u])&&"setAttribute"in f==!!j&&(j?f.localName===j:3===f.nodeType)){e=f,l[u]=null;break}}if(null==e){if(null===j)return document.createTextNode(b);e=document.createElementNS(r,j,b.is&&b),l=null,s=!1}if(null===j)y===b||s&&e.data===b||(e.data=b);else{if(l=l&&i.call(e.childNodes),y=n.props||m,!s&&null!=l)for(y={},u=0;u<e.attributes.length;u++)y[(f=e.attributes[u]).name]=f.value;for(u in y)if(f=y[u],"children"==u);else if("dangerouslySetInnerHTML"==u)_=f;else if("key"!==u&&!(u in b)){if("value"==u&&"defaultValue"in b||"checked"==u&&"defaultChecked"in b)continue;B(e,u,null,f,r)}for(u in b)f=b[u],"children"==u?p=f:"dangerouslySetInnerHTML"==u?d=f:"value"==u?h=f:"checked"==u?v=f:"key"===u||s&&"function"!=typeof f||y[u]===f||B(e,u,f,y[u],r);if(d)s||_&&(d.__html===_.__html||d.__html===e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(_&&(e.innerHTML=""),A(e,g(p)?p:[p],t,n,o,"foreignObject"===j?"http://www.w3.org/1999/xhtml":r,l,a,l?l[0]:n.__k&&N(n,0),s,c),null!=l)for(u=l.length;u--;)null!=l[u]&&C(l[u]);s||(u="value",void 0===h||h===e[u]&&("progress"!==j||h)&&("option"!==j||h===y[u])||B(e,u,h,y[u],r),u="checked",void 0!==v&&v!==e[u]&&B(e,u,v,y[u],r))}return e}(n.__e,t,n,o,r,a,s,u,d);(_=l.diffed)&&_(t)}function I(e,t,n){t.__d=void 0;for(var o=0;o<n.length;o++)L(n[o],n[++o],n[++o]);l.__c&&l.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){l.__e(e,t.__v)}})}function L(e,t,n){try{if("function"==typeof e){var o="function"==typeof e.__u;o&&e.__u(),o&&null==t||(e.__u=e(t))}else e.current=t}catch(e){l.__e(e,n)}}function S(e,t,n){var o,r;if(l.unmount&&l.unmount(e),(o=e.ref)&&(o.current&&o.current!==e.__e||L(o,null,t)),null!=(o=e.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(e){l.__e(e,t)}o.base=o.__P=null}if(o=e.__k)for(r=0;r<o.length;r++)o[r]&&S(o[r],t,n||"function"!=typeof e.type);n||null==e.__e||C(e.__e),e.__c=e.__=e.__e=e.__d=void 0}function O(e,t,n){return this.constructor(e,n)}function U(e,t,n){var o,r,a,s;l.__&&l.__(e,t),r=(o="function"==typeof n)?null:n&&n.__k||t.__k,a=[],s=[],T(t,e=(!o&&n||t).__k=function(e,t,n){var o,r,l,a={};for(l in t)"key"==l?o=t[l]:"ref"==l?r=t[l]:a[l]=t[l];if(arguments.length>2&&(a.children=arguments.length>3?i.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(l in e.defaultProps)void 0===a[l]&&(a[l]=e.defaultProps[l]);return j(e,a,o,r,null)}(w,null,[e]),r||m,m,t.namespaceURI,!o&&n?[n]:r?null:t.firstChild?i.call(t.childNodes):null,a,!o&&n?n:r?r.__e:t.firstChild,o,s),I(a,e,s)}i=v.slice,l={__e:function(e,t,n,o){for(var r,i,l;t=t.__;)if((r=t.__c)&&!r.__)try{if((i=r.constructor)&&null!=i.getDerivedStateFromError&&(r.setState(i.getDerivedStateFromError(e)),l=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(e,o||{}),l=r.__d),l)return r.__E=r}catch(t){e=t}throw e}},a=0,k.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=b({},this.state),"function"==typeof e&&(e=e(b({},n),this.props)),e&&b(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),E(this))},k.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),E(this))},k.prototype.render=w,s=[],u="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,d=function(e,t){return e.__v.__b-t.__v.__b},x.__r=0,_=0,p=M(!1),f=M(!0),h=0;var D=0;function F(e,t,n,o,r,i){t||(t={});var a,s,c=t;if("ref"in c)for(s in c={},t)"ref"==s?a=t[s]:c[s]=t[s];var u={type:e,props:c,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--D,__i:-1,__u:0,__source:r,__self:i};if("function"==typeof e&&(a=e.defaultProps))for(s in a)void 0===c[s]&&(c[s]=a[s]);return l.vnode&&l.vnode(u),u}var H,R,$,q,W=0,z=[],K=l,J=K.__b,V=K.__r,Y=K.diffed,G=K.__c,X=K.unmount,Q=K.__;function Z(e,t){K.__h&&K.__h(R,e,W||t),W=0;var n=R.__H||(R.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function ee(e){return W=1,function(e,t,n){var o=Z(H++,2);if(o.t=e,!o.__c&&(o.__=[n?n(t):eu(void 0,t),function(e){var t=o.__N?o.__N[0]:o.__[0],n=o.t(t,e);t!==n&&(o.__N=[n,o.__[1]],o.__c.setState({}))}],o.__c=R,!R.u)){var r=function(e,t,n){if(!o.__c.__H)return!0;var r=o.__c.__H.__.filter(function(e){return!!e.__c});if(r.every(function(e){return!e.__N}))return!i||i.call(this,e,t,n);var l=!1;return r.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(l=!0)}}),!(!l&&o.__c.props===e)&&(!i||i.call(this,e,t,n))};R.u=!0;var i=R.shouldComponentUpdate,l=R.componentWillUpdate;R.componentWillUpdate=function(e,t,n){if(this.__e){var o=i;i=void 0,r(e,t,n),i=o}l&&l.call(this,e,t,n)},R.shouldComponentUpdate=r}return o.__N||o.__}(eu,e)}function et(e,t){var n=Z(H++,3);!K.__s&&ec(n.__H,t)&&(n.__=e,n.i=t,R.__H.__h.push(n))}function en(e,t){var n=Z(H++,4);!K.__s&&ec(n.__H,t)&&(n.__=e,n.i=t,R.__h.push(n))}function eo(e){return W=5,function(e,t){var n=Z(H++,7);return ec(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}(function(){return{current:e}},[])}function er(e){var t=R.context[e.__c],n=Z(H++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(R)),t.props.value):e.__}function ei(){for(var e;e=z.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(ea),e.__H.__h.forEach(es),e.__H.__h=[]}catch(t){e.__H.__h=[],K.__e(t,e.__v)}}K.__b=function(e){R=null,J&&J(e)},K.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Q&&Q(e,t)},K.__r=function(e){V&&V(e),H=0;var t=(R=e.__c).__H;t&&($===R?(t.__h=[],R.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.i=e.__N=void 0})):(t.__h.forEach(ea),t.__h.forEach(es),t.__h=[],H=0)),$=R},K.diffed=function(e){Y&&Y(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==z.push(t)&&q===K.requestAnimationFrame||((q=K.requestAnimationFrame)||function(e){var t,n=function(){clearTimeout(o),el&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,100);el&&(t=requestAnimationFrame(n))})(ei)),t.__H.__.forEach(function(e){e.i&&(e.__H=e.i),e.i=void 0})),$=R=null},K.__c=function(e,t){t.some(function(e){try{e.__h.forEach(ea),e.__h=e.__h.filter(function(e){return!e.__||es(e)})}catch(n){t.some(function(e){e.__h&&(e.__h=[])}),t=[],K.__e(n,e.__v)}}),G&&G(e,t)},K.unmount=function(e){X&&X(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{ea(e)}catch(e){t=e}}),n.__H=void 0,t&&K.__e(t,n.__v))};var el="function"==typeof requestAnimationFrame;function ea(e){var t=R,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),R=t}function es(e){var t=R;e.__c=e.__(),R=t}function ec(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function eu(e,t){return"function"==typeof t?t(e):t}let ed={privacyPolicyUrl:"",forceModal:!1,forceBanner:!1,translations:{},purposes:[]},e_=e=>e.flatMap(e=>"purposes"in e?e_(e.purposes):[e]),ep=e=>"string"==typeof e?{src:e,alt:""}:{src:"",alt:"",...e},ef=(e,t)=>!!e.length&&e.every(t),eh=(e,t)=>e.filter(e=>!t.includes(e)),em=(e,t)=>Object.fromEntries(e.map(e=>[e[t],e])),ev=(e,t)=>{let{id:n,isExempt:o,isMandatory:r}=e;return!!o||(r?t?.[n]:n in t)},ey=e=>Object.fromEntries(e.map(e=>{let{id:t,isMandatory:n,default:o}=e;return[t,n||!!o]})),eg=e=>Object.fromEntries(e.map(e=>{let{id:t}=e;return[t,!0]})),eb=e=>Object.fromEntries(e.map(e=>{let{id:t}=e;return[t,!1]})),eC=e=>ef(e,e=>{let{isMandatory:t}=e;return t}),ej=(e,t)=>ef(e,e=>{let{id:n}=e;return t?.[n]}),ew=(e,t)=>ef(e,e=>{let{id:n,isMandatory:o}=e;return o||!t?.[n]});var ek=(eY={},(eX={__c:eG="__cC"+h++,__:eY,Consumer:function(e,t){return e.children(t)},Provider:function(e){var t,n;return this.getChildContext||(t=[],(n={})[eG]=this,this.getChildContext=function(){return n},this.componentWillUnmount=function(){t=null},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&t.some(function(e){e.__e=!0,E(e)})},this.sub=function(e){t.push(e);var n=e.componentWillUnmount;e.componentWillUnmount=function(){t&&t.splice(t.indexOf(e),1),n&&n.call(e)}}),e.children}}).Provider.__=eX.Consumer.contextType=eX);let eN=(e,t)=>e?"string"==typeof e?document.querySelector(e):e:t,eE=e=>{let t=eN(e)||document.createElement("div");return!t.classList.contains("orejime-Root")&&t.classList.add("orejime-Root"),!t.parentNode&&document.body.insertBefore(t,document.body.firstChild),t},ex=()=>{try{return window.self===window.top}catch(e){return!0}},eA=e=>{e&&ex()&&e?.focus()},eP=e=>e.querySelector('a[href], button:not([disabled]):not([aria-hidden]), [tabindex]:not([tabindex^="-"])'),eB=(e,t,n)=>{let o=(Number(e.dataset.translation)||0)+t*n;Math.sign(o)===Math.sign(n)?(e.dataset.translation=o.toString(),e.style.transform=`translateY(${o}px)`):(delete e.dataset.translation,e.style.transform="")},eM=e=>{let t=window.getComputedStyle(e).getPropertyValue("--orejime-collision-padding");return t.length?parseInt(t,10):16},eT=(e,t)=>({top:e.top+t,right:e.right+t,bottom:e.bottom+t,left:e.left+t}),eI=(e,t)=>{if(t.contains(e)){eB(t,0);return}let n=eT(e.getBoundingClientRect(),eM(t)),o=t.getBoundingClientRect();if(!(o.left<n.right&&o.right>n.left)){eB(t,0);return}let r=o.top+o.height/2>window.innerHeight/2?1:-1,i=r>0?n.bottom-o.top:o.bottom-n.top;if(!(o.top<n.bottom&&o.bottom>n.top)){eB(t,i,r);return}let l=document.documentElement,a=r>0?Math.abs(l.scrollHeight-l.clientHeight-l.scrollTop):l.scrollTop;window.scrollBy({top:i*r}),i>a&&eB(t,i-a,r)},eL=()=>{let{config:e}=er(ek);return e},eS=()=>{let{translations:e}=eL();return e},eO=()=>{let{config:e}=er(ek);return e.theme},eU=()=>{let{manager:e}=er(ek),[t,n]=ee(0);return et(()=>{let o=()=>{n(t+1)};return e.on("update",o),()=>{e.off("update",o)}}),e},eD=()=>{let e=eL(),t=eU();return!e.forceModal&&!!t.isDirty()&&!0},eF=()=>{let e=eL(),t=eU(),n=()=>e.forceModal&&t.isDirty(),[o,r]=ee(n());return[o,()=>{r(!0)},()=>{r(n())}]},eH=e=>{let t=eU();return[ej(e,t.getAllConsents()),ew(e,t.getAllConsents()),()=>{t.setConsents(eg(e))},()=>{t.setConsents(eb(e))}]},eR=e=>{let t=eU();return[t.getConsent(e),t.setConsent.bind(t,e)]},e$=e=>{et(()=>{let t=t=>{eI(t.target,e.current)};return document.addEventListener("focusin",t),()=>{document.removeEventListener("focusin",t)}},[e])},eq=(e,t)=>"string"!=typeof e?[]:e.split(/\{(?!\{)([\w\d]+)\}(?!\})/gi).filter(e=>!!e).map(e=>e in t?t[e]:e);var eW=e=>{let{isHidden:t,needsUpdate:n,purposeTitles:o,privacyPolicyUrl:r,logo:i,onAccept:l,onDecline:a,onConfigure:s}=e,c=eo(),u=eS();return e$(c),F("div",{"aria-hidden":t,className:"orejime-Banner",ref:c,children:F("div",{className:"orejime-Banner-body",children:[i&&F("div",{className:"orejime-Banner-logoContainer",children:F("img",{className:"orejime-Banner-logo",...ep(i)})}),F("div",{className:"orejime-Banner-text",children:[u.banner.title&&F("h1",{className:"orejime-Banner-title",id:"orejime-Banner-title",children:u.banner.title}),F("p",{className:"orejime-Banner-description",children:eq(u.banner.description,{purposes:F("strong",{className:"orejime-Banner-purposes",children:o.join(", ")},"purposes"),privacyPolicy:F("a",{className:"orejime-Banner-privacyPolicyLink",href:r,children:u.banner.privacyPolicyLabel},"privacyPolicyLink")})})]}),n&&F("p",{className:"orejime-Banner-changes",children:u.misc.updateNeeded}),F("ul",{className:"orejime-Banner-actions orejime-ButtonList",children:[F("li",{className:"orejime-Banner-actionItem orejime-Banner-actionItem--save",children:F("button",{className:"orejime-Button orejime-Button--save orejime-Banner-button orejime-Banner-saveButton",type:"button",title:u.banner.acceptTitle,onClick:l,children:u.banner.accept})}),F("li",{className:"orejime-Banner-actionItem orejime-Banner-actionItem--decline",children:F("button",{className:"orejime-Button orejime-Button--decline orejime-Banner-button orejime-Banner-declineButton",type:"button",title:u.banner.declineTitle,onClick:a,children:u.banner.decline})}),F("li",{className:"orejime-Banner-actionItem orejime-Banner-actionItem--info",children:F("button",{type:"button",className:"orejime-Button orejime-Button--info orejime-Banner-learnMoreButton",title:u.banner.configureTitle,onClick:s,children:u.banner.configure})})]})]})})};let ez=e=>{let{title:t}=e;return F("svg",{role:"img",className:"orejime-CloseIcon","aria-label":t,viewBox:"0 0 12 12",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:[F("title",{children:t}),F("line",{x1:"1",y1:"11",x2:"11",y2:"1","stroke-linecap":"round"}),F("line",{x1:"1",y1:"1",x2:"11",y2:"11","stroke-linecap":"round"})]})};function eK(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function eJ(e){return function(e){if(Array.isArray(e))return eV(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return eV(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return eV(e,t)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function eV(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}var eY,eG,eX,eQ,eZ,e0,e1,e2,e3=(eQ=["a[href]","area[href]",'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',"select:not([disabled]):not([aria-hidden])","textarea:not([disabled]):not([aria-hidden])","button:not([disabled]):not([aria-hidden])","iframe","object","embed","[contenteditable]",'[tabindex]:not([tabindex^="-"])'],eZ=function(){var e,t;function n(e){var t=e.targetModal,o=e.triggers,r=void 0===o?[]:o,i=e.onShow,l=e.onClose,a=e.openTrigger,s=e.closeTrigger,c=e.openClass,u=e.disableScroll,d=e.disableFocus,_=e.awaitCloseAnimation,p=e.awaitOpenAnimation,f=e.debugMode;(function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")})(this,n),this.modal=document.getElementById(t),this.config={debugMode:void 0!==f&&f,disableScroll:void 0!==u&&u,openTrigger:void 0===a?"data-micromodal-trigger":a,closeTrigger:void 0===s?"data-micromodal-close":s,openClass:void 0===c?"is-open":c,onShow:void 0===i?function(){}:i,onClose:void 0===l?function(){}:l,awaitCloseAnimation:void 0!==_&&_,awaitOpenAnimation:void 0!==p&&p,disableFocus:void 0!==d&&d},r.length>0&&this.registerTriggers.apply(this,eJ(r)),this.onClick=this.onClick.bind(this),this.onKeydown=this.onKeydown.bind(this)}return e=[{key:"registerTriggers",value:function(){for(var e=this,t=arguments.length,n=Array(t),o=0;o<t;o++)n[o]=arguments[o];n.filter(Boolean).forEach(function(t){t.addEventListener("click",function(t){return e.showModal(t)})})}},{key:"showModal",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;(this.activeElement=document.activeElement,this.modal.setAttribute("aria-hidden","false"),this.modal.classList.add(this.config.openClass),this.scrollBehaviour("disable"),this.addEventListeners(),this.config.awaitOpenAnimation)?this.modal.addEventListener("animationend",function t(){e.modal.removeEventListener("animationend",t,!1),e.setFocusToFirstNode()},!1):this.setFocusToFirstNode(),this.config.onShow(this.modal,this.activeElement,t)}},{key:"closeModal",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=this.modal;if(this.modal.setAttribute("aria-hidden","true"),this.removeEventListeners(),this.scrollBehaviour("enable"),this.activeElement&&this.activeElement.focus&&this.activeElement.focus(),this.config.onClose(this.modal,this.activeElement,e),this.config.awaitCloseAnimation){var n=this.config.openClass;this.modal.addEventListener("animationend",function e(){t.classList.remove(n),t.removeEventListener("animationend",e,!1)},!1)}else t.classList.remove(this.config.openClass)}},{key:"closeModalById",value:function(e){this.modal=document.getElementById(e),this.modal&&this.closeModal()}},{key:"scrollBehaviour",value:function(e){if(this.config.disableScroll){var t=document.querySelector("body");switch(e){case"enable":Object.assign(t.style,{overflow:""});break;case"disable":Object.assign(t.style,{overflow:"hidden"})}}}},{key:"addEventListeners",value:function(){this.modal.addEventListener("touchstart",this.onClick),this.modal.addEventListener("click",this.onClick),document.addEventListener("keydown",this.onKeydown)}},{key:"removeEventListeners",value:function(){this.modal.removeEventListener("touchstart",this.onClick),this.modal.removeEventListener("click",this.onClick),document.removeEventListener("keydown",this.onKeydown)}},{key:"onClick",value:function(e){(e.target.hasAttribute(this.config.closeTrigger)||e.target.parentNode.hasAttribute(this.config.closeTrigger))&&(e.preventDefault(),e.stopPropagation(),this.closeModal(e))}},{key:"onKeydown",value:function(e){27===e.keyCode&&this.closeModal(e),9===e.keyCode&&this.retainFocus(e)}},{key:"getFocusableNodes",value:function(){return Array.apply(void 0,eJ(this.modal.querySelectorAll(eQ)))}},{key:"setFocusToFirstNode",value:function(){var e=this;if(!this.config.disableFocus){var t=this.getFocusableNodes();if(0!==t.length){var n=t.filter(function(t){return!t.hasAttribute(e.config.closeTrigger)});n.length>0&&n[0].focus(),0===n.length&&t[0].focus()}}}},{key:"retainFocus",value:function(e){var t=this.getFocusableNodes();if(0!==t.length){if(t=t.filter(function(e){return null!==e.offsetParent}),this.modal.contains(document.activeElement)){var n=t.indexOf(document.activeElement);e.shiftKey&&0===n&&(t[t.length-1].focus(),e.preventDefault()),!e.shiftKey&&t.length>0&&n===t.length-1&&(t[0].focus(),e.preventDefault())}else t[0].focus()}}}],eK(n.prototype,e),t&&eK(n,t),n}(),e0=null,e1=function(e){if(!document.getElementById(e))return console.warn("MicroModal: ❗Seems like you have missed %c'".concat(e,"'"),"background-color: #f8f9fa;color: #50596c;font-weight: bold;","ID somewhere in your code. Refer example below to resolve it."),console.warn("%cExample:","background-color: #f8f9fa;color: #50596c;font-weight: bold;",'<div class="modal" id="'.concat(e,'"></div>')),!1},e2=function(e,t){if(e.length<=0&&(console.warn("MicroModal: ❗Please specify at least one %c'micromodal-trigger'","background-color: #f8f9fa;color: #50596c;font-weight: bold;","data attribute."),console.warn("%cExample:","background-color: #f8f9fa;color: #50596c;font-weight: bold;",'<a href="#" data-micromodal-trigger="my-modal"></a>')),!t)return!0;for(var n in t)e1(n);return!0},{init:function(e){var t,n,o,r=Object.assign({},{openTrigger:"data-micromodal-trigger"},e),i=eJ(document.querySelectorAll("[".concat(r.openTrigger,"]"))),l=(t=i,n=r.openTrigger,o=[],t.forEach(function(e){var t=e.attributes[n].value;void 0===o[t]&&(o[t]=[]),o[t].push(e)}),o);if(!0!==r.debugMode||!1!==e2(i,l))for(var a in l){var s=l[a];r.targetModal=a,r.triggers=eJ(s),e0=new eZ(r)}},show:function(e,t){var n=t||{};n.targetModal=e,!0===n.debugMode&&!1===e1(e)||(e0&&e0.removeEventListeners(),(e0=new eZ(n)).showModal())},close:function(e){e?e0.closeModalById(e):e0.closeModal()}});"undefined"!=typeof window&&(window.MicroModal=e3);var e6=e=>{let{isAlert:t=!1,label:n,labelId:o,className:r,portalClassName:i,overlayClassName:l,htmlClassName:a,handleScrollPosition:s=!0,onRequestClose:c,children:u}=e,d=function(){var e=Z(H++,11);if(!e.__){for(var t=R.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}(),[_,p]=ee(null);return en(()=>{null===_&&p(window.pageYOffset)}),et(()=>{null!==_&&setTimeout(()=>{s&&window.scrollTo(window.pageXOffset,_),p(null)},0)}),et(()=>(a&&document.documentElement.classList.add(a),e3.show(d,{onClose:c}),()=>{e3.close(d),a&&document.documentElement.classList.remove(a)}),[]),F("div",{className:i,id:d,"aria-hidden":"true",children:F("div",{className:l,tabIndex:-1,"data-micromodal-close":!t||null,children:F("div",{className:r,role:t?"alertdialog":"dialog","aria-modal":"true","aria-label":n,"aria-labelledby":o,children:u})})})},e9=e=>{let{className:t}=e,n=eS();return F("a",{className:t,title:`${n.misc.poweredBy} (${n.misc.newWindowTitle})`,href:"https://orejime.boscop.fr",target:"_blank",children:n.misc.poweredBy})};(e=t||(t={}))[e.declined=0]="declined",e[e.accepted=1]="accepted",e[e.partial=2]="partial";function e5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)e[o]=n[o]}return e}var e7=function e(t,n){function o(e,o,r){if("undefined"!=typeof document){"number"==typeof(r=e5({},n,r)).expires&&(r.expires=new Date(Date.now()+864e5*r.expires)),r.expires&&(r.expires=r.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var i="";for(var l in r){if(!r[l])continue;if(i+="; "+l,!0!==r[l])i+="="+r[l].split(";")[0]}return document.cookie=e+"="+t.write(o,e)+i}}return Object.create({set:o,get:function(e){if("undefined"!=typeof document&&(!arguments.length||!!e)){for(var n=document.cookie?document.cookie.split("; "):[],o={},r=0;r<n.length;r++){var i=n[r].split("="),l=i.slice(1).join("=");try{var a=decodeURIComponent(i[0]);if(o[a]=t.read(l,a),e===a)break}catch(e){}}return e?o[e]:o}},remove:function(e,t){o(e,"",e5({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,e5({},this.attributes,t))},withConverter:function(t){return e(e5({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});let e8=()=>document.cookie.split(";").reduce((e,t)=>{let[n]=t.split("=",2);return n?e.concat(n.trim()):e},[]),e4=e=>e7.get(e),te=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0;e7.set(e,t,{expires:n,domain:o,sameSite:r})},tt=(e,t,n)=>{if(n){e7.remove(e,{path:t,domain:n});return}e7.remove(e,{path:t,domain:location.hostname}),e7.remove(e,{path:t,domain:location.hostname.split(".").slice(-2).join(".")})};class tn{#e;constructor(e={}){this.#e={name:"eu-consent",domain:void 0,duration:120,sameSite:"strict",parse:JSON.parse,stringify:JSON.stringify,...e}}read(){let{name:e,parse:t}=this.#e,n=e4(e);return n?t(n):{}}write(e){let{name:t,domain:n,duration:o,sameSite:r,stringify:i}=this.#e;te(t,i(e),o,n,r)}clear(){tt(this.#e.name)}}var to=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),tr=e=>{let t=e8();e.forEach(e=>{let n,o;e instanceof Array&&([e,n,o]=e),!(e instanceof RegExp)&&(e=RegExp(`^${to(e)}$`)),t.filter(t=>e.test(t)).forEach(e=>{tt(e,n,o)})})};class ti{#t;constructor(e){this.#t=em(e,"id")}apply(e){Object.entries(e).filter(e=>{let[t,n]=e;return!n}).map(e=>{let[t]=e;return this.#t[t].cookies}).filter(e=>e?.length).forEach(tr)}}class tl{#n;#o;#r;constructor(e,t){this.#n=t,this.#o=Object.fromEntries(e.map(e=>{let{id:t,runsOnce:n}=e;return[t,!!n]})),this.#r=Object.fromEntries(e.map(e=>{let{id:t}=e;return[t,!1]}))}apply(e){Object.entries(e).filter(e=>{let[t,n]=e;return!n||!this.#o[t]||!this.#r?.[t]}).forEach(e=>{let[t,n]=e;this.#n(t,n),this.#r[t]=!0})}}class ta{#i;constructor(){this.#i={}}on(e,t){!(e in this.#i)&&(this.#i[e]=[]),this.#i[e].push(t)}off(e,t){if(!(e in this.#i))return;let n=this.#i[e].findIndex(e=>e===t);n>=0&&this.#i[e].splice(n,1)}emit(e){for(var t=arguments.length,n=Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];if(e in this.#i)this.#i[e].forEach(e=>{e(...n)})}}let ts=(e,t)=>Object.entries(t).reduce((t,n)=>{let[o,r]=n;return r===e?.[o]?t:{...t,[o]:r}},{}),tc=(e,t)=>Object.keys(e).reduce((n,o)=>({...n,[o]:t[o]??e[o]}),{});class tu extends ta{#t;#l;#a;#s;#c;#u;constructor(e,t={}){super(),this.#s=e.filter(e=>!ev(e,t)).map(e=>{let{id:t}=e;return t}),this.#a=ey(e),this.#l=eg(e.filter(e=>{let{isMandatory:t}=e;return t})),this.#t=e,this.#u=tc(this.#a,t),this.#c=Object.keys(t).length>0&&this.#s.length>0}clone(){return new tu(this.#t,this.getAllConsents())}isDirty(){return this.#s.length>0}needsUpdate(){return this.#c}areAllPurposesMandatory(){return eC(this.#t)}areAllPurposesEnabled(){return ej(this.#t,this.#u)}areAllPurposesDisabled(){return ew(this.#t,this.#u)}getConsent(e){return this.#u?.[e]}getAllConsents(){return{...this.#u}}acceptAll(){this.setConsents(eg(this.#t))}declineAll(){this.setConsents(eb(this.#t))}setConsent(e,t){this.setConsents({[e]:t})}setConsents(e){this.#d(e),this.#_(eh(this.#s,Object.keys(e)))}clearConsents(){this.#d({...this.#a}),this.#_(eh(this.#t.map(e=>{let{id:t}=e;return t}),Object.keys(this.#l))),this.emit("clear")}#d(e){let t=tc(e,this.#l),n=ts(this.#u,t);this.#u={...this.#u,...t},this.emit("update",n,{...this.#u})}#_(e){this.#s=e,0===this.#s.length&&(this.#c=!1),this.emit("dirty",this.isDirty())}}var td=(e,t)=>{t?document.querySelectorAll(`template[data-purpose="${e}"]:not([data-active])`).forEach(e=>{e.dataset.active="active",Array.from(e.content.cloneNode(!0).children).forEach(t=>{t.dataset.purpose=e.dataset.purpose,e.insertAdjacentElement("afterend",t)})}):document.querySelectorAll(`[data-purpose="${e}"]`).forEach(e=>{"TEMPLATE"===e.nodeName?delete e.dataset.active:e.remove()})},t_=(e,t)=>{let n=new tl(e,td),o=new ti(e),r=new tn(t?.cookie),i=new tu(e,r.read()),l=i.getAllConsents();return i.on("update",(e,t)=>{n.apply(e),o.apply(e),r.write(t)}),i.on("clear",()=>{r.clear()}),n.apply(l),o.apply(l),i},tp=e=>{let{purposes:n,children:o,...r}=e,[i,l,a,s]=eH(n),{Purpose:c}=eO();return F(c,{...r,consent:i?t.accepted:l?t.declined:t.partial,onChange:e=>e?a():s(),children:o})},tf=e=>{let[n,o]=eR(e.id),{Purpose:r}=eO();return F(r,{...e,consent:n?t.accepted:t.declined,onChange:o})};let th=e=>{let{purposes:t}=e,{PurposeList:n}=eO();return F(n,{children:t.map(e=>"purposes"in e?F(tp,{...e,children:F(th,{purposes:e.purposes})},e.id):F(tf,{...e},e.id))})};function tm(e){let{children:t,onCommit:n}=e,{manager:o,...r}=er(ek),{current:i}=eo(o.clone());return F(ek.Provider,{value:{...r,manager:i},children:t(()=>{o.setConsents(i.getAllConsents()),n()})})}var tv=()=>{let e=eU(),{GlobalConsent:t}=eO();return F(t,{isEnabled:e.areAllPurposesEnabled(),isDisabled:e.areAllPurposesDisabled(),acceptAll:()=>e.acceptAll(),declineAll:()=>e.declineAll()})},ty=e=>{var t,n,o;let{apiRef:r}=e,i=eL(),l=eU(),a=eD(),[s,c,u]=eF(),{Banner:d,Modal:_,ModalBanner:p}=eO(),f=eo(),h=i.forceBanner?p:d;return t=r,n=()=>({openModal:c}),W=6,en(function(){return"function"==typeof t?(t(n()),function(){return t(null)}):t?(t.current=n(),function(){return t.current=null}):void 0},o),et(()=>{a&&!s&&f.current&&eA(eP(f.current))},[a]),F("div",{className:"orejime-Main orejime-Env",children:[a?F("div",{ref:f,children:F(h,{isHidden:s,needsUpdate:l.needsUpdate(),purposeTitles:i.purposes.map(e=>{let{title:t}=e;return t}),privacyPolicyUrl:i.privacyPolicyUrl,logo:i.logo,onConfigure:c,onAccept:()=>{l.acceptAll(),u()},onDecline:()=>{l.declineAll(),u()}},"banner")}):null,s?F(tm,{onCommit:u,children:e=>F(_,{isForced:i.forceModal&&l.isDirty(),needsUpdate:l.needsUpdate(),privacyPolicyUrl:i.privacyPolicyUrl,onClose:u,onSave:e,children:[l.areAllPurposesMandatory()?null:F(tv,{}),F(th,{purposes:i.purposes})]},"modal")}):null]})};let tg=e=>{let t,n=!1;return()=>(!n&&(t=e(),n=!0),t)};var tb=e=>{let{purposeId:t,data:n,isEnabled:o}=e,r=eL(),i=eU(),l=eS(),{ContextualNotice:a}=eO(),[s,c]=ee(!1);if(!o&&!s)return null;let u=e_(r.purposes).find(e=>{let{id:n}=e;return n===t});return u?F("div",{className:"orejime-Env",children:o?F(a,{purpose:u,data:n,onAccept:()=>{i.setConsent(u.id,!0),c(!0)}}):s?F("div",{id:`orejime-ContextualNotice-placeholder--${u.id}`,className:"orejime-ContextualNotice-placeholder",title:eq(l.contextual.accepted,{purpose:u.title}).join(""),tabIndex:-1,ref:e=>{e?.focus()},onFocusOut:()=>{c(!1)}}):null}):null};class tC{#p;#f;#h;constructor(e,t){this.#p=e,this.#f=t,this.#h=new WeakMap}apply(e){Object.entries(e).forEach(e=>{let[t,n]=e;document.querySelectorAll(`template[data-contextual][data-purpose="${t}"]`).forEach(e=>{this.#m(e,!n)})})}#m(e,t){U(F(ek.Provider,{value:{config:this.#p,manager:this.#f},children:F(tb,{purposeId:e.dataset.purpose,data:{...e.dataset},isEnabled:t})}),this.#v(e))}#v(e){if(!this.#h.has(e)){let t=document.createElement("div");t.style.display="contents",e.insertAdjacentElement("beforebegin",t),this.#h.set(e,t)}return this.#h.get(e)}}var tj=(e,t)=>{let n=eE(e.orejimeElement),o={current:null},r=tg(()=>{U(F(ek.Provider,{value:{config:e,manager:t},children:F(ty,{apiRef:o})}),n)}),i=new tC(e,t);return t.on("update",e=>{i.apply(e)}),i.apply(t.getAllConsents()),t.on("dirty",e=>{e&&r()}),t.isDirty()&&r(),{openModal:()=>{r(),o.current.openModal()}}};let tw=e=>e&&"object"==typeof e,tk=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.reduce((e,t)=>(Object.keys(t).forEach(n=>{let o=e[n],r=t[n];Array.isArray(o)&&Array.isArray(r)?e[n]=o.concat(...r):tw(o)&&tw(r)?e[n]=tk(o,r):e[n]=r}),e),{})};var tN=e=>{let t=tk(ed,e);!function(e){if(!Object.keys(e.purposes).length)throw Error("Orejime config: you must define `purposes`");if(!e.privacyPolicyUrl.length)throw Error("Orejime config: you must define `privacyPolicyUrl`")}(t);let n=t_(e_(t.purposes),{cookie:t.cookie}),{openModal:o}=tj(t,n);return{config:t,manager:n,prompt:o}};((e,t)=>{let n=n=>{let o=tN(tk({translations:t},{...n,theme:e}));return"undefined"!=typeof CustomEvent&&document.dispatchEvent(new CustomEvent("orejime.loaded",{detail:o})),o},o=async()=>{window.loadOrejime=n,void 0!==window.orejimeConfig&&void 0===window.orejime&&(window.orejime=n(window.orejimeConfig))};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",o):o()})({Banner:eW,ContextualNotice:e=>{let{purpose:t,data:n,onAccept:o}=e,r=eS(),{titleLevel:i}=n,l=i?`h${i}`:"strong",a={purpose:t.title};return F("div",{className:"orejime-ContextualNotice",children:[F(l,{className:"orejime-ContextualNotice-title",children:eq(r.contextual.title,a)}),F("p",{className:"orejime-ContextualNotice-description",children:eq(r.contextual.description,a)}),F("button",{className:"orejime-ContextualNotice-button orejime-Button",title:r.contextual.acceptTitle?eq(r.contextual.acceptTitle,a).join(""):null,onClick:o,children:eq(r.contextual.accept,a)})]})},GlobalConsent:e=>{let{isEnabled:t,isDisabled:n,acceptAll:o,declineAll:r}=e,i=eS();return F("div",{className:"orejime-PurposeToggles orejime-ButtonList",children:[F("button",{type:"button",className:"orejime-Button orejime-Button--info orejime-PurposeToggles-button orejime-PurposeToggles-enableAll","aria-disabled":t,onClick:o,children:i.modal.acceptAll}),F("button",{type:"button",className:"orejime-Button orejime-Button--info orejime-PurposeToggles-button orejime-PurposeToggles-disableAll","aria-disabled":n,onClick:r,children:i.modal.declineAll})]})},Modal:e=>{let{isForced:t,needsUpdate:n,privacyPolicyUrl:o,onClose:r,onSave:i,children:l}=e,a=eS();return F(e6,{isAlert:t,labelId:"orejime-modal-title",overlayClassName:"orejime-ModalOverlay",className:"orejime-ModalWrapper",onRequestClose:r,children:F("div",{className:"orejime-Modal",children:[F("div",{className:"orejime-Modal-header",children:[t?null:F("button",{title:a.modal.closeTitle,className:"orejime-Modal-closeButton",type:"button",onClick:r,children:F(ez,{title:a.modal.close})}),F("h1",{className:"orejime-Modal-title",id:"orejime-modal-title",children:a.modal.title}),F("p",{className:"orejime-Modal-description",children:[t&&n?F("p",{className:"orejime-Modal-description",children:F("strong",{className:"orejime-Modal-changes",children:a.misc.updateNeeded})}):null,eq(a.modal.description,{privacyPolicy:F("a",{className:"orejime-Modal-privacyPolicyLink",onClick:e=>{r()},href:o,children:a.modal.privacyPolicyLabel},"privacyPolicyLink")})]})]}),F("form",{className:"orejime-Modal-form",onSubmit:e=>{e.preventDefault(),i()},onKeyDown:e=>{"INPUT"===e.target.nodeName&&"checkbox"===e.target.type&&"Enter"===e.key&&e.preventDefault()},children:[F("div",{className:"orejime-Modal-body",children:l}),F("div",{className:"orejime-Modal-footer",children:[F("button",{className:"orejime-Button orejime-Button--save orejime-Modal-saveButton",title:a.modal.saveTitle,children:a.modal.save}),F(e9,{className:"orejime-Modal-poweredByLink"})]})]})]})})},ModalBanner:e=>F(e6,{overlayClassName:"orejime-BannerOverlay",className:"orejime-BannerWrapper",label:eS().banner.title,isAlert:!0,children:F(eW,{...e})}),Purpose:e=>{let{id:n,title:o,description:r,isMandatory:i,isExempt:l,consent:a,children:s,onChange:c}=e,u=eS(),d=`orejime-purpose-${n}`,_=eo();return et(()=>{_.current&&(_.current.indeterminate=a===t.partial)},[a]),F("div",{className:"orejime-Purpose",children:[F("input",{id:d,ref:_,className:"orejime-Purpose-input","aria-describedby":r?`${d}-description`:null,disabled:i,checked:a===t.accepted,type:"checkbox",onChange:e=>{c(e.target.checked)}}),F("label",{htmlFor:d,className:"orejime-Purpose-label",...i?{tabIndex:0}:{},children:[F("span",{id:`${d}-title`,className:"orejime-Purpose-title",children:o})," ",i?F("span",{className:"orejime-Purpose-attribute orejime-Purpose-attribute--mandatory",title:u.purpose.mandatoryTitle,children:u.purpose.mandatory}):null," ",l?F("span",{className:"orejime-Purpose-attribute orejime-Purpose-attribute--exempt",title:u.purpose.exemptTitle,children:u.purpose.exempt}):null," ",F("span",{className:"orejime-Purpose-attribute orejime-Purpose-attribute--state","aria-hidden":"true",children:a===t.accepted?u.purpose.enabled:a===t.declined?u.purpose.disabled:u.purpose.partial})]}),r?F("p",{id:`${d}-description`,className:"orejime-Purpose-description",dangerouslySetInnerHTML:{__html:r}}):null,function e(t,n){return n=n||[],null==t||"boolean"==typeof t||(g(t)?t.some(function(t){e(t,n)}):n.push(t)),n}(s).length?F("div",{className:"orejime-Purpose-children",role:"group","aria-labelledby":`${d}-title`,children:s}):null]})},PurposeList:e=>{let{children:t}=e;return F("ul",{className:"orejime-PurposeList",children:t.map(e=>F("li",{className:"orejime-PurposeList-item",children:e}))})}},{banner:{title:null,description:"Reculhiss\xe8m e tractam v\xf2stras informacions personalas amb la t\xf2ca seguenta : {purposes}.\nPer ne saber mai, merc\xe9s de legir n\xf2stra {privacyPolicy}.",privacyPolicyLabel:"politica de confidencialitat",accept:"Acceptar",acceptTitle:"Acceptar los cookies",decline:"Refusar",declineTitle:"Refusar los cookies",configure:"Configurar",configureTitle:"Configurar los cookies"},modal:{title:"Las informacions que reculhiss\xe8m",description:"Aic\xed, pod\xe8tz veire e personalizar las informacions que reculhiss\xe8m vos tocant.\nPer ne saber mai, merc\xe9s de legir n\xf2stra {privacyPolicy}.",privacyPolicyLabel:"politica de confidencialitat",close:"Tancar",closeTitle:null,globalPreferences:"Prefer\xe9ncias per totes los servicis",acceptAll:"Tot acceptar",declineAll:"Tot refusar",save:"Salvagardar",saveTitle:"Salvagardar ma configuracion per las informacions collectadas"},contextual:{title:'"{purpose}" \xe9s inactiu',description:"Autorizar los cookies a accedir a aquesta foncionalitat.",accept:"Permetre",accepted:'"{purpose}" es ara autorizat.'},purpose:{mandatory:"tojors requerit",mandatoryTitle:"Aquesta aplicacion es totjorn requerida",exempt:"opt-out",exemptTitle:"Aquesta aplicacion es cargada per defaut (mas la pod\xe8tz desactivar)",showMore:"Mostrar mai",accept:"Acceptar",decline:"Refusar",enabled:"Activat",disabled:"Desactivat",partial:"parciala"},misc:{newWindowTitle:"fen\xe8stra nov\xe8la",updateNeeded:"I agu\xe8t de modificacions dempu\xe8i v\xf2stra darri\xe8ra visita, merc\xe9s d’actualizar v\xf2stre consentiment.",poweredBy:"Propulsat per Orejime"}})}();