@undrr/undrr-mangrove 2.0.0-rc.2 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -6
- package/components/BookCard.js +1 -1
- package/components/Breadcrumbs.js +2 -2
- package/components/Checkbox.js +1 -1
- package/components/Chips.js +1 -1
- package/components/CopyButton.js +2 -2
- package/components/CtaButton.js +1 -1
- package/components/Drawer.js +1 -1
- package/components/EmbedContainer.js +1 -1
- package/components/Footer.js +1 -1
- package/components/FormAction.js +1 -1
- package/components/FormErrorSummary.js +1 -1
- package/components/FormGroup.js +1 -1
- package/components/FullWidth.js +1 -1
- package/components/Gallery.js +2 -2
- package/components/Hero.js +2 -2
- package/components/HighlightBox.js +1 -1
- package/components/HorizontalBookCard.js +1 -1
- package/components/HorizontalCard.js +1 -1
- package/components/IconCard.js +1 -1
- package/components/Legend.js +1 -1
- package/components/Loader.js +1 -1
- package/components/MegaMenu.js +2 -2
- package/components/Notice.js +2 -2
- package/components/PageHeader.js +2 -2
- package/components/Pager.js +2 -2
- package/components/QuoteHighlight.js +2 -2
- package/components/QuoteHighlight.js.LICENSE.txt +2 -0
- package/components/Radio.js +1 -1
- package/components/Range.js +1 -1
- package/components/ScrollContainer.js +2 -2
- package/components/SegmentedControl.js +9 -0
- package/components/SegmentedControl.js.LICENSE.txt +9 -0
- package/components/Select.js +1 -1
- package/components/ServiceNotice.js +2 -2
- package/components/ShareButtons.js +2 -2
- package/components/ShowMore.js +2 -2
- package/components/SkipLink.js +1 -1
- package/components/StatsCard.js +1 -1
- package/components/SyndicationSearchWidget.js +2 -2
- package/components/Tab.js +2 -2
- package/components/TextCta.js +1 -1
- package/components/TextInput.js +1 -1
- package/components/Textarea.js +1 -1
- package/components/Tree.js +1 -1
- package/components/UserFeedback.js +1 -1
- package/components/VerticalCard.js +1 -1
- package/components/hydrate.js +2 -2
- package/css/style-all.css +60 -40
- package/css/style-all.css.map +1 -1
- package/css/style-delta.css +59 -39
- package/css/style-delta.css.map +1 -1
- package/css/style-gutenberg.css +16 -7
- package/css/style-gutenberg.css.map +1 -1
- package/css/style-irp.css +60 -40
- package/css/style-irp.css.map +1 -1
- package/css/style-mcr.css +59 -39
- package/css/style-mcr.css.map +1 -1
- package/css/style-preventionweb.css +60 -40
- package/css/style-preventionweb.css.map +1 -1
- package/css/style.css +59 -39
- package/css/style.css.map +1 -1
- package/error-pages/401.html +3 -3
- package/error-pages/403.html +3 -3
- package/error-pages/404.html +4 -4
- package/error-pages/429.html +3 -3
- package/error-pages/500.html +6 -6
- package/error-pages/502.html +3 -3
- package/error-pages/503.html +3 -3
- package/error-pages/504.html +3 -3
- package/error-pages/5xx.html +4 -4
- package/error-pages/challenge.html +3 -3
- package/error-pages/managed-challenge.html +3 -3
- package/js/README.md +31 -25
- package/js/copy-button.js +17 -0
- package/js/drawer.js +752 -0
- package/js/hub-header.js +217 -0
- package/js/show-more.js +144 -10
- package/js/switch-pending.js +195 -46
- package/package.json +8 -3
- package/scss/Atom/BaseTypography/Blockquote/blockquote.scss +2 -1
- package/scss/Atom/BaseTypography/Cite/cite.scss +2 -1
- package/scss/Atom/BaseTypography/Code/code.scss +8 -2
- package/scss/Atom/Icons/icons.scss +1 -1
- package/scss/Atom/Images/AuthorImage/author-image.scss +16 -1
- package/scss/Atom/StatusLabel/status-label.scss +331 -8
- package/scss/Atom/Table/table.scss +8 -3
- package/scss/Atom/Tag/tag.scss +20 -2
- package/scss/Components/Breadcrumbs/breadcrumbs.scss +8 -4
- package/scss/Components/Buttons/CtaButton/cta-button.scss +15 -0
- package/scss/Components/Cards/Card/card.scss +37 -10
- package/scss/Components/Cards/StatsCard/stats-card.scss +2 -10
- package/scss/Components/DataViz/Legend/legend.scss +2 -1
- package/scss/Components/ErrorPages/error-pages.scss +8 -0
- package/scss/Components/Forms/SegmentedControl/segmented-control.scss +412 -0
- package/scss/Components/Forms/_form-base.scss +109 -18
- package/scss/Components/Hero/hero.scss +296 -57
- package/scss/Components/MegaMenu/mega-menu.scss +26 -6
- package/scss/Components/OnThisPageNav/on-this-page-nav.scss +3 -1
- package/scss/Components/PageHeader/page-header.scss +13 -28
- package/scss/Components/Pager/pager.scss +3 -1
- package/scss/Components/QuoteHighlight/quote-highlight.scss +6 -1
- package/scss/Components/ScrollContainer/scroll-container.scss +11 -0
- package/scss/Components/SyndicationSearchWidget/syndication-search-widget.scss +51 -24
- package/scss/Components/Tab/tab.scss +1 -1
- package/scss/Components/TextCta/text-cta.scss +11 -3
- package/scss/Patterns/HubHeader/hub-header.scss +14 -3
- package/scss/Utilities/FullWidth/full-width.scss +14 -1
- package/scss/assets/scss/_components.scss +1 -0
- package/scss/assets/scss/_fonts.scss +11 -0
- package/scss/assets/scss/_foundational.scss +7 -0
- package/scss/assets/scss/_mixins.scss +32 -0
- package/scss/assets/scss/_tokens-data-viz.scss +9 -0
- package/scss/assets/scss/_variables.scss +16 -3
- package/scss/assets/scss/generated/_tokens-irp.scss +20 -4
- package/scss/assets/scss/generated/_tokens-mangrove.scss +6 -0
- package/scss/assets/scss/generated/_tokens-preventionweb.scss +20 -4
- package/js/__tests__/copy-button.test.js +0 -112
- package/js/__tests__/show-more.test.js +0 -80
- package/js/__tests__/table-of-contents.test.js +0 -196
- package/scss/Components/SyndicationSearchWidget/SyndicationSearchWidget.scss +0 -11
- package/scss/Components/TableOfContents/TableOfContents.scss +0 -11
- package/scss/Utilities/FullWidth/FullWidth.scss +0 -11
- package/scss/Utilities/ShowMore/ShowMore.scss +0 -11
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Storybook: https://mangrove.undrr.org/
|
|
4
4
|
* LLMs context: https://mangrove.undrr.org/llms.txt
|
|
5
5
|
* Repository: https://github.com/unisdr/undrr-mangrove
|
|
6
|
-
* Compiled on: 2026-09-
|
|
6
|
+
* Compiled on: 2026-09-24T08:35:35.831Z
|
|
7
7
|
*/
|
|
8
8
|
/*! For license information please see ShareButtons.js.LICENSE.txt */
|
|
9
|
-
import{useEffect as e,useRef as t,useState as n}from"react";var r={6320(e){var t={single_source_shortest_paths:function(e,n,r){var o={},a={};a[n]=0;var i,s,c,l,u,d,h,g=t.PriorityQueue.make();for(g.push(n,0);!g.empty();)for(c in s=(i=g.pop()).value,l=i.cost,u=e[s]||{})u.hasOwnProperty(c)&&(d=l+u[c],h=a[c],(void 0===a[c]||h>d)&&(a[c]=d,g.push(c,d),o[c]=s));if(void 0!==r&&void 0===a[r]){var f=["Could not find a path from ",n," to ",r,"."].join("");throw new Error(f)}return o},extract_shortest_path_from_predecessor_list:function(e,t){for(var n=[],r=t;r;)n.push(r),e[r],r=e[r];return n.reverse(),n},find_path:function(e,n,r){var o=t.single_source_shortest_paths(e,n,r);return t.extract_shortest_path_from_predecessor_list(o,r)},PriorityQueue:{make:function(e){var n,r=t.PriorityQueue,o={};for(n in e=e||{},r)r.hasOwnProperty(n)&&(o[n]=r[n]);return o.queue=[],o.sorter=e.sorter||r.default_sorter,o},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var n={value:e,cost:t};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};e.exports=t},2694(e,t,n){var r=n(6925);function o(){}function a(){}a.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,a,i){if(i!==r){var s=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 s.name="Invariant Violation",s}}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:a,resetWarningCache:o};return n.PropTypes=n,n}},5556(e,t,n){e.exports=n(2694)()},6925(e){e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},7583(e,t,n){const r=n(1333),o=n(157),a=n(7899),i=n(6756);function s(e,t,n,a,i){const s=[].slice.call(arguments,1),c=s.length,l="function"==typeof s[c-1];if(!l&&!r())throw new Error("Callback required as last argument");if(!l){if(c<1)throw new Error("Too few arguments provided");return 1===c?(n=t,t=a=void 0):2!==c||t.getContext||(a=n,n=t,t=void 0),new Promise(function(r,i){try{const i=o.create(n,a);r(e(i,t,a))}catch(e){i(e)}})}if(c<2)throw new Error("Too few arguments provided");2===c?(i=n,n=t,t=a=void 0):3===c&&(t.getContext&&void 0===i?(i=a,a=void 0):(i=a,a=n,n=t,t=void 0));try{const r=o.create(n,a);i(null,e(r,t,a))}catch(e){i(e)}}t.create=o.create,t.toCanvas=s.bind(null,a.render),t.toDataURL=s.bind(null,a.renderToDataURL),t.toString=s.bind(null,function(e,t,n){return i.render(e,n)})},1333(e){e.exports=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then}},6421(e,t,n){const r=n(6886).getSymbolSize;t.getRowColCoords=function(e){if(1===e)return[];const t=Math.floor(e/7)+2,n=r(e),o=145===n?26:2*Math.ceil((n-13)/(2*t-2)),a=[n-7];for(let e=1;e<t-1;e++)a[e]=a[e-1]-o;return a.push(6),a.reverse()},t.getPositions=function(e){const n=[],r=t.getRowColCoords(e),o=r.length;for(let e=0;e<o;e++)for(let t=0;t<o;t++)0===e&&0===t||0===e&&t===o-1||e===o-1&&0===t||n.push([r[e],r[t]]);return n}},1433(e,t,n){const r=n(208),o=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function a(e){this.mode=r.ALPHANUMERIC,this.data=e}a.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},a.prototype.getLength=function(){return this.data.length},a.prototype.getBitsLength=function(){return a.getBitsLength(this.data.length)},a.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let n=45*o.indexOf(this.data[t]);n+=o.indexOf(this.data[t+1]),e.put(n,11)}this.data.length%2&&e.put(o.indexOf(this.data[t]),6)},e.exports=a},9899(e){function t(){this.buffer=[],this.length=0}t.prototype={get:function(e){const t=Math.floor(e/8);return 1==(this.buffer[t]>>>7-e%8&1)},put:function(e,t){for(let n=0;n<t;n++)this.putBit(1==(e>>>t-n-1&1))},getLengthInBits:function(){return this.length},putBit:function(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},e.exports=t},8820(e){function t(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}t.prototype.set=function(e,t,n,r){const o=e*this.size+t;this.data[o]=n,r&&(this.reservedBit[o]=!0)},t.prototype.get=function(e,t){return this.data[e*this.size+t]},t.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n},t.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},e.exports=t},5822(e,t,n){const r=n(208);function o(e){this.mode=r.BYTE,this.data="string"==typeof e?(new TextEncoder).encode(e):new Uint8Array(e)}o.getBitsLength=function(e){return 8*e},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(e){for(let t=0,n=this.data.length;t<n;t++)e.put(this.data[t],8)},e.exports=o},7518(e,t,n){const r=n(9953),o=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],a=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];t.getBlocksCount=function(e,t){switch(t){case r.L:return o[4*(e-1)+0];case r.M:return o[4*(e-1)+1];case r.Q:return o[4*(e-1)+2];case r.H:return o[4*(e-1)+3];default:return}},t.getTotalCodewordsCount=function(e,t){switch(t){case r.L:return a[4*(e-1)+0];case r.M:return a[4*(e-1)+1];case r.Q:return a[4*(e-1)+2];case r.H:return a[4*(e-1)+3];default:return}}},9953(e,t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2},t.isValid=function(e){return e&&void 0!==e.bit&&e.bit>=0&&e.bit<4},t.from=function(e,n){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+e)}}(e)}catch(e){return n}}},7756(e,t,n){const r=n(6886).getSymbolSize;t.getPositions=function(e){const t=r(e);return[[0,0],[t-7,0],[0,t-7]]}},4565(e,t,n){const r=n(6886),o=r.getBCHDigit(1335);t.getEncodedBits=function(e,t){const n=e.bit<<3|t;let a=n<<10;for(;r.getBCHDigit(a)-o>=0;)a^=1335<<r.getBCHDigit(a)-o;return 21522^(n<<10|a)}},2731(e,t){const n=new Uint8Array(512),r=new Uint8Array(256);!function(){let e=1;for(let t=0;t<255;t++)n[t]=e,r[e]=t,e<<=1,256&e&&(e^=285);for(let e=255;e<512;e++)n[e]=n[e-255]}(),t.exp=function(e){return n[e]},t.mul=function(e,t){return 0===e||0===t?0:n[r[e]+r[t]]}},4861(e,t,n){const r=n(208),o=n(6886);function a(e){this.mode=r.KANJI,this.data=e}a.getBitsLength=function(e){return 13*e},a.prototype.getLength=function(){return this.data.length},a.prototype.getBitsLength=function(){return a.getBitsLength(this.data.length)},a.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let n=o.toSJIS(this.data[t]);if(n>=33088&&n<=40956)n-=33088;else{if(!(n>=57408&&n<=60351))throw new Error("Invalid SJIS character: "+this.data[t]+"\nMake sure your charset is UTF-8");n-=49472}n=192*(n>>>8&255)+(255&n),e.put(n,13)}},e.exports=a},1332(e,t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};function n(e,n,r){switch(e){case t.Patterns.PATTERN000:return(n+r)%2==0;case t.Patterns.PATTERN001:return n%2==0;case t.Patterns.PATTERN010:return r%3==0;case t.Patterns.PATTERN011:return(n+r)%3==0;case t.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(r/3))%2==0;case t.Patterns.PATTERN101:return n*r%2+n*r%3==0;case t.Patterns.PATTERN110:return(n*r%2+n*r%3)%2==0;case t.Patterns.PATTERN111:return(n*r%3+(n+r)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}}t.isValid=function(e){return null!=e&&""!==e&&!isNaN(e)&&e>=0&&e<=7},t.from=function(e){return t.isValid(e)?parseInt(e,10):void 0},t.getPenaltyN1=function(e){const t=e.size;let n=0,r=0,o=0,a=null,i=null;for(let s=0;s<t;s++){r=o=0,a=i=null;for(let c=0;c<t;c++){let t=e.get(s,c);t===a?r++:(r>=5&&(n+=r-5+3),a=t,r=1),t=e.get(c,s),t===i?o++:(o>=5&&(n+=o-5+3),i=t,o=1)}r>=5&&(n+=r-5+3),o>=5&&(n+=o-5+3)}return n},t.getPenaltyN2=function(e){const t=e.size;let n=0;for(let r=0;r<t-1;r++)for(let o=0;o<t-1;o++){const t=e.get(r,o)+e.get(r,o+1)+e.get(r+1,o)+e.get(r+1,o+1);4!==t&&0!==t||n++}return 3*n},t.getPenaltyN3=function(e){const t=e.size;let n=0,r=0,o=0;for(let a=0;a<t;a++){r=o=0;for(let i=0;i<t;i++)r=r<<1&2047|e.get(a,i),i>=10&&(1488===r||93===r)&&n++,o=o<<1&2047|e.get(i,a),i>=10&&(1488===o||93===o)&&n++}return 40*n},t.getPenaltyN4=function(e){let t=0;const n=e.data.length;for(let r=0;r<n;r++)t+=e.data[r];return 10*Math.abs(Math.ceil(100*t/n/5)-10)},t.applyMask=function(e,t){const r=t.size;for(let o=0;o<r;o++)for(let a=0;a<r;a++)t.isReserved(a,o)||t.xor(a,o,n(e,a,o))},t.getBestMask=function(e,n){const r=Object.keys(t.Patterns).length;let o=0,a=1/0;for(let i=0;i<r;i++){n(i),t.applyMask(i,e);const r=t.getPenaltyN1(e)+t.getPenaltyN2(e)+t.getPenaltyN3(e)+t.getPenaltyN4(e);t.applyMask(i,e),r<a&&(a=r,o=i)}return o}},208(e,t,n){const r=n(1878),o=n(7044);t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(e,t){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!r.isValid(t))throw new Error("Invalid version: "+t);return t>=1&&t<10?e.ccBits[0]:t<27?e.ccBits[1]:e.ccBits[2]},t.getBestModeForData=function(e){return o.testNumeric(e)?t.NUMERIC:o.testAlphanumeric(e)?t.ALPHANUMERIC:o.testKanji(e)?t.KANJI:t.BYTE},t.toString=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")},t.isValid=function(e){return e&&e.bit&&e.ccBits},t.from=function(e,n){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+e)}}(e)}catch(e){return n}}},4357(e,t,n){const r=n(208);function o(e){this.mode=r.NUMERIC,this.data=e.toString()}o.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(e){let t,n,r;for(t=0;t+3<=this.data.length;t+=3)n=this.data.substr(t,3),r=parseInt(n,10),e.put(r,10);const o=this.data.length-t;o>0&&(n=this.data.substr(t),r=parseInt(n,10),e.put(r,3*o+1))},e.exports=o},4713(e,t,n){const r=n(2731);t.mul=function(e,t){const n=new Uint8Array(e.length+t.length-1);for(let o=0;o<e.length;o++)for(let a=0;a<t.length;a++)n[o+a]^=r.mul(e[o],t[a]);return n},t.mod=function(e,t){let n=new Uint8Array(e);for(;n.length-t.length>=0;){const e=n[0];for(let o=0;o<t.length;o++)n[o]^=r.mul(t[o],e);let o=0;for(;o<n.length&&0===n[o];)o++;n=n.slice(o)}return n},t.generateECPolynomial=function(e){let n=new Uint8Array([1]);for(let o=0;o<e;o++)n=t.mul(n,new Uint8Array([1,r.exp(o)]));return n}},157(e,t,n){const r=n(6886),o=n(9953),a=n(9899),i=n(8820),s=n(6421),c=n(7756),l=n(1332),u=n(7518),d=n(4764),h=n(1427),g=n(4565),f=n(208),p=n(9801);function m(e,t,n){const r=e.size,o=g.getEncodedBits(t,n);let a,i;for(a=0;a<15;a++)i=1==(o>>a&1),a<6?e.set(a,8,i,!0):a<8?e.set(a+1,8,i,!0):e.set(r-15+a,8,i,!0),a<8?e.set(8,r-a-1,i,!0):a<9?e.set(8,15-a-1+1,i,!0):e.set(8,15-a-1,i,!0);e.set(r-8,8,1,!0)}function y(e,t,n,o){let g;if(Array.isArray(e))g=p.fromArray(e);else{if("string"!=typeof e)throw new Error("Invalid data");{let r=t;if(!r){const t=p.rawSplit(e);r=h.getBestVersionForData(t,n)}g=p.fromString(e,r||40)}}const y=h.getBestVersionForData(g,n);if(!y)throw new Error("The amount of data is too big to be stored in a QR Code");if(t){if(t<y)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+y+".\n")}else t=y;const w=function(e,t,n){const o=new a;n.forEach(function(t){o.put(t.mode.bit,4),o.put(t.getLength(),f.getCharCountIndicator(t.mode,e)),t.write(o)});const i=8*(r.getSymbolTotalCodewords(e)-u.getTotalCodewordsCount(e,t));for(o.getLengthInBits()+4<=i&&o.put(0,4);o.getLengthInBits()%8!=0;)o.putBit(0);const s=(i-o.getLengthInBits())/8;for(let e=0;e<s;e++)o.put(e%2?17:236,8);return function(e,t,n){const o=r.getSymbolTotalCodewords(t),a=o-u.getTotalCodewordsCount(t,n),i=u.getBlocksCount(t,n),s=i-o%i,c=Math.floor(o/i),l=Math.floor(a/i),h=l+1,g=c-l,f=new d(g);let p=0;const m=new Array(i),y=new Array(i);let w=0;const b=new Uint8Array(e.buffer);for(let e=0;e<i;e++){const t=e<s?l:h;m[e]=b.slice(p,p+t),y[e]=f.encode(m[e]),p+=t,w=Math.max(w,t)}const C=new Uint8Array(o);let x,E,v=0;for(x=0;x<w;x++)for(E=0;E<i;E++)x<m[E].length&&(C[v++]=m[E][x]);for(x=0;x<g;x++)for(E=0;E<i;E++)C[v++]=y[E][x];return C}(o,e,t)}(t,n,g),b=r.getSymbolSize(t),C=new i(b);return function(e,t){const n=e.size,r=c.getPositions(t);for(let t=0;t<r.length;t++){const o=r[t][0],a=r[t][1];for(let t=-1;t<=7;t++)if(!(o+t<=-1||n<=o+t))for(let r=-1;r<=7;r++)a+r<=-1||n<=a+r||(t>=0&&t<=6&&(0===r||6===r)||r>=0&&r<=6&&(0===t||6===t)||t>=2&&t<=4&&r>=2&&r<=4?e.set(o+t,a+r,!0,!0):e.set(o+t,a+r,!1,!0))}}(C,t),function(e){const t=e.size;for(let n=8;n<t-8;n++){const t=n%2==0;e.set(n,6,t,!0),e.set(6,n,t,!0)}}(C),function(e,t){const n=s.getPositions(t);for(let t=0;t<n.length;t++){const r=n[t][0],o=n[t][1];for(let t=-2;t<=2;t++)for(let n=-2;n<=2;n++)-2===t||2===t||-2===n||2===n||0===t&&0===n?e.set(r+t,o+n,!0,!0):e.set(r+t,o+n,!1,!0)}}(C,t),m(C,n,0),t>=7&&function(e,t){const n=e.size,r=h.getEncodedBits(t);let o,a,i;for(let t=0;t<18;t++)o=Math.floor(t/3),a=t%3+n-8-3,i=1==(r>>t&1),e.set(o,a,i,!0),e.set(a,o,i,!0)}(C,t),function(e,t){const n=e.size;let r=-1,o=n-1,a=7,i=0;for(let s=n-1;s>0;s-=2)for(6===s&&s--;;){for(let n=0;n<2;n++)if(!e.isReserved(o,s-n)){let r=!1;i<t.length&&(r=1==(t[i]>>>a&1)),e.set(o,s-n,r),a--,-1===a&&(i++,a=7)}if(o+=r,o<0||n<=o){o-=r,r=-r;break}}}(C,w),isNaN(o)&&(o=l.getBestMask(C,m.bind(null,C,n))),l.applyMask(o,C),m(C,n,o),{modules:C,version:t,errorCorrectionLevel:n,maskPattern:o,segments:g}}t.create=function(e,t){if(void 0===e||""===e)throw new Error("No input text");let n,a,i=o.M;return void 0!==t&&(i=o.from(t.errorCorrectionLevel,o.M),n=h.from(t.version),a=l.from(t.maskPattern),t.toSJISFunc&&r.setToSJISFunction(t.toSJISFunc)),y(e,n,i,a)}},4764(e,t,n){const r=n(4713);function o(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}o.prototype.initialize=function(e){this.degree=e,this.genPoly=r.generateECPolynomial(this.degree)},o.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const t=new Uint8Array(e.length+this.degree);t.set(e);const n=r.mod(t,this.genPoly),o=this.degree-n.length;if(o>0){const e=new Uint8Array(this.degree);return e.set(n,o),e}return n},e.exports=o},7044(e,t){const n="[0-9]+";let r="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";r=r.replace(/u/g,"\\u");const o="(?:(?![A-Z0-9 $%*+\\-./:]|"+r+")(?:.|[\r\n]))+";t.KANJI=new RegExp(r,"g"),t.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),t.BYTE=new RegExp(o,"g"),t.NUMERIC=new RegExp(n,"g"),t.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");const a=new RegExp("^"+r+"$"),i=new RegExp("^"+n+"$"),s=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");t.testKanji=function(e){return a.test(e)},t.testNumeric=function(e){return i.test(e)},t.testAlphanumeric=function(e){return s.test(e)}},9801(e,t,n){const r=n(208),o=n(4357),a=n(1433),i=n(5822),s=n(4861),c=n(7044),l=n(6886),u=n(6320);function d(e){return unescape(encodeURIComponent(e)).length}function h(e,t,n){const r=[];let o;for(;null!==(o=e.exec(n));)r.push({data:o[0],index:o.index,mode:t,length:o[0].length});return r}function g(e){const t=h(c.NUMERIC,r.NUMERIC,e),n=h(c.ALPHANUMERIC,r.ALPHANUMERIC,e);let o,a;return l.isKanjiModeEnabled()?(o=h(c.BYTE,r.BYTE,e),a=h(c.KANJI,r.KANJI,e)):(o=h(c.BYTE_KANJI,r.BYTE,e),a=[]),t.concat(n,o,a).sort(function(e,t){return e.index-t.index}).map(function(e){return{data:e.data,mode:e.mode,length:e.length}})}function f(e,t){switch(t){case r.NUMERIC:return o.getBitsLength(e);case r.ALPHANUMERIC:return a.getBitsLength(e);case r.KANJI:return s.getBitsLength(e);case r.BYTE:return i.getBitsLength(e)}}function p(e,t){let n;const c=r.getBestModeForData(e);if(n=r.from(t,c),n!==r.BYTE&&n.bit<c.bit)throw new Error('"'+e+'" cannot be encoded with mode '+r.toString(n)+".\n Suggested mode is: "+r.toString(c));switch(n!==r.KANJI||l.isKanjiModeEnabled()||(n=r.BYTE),n){case r.NUMERIC:return new o(e);case r.ALPHANUMERIC:return new a(e);case r.KANJI:return new s(e);case r.BYTE:return new i(e)}}t.fromArray=function(e){return e.reduce(function(e,t){return"string"==typeof t?e.push(p(t,null)):t.data&&e.push(p(t.data,t.mode)),e},[])},t.fromString=function(e,n){const o=function(e){const t=[];for(let n=0;n<e.length;n++){const o=e[n];switch(o.mode){case r.NUMERIC:t.push([o,{data:o.data,mode:r.ALPHANUMERIC,length:o.length},{data:o.data,mode:r.BYTE,length:o.length}]);break;case r.ALPHANUMERIC:t.push([o,{data:o.data,mode:r.BYTE,length:o.length}]);break;case r.KANJI:t.push([o,{data:o.data,mode:r.BYTE,length:d(o.data)}]);break;case r.BYTE:t.push([{data:o.data,mode:r.BYTE,length:d(o.data)}])}}return t}(g(e,l.isKanjiModeEnabled())),a=function(e,t){const n={},o={start:{}};let a=["start"];for(let i=0;i<e.length;i++){const s=e[i],c=[];for(let e=0;e<s.length;e++){const l=s[e],u=""+i+e;c.push(u),n[u]={node:l,lastCount:0},o[u]={};for(let e=0;e<a.length;e++){const i=a[e];n[i]&&n[i].node.mode===l.mode?(o[i][u]=f(n[i].lastCount+l.length,l.mode)-f(n[i].lastCount,l.mode),n[i].lastCount+=l.length):(n[i]&&(n[i].lastCount=l.length),o[i][u]=f(l.length,l.mode)+4+r.getCharCountIndicator(l.mode,t))}}a=c}for(let e=0;e<a.length;e++)o[a[e]].end=0;return{map:o,table:n}}(o,n),i=u.find_path(a.map,"start","end"),s=[];for(let e=1;e<i.length-1;e++)s.push(a.table[i[e]].node);return t.fromArray(s.reduce(function(e,t){const n=e.length-1>=0?e[e.length-1]:null;return n&&n.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)},[]))},t.rawSplit=function(e){return t.fromArray(g(e,l.isKanjiModeEnabled()))}},6886(e,t){let n;const r=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];t.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return 4*e+17},t.getSymbolTotalCodewords=function(e){return r[e]},t.getBCHDigit=function(e){let t=0;for(;0!==e;)t++,e>>>=1;return t},t.setToSJISFunction=function(e){if("function"!=typeof e)throw new Error('"toSJISFunc" is not a valid function.');n=e},t.isKanjiModeEnabled=function(){return void 0!==n},t.toSJIS=function(e){return n(e)}},1878(e,t){t.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}},1427(e,t,n){const r=n(6886),o=n(7518),a=n(9953),i=n(208),s=n(1878),c=r.getBCHDigit(7973);function l(e,t){return i.getCharCountIndicator(e,t)+4}function u(e,t){let n=0;return e.forEach(function(e){const r=l(e.mode,t);n+=r+e.getBitsLength()}),n}t.from=function(e,t){return s.isValid(e)?parseInt(e,10):t},t.getCapacity=function(e,t,n){if(!s.isValid(e))throw new Error("Invalid QR Code version");void 0===n&&(n=i.BYTE);const a=8*(r.getSymbolTotalCodewords(e)-o.getTotalCodewordsCount(e,t));if(n===i.MIXED)return a;const c=a-l(n,e);switch(n){case i.NUMERIC:return Math.floor(c/10*3);case i.ALPHANUMERIC:return Math.floor(c/11*2);case i.KANJI:return Math.floor(c/13);case i.BYTE:default:return Math.floor(c/8)}},t.getBestVersionForData=function(e,n){let r;const o=a.from(n,a.M);if(Array.isArray(e)){if(e.length>1)return function(e,n){for(let r=1;r<=40;r++)if(u(e,r)<=t.getCapacity(r,n,i.MIXED))return r}(e,o);if(0===e.length)return 1;r=e[0]}else r=e;return function(e,n,r){for(let o=1;o<=40;o++)if(n<=t.getCapacity(o,r,e))return o}(r.mode,r.getLength(),o)},t.getEncodedBits=function(e){if(!s.isValid(e)||e<7)throw new Error("Invalid QR Code version");let t=e<<12;for(;r.getBCHDigit(t)-c>=0;)t^=7973<<r.getBCHDigit(t)-c;return e<<12|t}},7899(e,t,n){const r=n(2726);t.render=function(e,t,n){let o=n,a=t;void 0!==o||t&&t.getContext||(o=t,t=void 0),t||(a=function(){try{return document.createElement("canvas")}catch(e){throw new Error("You need to specify a canvas element")}}()),o=r.getOptions(o);const i=r.getImageWidth(e.modules.size,o),s=a.getContext("2d"),c=s.createImageData(i,i);return r.qrToImageData(c.data,e,o),function(e,t,n){e.clearRect(0,0,t.width,t.height),t.style||(t.style={}),t.height=n,t.width=n,t.style.height=n+"px",t.style.width=n+"px"}(s,a,i),s.putImageData(c,0,0),a},t.renderToDataURL=function(e,n,r){let o=r;void 0!==o||n&&n.getContext||(o=n,n=void 0),o||(o={});const a=t.render(e,n,o),i=o.type||"image/png",s=o.rendererOpts||{};return a.toDataURL(i,s.quality)}},6756(e,t,n){const r=n(2726);function o(e,t){const n=e.a/255,r=t+'="'+e.hex+'"';return n<1?r+" "+t+'-opacity="'+n.toFixed(2).slice(1)+'"':r}function a(e,t,n){let r=e+t;return void 0!==n&&(r+=" "+n),r}t.render=function(e,t,n){const i=r.getOptions(t),s=e.modules.size,c=e.modules.data,l=s+2*i.margin,u=i.color.light.a?"<path "+o(i.color.light,"fill")+' d="M0 0h'+l+"v"+l+'H0z"/>':"",d="<path "+o(i.color.dark,"stroke")+' d="'+function(e,t,n){let r="",o=0,i=!1,s=0;for(let c=0;c<e.length;c++){const l=Math.floor(c%t),u=Math.floor(c/t);l||i||(i=!0),e[c]?(s++,c>0&&l>0&&e[c-1]||(r+=i?a("M",l+n,.5+u+n):a("m",o,0),o=0,i=!1),l+1<t&&e[c+1]||(r+=a("h",s),s=0)):o++}return r}(c,s,i.margin)+'"/>',h='viewBox="0 0 '+l+" "+l+'"',g='<svg xmlns="http://www.w3.org/2000/svg" '+(i.width?'width="'+i.width+'" height="'+i.width+'" ':"")+h+' shape-rendering="crispEdges">'+u+d+"</svg>\n";return"function"==typeof n&&n(null,g),g}},2726(e,t){function n(e){if("number"==typeof e&&(e=e.toString()),"string"!=typeof e)throw new Error("Color should be defined as hex string");let t=e.slice().replace("#","").split("");if(t.length<3||5===t.length||t.length>8)throw new Error("Invalid hex color: "+e);3!==t.length&&4!==t.length||(t=Array.prototype.concat.apply([],t.map(function(e){return[e,e]}))),6===t.length&&t.push("F","F");const n=parseInt(t.join(""),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:255&n,hex:"#"+t.slice(0,6).join("")}}t.getOptions=function(e){e||(e={}),e.color||(e.color={});const t=void 0===e.margin||null===e.margin||e.margin<0?4:e.margin,r=e.width&&e.width>=21?e.width:void 0,o=e.scale||4;return{width:r,scale:r?4:o,margin:t,color:{dark:n(e.color.dark||"#000000ff"),light:n(e.color.light||"#ffffffff")},type:e.type,rendererOpts:e.rendererOpts||{}}},t.getScale=function(e,t){return t.width&&t.width>=e+2*t.margin?t.width/(e+2*t.margin):t.scale},t.getImageWidth=function(e,n){const r=t.getScale(e,n);return Math.floor((e+2*n.margin)*r)},t.qrToImageData=function(e,n,r){const o=n.modules.size,a=n.modules.data,i=t.getScale(o,r),s=Math.floor((o+2*r.margin)*i),c=r.margin*i,l=[r.color.light,r.color.dark];for(let t=0;t<s;t++)for(let n=0;n<s;n++){let u=4*(t*s+n),d=r.color.light;t>=c&&n>=c&&t<s-c&&n<s-c&&(d=l[a[Math.floor((t-c)/i)*o+Math.floor((n-c)/i)]?1:0]),e[u++]=d.r,e[u++]=d.g,e[u++]=d.b,e[u]=d.a}}}};const o={};function a(e){const t=o[e];if(void 0!==t)return t.exports;const n=o[e]={exports:{}};return r[e](n,n.exports,a),n.exports}a.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.cw=e=>{var t;return()=>{if(e){var n=e;e=0,t={exports:{}},n.call(t.exports,t,t.exports)}return t.exports}},a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var i=a.cw(function(e,t){var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function o(e,t,r){var o=null;if(void 0!==r&&(o=""+r),void 0!==t.key&&(o=""+t.key),"key"in t)for(var a in r={},t)"key"!==a&&(r[a]=t[a]);else r=t;return t=r.ref,{$$typeof:n,type:e,key:o,ref:void 0!==t?t:null,props:r}}t.Fragment=r,t.jsx=o,t.jsxs=o}),s=a.cw(function(e,t){e.exports=i()}),c=a(5556),l=a.n(c),u=a(7583);const d=JSON.parse('{"Mail":"mailto:?subject=[SHARING_TEXT_SUBJECT]&body=[SHARING_TEXT_BODY]","Facebook":"https://facebook.com/sharer/sharer.php?u=[SHARING_TEXT_BODY]","LinkedIn":"https://www.linkedin.com/sharing/share-offsite/?url=[SHARING_TEXT_BODY]","Twitter":"https://twitter.com/intent/tweet?text=[SHARING_TEXT_BODY]"}');s();const h="Check out this link: ",g="Sharing Link",f={mainLabel:"Share this",onCopy:"Copied",qrCodeTitle:"QR code",qrCodeDescription:"This QR code contains the link below. You can copy the image or add it to your printed or display materials.",closeModal:"Close modal",copyImage:"Copy image",downloadImage:"Download image",closeMessage:"Close message",shareUsingDevice:"Share using your device",shareOnLinkedIn:"Share on LinkedIn",shareOnFacebook:"Share on Facebook",shareOnX:"Share on X",shareViaEmail:"Share via Email",generateQRCode:"Generate QR Code",copyToClipboard:"Copy to Clipboard"},p=({isOpen:r,onClose:o,qrCodeDataUrl:a,onCopy:s,onDownload:c,sharedLink:l,copiedLabel:u="Image copied",titleLabel:d="QR code",descriptionLabel:h="This QR code contains the link below. You can copy the image or add it to your printed or display materials.",closeModalLabel:g="Close modal",copyImageLabel:f="Copy image",downloadImageLabel:p="Download image",closeMessageLabel:m="Close message"})=>{const y=t(null),[w,b]=n(!1),C=t(r);return r!==C.current&&(C.current=r,r&&b(!1)),e(()=>{const e=e=>{"Escape"===e.key&&o()},t=e=>{y.current&&!y.current.contains(e.target)&&o()};return r&&(document.addEventListener("keydown",e),document.addEventListener("mousedown",t),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",e),document.removeEventListener("mousedown",t),document.body.style.overflow="unset"}},[r,o]),r?(0,i().jsx)("div",{"data-vf-google-analytics-region":"share-qr-code",className:"mg-modal-overlay",style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},children:(0,i().jsxs)("div",{ref:y,className:"mg-modal",style:{backgroundColor:"white",borderRadius:"8px",padding:"24px",maxWidth:"500px",width:"90%",maxHeight:"90vh",boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",display:"flex",flexDirection:"column",overflow:"hidden"},children:[(0,i().jsxs)("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"16px",flexShrink:0},children:[(0,i().jsx)("h3",{children:d}),(0,i().jsx)("button",{onClick:o,style:{background:"none",border:"none",fontSize:"24px",cursor:"pointer",padding:"4px",borderRadius:"4px",color:"#666"},"aria-label":g,children:"×"})]}),(0,i().jsx)("p",{children:h}),(0,i().jsx)("div",{style:{flex:1,overflowY:"auto",paddingRight:"8px"},children:a&&(0,i().jsxs)("div",{style:{marginBottom:"16px"},children:[(0,i().jsx)("img",{src:a,alt:"QR Code",style:{maxWidth:"100%",maxHeight:"220px",height:"auto"}}),(0,i().jsx)("div",{style:{textAlign:"left"},children:(0,i().jsx)("code",{className:"mg-code--block",children:(()=>{const e=new URL(l);return e.searchParams.set("utm_source","qr"),e.searchParams.set("utm_medium","web"),e.searchParams.set("utm_campaign","share_box"),e.toString()})()})})]})}),(0,i().jsx)("div",{"aria-live":"polite","aria-atomic":"true",style:{position:"absolute",left:"-10000px",width:"1px",height:"1px",overflow:"hidden"},children:w?`${u}`:""}),(0,i().jsxs)("div",{style:{marginTop:"16px",flexShrink:0,display:"flex",gap:"8px",flexWrap:"wrap",justifyContent:"space-between",alignItems:"flex-end"},children:[(0,i().jsxs)("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap"},children:[(0,i().jsx)("button",{onClick:async()=>{try{await s(),b(!0),setTimeout(()=>{b(!1)},2e3)}catch(e){console.error("Copy failed:",e)}},className:"mg-button mg-button-primary",disabled:w,children:w?u:f}),(0,i().jsx)("button",{onClick:c,className:"mg-button mg-button-secondary",children:p})]}),(0,i().jsx)("button",{onClick:o,className:"mg-button mg-button-secondary",style:{marginLeft:"auto"},children:m})]})]})}):null},m=({labels:e={},SharingSubject:t,SharingTextBody:r,...o})=>{const a={...f,...e},[s,c]=n(!1),[l,m]=n(null),w=(()=>{const e=document.querySelector('link[rel="shortlink"]');return e?e.href:window.location.href})(),b=e=>{if("QRCode"===e)C();else if("WebShare"===e&&navigator.share)navigator.share({title:t??g,text:r??h,url:w}).catch(e=>console.error("Error sharing",e));else{var n=(e=>{let n=d[e];const o=encodeURIComponent(t??g),a=encodeURIComponent(r??h)+encodeURIComponent(w);return n.replace("[SHARING_TEXT_SUBJECT]",o).replace("[SHARING_TEXT_BODY]",a)})(e);"Mail"===e?window.location.href=n:window.open(n,"_blank","width=600,height=300")}},C=async()=>{try{const e=new URL(w);e.searchParams.set("utm_source","qr"),e.searchParams.set("utm_medium","web"),e.searchParams.set("utm_campaign","share_box");const t=e.toString(),n=await u.toDataURL(t,{width:1024,margin:2,color:{dark:"#000000",light:"#FFFFFF"}});m(n),c(!0)}catch(e){console.error("Error generating QR code:",e),alert("Failed to generate QR code. Please try again.")}};return(0,i().jsxs)(i().Fragment,{children:[(0,i().jsxs)("section",{"data-vf-google-analytics-region":"share-this",className:"mg-share",...o,children:[(0,i().jsx)("header",{className:"mg-share__header",children:a.mainLabel}),(0,i().jsxs)("div",{className:"mg-share__buttons",children:[navigator.share&&(0,i().jsx)("button",{"data-vf-analytics-label":"Social share: Web Share API",onClick:()=>b("WebShare"),"aria-label":a.shareUsingDevice,title:a.shareUsingDevice,className:"mg-share__button",children:(0,i().jsx)("span",{className:"mg-icon mg-icon-share","aria-hidden":"true"})}),(0,i().jsx)("button",{"data-vf-analytics-label":"Social share: LinkedIn",onClick:()=>b("LinkedIn"),"aria-label":a.shareOnLinkedIn,className:"mg-share__button",title:a.shareOnLinkedIn,children:(0,i().jsx)("span",{className:"mg-icon mg-icon-linkedin","aria-hidden":"true"})}),(0,i().jsx)("button",{"data-vf-analytics-label":"Social share: Facebook",onClick:()=>b("Facebook"),"aria-label":a.shareOnFacebook,title:a.shareOnFacebook,className:"mg-share__button",children:(0,i().jsx)("span",{className:"mg-icon mg-icon-facebook","aria-hidden":"true"})}),(0,i().jsx)("button",{"data-vf-analytics-label":"Social share: X",onClick:()=>b("Twitter"),"aria-label":a.shareOnX,className:"mg-share__button",title:a.shareOnX,children:(0,i().jsx)("span",{className:"mg-icon mg-icon-x-social","aria-hidden":"true"})}),(0,i().jsx)("button",{"data-vf-analytics-label":"Social share: Mail",onClick:()=>b("Mail"),"aria-label":a.shareViaEmail,className:"mg-share__button",title:a.shareViaEmail,children:(0,i().jsx)("span",{className:"mg-icon mg-icon-envelope","aria-hidden":"true"})}),(0,i().jsx)("button",{"data-vf-analytics-label":"Social share: QR Code",onClick:()=>b("QRCode"),"aria-label":a.generateQRCode,className:"mg-share__button",title:a.generateQRCode,children:(0,i().jsx)("span",{className:"mg-icon mg-icon-qrcode","aria-hidden":"true"})})]}),(0,i().jsx)(y,{className:"mg-share__copy-button",copiedLabel:a.onCopy,copyToClipboardLabel:a.copyToClipboard,sharedLink:w})]}),(0,i().jsx)(p,{isOpen:s,onClose:()=>{c(!1),l&&(URL.revokeObjectURL(l),m(null))},qrCodeDataUrl:l,onCopy:async()=>{try{if(l){const e=await fetch(l),t=await e.blob(),n=new ClipboardItem({"image/png":t});await navigator.clipboard.write([n])}}catch(e){console.error("Error copying QR code to clipboard:",e),alert("Failed to copy QR code to clipboard. Please check browser permissions.")}},onDownload:async()=>{try{if(l){const e=await fetch(l),t=await e.blob(),n=new URL(w);let r="qr-code";if(n.hostname&&(r+=`-${n.hostname.replace(/^www\./,"").replace(/\./g,"-")}`),n.pathname&&"/"!==n.pathname){const e=n.pathname.replace(/^\//,"").replace(/\/$/,"").replace(/[^a-zA-Z0-9-_]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"");e&&(r+=`-${e}`)}r=r.substring(0,100)+".png";const o=URL.createObjectURL(t),a=document.createElement("a");a.href=o,a.download=r,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(o)}}catch(e){console.error("Error downloading QR code:",e),alert("Failed to download QR code. Please try again.")}},sharedLink:w,copiedLabel:a.onCopy,titleLabel:a.qrCodeTitle,descriptionLabel:a.qrCodeDescription,closeModalLabel:a.closeModal,copyImageLabel:a.copyImage,downloadImageLabel:a.downloadImage,closeMessageLabel:a.closeMessage})]})};function y({copiedLabel:e,sharedLink:t,className:r,copyToClipboardLabel:o="Copy to Clipboard"}){const[a,s]=n(!1);let c=t;return t.startsWith("https://")?c=t.replace("https://",""):t.startsWith("http://")&&(c=t.replace("http://","")),(0,i().jsxs)("button",{"data-vf-analytics-label":"Quick link copy","aria-label":o,title:o,className:r,onClick:()=>(navigator.clipboard.writeText(t),void s(!0)),children:[(0,i().jsx)("div",{className:"mg-share__clip-icon",children:(0,i().jsx)("span",{className:"mg-icon mg-icon-link","aria-hidden":"true"})}),(0,i().jsx)("div",{className:"mg-share__copy-text",children:a?e:c}),(0,i().jsx)("div",{className:"mg-share__stack-icon",children:(0,i().jsx)("span",{className:"mg-icon mg-icon-clone","aria-hidden":"true"})})]})}p.propTypes={isOpen:l().bool.isRequired,onClose:l().func.isRequired,qrCodeDataUrl:l().string,onCopy:l().func.isRequired,onDownload:l().func.isRequired,sharedLink:l().string.isRequired,copiedLabel:l().string},m.propTypes={labels:l().shape({mainLabel:l().string,onCopy:l().string,qrCodeTitle:l().string,qrCodeDescription:l().string,closeModal:l().string,copyImage:l().string,downloadImage:l().string,closeMessage:l().string,shareUsingDevice:l().string,shareOnLinkedIn:l().string,shareOnFacebook:l().string,shareOnX:l().string,shareViaEmail:l().string,generateQRCode:l().string,copyToClipboard:l().string}),SharingSubject:l().string,SharingTextBody:l().string},y.propTypes={copiedLabel:l().string.isRequired,sharedLink:l().string.isRequired,className:l().string,copyToClipboardLabel:l().string};const w=m;function b(e){const{dataset:t}=e;return{labels:{mainLabel:t.mainLabel||"Share this",onCopy:t.onCopyLabel||"Link copied"},SharingSubject:t.sharingSubject||"Sharing Link",SharingTextBody:t.sharingBody||""}}export{y as CopyButton,w as default,b as fromElement};
|
|
9
|
+
import{useEffect as e,useRef as t,useState as n}from"react";var r={6320(e){var t={single_source_shortest_paths:function(e,n,r){var o={},a={};a[n]=0;var i,s,c,l,u,d,h,g=t.PriorityQueue.make();for(g.push(n,0);!g.empty();)for(c in s=(i=g.pop()).value,l=i.cost,u=e[s]||{})u.hasOwnProperty(c)&&(d=l+u[c],h=a[c],(void 0===a[c]||h>d)&&(a[c]=d,g.push(c,d),o[c]=s));if(void 0!==r&&void 0===a[r]){var f=["Could not find a path from ",n," to ",r,"."].join("");throw new Error(f)}return o},extract_shortest_path_from_predecessor_list:function(e,t){for(var n=[],r=t;r;)n.push(r),e[r],r=e[r];return n.reverse(),n},find_path:function(e,n,r){var o=t.single_source_shortest_paths(e,n,r);return t.extract_shortest_path_from_predecessor_list(o,r)},PriorityQueue:{make:function(e){var n,r=t.PriorityQueue,o={};for(n in e=e||{},r)r.hasOwnProperty(n)&&(o[n]=r[n]);return o.queue=[],o.sorter=e.sorter||r.default_sorter,o},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var n={value:e,cost:t};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};e.exports=t},2694(e,t,n){var r=n(6925);function o(){}function a(){}a.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,a,i){if(i!==r){var s=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 s.name="Invariant Violation",s}}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:a,resetWarningCache:o};return n.PropTypes=n,n}},5556(e,t,n){e.exports=n(2694)()},6925(e){e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},7583(e,t,n){const r=n(1333),o=n(157),a=n(7899),i=n(6756);function s(e,t,n,a,i){const s=[].slice.call(arguments,1),c=s.length,l="function"==typeof s[c-1];if(!l&&!r())throw new Error("Callback required as last argument");if(!l){if(c<1)throw new Error("Too few arguments provided");return 1===c?(n=t,t=a=void 0):2!==c||t.getContext||(a=n,n=t,t=void 0),new Promise(function(r,i){try{const i=o.create(n,a);r(e(i,t,a))}catch(e){i(e)}})}if(c<2)throw new Error("Too few arguments provided");2===c?(i=n,n=t,t=a=void 0):3===c&&(t.getContext&&void 0===i?(i=a,a=void 0):(i=a,a=n,n=t,t=void 0));try{const r=o.create(n,a);i(null,e(r,t,a))}catch(e){i(e)}}t.create=o.create,t.toCanvas=s.bind(null,a.render),t.toDataURL=s.bind(null,a.renderToDataURL),t.toString=s.bind(null,function(e,t,n){return i.render(e,n)})},1333(e){e.exports=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then}},6421(e,t,n){const r=n(6886).getSymbolSize;t.getRowColCoords=function(e){if(1===e)return[];const t=Math.floor(e/7)+2,n=r(e),o=145===n?26:2*Math.ceil((n-13)/(2*t-2)),a=[n-7];for(let e=1;e<t-1;e++)a[e]=a[e-1]-o;return a.push(6),a.reverse()},t.getPositions=function(e){const n=[],r=t.getRowColCoords(e),o=r.length;for(let e=0;e<o;e++)for(let t=0;t<o;t++)0===e&&0===t||0===e&&t===o-1||e===o-1&&0===t||n.push([r[e],r[t]]);return n}},1433(e,t,n){const r=n(208),o=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function a(e){this.mode=r.ALPHANUMERIC,this.data=e}a.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},a.prototype.getLength=function(){return this.data.length},a.prototype.getBitsLength=function(){return a.getBitsLength(this.data.length)},a.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let n=45*o.indexOf(this.data[t]);n+=o.indexOf(this.data[t+1]),e.put(n,11)}this.data.length%2&&e.put(o.indexOf(this.data[t]),6)},e.exports=a},9899(e){function t(){this.buffer=[],this.length=0}t.prototype={get:function(e){const t=Math.floor(e/8);return 1==(this.buffer[t]>>>7-e%8&1)},put:function(e,t){for(let n=0;n<t;n++)this.putBit(1==(e>>>t-n-1&1))},getLengthInBits:function(){return this.length},putBit:function(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},e.exports=t},8820(e){function t(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}t.prototype.set=function(e,t,n,r){const o=e*this.size+t;this.data[o]=n,r&&(this.reservedBit[o]=!0)},t.prototype.get=function(e,t){return this.data[e*this.size+t]},t.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n},t.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},e.exports=t},5822(e,t,n){const r=n(208);function o(e){this.mode=r.BYTE,this.data="string"==typeof e?(new TextEncoder).encode(e):new Uint8Array(e)}o.getBitsLength=function(e){return 8*e},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(e){for(let t=0,n=this.data.length;t<n;t++)e.put(this.data[t],8)},e.exports=o},7518(e,t,n){const r=n(9953),o=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],a=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];t.getBlocksCount=function(e,t){switch(t){case r.L:return o[4*(e-1)+0];case r.M:return o[4*(e-1)+1];case r.Q:return o[4*(e-1)+2];case r.H:return o[4*(e-1)+3];default:return}},t.getTotalCodewordsCount=function(e,t){switch(t){case r.L:return a[4*(e-1)+0];case r.M:return a[4*(e-1)+1];case r.Q:return a[4*(e-1)+2];case r.H:return a[4*(e-1)+3];default:return}}},9953(e,t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2},t.isValid=function(e){return e&&void 0!==e.bit&&e.bit>=0&&e.bit<4},t.from=function(e,n){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+e)}}(e)}catch(e){return n}}},7756(e,t,n){const r=n(6886).getSymbolSize;t.getPositions=function(e){const t=r(e);return[[0,0],[t-7,0],[0,t-7]]}},4565(e,t,n){const r=n(6886),o=r.getBCHDigit(1335);t.getEncodedBits=function(e,t){const n=e.bit<<3|t;let a=n<<10;for(;r.getBCHDigit(a)-o>=0;)a^=1335<<r.getBCHDigit(a)-o;return 21522^(n<<10|a)}},2731(e,t){const n=new Uint8Array(512),r=new Uint8Array(256);!function(){let e=1;for(let t=0;t<255;t++)n[t]=e,r[e]=t,e<<=1,256&e&&(e^=285);for(let e=255;e<512;e++)n[e]=n[e-255]}(),t.exp=function(e){return n[e]},t.mul=function(e,t){return 0===e||0===t?0:n[r[e]+r[t]]}},4861(e,t,n){const r=n(208),o=n(6886);function a(e){this.mode=r.KANJI,this.data=e}a.getBitsLength=function(e){return 13*e},a.prototype.getLength=function(){return this.data.length},a.prototype.getBitsLength=function(){return a.getBitsLength(this.data.length)},a.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let n=o.toSJIS(this.data[t]);if(n>=33088&&n<=40956)n-=33088;else{if(!(n>=57408&&n<=60351))throw new Error("Invalid SJIS character: "+this.data[t]+"\nMake sure your charset is UTF-8");n-=49472}n=192*(n>>>8&255)+(255&n),e.put(n,13)}},e.exports=a},1332(e,t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};function n(e,n,r){switch(e){case t.Patterns.PATTERN000:return(n+r)%2==0;case t.Patterns.PATTERN001:return n%2==0;case t.Patterns.PATTERN010:return r%3==0;case t.Patterns.PATTERN011:return(n+r)%3==0;case t.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(r/3))%2==0;case t.Patterns.PATTERN101:return n*r%2+n*r%3==0;case t.Patterns.PATTERN110:return(n*r%2+n*r%3)%2==0;case t.Patterns.PATTERN111:return(n*r%3+(n+r)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}}t.isValid=function(e){return null!=e&&""!==e&&!isNaN(e)&&e>=0&&e<=7},t.from=function(e){return t.isValid(e)?parseInt(e,10):void 0},t.getPenaltyN1=function(e){const t=e.size;let n=0,r=0,o=0,a=null,i=null;for(let s=0;s<t;s++){r=o=0,a=i=null;for(let c=0;c<t;c++){let t=e.get(s,c);t===a?r++:(r>=5&&(n+=r-5+3),a=t,r=1),t=e.get(c,s),t===i?o++:(o>=5&&(n+=o-5+3),i=t,o=1)}r>=5&&(n+=r-5+3),o>=5&&(n+=o-5+3)}return n},t.getPenaltyN2=function(e){const t=e.size;let n=0;for(let r=0;r<t-1;r++)for(let o=0;o<t-1;o++){const t=e.get(r,o)+e.get(r,o+1)+e.get(r+1,o)+e.get(r+1,o+1);4!==t&&0!==t||n++}return 3*n},t.getPenaltyN3=function(e){const t=e.size;let n=0,r=0,o=0;for(let a=0;a<t;a++){r=o=0;for(let i=0;i<t;i++)r=r<<1&2047|e.get(a,i),i>=10&&(1488===r||93===r)&&n++,o=o<<1&2047|e.get(i,a),i>=10&&(1488===o||93===o)&&n++}return 40*n},t.getPenaltyN4=function(e){let t=0;const n=e.data.length;for(let r=0;r<n;r++)t+=e.data[r];return 10*Math.abs(Math.ceil(100*t/n/5)-10)},t.applyMask=function(e,t){const r=t.size;for(let o=0;o<r;o++)for(let a=0;a<r;a++)t.isReserved(a,o)||t.xor(a,o,n(e,a,o))},t.getBestMask=function(e,n){const r=Object.keys(t.Patterns).length;let o=0,a=1/0;for(let i=0;i<r;i++){n(i),t.applyMask(i,e);const r=t.getPenaltyN1(e)+t.getPenaltyN2(e)+t.getPenaltyN3(e)+t.getPenaltyN4(e);t.applyMask(i,e),r<a&&(a=r,o=i)}return o}},208(e,t,n){const r=n(1878),o=n(7044);t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(e,t){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!r.isValid(t))throw new Error("Invalid version: "+t);return t>=1&&t<10?e.ccBits[0]:t<27?e.ccBits[1]:e.ccBits[2]},t.getBestModeForData=function(e){return o.testNumeric(e)?t.NUMERIC:o.testAlphanumeric(e)?t.ALPHANUMERIC:o.testKanji(e)?t.KANJI:t.BYTE},t.toString=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")},t.isValid=function(e){return e&&e.bit&&e.ccBits},t.from=function(e,n){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+e)}}(e)}catch(e){return n}}},4357(e,t,n){const r=n(208);function o(e){this.mode=r.NUMERIC,this.data=e.toString()}o.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(e){let t,n,r;for(t=0;t+3<=this.data.length;t+=3)n=this.data.substr(t,3),r=parseInt(n,10),e.put(r,10);const o=this.data.length-t;o>0&&(n=this.data.substr(t),r=parseInt(n,10),e.put(r,3*o+1))},e.exports=o},4713(e,t,n){const r=n(2731);t.mul=function(e,t){const n=new Uint8Array(e.length+t.length-1);for(let o=0;o<e.length;o++)for(let a=0;a<t.length;a++)n[o+a]^=r.mul(e[o],t[a]);return n},t.mod=function(e,t){let n=new Uint8Array(e);for(;n.length-t.length>=0;){const e=n[0];for(let o=0;o<t.length;o++)n[o]^=r.mul(t[o],e);let o=0;for(;o<n.length&&0===n[o];)o++;n=n.slice(o)}return n},t.generateECPolynomial=function(e){let n=new Uint8Array([1]);for(let o=0;o<e;o++)n=t.mul(n,new Uint8Array([1,r.exp(o)]));return n}},157(e,t,n){const r=n(6886),o=n(9953),a=n(9899),i=n(8820),s=n(6421),c=n(7756),l=n(1332),u=n(7518),d=n(4764),h=n(1427),g=n(4565),f=n(208),p=n(9801);function m(e,t,n){const r=e.size,o=g.getEncodedBits(t,n);let a,i;for(a=0;a<15;a++)i=1==(o>>a&1),a<6?e.set(a,8,i,!0):a<8?e.set(a+1,8,i,!0):e.set(r-15+a,8,i,!0),a<8?e.set(8,r-a-1,i,!0):a<9?e.set(8,15-a-1+1,i,!0):e.set(8,15-a-1,i,!0);e.set(r-8,8,1,!0)}function y(e,t,n,o){let g;if(Array.isArray(e))g=p.fromArray(e);else{if("string"!=typeof e)throw new Error("Invalid data");{let r=t;if(!r){const t=p.rawSplit(e);r=h.getBestVersionForData(t,n)}g=p.fromString(e,r||40)}}const y=h.getBestVersionForData(g,n);if(!y)throw new Error("The amount of data is too big to be stored in a QR Code");if(t){if(t<y)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+y+".\n")}else t=y;const w=function(e,t,n){const o=new a;n.forEach(function(t){o.put(t.mode.bit,4),o.put(t.getLength(),f.getCharCountIndicator(t.mode,e)),t.write(o)});const i=8*(r.getSymbolTotalCodewords(e)-u.getTotalCodewordsCount(e,t));for(o.getLengthInBits()+4<=i&&o.put(0,4);o.getLengthInBits()%8!=0;)o.putBit(0);const s=(i-o.getLengthInBits())/8;for(let e=0;e<s;e++)o.put(e%2?17:236,8);return function(e,t,n){const o=r.getSymbolTotalCodewords(t),a=o-u.getTotalCodewordsCount(t,n),i=u.getBlocksCount(t,n),s=i-o%i,c=Math.floor(o/i),l=Math.floor(a/i),h=l+1,g=c-l,f=new d(g);let p=0;const m=new Array(i),y=new Array(i);let w=0;const b=new Uint8Array(e.buffer);for(let e=0;e<i;e++){const t=e<s?l:h;m[e]=b.slice(p,p+t),y[e]=f.encode(m[e]),p+=t,w=Math.max(w,t)}const C=new Uint8Array(o);let x,E,v=0;for(x=0;x<w;x++)for(E=0;E<i;E++)x<m[E].length&&(C[v++]=m[E][x]);for(x=0;x<g;x++)for(E=0;E<i;E++)C[v++]=y[E][x];return C}(o,e,t)}(t,n,g),b=r.getSymbolSize(t),C=new i(b);return function(e,t){const n=e.size,r=c.getPositions(t);for(let t=0;t<r.length;t++){const o=r[t][0],a=r[t][1];for(let t=-1;t<=7;t++)if(!(o+t<=-1||n<=o+t))for(let r=-1;r<=7;r++)a+r<=-1||n<=a+r||(t>=0&&t<=6&&(0===r||6===r)||r>=0&&r<=6&&(0===t||6===t)||t>=2&&t<=4&&r>=2&&r<=4?e.set(o+t,a+r,!0,!0):e.set(o+t,a+r,!1,!0))}}(C,t),function(e){const t=e.size;for(let n=8;n<t-8;n++){const t=n%2==0;e.set(n,6,t,!0),e.set(6,n,t,!0)}}(C),function(e,t){const n=s.getPositions(t);for(let t=0;t<n.length;t++){const r=n[t][0],o=n[t][1];for(let t=-2;t<=2;t++)for(let n=-2;n<=2;n++)-2===t||2===t||-2===n||2===n||0===t&&0===n?e.set(r+t,o+n,!0,!0):e.set(r+t,o+n,!1,!0)}}(C,t),m(C,n,0),t>=7&&function(e,t){const n=e.size,r=h.getEncodedBits(t);let o,a,i;for(let t=0;t<18;t++)o=Math.floor(t/3),a=t%3+n-8-3,i=1==(r>>t&1),e.set(o,a,i,!0),e.set(a,o,i,!0)}(C,t),function(e,t){const n=e.size;let r=-1,o=n-1,a=7,i=0;for(let s=n-1;s>0;s-=2)for(6===s&&s--;;){for(let n=0;n<2;n++)if(!e.isReserved(o,s-n)){let r=!1;i<t.length&&(r=1==(t[i]>>>a&1)),e.set(o,s-n,r),a--,-1===a&&(i++,a=7)}if(o+=r,o<0||n<=o){o-=r,r=-r;break}}}(C,w),isNaN(o)&&(o=l.getBestMask(C,m.bind(null,C,n))),l.applyMask(o,C),m(C,n,o),{modules:C,version:t,errorCorrectionLevel:n,maskPattern:o,segments:g}}t.create=function(e,t){if(void 0===e||""===e)throw new Error("No input text");let n,a,i=o.M;return void 0!==t&&(i=o.from(t.errorCorrectionLevel,o.M),n=h.from(t.version),a=l.from(t.maskPattern),t.toSJISFunc&&r.setToSJISFunction(t.toSJISFunc)),y(e,n,i,a)}},4764(e,t,n){const r=n(4713);function o(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}o.prototype.initialize=function(e){this.degree=e,this.genPoly=r.generateECPolynomial(this.degree)},o.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const t=new Uint8Array(e.length+this.degree);t.set(e);const n=r.mod(t,this.genPoly),o=this.degree-n.length;if(o>0){const e=new Uint8Array(this.degree);return e.set(n,o),e}return n},e.exports=o},7044(e,t){const n="[0-9]+";let r="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";r=r.replace(/u/g,"\\u");const o="(?:(?![A-Z0-9 $%*+\\-./:]|"+r+")(?:.|[\r\n]))+";t.KANJI=new RegExp(r,"g"),t.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),t.BYTE=new RegExp(o,"g"),t.NUMERIC=new RegExp(n,"g"),t.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");const a=new RegExp("^"+r+"$"),i=new RegExp("^"+n+"$"),s=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");t.testKanji=function(e){return a.test(e)},t.testNumeric=function(e){return i.test(e)},t.testAlphanumeric=function(e){return s.test(e)}},9801(e,t,n){const r=n(208),o=n(4357),a=n(1433),i=n(5822),s=n(4861),c=n(7044),l=n(6886),u=n(6320);function d(e){return unescape(encodeURIComponent(e)).length}function h(e,t,n){const r=[];let o;for(;null!==(o=e.exec(n));)r.push({data:o[0],index:o.index,mode:t,length:o[0].length});return r}function g(e){const t=h(c.NUMERIC,r.NUMERIC,e),n=h(c.ALPHANUMERIC,r.ALPHANUMERIC,e);let o,a;return l.isKanjiModeEnabled()?(o=h(c.BYTE,r.BYTE,e),a=h(c.KANJI,r.KANJI,e)):(o=h(c.BYTE_KANJI,r.BYTE,e),a=[]),t.concat(n,o,a).sort(function(e,t){return e.index-t.index}).map(function(e){return{data:e.data,mode:e.mode,length:e.length}})}function f(e,t){switch(t){case r.NUMERIC:return o.getBitsLength(e);case r.ALPHANUMERIC:return a.getBitsLength(e);case r.KANJI:return s.getBitsLength(e);case r.BYTE:return i.getBitsLength(e)}}function p(e,t){let n;const c=r.getBestModeForData(e);if(n=r.from(t,c),n!==r.BYTE&&n.bit<c.bit)throw new Error('"'+e+'" cannot be encoded with mode '+r.toString(n)+".\n Suggested mode is: "+r.toString(c));switch(n!==r.KANJI||l.isKanjiModeEnabled()||(n=r.BYTE),n){case r.NUMERIC:return new o(e);case r.ALPHANUMERIC:return new a(e);case r.KANJI:return new s(e);case r.BYTE:return new i(e)}}t.fromArray=function(e){return e.reduce(function(e,t){return"string"==typeof t?e.push(p(t,null)):t.data&&e.push(p(t.data,t.mode)),e},[])},t.fromString=function(e,n){const o=function(e){const t=[];for(let n=0;n<e.length;n++){const o=e[n];switch(o.mode){case r.NUMERIC:t.push([o,{data:o.data,mode:r.ALPHANUMERIC,length:o.length},{data:o.data,mode:r.BYTE,length:o.length}]);break;case r.ALPHANUMERIC:t.push([o,{data:o.data,mode:r.BYTE,length:o.length}]);break;case r.KANJI:t.push([o,{data:o.data,mode:r.BYTE,length:d(o.data)}]);break;case r.BYTE:t.push([{data:o.data,mode:r.BYTE,length:d(o.data)}])}}return t}(g(e,l.isKanjiModeEnabled())),a=function(e,t){const n={},o={start:{}};let a=["start"];for(let i=0;i<e.length;i++){const s=e[i],c=[];for(let e=0;e<s.length;e++){const l=s[e],u=""+i+e;c.push(u),n[u]={node:l,lastCount:0},o[u]={};for(let e=0;e<a.length;e++){const i=a[e];n[i]&&n[i].node.mode===l.mode?(o[i][u]=f(n[i].lastCount+l.length,l.mode)-f(n[i].lastCount,l.mode),n[i].lastCount+=l.length):(n[i]&&(n[i].lastCount=l.length),o[i][u]=f(l.length,l.mode)+4+r.getCharCountIndicator(l.mode,t))}}a=c}for(let e=0;e<a.length;e++)o[a[e]].end=0;return{map:o,table:n}}(o,n),i=u.find_path(a.map,"start","end"),s=[];for(let e=1;e<i.length-1;e++)s.push(a.table[i[e]].node);return t.fromArray(s.reduce(function(e,t){const n=e.length-1>=0?e[e.length-1]:null;return n&&n.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)},[]))},t.rawSplit=function(e){return t.fromArray(g(e,l.isKanjiModeEnabled()))}},6886(e,t){let n;const r=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];t.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return 4*e+17},t.getSymbolTotalCodewords=function(e){return r[e]},t.getBCHDigit=function(e){let t=0;for(;0!==e;)t++,e>>>=1;return t},t.setToSJISFunction=function(e){if("function"!=typeof e)throw new Error('"toSJISFunc" is not a valid function.');n=e},t.isKanjiModeEnabled=function(){return void 0!==n},t.toSJIS=function(e){return n(e)}},1878(e,t){t.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}},1427(e,t,n){const r=n(6886),o=n(7518),a=n(9953),i=n(208),s=n(1878),c=r.getBCHDigit(7973);function l(e,t){return i.getCharCountIndicator(e,t)+4}function u(e,t){let n=0;return e.forEach(function(e){const r=l(e.mode,t);n+=r+e.getBitsLength()}),n}t.from=function(e,t){return s.isValid(e)?parseInt(e,10):t},t.getCapacity=function(e,t,n){if(!s.isValid(e))throw new Error("Invalid QR Code version");void 0===n&&(n=i.BYTE);const a=8*(r.getSymbolTotalCodewords(e)-o.getTotalCodewordsCount(e,t));if(n===i.MIXED)return a;const c=a-l(n,e);switch(n){case i.NUMERIC:return Math.floor(c/10*3);case i.ALPHANUMERIC:return Math.floor(c/11*2);case i.KANJI:return Math.floor(c/13);case i.BYTE:default:return Math.floor(c/8)}},t.getBestVersionForData=function(e,n){let r;const o=a.from(n,a.M);if(Array.isArray(e)){if(e.length>1)return function(e,n){for(let r=1;r<=40;r++)if(u(e,r)<=t.getCapacity(r,n,i.MIXED))return r}(e,o);if(0===e.length)return 1;r=e[0]}else r=e;return function(e,n,r){for(let o=1;o<=40;o++)if(n<=t.getCapacity(o,r,e))return o}(r.mode,r.getLength(),o)},t.getEncodedBits=function(e){if(!s.isValid(e)||e<7)throw new Error("Invalid QR Code version");let t=e<<12;for(;r.getBCHDigit(t)-c>=0;)t^=7973<<r.getBCHDigit(t)-c;return e<<12|t}},7899(e,t,n){const r=n(2726);t.render=function(e,t,n){let o=n,a=t;void 0!==o||t&&t.getContext||(o=t,t=void 0),t||(a=function(){try{return document.createElement("canvas")}catch(e){throw new Error("You need to specify a canvas element")}}()),o=r.getOptions(o);const i=r.getImageWidth(e.modules.size,o),s=a.getContext("2d"),c=s.createImageData(i,i);return r.qrToImageData(c.data,e,o),function(e,t,n){e.clearRect(0,0,t.width,t.height),t.style||(t.style={}),t.height=n,t.width=n,t.style.height=n+"px",t.style.width=n+"px"}(s,a,i),s.putImageData(c,0,0),a},t.renderToDataURL=function(e,n,r){let o=r;void 0!==o||n&&n.getContext||(o=n,n=void 0),o||(o={});const a=t.render(e,n,o),i=o.type||"image/png",s=o.rendererOpts||{};return a.toDataURL(i,s.quality)}},6756(e,t,n){const r=n(2726);function o(e,t){const n=e.a/255,r=t+'="'+e.hex+'"';return n<1?r+" "+t+'-opacity="'+n.toFixed(2).slice(1)+'"':r}function a(e,t,n){let r=e+t;return void 0!==n&&(r+=" "+n),r}t.render=function(e,t,n){const i=r.getOptions(t),s=e.modules.size,c=e.modules.data,l=s+2*i.margin,u=i.color.light.a?"<path "+o(i.color.light,"fill")+' d="M0 0h'+l+"v"+l+'H0z"/>':"",d="<path "+o(i.color.dark,"stroke")+' d="'+function(e,t,n){let r="",o=0,i=!1,s=0;for(let c=0;c<e.length;c++){const l=Math.floor(c%t),u=Math.floor(c/t);l||i||(i=!0),e[c]?(s++,c>0&&l>0&&e[c-1]||(r+=i?a("M",l+n,.5+u+n):a("m",o,0),o=0,i=!1),l+1<t&&e[c+1]||(r+=a("h",s),s=0)):o++}return r}(c,s,i.margin)+'"/>',h='viewBox="0 0 '+l+" "+l+'"',g='<svg xmlns="http://www.w3.org/2000/svg" '+(i.width?'width="'+i.width+'" height="'+i.width+'" ':"")+h+' shape-rendering="crispEdges">'+u+d+"</svg>\n";return"function"==typeof n&&n(null,g),g}},2726(e,t){function n(e){if("number"==typeof e&&(e=e.toString()),"string"!=typeof e)throw new Error("Color should be defined as hex string");let t=e.slice().replace("#","").split("");if(t.length<3||5===t.length||t.length>8)throw new Error("Invalid hex color: "+e);3!==t.length&&4!==t.length||(t=Array.prototype.concat.apply([],t.map(function(e){return[e,e]}))),6===t.length&&t.push("F","F");const n=parseInt(t.join(""),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:255&n,hex:"#"+t.slice(0,6).join("")}}t.getOptions=function(e){e||(e={}),e.color||(e.color={});const t=void 0===e.margin||null===e.margin||e.margin<0?4:e.margin,r=e.width&&e.width>=21?e.width:void 0,o=e.scale||4;return{width:r,scale:r?4:o,margin:t,color:{dark:n(e.color.dark||"#000000ff"),light:n(e.color.light||"#ffffffff")},type:e.type,rendererOpts:e.rendererOpts||{}}},t.getScale=function(e,t){return t.width&&t.width>=e+2*t.margin?t.width/(e+2*t.margin):t.scale},t.getImageWidth=function(e,n){const r=t.getScale(e,n);return Math.floor((e+2*n.margin)*r)},t.qrToImageData=function(e,n,r){const o=n.modules.size,a=n.modules.data,i=t.getScale(o,r),s=Math.floor((o+2*r.margin)*i),c=r.margin*i,l=[r.color.light,r.color.dark];for(let t=0;t<s;t++)for(let n=0;n<s;n++){let u=4*(t*s+n),d=r.color.light;t>=c&&n>=c&&t<s-c&&n<s-c&&(d=l[a[Math.floor((t-c)/i)*o+Math.floor((n-c)/i)]?1:0]),e[u++]=d.r,e[u++]=d.g,e[u++]=d.b,e[u]=d.a}}}};const o={};function a(e){const t=o[e];if(void 0!==t)return t.exports;const n=o[e]={exports:{}};return r[e](n,n.exports,a),n.exports}a.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.cw=e=>{var t;return()=>{if(e){var n=e;e=0,t={exports:{}},n.call(t.exports,t,t.exports)}return t.exports}},a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var i=a.cw(function(e,t){var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function o(e,t,r){var o=null;if(void 0!==r&&(o=""+r),void 0!==t.key&&(o=""+t.key),"key"in t)for(var a in r={},t)"key"!==a&&(r[a]=t[a]);else r=t;return t=r.ref,{$$typeof:n,type:e,key:o,ref:void 0!==t?t:null,props:r}}t.Fragment=r,t.jsx=o,t.jsxs=o}),s=a.cw(function(e,t){e.exports=i()}),c=a(5556),l=a.n(c),u=a(7583);const d=JSON.parse('{"Mail":"mailto:?subject=[SHARING_TEXT_SUBJECT]&body=[SHARING_TEXT_BODY]","Facebook":"https://facebook.com/sharer/sharer.php?u=[SHARING_TEXT_BODY]","LinkedIn":"https://www.linkedin.com/sharing/share-offsite/?url=[SHARING_TEXT_BODY]","Twitter":"https://twitter.com/intent/tweet?text=[SHARING_TEXT_BODY]"}');s();const h="Check out this link: ",g="Sharing Link",f={mainLabel:"Share this",onCopy:"Copied",qrCodeTitle:"QR code",qrCodeDescription:"This QR code contains the link below. You can copy the image or add it to your printed or display materials.",closeModal:"Close modal",copyImage:"Copy image",downloadImage:"Download image",closeMessage:"Close message",shareUsingDevice:"Share using your device",shareOnLinkedIn:"Share on LinkedIn",shareOnFacebook:"Share on Facebook",shareOnX:"Share on X",shareViaEmail:"Share via Email",generateQRCode:"Generate QR Code",copyToClipboard:"Copy to Clipboard"},p=({isOpen:r,onClose:o,qrCodeDataUrl:a,onCopy:s,onDownload:c,sharedLink:l,copiedLabel:u="Image copied",titleLabel:d="QR code",descriptionLabel:h="This QR code contains the link below. You can copy the image or add it to your printed or display materials.",closeModalLabel:g="Close modal",copyImageLabel:f="Copy image",downloadImageLabel:p="Download image",closeMessageLabel:m="Close message"})=>{const y=t(null),[w,b]=n(!1),C=t(r);return r!==C.current&&(C.current=r,r&&b(!1)),e(()=>{const e=e=>{"Escape"===e.key&&o()},t=e=>{y.current&&!y.current.contains(e.target)&&o()};return r&&(document.addEventListener("keydown",e),document.addEventListener("mousedown",t),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",e),document.removeEventListener("mousedown",t),document.body.style.overflow="unset"}},[r,o]),r?(0,i().jsx)("div",{"data-vf-google-analytics-region":"share-qr-code",className:"mg-modal-overlay",style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},children:(0,i().jsxs)("div",{ref:y,className:"mg-modal",style:{backgroundColor:"white",borderRadius:"8px",padding:"24px",maxWidth:"500px",width:"90%",maxHeight:"90vh",boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",display:"flex",flexDirection:"column",overflow:"hidden"},children:[(0,i().jsxs)("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"16px",flexShrink:0},children:[(0,i().jsx)("h3",{children:d}),(0,i().jsx)("button",{onClick:o,style:{background:"none",border:"none",fontSize:"24px",cursor:"pointer",padding:"4px",borderRadius:"4px",color:"#666"},"aria-label":g,children:"×"})]}),(0,i().jsx)("p",{children:h}),(0,i().jsx)("div",{style:{flex:1,overflowY:"auto",paddingRight:"8px"},children:a&&(0,i().jsxs)("div",{style:{marginBottom:"16px"},children:[(0,i().jsx)("img",{src:a,alt:"QR Code",style:{maxWidth:"100%",maxHeight:"220px",height:"auto"}}),(0,i().jsx)("div",{style:{textAlign:"left"},children:(0,i().jsx)("code",{className:"mg-code--block",children:(()=>{const e=new URL(l);return e.searchParams.set("utm_source","qr"),e.searchParams.set("utm_medium","web"),e.searchParams.set("utm_campaign","share_box"),e.toString()})()})})]})}),(0,i().jsx)("div",{"aria-live":"polite","aria-atomic":"true",style:{position:"absolute",left:"-10000px",width:"1px",height:"1px",overflow:"hidden"},children:w?`${u}`:""}),(0,i().jsxs)("div",{style:{marginTop:"16px",flexShrink:0,display:"flex",gap:"8px",flexWrap:"wrap",justifyContent:"space-between",alignItems:"flex-end"},children:[(0,i().jsxs)("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap"},children:[(0,i().jsx)("button",{onClick:async()=>{try{await s(),b(!0),setTimeout(()=>{b(!1)},2e3)}catch(e){console.error("Copy failed:",e)}},className:"mg-button mg-button-primary",disabled:w,children:w?u:f}),(0,i().jsx)("button",{onClick:c,className:"mg-button mg-button-secondary",children:p})]}),(0,i().jsx)("button",{onClick:o,className:"mg-button mg-button-secondary",style:{marginLeft:"auto"},children:m})]})]})}):null},m=({labels:e={},SharingSubject:t,SharingTextBody:r,...o})=>{const a={...f,...e},[s,c]=n(!1),[l,m]=n(null),w=(()=>{const e=document.querySelector('link[rel="shortlink"]');return e?e.href:window.location.href})(),b=e=>{if("QRCode"===e)C();else if("WebShare"===e&&navigator.share)navigator.share({title:t??g,text:r??h,url:w}).catch(e=>console.error("Error sharing",e));else{var n=(e=>{const n=d[e],o=encodeURIComponent(t??g),a=encodeURIComponent(r??h)+encodeURIComponent(w);return n.replace("[SHARING_TEXT_SUBJECT]",o).replace("[SHARING_TEXT_BODY]",a)})(e);"Mail"===e?window.location.href=n:window.open(n,"_blank","width=600,height=300")}},C=async()=>{try{const e=new URL(w);e.searchParams.set("utm_source","qr"),e.searchParams.set("utm_medium","web"),e.searchParams.set("utm_campaign","share_box");const t=e.toString(),n=await u.toDataURL(t,{width:1024,margin:2,color:{dark:"#000000",light:"#FFFFFF"}});m(n),c(!0)}catch(e){console.error("Error generating QR code:",e),alert("Failed to generate QR code. Please try again.")}};return(0,i().jsxs)(i().Fragment,{children:[(0,i().jsxs)("section",{"data-vf-google-analytics-region":"share-this",className:"mg-share",...o,children:[(0,i().jsx)("header",{className:"mg-share__header",children:a.mainLabel}),(0,i().jsxs)("div",{className:"mg-share__buttons",children:[navigator.share&&(0,i().jsx)("button",{"data-vf-analytics-label":"Social share: Web Share API",onClick:()=>b("WebShare"),"aria-label":a.shareUsingDevice,title:a.shareUsingDevice,className:"mg-share__button",children:(0,i().jsx)("span",{className:"mg-icon mg-icon-share","aria-hidden":"true"})}),(0,i().jsx)("button",{"data-vf-analytics-label":"Social share: LinkedIn",onClick:()=>b("LinkedIn"),"aria-label":a.shareOnLinkedIn,className:"mg-share__button",title:a.shareOnLinkedIn,children:(0,i().jsx)("span",{className:"mg-icon mg-icon-linkedin","aria-hidden":"true"})}),(0,i().jsx)("button",{"data-vf-analytics-label":"Social share: Facebook",onClick:()=>b("Facebook"),"aria-label":a.shareOnFacebook,title:a.shareOnFacebook,className:"mg-share__button",children:(0,i().jsx)("span",{className:"mg-icon mg-icon-facebook","aria-hidden":"true"})}),(0,i().jsx)("button",{"data-vf-analytics-label":"Social share: X",onClick:()=>b("Twitter"),"aria-label":a.shareOnX,className:"mg-share__button",title:a.shareOnX,children:(0,i().jsx)("span",{className:"mg-icon mg-icon-x-social","aria-hidden":"true"})}),(0,i().jsx)("button",{"data-vf-analytics-label":"Social share: Mail",onClick:()=>b("Mail"),"aria-label":a.shareViaEmail,className:"mg-share__button",title:a.shareViaEmail,children:(0,i().jsx)("span",{className:"mg-icon mg-icon-envelope","aria-hidden":"true"})}),(0,i().jsx)("button",{"data-vf-analytics-label":"Social share: QR Code",onClick:()=>b("QRCode"),"aria-label":a.generateQRCode,className:"mg-share__button",title:a.generateQRCode,children:(0,i().jsx)("span",{className:"mg-icon mg-icon-qrcode","aria-hidden":"true"})})]}),(0,i().jsx)(y,{className:"mg-share__copy-button",copiedLabel:a.onCopy,copyToClipboardLabel:a.copyToClipboard,sharedLink:w})]}),(0,i().jsx)(p,{isOpen:s,onClose:()=>{c(!1),l&&(URL.revokeObjectURL(l),m(null))},qrCodeDataUrl:l,onCopy:async()=>{try{if(l){const e=await fetch(l),t=await e.blob(),n=new ClipboardItem({"image/png":t});await navigator.clipboard.write([n])}}catch(e){console.error("Error copying QR code to clipboard:",e),alert("Failed to copy QR code to clipboard. Please check browser permissions.")}},onDownload:async()=>{try{if(l){const e=await fetch(l),t=await e.blob(),n=new URL(w);let r="qr-code";if(n.hostname&&(r+=`-${n.hostname.replace(/^www\./,"").replace(/\./g,"-")}`),n.pathname&&"/"!==n.pathname){const e=n.pathname.replace(/^\//,"").replace(/\/$/,"").replace(/[^a-zA-Z0-9-_]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"");e&&(r+=`-${e}`)}r=r.substring(0,100)+".png";const o=URL.createObjectURL(t),a=document.createElement("a");a.href=o,a.download=r,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(o)}}catch(e){console.error("Error downloading QR code:",e),alert("Failed to download QR code. Please try again.")}},sharedLink:w,copiedLabel:a.onCopy,titleLabel:a.qrCodeTitle,descriptionLabel:a.qrCodeDescription,closeModalLabel:a.closeModal,copyImageLabel:a.copyImage,downloadImageLabel:a.downloadImage,closeMessageLabel:a.closeMessage})]})};function y({copiedLabel:e,sharedLink:t,className:r,copyToClipboardLabel:o="Copy to Clipboard"}){const[a,s]=n(!1);let c=t;return t.startsWith("https://")?c=t.replace("https://",""):t.startsWith("http://")&&(c=t.replace("http://","")),(0,i().jsxs)("button",{"data-vf-analytics-label":"Quick link copy","aria-label":o,title:o,className:r,onClick:()=>(navigator.clipboard.writeText(t),void s(!0)),children:[(0,i().jsx)("div",{className:"mg-share__clip-icon",children:(0,i().jsx)("span",{className:"mg-icon mg-icon-link","aria-hidden":"true"})}),(0,i().jsx)("div",{className:"mg-share__copy-text",children:a?e:c}),(0,i().jsx)("div",{className:"mg-share__stack-icon",children:(0,i().jsx)("span",{className:"mg-icon mg-icon-clone","aria-hidden":"true"})})]})}p.propTypes={isOpen:l().bool.isRequired,onClose:l().func.isRequired,qrCodeDataUrl:l().string,onCopy:l().func.isRequired,onDownload:l().func.isRequired,sharedLink:l().string.isRequired,copiedLabel:l().string},m.propTypes={labels:l().shape({mainLabel:l().string,onCopy:l().string,qrCodeTitle:l().string,qrCodeDescription:l().string,closeModal:l().string,copyImage:l().string,downloadImage:l().string,closeMessage:l().string,shareUsingDevice:l().string,shareOnLinkedIn:l().string,shareOnFacebook:l().string,shareOnX:l().string,shareViaEmail:l().string,generateQRCode:l().string,copyToClipboard:l().string}),SharingSubject:l().string,SharingTextBody:l().string},y.propTypes={copiedLabel:l().string.isRequired,sharedLink:l().string.isRequired,className:l().string,copyToClipboardLabel:l().string};const w=m;function b(e){const{dataset:t}=e;return{labels:{mainLabel:t.mainLabel||"Share this",onCopy:t.onCopyLabel||"Link copied"},SharingSubject:t.sharingSubject||"Sharing Link",SharingTextBody:t.sharingBody||""}}export{y as CopyButton,w as default,b as fromElement};
|
package/components/ShowMore.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Storybook: https://mangrove.undrr.org/
|
|
4
4
|
* LLMs context: https://mangrove.undrr.org/llms.txt
|
|
5
5
|
* Repository: https://github.com/unisdr/undrr-mangrove
|
|
6
|
-
* Compiled on: 2026-09-
|
|
6
|
+
* Compiled on: 2026-09-24T08:35:35.831Z
|
|
7
7
|
*/
|
|
8
8
|
/*! For license information please see ShowMore.js.LICENSE.txt */
|
|
9
|
-
import{default as e,useEffect as t}from"react";var
|
|
9
|
+
import{default as e,useEffect as t,useId as o,useRef as r}from"react";var s={2694(e,t,o){var r=o(6925);function s(){}function n(){}n.resetWarningCache=s,e.exports=function(){function e(e,t,o,s,n,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 o={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:n,resetWarningCache:s};return o.PropTypes=o,o}},5556(e,t,o){e.exports=o(2694)()},6925(e){e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}};const n={};function a(e){const t=n[e];if(void 0!==t)return t.exports;const o=n[e]={exports:{}};return s[e](o,o.exports,a),o.exports}a.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.cw=e=>{var t;return()=>{if(e){var o=e;e=0,t={exports:{}},o.call(t.exports,t,t.exports)}return t.exports}},a.d=(e,t)=>{for(var o in t)a.o(t,o)&&!a.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var l=a.cw(function(e,t){var o=Symbol.for("react.transitional.element");function r(e,t,r){var s=null;if(void 0!==r&&(s=""+r),void 0!==t.key&&(s=""+t.key),"key"in t)for(var n in r={},t)"key"!==n&&(r[n]=t[n]);else r=t;return t=r.ref,{$$typeof:o,type:e,key:s,ref:void 0!==t?t:null,props:r}}Symbol.for("react.fragment"),t.jsx=r,t.jsxs=r}),i=a.cw(function(e,t){e.exports=l()}),c=a(5556),m=a.n(c);const d=Symbol.for("undrr.mangrove.showMore.targetCounter");function p(e){const t=[];return(e?e instanceof HTMLElement?[e]:e:document.querySelectorAll("[data-mg-show-more]")).forEach(o=>{if(!e&&o.hasAttribute("data-mg-show-more-skip-auto-init"))return;if(o.dataset.mgShowMoreInitialized)return;const r=o.dataset.mgShowMoreTarget||".mg-show-more--container",s=function(e,t){for(let o=e.parentElement;o;o=o.parentElement){const e=o.querySelector(t);if(e)return e}return document.querySelector(t)}(o,r);if(!s)return void console.warn(`[mg-show-more] Target not found: "${r}"`);o.dataset.mgShowMoreInitialized="true";const n=s.classList.contains("mg-show-more--collapsed"),a=o.classList.contains("mg-show-more--button--open"),l=o.textContent,i=o.getAttribute("aria-controls"),c=o.getAttribute("role"),m=e=>{" "!==e.key&&"Spacebar"!==e.key||(e.preventDefault(),o.click())};o.dataset.dataVfGoogleAnalyticsLabel="Show more: "+(o.dataset.mgShowMoreLabelCollapsed||"Show more"),""===s.id&&(s.id=function(){for(;;){const e=globalThis[d],t=Number.isSafeInteger(e)&&e>=0?e:0;globalThis[d]=t+1;const o=`mg-show-more-target-${t}`;if(!document.getElementById(o))return o}}()),o.setAttribute("aria-controls",s.id),"BUTTON"!==o.tagName&&(o.setAttribute("role","button"),o.addEventListener("keydown",m));const p=e=>{e.preventDefault(),s.classList.toggle("mg-show-more--collapsed"),o.textContent=s.classList.contains("mg-show-more--collapsed")?o.dataset.mgShowMoreLabelCollapsed||"Show more":o.dataset.mgShowMoreLabelOpen||"Show less",s.classList.contains("mg-show-more--collapsed")?o.classList.remove("mg-show-more--button--open"):o.classList.add("mg-show-more--button--open")};o.addEventListener("click",p);const u=e=>{o===e.target||o.contains(e.target)||s.classList.contains("mg-show-more--collapsed")&&o.click()};s.addEventListener("focusin",u);const g=()=>{s.classList.contains("mg-show-more--collapsed")&&o.click()};s.addEventListener("click",g),o.click(),t.push(()=>{o.removeEventListener("click",p),o.removeEventListener("keydown",m),s.removeEventListener("focusin",u),s.removeEventListener("click",g),s.classList.toggle("mg-show-more--collapsed",n),o.classList.toggle("mg-show-more--button--open",a),o.textContent=l;for(const[e,t]of[["aria-controls",i],["role",c]])null===t?o.removeAttribute(e):o.setAttribute(e,t);delete o.dataset.mgShowMoreInitialized})}),()=>t.splice(0).forEach(e=>e())}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>p(),!1):p(),i();const u=[];function g({item:o,id:s,labelOpen:n,labelCollapsed:a}){const i=r(null);return t(()=>p(i.current),[]),t(()=>{const e=i.current,t=document.getElementById(s);e.textContent=t.classList.contains("mg-show-more--collapsed")?a:n},[s,n,a]),(0,l().jsxs)(e.Fragment,{children:[(0,l().jsx)("div",{id:s,className:o.collapsable_wrapper_class,children:o.collapsable_text}),(0,l().jsx)("button",{ref:i,type:"button",className:"mg-button mg-button-primary mg-show-more--button","data-mg-show-more":"true","data-mg-show-more-skip-auto-init":"true","data-mg-show-more-target":`#${s}`,"data-mg-show-more-label-open":n,"data-mg-show-more-label-collapsed":a,children:a})]})}const f=m().shape({button_text:m().string,collapsable_wrapper_class:m().string.isRequired,collapsable_text:m().string.isRequired});function h({data:t=u,labelOpen:r="Show less",labelCollapsed:s="Show more"}){const n=o().replace(/[^a-zA-Z0-9_-]/g,"");return(0,l().jsx)(e.Fragment,{children:t.map((e,t)=>(0,l().jsx)(g,{item:e,id:`mg-show-more-${n}-${t}`,labelOpen:r,labelCollapsed:s},t))})}g.propTypes={item:f.isRequired,id:m().string.isRequired,labelOpen:m().string.isRequired,labelCollapsed:m().string.isRequired},h.propTypes={data:m().arrayOf(f).isRequired,labelOpen:m().string,labelCollapsed:m().string};const b=h;export{h as ShowMore,b as default};
|
package/components/SkipLink.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Storybook: https://mangrove.undrr.org/
|
|
4
4
|
* LLMs context: https://mangrove.undrr.org/llms.txt
|
|
5
5
|
* Repository: https://github.com/unisdr/undrr-mangrove
|
|
6
|
-
* Compiled on: 2026-09-
|
|
6
|
+
* Compiled on: 2026-09-24T08:35:35.831Z
|
|
7
7
|
*/
|
|
8
8
|
/*! For license information please see SkipLink.js.LICENSE.txt */
|
|
9
9
|
import"react";var e={2694(e,t,r){var n=r(6925);function o(){}function a(){}a.resetWarningCache=o,e.exports=function(){function e(e,t,r,o,a,s){if(s!==n){var c=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 c.name="Invariant Violation",c}}function t(){return e}e.isRequired=e;var r={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:a,resetWarningCache:o};return r.PropTypes=r,r}},5556(e,t,r){e.exports=r(2694)()},6925(e){e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}};const t={};function r(n){const o=t[n];if(void 0!==o)return o.exports;const a=t[n]={exports:{}};return e[n](a,a.exports,r),a.exports}r.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.cw=e=>{var t;return()=>{if(e){var r=e;e=0,t={exports:{}},r.call(t.exports,t,t.exports)}return t.exports}},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var n=r.cw(function(e,t){var r=Symbol.for("react.transitional.element");Symbol.for("react.fragment"),t.jsx=function(e,t,n){var o=null;if(void 0!==n&&(o=""+n),void 0!==t.key&&(o=""+t.key),"key"in t)for(var a in n={},t)"key"!==a&&(n[a]=t[a]);else n=t;return t=n.ref,{$$typeof:r,type:e,key:o,ref:void 0!==t?t:null,props:n}}}),o=r.cw(function(e,t){e.exports=n()}),a=r(5556),s=r.n(a);function c({targetId:e="main-content",label:t="Skip to main content",className:r,onClick:o,...a}){const s=["mg-skip-link",r].filter(Boolean).join(" ");return(0,n().jsx)("a",{className:s,href:`#${e}`,onClick:t=>{const r="undefined"==typeof document?null:document.getElementById(e);r&&r.focus(),o&&o(t)},...a,children:t})}o(),c.propTypes={targetId:s().string,label:s().string,className:s().string,onClick:s().func};const i=c;export{c as SkipLink,i as default};
|
package/components/StatsCard.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Storybook: https://mangrove.undrr.org/
|
|
4
4
|
* LLMs context: https://mangrove.undrr.org/llms.txt
|
|
5
5
|
* Repository: https://github.com/unisdr/undrr-mangrove
|
|
6
|
-
* Compiled on: 2026-09-
|
|
6
|
+
* Compiled on: 2026-09-24T08:35:35.831Z
|
|
7
7
|
*/
|
|
8
8
|
/*! For license information please see StatsCard.js.LICENSE.txt */
|
|
9
9
|
import"react";var t={2694(t,e,n){var r=n(6925);function o(){}function a(){}a.resetWarningCache=o,t.exports=function(){function t(t,e,n,o,a,i){if(i!==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 e(){return t}t.isRequired=t;var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:a,resetWarningCache:o};return n.PropTypes=n,n}},5556(t,e,n){t.exports=n(2694)()},6925(t){t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}};const e={};function n(r){const o=e[r];if(void 0!==o)return o.exports;const a=e[r]={exports:{}};return t[r](a,a.exports,n),a.exports}n.n=t=>{const e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.cw=t=>{var e;return()=>{if(t){var n=t;t=0,e={exports:{}},n.call(e.exports,e,e.exports)}return e.exports}},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var r=n.cw(function(t,e){var n=Symbol.for("react.transitional.element");function r(t,e,r){var o=null;if(void 0!==r&&(o=""+r),void 0!==e.key&&(o=""+e.key),"key"in e)for(var a in r={},e)"key"!==a&&(r[a]=e[a]);else r=e;return e=r.ref,{$$typeof:n,type:t,key:o,ref:void 0!==e?e:null,props:r}}Symbol.for("react.fragment"),e.jsx=r,e.jsxs=r}),o=n.cw(function(t,e){t.exports=r()}),a=n(5556),i=n.n(a);o();const l=({type:t=2,children:e,className:n,tabIndex:o,...a})=>{const i=`h${Math.min(Math.max(parseInt(t,10)||2,1),6)}`;return(0,r().jsx)(i,{className:n,tabIndex:o,...a,children:e})};function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function s(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,a,i,l=[],c=!0,s=!1;try{if(a=(n=n.call(t)).next,0===e);else for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==e);c=!0);}catch(t){s=!0,o=t}finally{try{if(!c&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(s)throw o}}return l}}(t,e)||function(t,e){if(t){if("string"==typeof t)return c(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(t,e):void 0}}(t,e)||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.")}()}const u=Object.entries,f=Object.setPrototypeOf,p=Object.isFrozen,m=Object.getPrototypeOf,d=Object.getOwnPropertyDescriptor;let h=Object.freeze,g=Object.seal,y=Object.create,b="undefined"!=typeof Reflect&&Reflect,T=b.apply,S=b.construct;h||(h=function(t){return t}),g||(g=function(t){return t}),T||(T=function(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return t.apply(e,r)}),S||(S=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return new t(...n)});const v=B(Array.prototype.forEach),A=B(Array.prototype.lastIndexOf),E=B(Array.prototype.pop),w=B(Array.prototype.push),x=B(Array.prototype.splice),_=Array.isArray,N=B(String.prototype.toLowerCase),O=B(String.prototype.toString),k=B(String.prototype.match),D=B(String.prototype.replace),R=B(String.prototype.indexOf),C=B(String.prototype.trim),I=B(Number.prototype.toString),L=B(Boolean.prototype.toString),M="undefined"==typeof BigInt?null:B(BigInt.prototype.toString),z="undefined"==typeof Symbol?null:B(Symbol.prototype.toString),P=B(Object.prototype.hasOwnProperty),j=B(Object.prototype.toString),U=B(RegExp.prototype.test),F=(H=TypeError,function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return S(H,e)});var H;function B(t){return function(e){e instanceof RegExp&&(e.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 T(t,e,r)}}function W(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:N;if(f&&f(t,null),!_(e))return t;let r=e.length;for(;r--;){let o=e[r];if("string"==typeof o){const t=n(o);t!==o&&(p(e)||(e[r]=t),o=t)}t[o]=!0}return t}function Y(t){for(let e=0;e<t.length;e++)P(t,e)||(t[e]=null);return t}function $(t){const e=y(null);for(const r of u(t)){var n=s(r,2);const o=n[0],a=n[1];P(t,o)&&(_(a)?e[o]=Y(a):a&&"object"==typeof a&&a.constructor===Object?e[o]=$(a):e[o]=a)}return e}function G(t,e){for(;null!==t;){const n=d(t,e);if(n){if(n.get)return B(n.get);if("function"==typeof n.value)return B(n.value)}t=m(t)}return function(){return null}}const q=h(["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"]),X=h(["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"]),K=h(["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"]),V=h(["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"]),Z=h(["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"]),J=h(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Q=h(["#text"]),tt=h(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","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"]),et=h(["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","dominant-baseline","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","pointer-events","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-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","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"]),nt=h(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","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"]),rt=h(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ot=g(/{{[\w\W]*|^[\w\W]*}}/g),at=g(/<%[\w\W]*|^[\w\W]*%>/g),it=g(/\${[\w\W]*/g),lt=g(/^data-[\-\w.\u00B7-\uFFFF]+$/),ct=g(/^aria-[\-\w]+$/),st=g(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ut=g(/^(?:\w+script|data):/i),ft=g(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),pt=g(/^html$/i),mt=g(/^[a-z][.\w]*(-[.\w]+)+$/i),dt=g(/<[/\w!]/g),ht=g(/<[/\w]/g),gt=g(/<\/no(script|embed|frames)/i),yt=g(/\/>/i),bt=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],Tt=h(W({},bt)),St=function(){const t={};return v(bt,e=>{t[e]=g(new RegExp("</"+e+"(?=[\\t\\n\\f\\r />])","i"))}),h(t)}(),vt=function(){return"undefined"==typeof window?null:window},At=function(t,e,n,r){return P(t,e)&&_(t[e])?W(r.base?$(r.base):{},t[e],r.transform):n},Et=function(t,e,n){const r=P(t,e)?t[e]:void 0;return r&&"object"==typeof r?$(r):n()};var wt=function t(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:vt();const n=e=>t(e);if(n.version="3.4.15",n.removed=[],!e||!e.document||9!==e.document.nodeType||!e.Element)return n.isSupported=!1,n;let r=e.document;const o=r,a=o.currentScript;e.DocumentFragment;const i=e.HTMLTemplateElement,l=e.Node,c=e.Element,s=e.NodeFilter;void 0===e.NamedNodeMap&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;const f=e.DOMParser,p=e.trustedTypes,m=c.prototype,d=G(m,"cloneNode"),b=G(m,"remove"),T=G(m,"removeAttributeNode"),S=G(m,"nextSibling"),H=G(m,"childNodes"),B=G(m,"parentNode"),Y=G(m,"shadowRoot"),bt=G(m,"attributes"),wt=l&&l.prototype?G(l.prototype,"nodeType"):null,xt=l&&l.prototype?G(l.prototype,"nodeName"):null,_t=l&&l.prototype?G(l.prototype,"ownerDocument"):null,Nt=function(t){return wt?wt(t):t.nodeType},Ot=function(t){return xt?xt(t):t.nodeName};if("function"==typeof i){const t=r.createElement("template");t.content&&t.content.ownerDocument&&(r=t.content.ownerDocument)}let kt,Dt,Rt="",Ct=!1,It=0;const Lt=function(){if(It>0)throw F('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},Mt=function(t){Lt(),It++;try{return kt.createHTML(t)}finally{It--}},zt=r,Pt=zt.implementation,jt=zt.createNodeIterator,Ut=zt.createDocumentFragment,Ft=zt.getElementsByTagName,Ht=o.importNode;let Bt={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof u&&"function"==typeof B&&Pt&&void 0!==Pt.createHTMLDocument;const Wt=ot,Yt=at,$t=it,Gt=lt,qt=ct,Xt=ut,Kt=ft,Vt=mt;let Zt=st,Jt=null;const Qt=W({},[...q,...X,...K,...Z,...Q]);let te=null;const ee=W({},[...tt,...et,...nt,...rt]);let ne=Object.seal(y(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}})),re=null,oe=null;const ae=Object.seal(y(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ie=!0,le=!0,ce=!1,se=!0,ue=!1,fe=!0,pe=!1,me=!1,de=null,he=null,ge=!1,ye=!1,be=!1,Te=!1,Se=!0,ve=!1;const Ae="user-content-";let Ee=!0,we=!1,xe={},_e=null;const Ne=W({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Oe=null;const ke=W({},["audio","video","img","source","image","track"]);let De=null;const Re=W({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ce="http://www.w3.org/1998/Math/MathML",Ie="http://www.w3.org/2000/svg",Le="http://www.w3.org/1999/xhtml";let Me=Le,ze=!1,Pe=null;const je=W({},[Ce,Ie,Le],O),Ue=h(["mi","mo","mn","ms","mtext"]);let Fe=W({},Ue);const He=h(["annotation-xml"]);let Be=W({},He);const We=W({},["title","style","font","a","script"]);let Ye=null;const $e=["application/xhtml+xml","text/html"];let Ge=null,qe=null;const Xe=r.createElement("form"),Ke=function(t){return t instanceof RegExp||t instanceof Function},Ve=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(qe&&qe===t)return;t&&"object"==typeof t||(t={}),t=$(t),Ye=-1===$e.indexOf(t.PARSER_MEDIA_TYPE)?"text/html":t.PARSER_MEDIA_TYPE,Ge="application/xhtml+xml"===Ye?O:N,Jt=At(t,"ALLOWED_TAGS",Qt,{transform:Ge}),te=At(t,"ALLOWED_ATTR",ee,{transform:Ge}),Pe=At(t,"ALLOWED_NAMESPACES",je,{transform:O}),De=At(t,"ADD_URI_SAFE_ATTR",Re,{transform:Ge,base:Re}),Oe=At(t,"ADD_DATA_URI_TAGS",ke,{transform:Ge,base:ke}),_e=At(t,"FORBID_CONTENTS",Ne,{transform:Ge}),re=At(t,"FORBID_TAGS",$({}),{transform:Ge}),oe=At(t,"FORBID_ATTR",$({}),{transform:Ge}),xe=!!P(t,"USE_PROFILES")&&(t.USE_PROFILES&&"object"==typeof t.USE_PROFILES?$(t.USE_PROFILES):t.USE_PROFILES),ie=!1!==t.ALLOW_ARIA_ATTR,le=!1!==t.ALLOW_DATA_ATTR,ce=t.ALLOW_UNKNOWN_PROTOCOLS||!1,se=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,ue=t.SAFE_FOR_TEMPLATES||!1,fe=!1!==t.SAFE_FOR_XML,pe=t.WHOLE_DOCUMENT||!1,ye=t.RETURN_DOM||!1,be=t.RETURN_DOM_FRAGMENT||!1,Te=t.RETURN_TRUSTED_TYPE||!1,ge=t.FORCE_BODY||!1,Se=!1!==t.SANITIZE_DOM,ve=t.SANITIZE_NAMED_PROPS||!1,Ee=!1!==t.KEEP_CONTENT,we=t.IN_PLACE||!1,Zt=function(t){try{return U(t,""),!0}catch(t){return!1}}(t.ALLOWED_URI_REGEXP)?t.ALLOWED_URI_REGEXP:st,Me="string"==typeof t.NAMESPACE?t.NAMESPACE:Le,Fe=Et(t,"MATHML_TEXT_INTEGRATION_POINTS",()=>W({},Ue)),Be=Et(t,"HTML_INTEGRATION_POINTS",()=>W({},He));const e=Et(t,"CUSTOM_ELEMENT_HANDLING",()=>y(null));if(ne=y(null),P(e,"tagNameCheck")&&Ke(e.tagNameCheck)&&(ne.tagNameCheck=e.tagNameCheck),P(e,"attributeNameCheck")&&Ke(e.attributeNameCheck)&&(ne.attributeNameCheck=e.attributeNameCheck),P(e,"allowCustomizedBuiltInElements")&&"boolean"==typeof e.allowCustomizedBuiltInElements&&(ne.allowCustomizedBuiltInElements=e.allowCustomizedBuiltInElements),g(ne),ue&&(le=!1),be&&(ye=!0),xe&&(Jt=W({},Q),te=y(null),!0===xe.html&&(W(Jt,q),W(te,tt)),!0===xe.svg&&(W(Jt,X),W(te,et),W(te,rt)),!0===xe.svgFilters&&(W(Jt,K),W(te,et),W(te,rt)),!0===xe.mathMl&&(W(Jt,Z),W(te,nt),W(te,rt))),ae.tagCheck=null,ae.attributeCheck=null,P(t,"ADD_TAGS")&&("function"==typeof t.ADD_TAGS?ae.tagCheck=t.ADD_TAGS:_(t.ADD_TAGS)&&(Jt===Qt&&(Jt=$(Jt)),W(Jt,t.ADD_TAGS,Ge))),P(t,"ADD_ATTR")&&("function"==typeof t.ADD_ATTR?ae.attributeCheck=t.ADD_ATTR:_(t.ADD_ATTR)&&(te===ee&&(te=$(te)),W(te,t.ADD_ATTR,Ge))),P(t,"ADD_FORBID_CONTENTS")&&_(t.ADD_FORBID_CONTENTS)&&(_e===Ne&&(_e=$(_e)),W(_e,t.ADD_FORBID_CONTENTS,Ge)),Ee&&(Jt["#text"]=!0),pe&&W(Jt,["html","head","body"]),Jt.table&&(W(Jt,["tbody"]),delete re.tbody),t.TRUSTED_TYPES_POLICY){if("function"!=typeof t.TRUSTED_TYPES_POLICY.createHTML)throw F('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof t.TRUSTED_TYPES_POLICY.createScriptURL)throw F('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const e=kt;kt=t.TRUSTED_TYPES_POLICY;try{Rt=Mt("")}catch(t){throw kt=e,t}}else null===t.TRUSTED_TYPES_POLICY?(kt=void 0,Rt=""):(void 0===kt&&(Ct||(Dt=function(t,e){if("object"!=typeof t||"function"!=typeof t.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";e&&e.hasAttribute(r)&&(n=e.getAttribute(r));const o="dompurify"+(n?"#"+n:"");try{return t.createPolicy(o,{createHTML:t=>t,createScriptURL:t=>t})}catch(t){return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(p,a),Ct=!0),kt=Dt),kt&&"string"==typeof Rt&&(Rt=Mt("")));h&&h(t),qe=t},Ze=W({},[...X,...K,...V]),Je=W({},[...Z,...J]),Qe=function(t){w(n.removed,{element:t});try{B(t).removeChild(t)}catch(e){if(b(t),!B(t))throw F("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},tn=function(t,e,n){try{T(t,e)}catch(e){try{t.removeAttribute(n)}catch(t){}}},en=function(t){on(t);const e=H(t);if(e){const t=[];v(e,e=>{w(t,e)}),v(t,t=>{try{b(t)}catch(t){}})}const n=bt(t);if(n)for(let e=n.length-1;e>=0;--e){const r=n[e],o=r&&r.name;"string"==typeof o&&tn(t,r,o)}},nn=function(t,e,r){if(!r)try{r=e.getAttributeNode(t)}catch(t){r=null}w(n.removed,{attribute:r||null,from:e});try{r?T(e,r):e.removeAttribute(t)}catch(n){try{e.removeAttribute(t)}catch(t){}}if("is"===t)if(ye||be)try{Qe(e)}catch(t){}else try{e.setAttribute(t,"")}catch(t){}},rn=function(t){const e=bt(t);if(e)for(let n=e.length-1;n>=0;--n){const r=e[n],o=r&&r.name;"string"!=typeof o||te[Ge(o)]||tn(t,r,o)}},on=function(t){const e=[t];for(;e.length>0;){const t=e.pop();1===Nt(t)&&rn(t);const n=H(t);if(n)for(let t=n.length-1;t>=0;--t)e.push(n[t])}},an=function(t,e){return!!fe&&("patchsrc"===t||"for"===t&&"label"!==e&&"output"!==e)},ln=function(t){let e=null,n=null;if(ge)t="<remove></remove>"+t;else{const e=k(t,/^[\r\n\t ]+/);n=e&&e[0]}"application/xhtml+xml"===Ye&&Me===Le&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");const o=kt?Mt(t):t;if(Me===Le)try{e=(new f).parseFromString(o,Ye)}catch(t){}if(!e||!e.documentElement){e=Pt.createDocument(Me,"template",null);try{e.documentElement.innerHTML=ze?Rt:o}catch(t){}}const a=e.body||e.documentElement;return t&&n&&a.insertBefore(r.createTextNode(n),a.childNodes[0]||null),Me===Le?Ft.call(e,pe?"html":"body")[0]:pe?e.documentElement:a},cn=function(t){const e=_t?_t(t):t.ownerDocument;return jt.call(e||t,t,s.SHOW_ELEMENT|s.SHOW_COMMENT|s.SHOW_TEXT|s.SHOW_PROCESSING_INSTRUCTION|s.SHOW_CDATA_SECTION,null)},sn=function(t){return t=D(t,Wt," "),t=D(t,Yt," "),D(t,$t," ")},un=function(t){var e;t.normalize();const n=_t?_t(t):t.ownerDocument,r=jt.call(n||t,t,s.SHOW_TEXT|s.SHOW_COMMENT|s.SHOW_CDATA_SECTION|s.SHOW_PROCESSING_INSTRUCTION,null);let o=r.nextNode();for(;o;)o.data=sn(o.data),o=r.nextNode();const a=null===(e=t.querySelectorAll)||void 0===e?void 0:e.call(t,"template");a&&v(a,t=>{pn(t.content)&&un(t.content)})},fn=function(t){const e=xt?xt(t):null;return"string"==typeof e&&"form"===Ge(e)&&("string"!=typeof t.nodeName||"string"!=typeof t.textContent||"function"!=typeof t.removeChild||t.attributes!==bt(t)||"function"!=typeof t.removeAttribute||"function"!=typeof t.removeAttributeNode||"function"!=typeof t.getAttributeNode||"function"!=typeof t.setAttribute||"string"!=typeof t.namespaceURI||"function"!=typeof t.insertBefore||"function"!=typeof t.hasChildNodes||t.nodeType!==wt(t)||t.childNodes!==H(t))},pn=function(t){if(!wt||"object"!=typeof t||null===t)return!1;try{return 11===wt(t)}catch(t){return!1}},mn=function(t){if(!wt||"object"!=typeof t||null===t)return!1;try{return"number"==typeof wt(t)}catch(t){return!1}};function dn(t,e,r){0!==t.length&&v(t,t=>{t.call(n,e,r,qe)})}const hn=function(t,e){if(t instanceof RegExp)return U(t,e);if(t instanceof Function){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return Boolean(t(e,...r))}return!1},gn=function(t,e,n,r){return 0===t.length?e:e===n||e===r?$(e):e},yn=function(t,e){return t!==e&&null===B(t)&&(we&&on(t),!0)},bn=function(t,e){if(dn(Bt.beforeSanitizeElements,t,null),yn(t,e))return!0;if(fn(t))return Qe(t),!0;const r=Ge(Ot(t));if(Jt=gn(Bt.uponSanitizeElement,Jt,Qt,de),dn(Bt.uponSanitizeElement,t,{tagName:r,allowedTags:Jt}),yn(t,e))return!0;if(function(t,e){return!!(fe&&t.hasChildNodes()&&!mn(t.firstElementChild)&&U(dt,t.textContent)&&U(dt,t.innerHTML))||!!(fe&&t.namespaceURI===Le&&Tt[e]&&(mn(t.firstElementChild)||"string"==typeof t.textContent&&U(St[e],t.textContent)))||7===t.nodeType||!(!fe||8!==t.nodeType||!U(ht,t.data))}(t,r))return Qe(t),!0;if(re[r]||!(ae.tagCheck instanceof Function&&ae.tagCheck(r))&&!Jt[r]){const n=function(t,e,n){if(!re[e]&&vn(e)&&hn(ne.tagNameCheck,e))return!1;if(Ee&&!_e[e]){const e=B(t),r=H(t);if(r&&e)for(let o=r.length-1;o>=0;--o){const a=t===n?d(r[o],!0):r[o];e.insertBefore(a,S(t))}}return Qe(t),!0}(t,r,e);return!1===n&&dn(Bt.afterSanitizeElements,t,null),n}if(1===Nt(t)&&!function(t){let e=B(t);e&&e.tagName||(e={namespaceURI:Me,tagName:"template"});const n=N(t.tagName),r=N(e.tagName);return!!Pe[t.namespaceURI]&&(t.namespaceURI===Ie?function(t,e,n){return e.namespaceURI===Le?"svg"===t:e.namespaceURI===Ce?"svg"===t&&("annotation-xml"===n||Fe[n]):Boolean(Ze[t])}(n,e,r):t.namespaceURI===Ce?function(t,e,n){return e.namespaceURI===Le?"math"===t:e.namespaceURI===Ie?"math"===t&&Be[n]:Boolean(Je[t])}(n,e,r):t.namespaceURI===Le?function(t,e,n){return!(e.namespaceURI===Ie&&!Be[n])&&!(e.namespaceURI===Ce&&!Fe[n])&&!Je[t]&&(We[t]||!Ze[t])}(n,e,r):!("application/xhtml+xml"!==Ye||!Pe[t.namespaceURI]))}(t))return Qe(t),!0;if(("noscript"===r||"noembed"===r||"noframes"===r)&&U(gt,t.innerHTML))return Qe(t),!0;if(ue&&3===t.nodeType){const e=sn(t.textContent);t.textContent!==e&&(w(n.removed,{element:t.cloneNode()}),t.textContent=e)}return dn(Bt.afterSanitizeElements,t,null),!1},Tn=function(t,e,n){if(oe[e])return!1;if(an(e,t))return!1;if(Se&&("id"===e||"name"===e)&&(n in r||n in Xe))return!1;const o=te[e]||ae.attributeCheck instanceof Function&&ae.attributeCheck(e,t);return!(!le||!U(Gt,e))||!(!ie||!U(qt,e))||(o?!(!De[e]&&!U(Zt,D(n,Kt,""))&&("src"!==e&&"xlink:href"!==e&&"href"!==e||"script"===t||0!==R(n,"data:")||!Oe[t])&&(!ce||U(Xt,D(n,Kt,"")))&&n):vn(t)&&hn(ne.tagNameCheck,t)&&hn(ne.attributeNameCheck,e,t)||"is"===e&&ne.allowCustomizedBuiltInElements&&hn(ne.tagNameCheck,n))},Sn=W({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),vn=function(t){return!Sn[N(t)]&&U(Vt,t)},An=function(t,e,n,r){if(kt&&"object"==typeof p&&"function"==typeof p.getAttributeType&&!n)switch(p.getAttributeType(t,e)){case"TrustedHTML":return Mt(r);case"TrustedScriptURL":return function(t){Lt(),It++;try{return kt.createScriptURL(t)}finally{It--}}(r)}return r},En=function(t,e,n,r){try{return n?t.setAttributeNS(n,e,r):t.setAttribute(e,r),!fn(t)||(Qe(t),!1)}catch(n){return nn(e,t),!1}},wn=function(t){dn(Bt.beforeSanitizeAttributes,t,null);const e=t.attributes;if(!e||fn(t))return;te=gn(Bt.uponSanitizeAttribute,te,ee,he);const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:te,forceKeepAttr:void 0};let o=e.length;const a=Ge(t.nodeName);for(;o--;){const i=e[o],l=i.name,c=i.namespaceURI,s=i.value,u=Ge(l),f=s;let p="value"===l?f:C(f),m=!1;r.attrName=u,r.attrValue=p,r.keepAttr=!0,r.forceKeepAttr=void 0,dn(Bt.uponSanitizeAttribute,t,r),p=r.attrValue,!ve||"id"!==u&&"name"!==u||0===R(p,Ae)||(nn(l,t,i),p=Ae+p,m=!0),fe&&U(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,p)||"attributename"===u&&k(p,"href")?nn(l,t,i):r.forceKeepAttr||(r.keepAttr&&(se||!U(yt,p))?(ue&&(p=sn(p)),Tn(a,u,p)?(p=An(a,u,c,p),p!==f&&En(t,l,c,p)&&m&&E(n.removed)):nn(l,t,i)):nn(l,t,i))}dn(Bt.afterSanitizeAttributes,t,null)},xn=function(t){let e=null;const n=cn(t);for(dn(Bt.beforeSanitizeShadowDOM,t,null);e=n.nextNode();)if(dn(Bt.uponSanitizeShadowNode,e,null),bn(e,t),wn(e),pn(e.content)&&xn(e.content),1===Nt(e)){const t=Y(e);pn(t)&&(_n(t),xn(t))}dn(Bt.afterSanitizeShadowDOM,t,null)},_n=function(t){const e=[{node:t,shadow:null}];for(;e.length>0;){const t=e.pop();if(t.shadow){xn(t.shadow);continue}const n=t.node,r=1===Nt(n),o=H(n);if(o)for(let t=o.length-1;t>=0;--t)e.push({node:o[t],shadow:null});if(r){const t=xt?xt(n):null;if("string"==typeof t&&"template"===Ge(t)){const t=n.content;pn(t)&&e.push({node:t,shadow:null})}}if(r){const t=Y(n);pn(t)&&e.push({node:null,shadow:t},{node:t,shadow:null})}}};return n.sanitize=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,a=null,i=null,l=null;if(ze=!t,ze&&(t="\x3c!--\x3e"),"string"!=typeof t&&!mn(t)&&"string"!=typeof(t=function(t){switch(typeof t){case"string":return t;case"number":return I(t);case"boolean":return L(t);case"bigint":return M?M(t):"0";case"symbol":return z?z(t):"Symbol()";case"undefined":default:return j(t);case"function":case"object":{if(null===t)return j(t);const e=t,n=G(e,"toString");if("function"==typeof n){const t=n(e);return"string"==typeof t?t:j(t)}return j(t)}}}(t)))throw F("dirty is not a string, aborting");if(!n.isSupported)return t;me?(Jt=de,te=he):Ve(e),(Bt.uponSanitizeElement.length>0||Bt.uponSanitizeAttribute.length>0)&&(Jt=$(Jt)),Bt.uponSanitizeAttribute.length>0&&(te=$(te)),n.removed=[];const c=we&&"string"!=typeof t&&mn(t);if(c){!function(t){if(!fe)return;const e=[t];for(;e.length>0;){const t=e.pop(),n=Nt(t);if(7===n||8===n&&U(ht,t.data)){try{b(t)}catch(t){}continue}if(1===n){const e=t,n=Ge(Ot(t));try{e.hasAttribute&&e.hasAttribute("patchsrc")&&e.removeAttribute("patchsrc"),e.hasAttribute&&e.hasAttribute("for")&&an("for",n)&&e.removeAttribute("for")}catch(t){}}const r=H(t);if(r)for(let t=r.length-1;t>=0;--t)e.push(r[t])}}(t);const e=Ot(t);if("string"==typeof e){const n=Ge(e);if(!Jt[n]||re[n])throw en(t),F("root node is forbidden and cannot be sanitized in-place")}if(fn(t))throw en(t),F("root node is clobbered and cannot be sanitized in-place");try{_n(t)}catch(e){throw en(t),e}}else if(mn(t))r=ln("\x3c!----\x3e"),a=r.ownerDocument.importNode(t,!0),1===a.nodeType&&"BODY"===a.nodeName||"HTML"===a.nodeName?r=a:r.appendChild(a),_n(r);else{if(!ye&&!ue&&!pe&&-1===t.indexOf("<"))return kt&&Te?Mt(t):t;if(r=ln(t),!r)return ye?null:Te?Rt:""}r&&ge&&Qe(r.firstChild);const s=c?t:r;try{const t=cn(s);for(;i=t.nextNode();)bn(i,s),wn(i),pn(i.content)&&xn(i.content)}catch(e){throw c&&(en(t),v(n.removed,t=>{t.element&&on(t.element)})),e}if(c)return v(n.removed,t=>{t.element&&on(t.element)}),ue&&un(t),t;if(ye){if(ue&&un(r),be)for(l=Ut.call(r.ownerDocument);r.firstChild;)l.appendChild(r.firstChild);else l=r;return(te.shadowroot||te.shadowrootmode)&&(l=Ht.call(o,l,!0)),l}let u=pe?r.outerHTML:r.innerHTML;return pe&&Jt["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&U(pt,r.ownerDocument.doctype.name)&&(u="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+u),ue&&(u=sn(u)),kt&&Te?Mt(u):u},n.setConfig=function(){Ve(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),me=!0,de=Jt,he=te},n.clearConfig=function(){qe=null,me=!1,de=null,he=null,kt=Dt,Rt=""},n.isValidAttribute=function(t,e,n){qe||Ve({});const r=Ge(t),o=Ge(e);return Tn(r,o,n)},n.addHook=function(t,e){"function"==typeof e&&P(Bt,t)&&w(Bt[t],e)},n.removeHook=function(t,e){if(P(Bt,t)){if(void 0!==e){const n=A(Bt[t],e);return-1===n?void 0:x(Bt[t],n,1)[0]}return E(Bt[t])}},n.removeHooks=function(t){P(Bt,t)&&(Bt[t]=[])},n.removeAllHooks=function(){Bt={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}();function xt({icon:t,label:e,value:n,bottomLabel:o,summaryText:a,link:i,className:l="",...c}){const s="mg-stats-card-item",u=["mg-card",s,i&&`${s}--linked`,l].filter(Boolean).join(" "),f=i?(0,r().jsx)("a",{href:i,className:`${s}__value`,children:n}):(0,r().jsx)("data",{className:`${s}__value`,value:n,children:n});return(0,r().jsxs)("article",{className:u,...c,children:[t&&(0,r().jsx)("span",{className:`${s}__icon`,"aria-hidden":"true",children:(0,r().jsx)("span",{className:t})}),e&&(0,r().jsx)("span",{className:`${s}__label`,children:e}),f,o&&(0,r().jsx)("strong",{className:`${s}__bottom-label`,children:o}),a&&(0,r().jsx)("p",{className:`${s}__summary`,dangerouslySetInnerHTML:{__html:wt.sanitize(a)}})]})}xt.propTypes={icon:i().string,label:i().string,value:i().oneOfType([i().string,i().number]).isRequired,bottomLabel:i().string,summaryText:i().string,link:i().string,className:i().string};const _t=[];function Nt({title:t,stats:e=_t,variant:n="default",className:o="",...a}){const i="mg-stats-card",c=e.length;let s="mg-grid";c>0&&c<=12?s=`mg-grid mg-grid__col-${c}`:c>12&&(s="mg-grid mg-grid--auto-fit");const u=[i,n&&`${i}--${n}`,o].filter(Boolean).join(" ");return(0,r().jsxs)("section",{className:u,"aria-label":t||"Statistics",...a,children:[t&&(0,r().jsx)(l,{type:"2",children:t}),(0,r().jsx)("div",{className:s,children:e.map((t,e)=>(0,r().jsx)(xt,{icon:t.icon,label:t.label,value:t.value,bottomLabel:t.bottomLabel,summaryText:t.summaryText,link:t.link},e))})]})}Nt.propTypes={title:i().string,stats:i().arrayOf(i().shape({icon:i().string,label:i().string,value:i().oneOfType([i().string,i().number]).isRequired,bottomLabel:i().string,summaryText:i().string,link:i().string})),variant:i().oneOf(["default","compact","highlighted","negative"]),className:i().string};const Ot=Nt;function kt(t){const{dataset:e}=t,n={title:e.title||void 0,variant:e.variant||"default",className:e.className||""};try{n.stats=e.stats?JSON.parse(e.stats):[]}catch{n.stats=[]}return n}export{Nt as StatsCard,Ot as default,kt as fromElement};
|