{"version":3,"file":"PostShow-DEyRPNnH.js","sources":["../../../node_modules/@mui/icons-material/esm/HowToVote.js","../../../node_modules/@mui/icons-material/esm/PlayCircle.js","../../../node_modules/@mui/icons-material/esm/QrCode2.js","../../../node_modules/@mui/icons-material/esm/RefreshOutlined.js","../../../node_modules/@mui/icons-material/esm/ViewCarousel.js","../../../node_modules/@mui/icons-material/esm/ViewListOutlined.js","../../../frontend/src/Components/Posts/Show/Skeleton.tsx","../../../node_modules/qr-code-styling/lib/qr-code-styling.js","../../../frontend/src/Components/DesignSystem/IconButton/IconButton.tsx","../../../frontend/src/Utils/SocialShare.ts","../../../frontend/src/Components/Posts/Shared/ShareIt/ShareIt.tsx","../../../frontend/src/Components/Posts/Shared/PostStatus/PostStatusHelpDialog/PostStatusHelpDialog.tsx","../../../frontend/src/Components/Posts/Shared/PostStatus/PostStatus.tsx","../../../frontend/src/Layout/PostHeader/PostHeader.tsx","../../../frontend/src/Layout/PostLayout/PostLayout.tsx","../../../frontend/src/Components/DesignSystem/EventUrlState/EventUrlState.tsx","../../../frontend/src/Utils/Types/Attendances.ts","../../../node_modules/calendar-link/dist/index.modern.mjs","../../../frontend/src/Components/Posts/Show/Communication/DownloadICSButton/DownloadICSButton.tsx","../../../frontend/src/Components/Posts/Show/Communication/EventActions.tsx","../../../frontend/src/Components/Posts/Show/Communication/PostSidePrimaryActions.tsx","../../../frontend/src/Components/Posts/Show/Communication/Show.tsx","../../../frontend/src/Components/Posts/Show/StickyFooterWrapper.tsx","../../../frontend/src/Components/Posts/Show/Communication/EventFooter.tsx","../../../frontend/src/Components/Posts/Show/Communication/Wrapper.tsx","../../../frontend/src/Components/Posts/Show/PostSideHeader/PostSideHeader.tsx","../../../frontend/src/Components/Posts/Shared/Budget/Budget.tsx","../../../frontend/src/Components/Posts/Shared/UserVotesInfo/UserVotesInfo.tsx","../../../frontend/src/Components/Posts/PostSidePrimaryActions/PostSidePrimaryActions.tsx","../../../frontend/src/Components/Posts/Show/Participation/Footer/index.tsx","../../../frontend/src/Components/Posts/DuplicatedPostList/DuplicatedPostList.tsx","../../../frontend/src/Components/Posts/OriginalPost/OriginalPost.tsx","../../../frontend/src/Components/Posts/Show/Participation/ParticipationPostShow.tsx","../../../frontend/src/Components/Posts/Show/Participation/Wrapper.tsx","../../../frontend/src/Components/Posts/Show/Folder/SubContent/ChildrenList.tsx","../../../frontend/src/Components/Posts/Show/Folder/SubContent/Loader.tsx","../../../frontend/src/Components/Posts/Show/Folder/SubContent/SubContent.tsx","../../../frontend/src/Components/Posts/Show/Folder/FolderShow/FolderShow.tsx","../../../frontend/src/Components/Posts/Show/Folder/Wrapper.tsx","../../../frontend/src/Services/postDatesStatus.ts","../../../frontend/src/Components/Posts/Show/Consultation/ConsultationFooter/ConsultationFooter.tsx","../../../frontend/src/Components/StepTabs/stepTabsIcon.tsx","../../../frontend/src/Components/StepTabs/MobileStepTabs/MobileStepTabs.tsx","../../../frontend/src/Components/StepTabs/StepTab/StepTab.tsx","../../../frontend/src/Components/StepTabs/DesktopStepTabs/DesktopStepTabs.tsx","../../../frontend/src/Components/StepTabs/StepTabs.tsx","../../../frontend/src/Components/Posts/Show/Consultation/Tabs/Contents/EmptyStates/EmptyComing.tsx","../../../frontend/src/Components/Posts/Show/Consultation/Tabs/Contents/EmptyStates/EmptyDefault.tsx","../../../frontend/src/Components/Posts/Show/Consultation/Tabs/Contents/EmptyStates/EmptyEnded.tsx","../../../frontend/src/Components/Posts/Show/Consultation/Tabs/Contents/EmptyStates/EmptyOngoing.tsx","../../../frontend/src/Components/Posts/Show/Consultation/Tabs/Contents/TogglePostsView.tsx","../../../frontend/src/Components/Posts/Show/Consultation/Tabs/Contents/TabPostsList.tsx","../../../frontend/src/Components/DesignSystem/PostCarouselItem/PostCarouselItem.tsx","../../../frontend/src/Components/Posts/Show/Consultation/Tabs/Contents/TabPostsCarousel/PromptStep.tsx","../../../frontend/src/Components/Posts/Show/Consultation/Tabs/Contents/TabPostsCarousel/ProgressBar.tsx","../../../frontend/src/Components/Posts/Show/Consultation/Tabs/Contents/TabPostsCarousel/TabPostsCarousel.tsx","../../../node_modules/lodash/_freeGlobal.js","../../../node_modules/lodash/_root.js","../../../node_modules/lodash/_Symbol.js","../../../node_modules/lodash/_getRawTag.js","../../../node_modules/lodash/_objectToString.js","../../../node_modules/lodash/_baseGetTag.js","../../../node_modules/lodash/isObject.js","../../../node_modules/lodash/isFunction.js","../../../node_modules/lodash/_coreJsData.js","../../../node_modules/lodash/_isMasked.js","../../../node_modules/lodash/_toSource.js","../../../node_modules/lodash/_baseIsNative.js","../../../node_modules/lodash/_getValue.js","../../../node_modules/lodash/_getNative.js","../../../node_modules/lodash/_nativeCreate.js","../../../node_modules/lodash/_hashClear.js","../../../node_modules/lodash/_hashDelete.js","../../../node_modules/lodash/_hashGet.js","../../../node_modules/lodash/_hashHas.js","../../../node_modules/lodash/_hashSet.js","../../../node_modules/lodash/_Hash.js","../../../node_modules/lodash/_listCacheClear.js","../../../node_modules/lodash/eq.js","../../../node_modules/lodash/_assocIndexOf.js","../../../node_modules/lodash/_listCacheDelete.js","../../../node_modules/lodash/_listCacheGet.js","../../../node_modules/lodash/_listCacheHas.js","../../../node_modules/lodash/_listCacheSet.js","../../../node_modules/lodash/_ListCache.js","../../../node_modules/lodash/_Map.js","../../../node_modules/lodash/_mapCacheClear.js","../../../node_modules/lodash/_isKeyable.js","../../../node_modules/lodash/_getMapData.js","../../../node_modules/lodash/_mapCacheDelete.js","../../../node_modules/lodash/_mapCacheGet.js","../../../node_modules/lodash/_mapCacheHas.js","../../../node_modules/lodash/_mapCacheSet.js","../../../node_modules/lodash/_MapCache.js","../../../node_modules/lodash/_setCacheAdd.js","../../../node_modules/lodash/_setCacheHas.js","../../../node_modules/lodash/_SetCache.js","../../../node_modules/lodash/_baseFindIndex.js","../../../node_modules/lodash/_baseIsNaN.js","../../../node_modules/lodash/_strictIndexOf.js","../../../node_modules/lodash/_baseIndexOf.js","../../../node_modules/lodash/_arrayIncludes.js","../../../node_modules/lodash/_arrayIncludesWith.js","../../../node_modules/lodash/_cacheHas.js","../../../node_modules/lodash/_Set.js","../../../node_modules/lodash/noop.js","../../../node_modules/lodash/_setToArray.js","../../../node_modules/lodash/_createSet.js","../../../node_modules/lodash/_baseUniq.js","../../../node_modules/lodash/uniqWith.js","../../../frontend/src/Components/Posts/Show/Consultation/Tabs/Contents/TabPostsMap.tsx","../../../frontend/src/Components/Posts/Show/Consultation/Tabs/Contents/Stats/Kpis.tsx","../../../frontend/src/Components/Posts/Show/Consultation/Tabs/Contents/Stats/index.tsx","../../../frontend/src/Components/Posts/Show/Consultation/Tabs/Contents/TabContent.tsx","../../../node_modules/@typeform/embed-react/build/index.js","../../../frontend/src/Components/DesignSystem/FormEmbed/FormEmbed.tsx","../../../frontend/src/Components/Posts/Show/Consultation/Tabs/Contents/FormShow/TitleWhenAnswered.tsx","../../../frontend/src/Components/Posts/Show/Consultation/Tabs/Contents/FormShow/FormShow.tsx","../../../frontend/src/Components/Posts/Show/Consultation/Tabs/Contents/EmptyStates/Study/EmptyAnswered.tsx","../../../frontend/src/Components/Posts/Show/Consultation/Tabs/Contents/EmptyStates/Study/index.tsx","../../../frontend/src/Components/Posts/Show/Consultation/Tabs/Contents/StudyTabContent.tsx","../../../frontend/src/Components/PostStepShow/PostStepShow.tsx","../../../frontend/src/Components/Posts/Show/Consultation/Tabs/Contents/TabContainer.tsx","../../../frontend/src/Components/Posts/Show/Consultation/Tabs/Tabs.tsx","../../../frontend/src/Components/Posts/Show/Consultation/ConsultationShow/ConsultationShow.tsx","../../../frontend/src/Components/Posts/Show/Consultation/ConsultationShow/PostSidePrimaryAction/PostSidePrimaryActions.tsx","../../../frontend/src/Components/Posts/Show/Consultation/Wrapper.tsx","../../../frontend/src/Components/Posts/Show/Messaging/Footer/index.tsx","../../../frontend/src/Components/Posts/Show/Messaging/Show.tsx","../../../frontend/src/Components/Posts/Show/Messaging/Wrapper.tsx","../../../frontend/src/Pages/Posts/Show/PostShow.tsx"],"sourcesContent":["\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M18 13h-.68l-2 2h1.91L19 17H5l1.78-2h2.05l-2-2H6l-3 3v4c0 1.1.89 2 1.99 2H19c1.1 0 2-.89 2-2v-4zm-1-5.05-4.95 4.95-3.54-3.54 4.95-4.95zm-4.24-5.66L6.39 8.66c-.39.39-.39 1.02 0 1.41l4.95 4.95c.39.39 1.02.39 1.41 0l6.36-6.36c.39-.39.39-1.02 0-1.41L14.16 2.3c-.38-.4-1.01-.4-1.4-.01\"\n}), 'HowToVote');","\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M9.5 16.5v-9l7 4.5z\"\n}), 'PlayCircle');","\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M15 21h-2v-2h2zm-2-7h-2v5h2zm8-2h-2v4h2zm-2-2h-2v2h2zM7 12H5v2h2zm-2-2H3v2h2zm7-5h2V3h-2zm-7.5-.5v3h3v-3zM9 9H3V3h6zm-4.5 7.5v3h3v-3zM9 21H3v-6h6zm7.5-16.5v3h3v-3zM21 9h-6V3h6zm-2 10v-3h-4v2h2v3h4v-2zm-2-7h-4v2h4zm-4-2H7v2h2v2h2v-2h2zm1-1V7h-2V5h-2v4zM6.75 5.25h-1.5v1.5h1.5zm0 12h-1.5v1.5h1.5zm12-12h-1.5v1.5h1.5z\"\n}), 'QrCode2');","\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z\"\n}), 'RefreshOutlined');","\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M2 7h4v10H2zm5 12h10V5H7zM18 7h4v10h-4z\"\n}), 'ViewCarousel');","\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M3 5v14h18V5zm4 2v2H5V7zm-2 6v-2h2v2zm0 2h2v2H5zm14 2H9v-2h10zm0-4H9v-2h10zm0-4H9V7h10z\"\n}), 'ViewListOutlined');","import React from 'react';\nimport { Grid2 as Grid } from '@mui/material';\nimport { Box, Container, Skeleton } from '@mui/material';\n\nimport Hidden from '../../DesignSystem/Hidden';\n\nfunction PostSkeleton() {\n return (\n ({\n bgcolor: theme.palette.grey[50],\n pb: 5,\n })}\n >\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n );\n}\n\nexport default PostSkeleton;\n","!function(t,e){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define([],e):\"object\"==typeof exports?exports.QRCodeStyling=e():t.QRCodeStyling=e()}(this,(()=>(()=>{var t={873:(t,e)=>{var i,r,n=function(){var t=function(t,e){var i=t,r=s[e],n=null,o=0,h=null,p=[],v={},m=function(t,e){n=function(t){for(var e=new Array(t),i=0;i=7&&S(t),null==h&&(h=M(i,r,p)),A(h,e)},b=function(t,e){for(var i=-1;i<=7;i+=1)if(!(t+i<=-1||o<=t+i))for(var r=-1;r<=7;r+=1)e+r<=-1||o<=e+r||(n[t+i][e+r]=0<=i&&i<=6&&(0==r||6==r)||0<=r&&r<=6&&(0==i||6==i)||2<=i&&i<=4&&2<=r&&r<=4)},y=function(){for(var t=8;t>r&1);n[Math.floor(r/3)][r%3+o-8-3]=s}for(r=0;r<18;r+=1)s=!t&&1==(e>>r&1),n[r%3+o-8-3][Math.floor(r/3)]=s},C=function(t,e){for(var i=r<<3|e,s=a.getBCHTypeInfo(i),h=0;h<15;h+=1){var d=!t&&1==(s>>h&1);h<6?n[h][8]=d:h<8?n[h+1][8]=d:n[o-15+h][8]=d}for(h=0;h<15;h+=1)d=!t&&1==(s>>h&1),h<8?n[8][o-h-1]=d:h<9?n[8][15-h-1+1]=d:n[8][15-h-1]=d;n[o-8][8]=!t},A=function(t,e){for(var i=-1,r=o-1,s=7,h=0,d=a.getMaskFunction(e),u=o-1;u>0;u-=2)for(6==u&&(u-=1);;){for(var c=0;c<2;c+=1)if(null==n[r][u-c]){var l=!1;h>>s&1)),d(r,u-c)&&(l=!l),n[r][u-c]=l,-1==(s-=1)&&(h+=1,s=7)}if((r+=i)<0||o<=r){r-=i,i=-i;break}}},M=function(t,e,i){for(var r=u.getRSBlocks(t,e),n=c(),o=0;o8*h)throw\"code length overflow. (\"+n.getLengthInBits()+\">\"+8*h+\")\";for(n.getLengthInBits()+4<=8*h&&n.put(0,4);n.getLengthInBits()%8!=0;)n.putBit(!1);for(;!(n.getLengthInBits()>=8*h||(n.put(236,8),n.getLengthInBits()>=8*h));)n.put(17,8);return function(t,e){for(var i=0,r=0,n=0,o=new Array(e.length),s=new Array(e.length),h=0;h=0?f.getAt(w):0}}var p=0;for(l=0;lr)&&(t=r,e=i)}return e}())},v.createTableTag=function(t,e){t=t||2;var i=\"\";i+='',i+=\"\";for(var r=0;r\";for(var n=0;n';i+=\"\"}return(i+=\"\")+\"
\"},v.createSvgTag=function(t,e,i,r){var n={};\"object\"==typeof arguments[0]&&(t=(n=arguments[0]).cellSize,e=n.margin,i=n.alt,r=n.title),t=t||2,e=void 0===e?4*t:e,(i=\"string\"==typeof i?{text:i}:i||{}).text=i.text||null,i.id=i.text?i.id||\"qrcode-description\":null,(r=\"string\"==typeof r?{text:r}:r||{}).text=r.text||null,r.id=r.text?r.id||\"qrcode-title\":null;var o,s,a,h,d=v.getModuleCount()*t+2*e,u=\"\";for(h=\"l\"+t+\",0 0,\"+t+\" -\"+t+\",0 0,-\"+t+\"z \",u+='\",u+=r.text?''+$(r.text)+\"\":\"\",u+=i.text?''+$(i.text)+\"\":\"\",u+='',u+='')+\"\"},v.createDataURL=function(t,e){t=t||2,e=void 0===e?4*t:e;var i=v.getModuleCount()*t+2*e,r=e,n=i-e;return _(i,i,(function(e,i){if(r<=e&&e\"};var $=function(t){for(var e=\"\",i=0;i\":e+=\">\";break;case\"&\":e+=\"&\";break;case'\"':e+=\""\";break;default:e+=r}}return e};return v.createASCII=function(t,e){if((t=t||1)<2)return function(t){t=void 0===t?2:t;var e,i,r,n,o,s=1*v.getModuleCount()+2*t,a=t,h=s-t,d={\"██\":\"█\",\"█ \":\"▀\",\" █\":\"▄\",\" \":\" \"},u={\"██\":\"▀\",\"█ \":\"▀\",\" █\":\" \",\" \":\" \"},c=\"\";for(e=0;e=h?u[o]:d[o];c+=\"\\n\"}return s%2&&t>0?c.substring(0,c.length-s-1)+Array(s+1).join(\"▀\"):c.substring(0,c.length-1)}(e);t-=1,e=void 0===e?2*t:e;var i,r,n,o,s=v.getModuleCount()*t+2*e,a=e,h=s-e,d=Array(t+1).join(\"██\"),u=Array(t+1).join(\" \"),c=\"\",l=\"\";for(i=0;i>>8),e.push(255&s)):e.push(r)}}return e}};var e,i,r,n,o,s={L:1,M:0,Q:3,H:2},a=(e=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],i=1335,r=7973,o=function(t){for(var e=0;0!=t;)e+=1,t>>>=1;return e},(n={}).getBCHTypeInfo=function(t){for(var e=t<<10;o(e)-o(i)>=0;)e^=i<=0;)e^=r<5&&(i+=3+o-5)}for(r=0;r=256;)e-=255;return t[e]}}}();function d(t,e){if(void 0===t.length)throw t.length+\"/\"+e;var i=function(){for(var i=0;i>>7-e%8&1)},put:function(t,e){for(var r=0;r>>e-r-1&1))},getLengthInBits:function(){return e},putBit:function(i){var r=Math.floor(e/8);t.length<=r&&t.push(0),i&&(t[r]|=128>>>e%8),e+=1}};return i},l=function(t){var e=t,i={getMode:function(){return 1},getLength:function(t){return e.length},write:function(t){for(var i=e,n=0;n+2>>8&255)+(255&n),t.put(n,13),i+=2}if(i>>8)},writeBytes:function(t,i,r){i=i||0,r=r||t.length;for(var n=0;n0&&(e+=\",\"),e+=t[i];return e+\"]\"}};return e},v=function(t){var e=t,i=0,r=0,n=0,o={read:function(){for(;n<8;){if(i>=e.length){if(0==n)return-1;throw\"unexpected end of file./\"+n}var t=e.charAt(i);if(i+=1,\"=\"==t)return n=0,-1;t.match(/^\\s$/)||(r=r<<6|s(t.charCodeAt(0)),n+=6)}var o=r>>>n-8&255;return n-=8,o}},s=function(t){if(65<=t&&t<=90)return t-65;if(97<=t&&t<=122)return t-97+26;if(48<=t&&t<=57)return t-48+52;if(43==t)return 62;if(47==t)return 63;throw\"c:\"+t};return o},_=function(t,e,i){for(var r=function(t,e){var i=t,r=e,n=new Array(t*e),o={setPixel:function(t,e,r){n[e*i+t]=r},write:function(t){t.writeString(\"GIF87a\"),t.writeShort(i),t.writeShort(r),t.writeByte(128),t.writeByte(0),t.writeByte(0),t.writeByte(0),t.writeByte(0),t.writeByte(0),t.writeByte(255),t.writeByte(255),t.writeByte(255),t.writeString(\",\"),t.writeShort(0),t.writeShort(0),t.writeShort(i),t.writeShort(r),t.writeByte(0);var e=s(2);t.writeByte(2);for(var n=0;e.length-n>255;)t.writeByte(255),t.writeBytes(e,n,255),n+=255;t.writeByte(e.length-n),t.writeBytes(e,n,e.length-n),t.writeByte(0),t.writeString(\";\")}},s=function(t){for(var e=1<>>e!=0)throw\"length over\";for(;d+e>=8;)h.writeByte(255&(t<>>=8-d,u=0,d=0;u|=t<0&&h.writeByte(u)}});l.write(e,r);var g=0,f=String.fromCharCode(n[g]);for(g+=1;g=6;)o(t>>>e-6),e-=6},n.flush=function(){if(e>0&&(o(t<<6-e),t=0,e=0),i%3!=0)for(var n=3-i%3,s=0;s>6,128|63&r):r<55296||r>=57344?e.push(224|r>>12,128|r>>6&63,128|63&r):(i++,r=65536+((1023&r)<<10|1023&t.charCodeAt(i)),e.push(240|r>>18,128|r>>12&63,128|r>>6&63,128|63&r))}return e}(t)},void 0===(r=\"function\"==typeof(i=function(){return n})?i.apply(e,[]):i)||(t.exports=r)}},e={};function i(r){var n=e[r];if(void 0!==n)return n.exports;var o=e[r]={exports:{}};return t[r](o,o.exports,i),o.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var r in e)i.o(e,r)&&!i.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var r={};return(()=>{\"use strict\";i.d(r,{default:()=>$});const t=t=>!!t&&\"object\"==typeof t&&!Array.isArray(t);function e(i,...r){if(!r.length)return i;const n=r.shift();return void 0!==n&&t(i)&&t(n)?(i=Object.assign({},i),Object.keys(n).forEach((r=>{const o=i[r],s=n[r];Array.isArray(o)&&Array.isArray(s)?i[r]=s:t(o)&&t(s)?i[r]=e(Object.assign({},o),s):i[r]=s})),e(i,...r)):i}function n(t,e){const i=document.createElement(\"a\");i.download=e,i.href=t,document.body.appendChild(i),i.click(),document.body.removeChild(i)}const o={L:.07,M:.15,Q:.25,H:.3};class s{constructor({svg:t,type:e,window:i}){this._svg=t,this._type=e,this._window=i}draw(t,e,i,r){let n;switch(this._type){case\"dots\":n=this._drawDot;break;case\"classy\":n=this._drawClassy;break;case\"classy-rounded\":n=this._drawClassyRounded;break;case\"rounded\":n=this._drawRounded;break;case\"extra-rounded\":n=this._drawExtraRounded;break;default:n=this._drawSquare}n.call(this,{x:t,y:e,size:i,getNeighbor:r})}_rotateFigure({x:t,y:e,size:i,rotation:r=0,draw:n}){var o;const s=t+i/2,a=e+i/2;n(),null===(o=this._element)||void 0===o||o.setAttribute(\"transform\",`rotate(${180*r/Math.PI},${s},${a})`)}_basicDot(t){const{size:e,x:i,y:r}=t;this._rotateFigure(Object.assign(Object.assign({},t),{draw:()=>{this._element=this._window.document.createElementNS(\"http://www.w3.org/2000/svg\",\"circle\"),this._element.setAttribute(\"cx\",String(i+e/2)),this._element.setAttribute(\"cy\",String(r+e/2)),this._element.setAttribute(\"r\",String(e/2))}}))}_basicSquare(t){const{size:e,x:i,y:r}=t;this._rotateFigure(Object.assign(Object.assign({},t),{draw:()=>{this._element=this._window.document.createElementNS(\"http://www.w3.org/2000/svg\",\"rect\"),this._element.setAttribute(\"x\",String(i)),this._element.setAttribute(\"y\",String(r)),this._element.setAttribute(\"width\",String(e)),this._element.setAttribute(\"height\",String(e))}}))}_basicSideRounded(t){const{size:e,x:i,y:r}=t;this._rotateFigure(Object.assign(Object.assign({},t),{draw:()=>{this._element=this._window.document.createElementNS(\"http://www.w3.org/2000/svg\",\"path\"),this._element.setAttribute(\"d\",`M ${i} ${r}v ${e}h `+e/2+`a ${e/2} ${e/2}, 0, 0, 0, 0 ${-e}`)}}))}_basicCornerRounded(t){const{size:e,x:i,y:r}=t;this._rotateFigure(Object.assign(Object.assign({},t),{draw:()=>{this._element=this._window.document.createElementNS(\"http://www.w3.org/2000/svg\",\"path\"),this._element.setAttribute(\"d\",`M ${i} ${r}v ${e}h ${e}v `+-e/2+`a ${e/2} ${e/2}, 0, 0, 0, ${-e/2} ${-e/2}`)}}))}_basicCornerExtraRounded(t){const{size:e,x:i,y:r}=t;this._rotateFigure(Object.assign(Object.assign({},t),{draw:()=>{this._element=this._window.document.createElementNS(\"http://www.w3.org/2000/svg\",\"path\"),this._element.setAttribute(\"d\",`M ${i} ${r}v ${e}h ${e}a ${e} ${e}, 0, 0, 0, ${-e} ${-e}`)}}))}_basicCornersRounded(t){const{size:e,x:i,y:r}=t;this._rotateFigure(Object.assign(Object.assign({},t),{draw:()=>{this._element=this._window.document.createElementNS(\"http://www.w3.org/2000/svg\",\"path\"),this._element.setAttribute(\"d\",`M ${i} ${r}v `+e/2+`a ${e/2} ${e/2}, 0, 0, 0, ${e/2} ${e/2}h `+e/2+\"v \"+-e/2+`a ${e/2} ${e/2}, 0, 0, 0, ${-e/2} ${-e/2}`)}}))}_drawDot({x:t,y:e,size:i}){this._basicDot({x:t,y:e,size:i,rotation:0})}_drawSquare({x:t,y:e,size:i}){this._basicSquare({x:t,y:e,size:i,rotation:0})}_drawRounded({x:t,y:e,size:i,getNeighbor:r}){const n=r?+r(-1,0):0,o=r?+r(1,0):0,s=r?+r(0,-1):0,a=r?+r(0,1):0,h=n+o+s+a;if(0!==h)if(h>2||n&&o||s&&a)this._basicSquare({x:t,y:e,size:i,rotation:0});else{if(2===h){let r=0;return n&&s?r=Math.PI/2:s&&o?r=Math.PI:o&&a&&(r=-Math.PI/2),void this._basicCornerRounded({x:t,y:e,size:i,rotation:r})}if(1===h){let r=0;return s?r=Math.PI/2:o?r=Math.PI:a&&(r=-Math.PI/2),void this._basicSideRounded({x:t,y:e,size:i,rotation:r})}}else this._basicDot({x:t,y:e,size:i,rotation:0})}_drawExtraRounded({x:t,y:e,size:i,getNeighbor:r}){const n=r?+r(-1,0):0,o=r?+r(1,0):0,s=r?+r(0,-1):0,a=r?+r(0,1):0,h=n+o+s+a;if(0!==h)if(h>2||n&&o||s&&a)this._basicSquare({x:t,y:e,size:i,rotation:0});else{if(2===h){let r=0;return n&&s?r=Math.PI/2:s&&o?r=Math.PI:o&&a&&(r=-Math.PI/2),void this._basicCornerExtraRounded({x:t,y:e,size:i,rotation:r})}if(1===h){let r=0;return s?r=Math.PI/2:o?r=Math.PI:a&&(r=-Math.PI/2),void this._basicSideRounded({x:t,y:e,size:i,rotation:r})}}else this._basicDot({x:t,y:e,size:i,rotation:0})}_drawClassy({x:t,y:e,size:i,getNeighbor:r}){const n=r?+r(-1,0):0,o=r?+r(1,0):0,s=r?+r(0,-1):0,a=r?+r(0,1):0;0!==n+o+s+a?n||s?o||a?this._basicSquare({x:t,y:e,size:i,rotation:0}):this._basicCornerRounded({x:t,y:e,size:i,rotation:Math.PI/2}):this._basicCornerRounded({x:t,y:e,size:i,rotation:-Math.PI/2}):this._basicCornersRounded({x:t,y:e,size:i,rotation:Math.PI/2})}_drawClassyRounded({x:t,y:e,size:i,getNeighbor:r}){const n=r?+r(-1,0):0,o=r?+r(1,0):0,s=r?+r(0,-1):0,a=r?+r(0,1):0;0!==n+o+s+a?n||s?o||a?this._basicSquare({x:t,y:e,size:i,rotation:0}):this._basicCornerExtraRounded({x:t,y:e,size:i,rotation:Math.PI/2}):this._basicCornerExtraRounded({x:t,y:e,size:i,rotation:-Math.PI/2}):this._basicCornersRounded({x:t,y:e,size:i,rotation:Math.PI/2})}}const a={dot:\"dot\",square:\"square\",extraRounded:\"extra-rounded\"},h=Object.values(a);class d{constructor({svg:t,type:e,window:i}){this._svg=t,this._type=e,this._window=i}draw(t,e,i,r){let n;switch(this._type){case a.square:n=this._drawSquare;break;case a.extraRounded:n=this._drawExtraRounded;break;default:n=this._drawDot}n.call(this,{x:t,y:e,size:i,rotation:r})}_rotateFigure({x:t,y:e,size:i,rotation:r=0,draw:n}){var o;const s=t+i/2,a=e+i/2;n(),null===(o=this._element)||void 0===o||o.setAttribute(\"transform\",`rotate(${180*r/Math.PI},${s},${a})`)}_basicDot(t){const{size:e,x:i,y:r}=t,n=e/7;this._rotateFigure(Object.assign(Object.assign({},t),{draw:()=>{this._element=this._window.document.createElementNS(\"http://www.w3.org/2000/svg\",\"path\"),this._element.setAttribute(\"clip-rule\",\"evenodd\"),this._element.setAttribute(\"d\",`M ${i+e/2} ${r}a ${e/2} ${e/2} 0 1 0 0.1 0zm 0 ${n}a ${e/2-n} ${e/2-n} 0 1 1 -0.1 0Z`)}}))}_basicSquare(t){const{size:e,x:i,y:r}=t,n=e/7;this._rotateFigure(Object.assign(Object.assign({},t),{draw:()=>{this._element=this._window.document.createElementNS(\"http://www.w3.org/2000/svg\",\"path\"),this._element.setAttribute(\"clip-rule\",\"evenodd\"),this._element.setAttribute(\"d\",`M ${i} ${r}v ${e}h ${e}v `+-e+\"z\"+`M ${i+n} ${r+n}h `+(e-2*n)+\"v \"+(e-2*n)+\"h \"+(2*n-e)+\"z\")}}))}_basicExtraRounded(t){const{size:e,x:i,y:r}=t,n=e/7;this._rotateFigure(Object.assign(Object.assign({},t),{draw:()=>{this._element=this._window.document.createElementNS(\"http://www.w3.org/2000/svg\",\"path\"),this._element.setAttribute(\"clip-rule\",\"evenodd\"),this._element.setAttribute(\"d\",`M ${i} ${r+2.5*n}v `+2*n+`a ${2.5*n} ${2.5*n}, 0, 0, 0, ${2.5*n} ${2.5*n}h `+2*n+`a ${2.5*n} ${2.5*n}, 0, 0, 0, ${2.5*n} ${2.5*-n}v `+-2*n+`a ${2.5*n} ${2.5*n}, 0, 0, 0, ${2.5*-n} ${2.5*-n}h `+-2*n+`a ${2.5*n} ${2.5*n}, 0, 0, 0, ${2.5*-n} ${2.5*n}`+`M ${i+2.5*n} ${r+n}h `+2*n+`a ${1.5*n} ${1.5*n}, 0, 0, 1, ${1.5*n} ${1.5*n}v `+2*n+`a ${1.5*n} ${1.5*n}, 0, 0, 1, ${1.5*-n} ${1.5*n}h `+-2*n+`a ${1.5*n} ${1.5*n}, 0, 0, 1, ${1.5*-n} ${1.5*-n}v `+-2*n+`a ${1.5*n} ${1.5*n}, 0, 0, 1, ${1.5*n} ${1.5*-n}`)}}))}_drawDot({x:t,y:e,size:i,rotation:r}){this._basicDot({x:t,y:e,size:i,rotation:r})}_drawSquare({x:t,y:e,size:i,rotation:r}){this._basicSquare({x:t,y:e,size:i,rotation:r})}_drawExtraRounded({x:t,y:e,size:i,rotation:r}){this._basicExtraRounded({x:t,y:e,size:i,rotation:r})}}const u={dot:\"dot\",square:\"square\"},c=Object.values(u);class l{constructor({svg:t,type:e,window:i}){this._svg=t,this._type=e,this._window=i}draw(t,e,i,r){let n;n=this._type===u.square?this._drawSquare:this._drawDot,n.call(this,{x:t,y:e,size:i,rotation:r})}_rotateFigure({x:t,y:e,size:i,rotation:r=0,draw:n}){var o;const s=t+i/2,a=e+i/2;n(),null===(o=this._element)||void 0===o||o.setAttribute(\"transform\",`rotate(${180*r/Math.PI},${s},${a})`)}_basicDot(t){const{size:e,x:i,y:r}=t;this._rotateFigure(Object.assign(Object.assign({},t),{draw:()=>{this._element=this._window.document.createElementNS(\"http://www.w3.org/2000/svg\",\"circle\"),this._element.setAttribute(\"cx\",String(i+e/2)),this._element.setAttribute(\"cy\",String(r+e/2)),this._element.setAttribute(\"r\",String(e/2))}}))}_basicSquare(t){const{size:e,x:i,y:r}=t;this._rotateFigure(Object.assign(Object.assign({},t),{draw:()=>{this._element=this._window.document.createElementNS(\"http://www.w3.org/2000/svg\",\"rect\"),this._element.setAttribute(\"x\",String(i)),this._element.setAttribute(\"y\",String(r)),this._element.setAttribute(\"width\",String(e)),this._element.setAttribute(\"height\",String(e))}}))}_drawDot({x:t,y:e,size:i,rotation:r}){this._basicDot({x:t,y:e,size:i,rotation:r})}_drawSquare({x:t,y:e,size:i,rotation:r}){this._basicSquare({x:t,y:e,size:i,rotation:r})}}const g=\"circle\",f=[[1,1,1,1,1,1,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,1,1,1,1,1,1]],w=[[0,0,0,0,0,0,0],[0,0,0,0,0,0,0],[0,0,1,1,1,0,0],[0,0,1,1,1,0,0],[0,0,1,1,1,0,0],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]];class p{constructor(t,e){this._roundSize=t=>this._options.dotsOptions.roundSize?Math.floor(t):t,this._window=e,this._element=this._window.document.createElementNS(\"http://www.w3.org/2000/svg\",\"svg\"),this._element.setAttribute(\"width\",String(t.width)),this._element.setAttribute(\"height\",String(t.height)),this._element.setAttribute(\"xmlns:xlink\",\"http://www.w3.org/1999/xlink\"),t.dotsOptions.roundSize||this._element.setAttribute(\"shape-rendering\",\"crispEdges\"),this._element.setAttribute(\"viewBox\",`0 0 ${t.width} ${t.height}`),this._defs=this._window.document.createElementNS(\"http://www.w3.org/2000/svg\",\"defs\"),this._element.appendChild(this._defs),this._imageUri=t.image,this._instanceId=p.instanceCount++,this._options=t}get width(){return this._options.width}get height(){return this._options.height}getElement(){return this._element}async drawQR(t){const e=t.getModuleCount(),i=Math.min(this._options.width,this._options.height)-2*this._options.margin,r=this._options.shape===g?i/Math.sqrt(2):i,n=this._roundSize(r/e);let s={hideXDots:0,hideYDots:0,width:0,height:0};if(this._qr=t,this._options.image){if(await this.loadImage(),!this._image)return;const{imageOptions:t,qrOptions:i}=this._options,r=t.imageSize*o[i.errorCorrectionLevel],a=Math.floor(r*e*e);s=function({originalHeight:t,originalWidth:e,maxHiddenDots:i,maxHiddenAxisDots:r,dotSize:n}){const o={x:0,y:0},s={x:0,y:0};if(t<=0||e<=0||i<=0||n<=0)return{height:0,width:0,hideYDots:0,hideXDots:0};const a=t/e;return o.x=Math.floor(Math.sqrt(i/a)),o.x<=0&&(o.x=1),r&&ri||r&&r{var r,n,o,a,h,d;return!(this._options.imageOptions.hideBackgroundDots&&t>=(e-s.hideYDots)/2&&t<(e+s.hideYDots)/2&&i>=(e-s.hideXDots)/2&&i<(e+s.hideXDots)/2||(null===(r=f[t])||void 0===r?void 0:r[i])||(null===(n=f[t-e+7])||void 0===n?void 0:n[i])||(null===(o=f[t])||void 0===o?void 0:o[i-e+7])||(null===(a=w[t])||void 0===a?void 0:a[i])||(null===(h=w[t-e+7])||void 0===h?void 0:h[i])||(null===(d=w[t])||void 0===d?void 0:d[i-e+7]))})),this.drawCorners(),this._options.image&&await this.drawImage({width:s.width,height:s.height,count:e,dotSize:n})}drawBackground(){var t,e,i;const r=this._element,n=this._options;if(r){const r=null===(t=n.backgroundOptions)||void 0===t?void 0:t.gradient,o=null===(e=n.backgroundOptions)||void 0===e?void 0:e.color;let s=n.height,a=n.width;if(r||o){const t=this._window.document.createElementNS(\"http://www.w3.org/2000/svg\",\"rect\");this._backgroundClipPath=this._window.document.createElementNS(\"http://www.w3.org/2000/svg\",\"clipPath\"),this._backgroundClipPath.setAttribute(\"id\",`clip-path-background-color-${this._instanceId}`),this._defs.appendChild(this._backgroundClipPath),(null===(i=n.backgroundOptions)||void 0===i?void 0:i.round)&&(s=a=Math.min(n.width,n.height),t.setAttribute(\"rx\",String(s/2*n.backgroundOptions.round))),t.setAttribute(\"x\",String(this._roundSize((n.width-a)/2))),t.setAttribute(\"y\",String(this._roundSize((n.height-s)/2))),t.setAttribute(\"width\",String(a)),t.setAttribute(\"height\",String(s)),this._backgroundClipPath.appendChild(t),this._createColor({options:r,color:o,additionalRotation:0,x:0,y:0,height:n.height,width:n.width,name:`background-color-${this._instanceId}`})}}}drawDots(t){var e,i;if(!this._qr)throw\"QR code is not defined\";const r=this._options,n=this._qr.getModuleCount();if(n>r.width||n>r.height)throw\"The canvas is too small.\";const o=Math.min(r.width,r.height)-2*r.margin,a=r.shape===g?o/Math.sqrt(2):o,h=this._roundSize(a/n),d=this._roundSize((r.width-n*h)/2),u=this._roundSize((r.height-n*h)/2),c=new s({svg:this._element,type:r.dotsOptions.type,window:this._window});this._dotsClipPath=this._window.document.createElementNS(\"http://www.w3.org/2000/svg\",\"clipPath\"),this._dotsClipPath.setAttribute(\"id\",`clip-path-dot-color-${this._instanceId}`),this._defs.appendChild(this._dotsClipPath),this._createColor({options:null===(e=r.dotsOptions)||void 0===e?void 0:e.gradient,color:r.dotsOptions.color,additionalRotation:0,x:0,y:0,height:r.height,width:r.width,name:`dot-color-${this._instanceId}`});for(let e=0;e!(r+i<0||e+o<0||r+i>=n||e+o>=n)&&!(t&&!t(e+o,r+i))&&!!this._qr&&this._qr.isDark(e+o,r+i))),c._element&&this._dotsClipPath&&this._dotsClipPath.appendChild(c._element));if(r.shape===g){const t=this._roundSize((o/h-n)/2),e=n+2*t,i=d-t*h,r=u-t*h,s=[],a=this._roundSize(e/2);for(let i=0;i=t-1&&i<=e-t&&r>=t-1&&r<=e-t||Math.sqrt((i-a)*(i-a)+(r-a)*(r-a))>a?s[i][r]=0:s[i][r]=this._qr.isDark(r-2*t<0?r:r>=n?r-2*t:r-t,i-2*t<0?i:i>=n?i-2*t:i-t)?1:0}for(let t=0;t{var r;return!!(null===(r=s[t+i])||void 0===r?void 0:r[n+e])})),c._element&&this._dotsClipPath&&this._dotsClipPath.appendChild(c._element))}}drawCorners(){if(!this._qr)throw\"QR code is not defined\";const t=this._element,e=this._options;if(!t)throw\"Element code is not defined\";const i=this._qr.getModuleCount(),r=Math.min(e.width,e.height)-2*e.margin,n=e.shape===g?r/Math.sqrt(2):r,o=this._roundSize(n/i),a=7*o,u=3*o,p=this._roundSize((e.width-i*o)/2),v=this._roundSize((e.height-i*o)/2);[[0,0,0],[1,0,Math.PI/2],[0,1,-Math.PI/2]].forEach((([t,r,n])=>{var g,_,m,b,y,x,S,C,A,M,$,O,D,z;const k=p+t*o*(i-7),B=v+r*o*(i-7);let P=this._dotsClipPath,I=this._dotsClipPath;if(((null===(g=e.cornersSquareOptions)||void 0===g?void 0:g.gradient)||(null===(_=e.cornersSquareOptions)||void 0===_?void 0:_.color))&&(P=this._window.document.createElementNS(\"http://www.w3.org/2000/svg\",\"clipPath\"),P.setAttribute(\"id\",`clip-path-corners-square-color-${t}-${r}-${this._instanceId}`),this._defs.appendChild(P),this._cornersSquareClipPath=this._cornersDotClipPath=I=P,this._createColor({options:null===(m=e.cornersSquareOptions)||void 0===m?void 0:m.gradient,color:null===(b=e.cornersSquareOptions)||void 0===b?void 0:b.color,additionalRotation:n,x:k,y:B,height:a,width:a,name:`corners-square-color-${t}-${r}-${this._instanceId}`})),(null===(y=e.cornersSquareOptions)||void 0===y?void 0:y.type)&&h.includes(e.cornersSquareOptions.type)){const t=new d({svg:this._element,type:e.cornersSquareOptions.type,window:this._window});t.draw(k,B,a,n),t._element&&P&&P.appendChild(t._element)}else{const t=new s({svg:this._element,type:(null===(x=e.cornersSquareOptions)||void 0===x?void 0:x.type)||e.dotsOptions.type,window:this._window});for(let e=0;e{var n;return!!(null===(n=f[e+r])||void 0===n?void 0:n[i+t])})),t._element&&P&&P.appendChild(t._element))}if(((null===(C=e.cornersDotOptions)||void 0===C?void 0:C.gradient)||(null===(A=e.cornersDotOptions)||void 0===A?void 0:A.color))&&(I=this._window.document.createElementNS(\"http://www.w3.org/2000/svg\",\"clipPath\"),I.setAttribute(\"id\",`clip-path-corners-dot-color-${t}-${r}-${this._instanceId}`),this._defs.appendChild(I),this._cornersDotClipPath=I,this._createColor({options:null===(M=e.cornersDotOptions)||void 0===M?void 0:M.gradient,color:null===($=e.cornersDotOptions)||void 0===$?void 0:$.color,additionalRotation:n,x:k+2*o,y:B+2*o,height:u,width:u,name:`corners-dot-color-${t}-${r}-${this._instanceId}`})),(null===(O=e.cornersDotOptions)||void 0===O?void 0:O.type)&&c.includes(e.cornersDotOptions.type)){const t=new l({svg:this._element,type:e.cornersDotOptions.type,window:this._window});t.draw(k+2*o,B+2*o,u,n),t._element&&I&&I.appendChild(t._element)}else{const t=new s({svg:this._element,type:(null===(D=e.cornersDotOptions)||void 0===D?void 0:D.type)||e.dotsOptions.type,window:this._window});for(let e=0;e{var n;return!!(null===(n=w[e+r])||void 0===n?void 0:n[i+t])})),t._element&&I&&I.appendChild(t._element))}}))}loadImage(){return new Promise(((t,e)=>{var i;const r=this._options;if(!r.image)return e(\"Image is not defined\");if(null===(i=r.nodeCanvas)||void 0===i?void 0:i.loadImage)r.nodeCanvas.loadImage(r.image).then((e=>{var i,n;if(this._image=e,this._options.imageOptions.saveAsBlob){const t=null===(i=r.nodeCanvas)||void 0===i?void 0:i.createCanvas(this._image.width,this._image.height);null===(n=null==t?void 0:t.getContext(\"2d\"))||void 0===n||n.drawImage(e,0,0),this._imageUri=null==t?void 0:t.toDataURL()}t()})).catch(e);else{const e=new this._window.Image;\"string\"==typeof r.imageOptions.crossOrigin&&(e.crossOrigin=r.imageOptions.crossOrigin),this._image=e,e.onload=async()=>{this._options.imageOptions.saveAsBlob&&(this._imageUri=await async function(t,e){return new Promise((i=>{const r=new e.XMLHttpRequest;r.onload=function(){const t=new e.FileReader;t.onloadend=function(){i(t.result)},t.readAsDataURL(r.response)},r.open(\"GET\",t),r.responseType=\"blob\",r.send()}))}(r.image||\"\",this._window)),t()},e.src=r.image}}))}async drawImage({width:t,height:e,count:i,dotSize:r}){const n=this._options,o=this._roundSize((n.width-i*r)/2),s=this._roundSize((n.height-i*r)/2),a=o+this._roundSize(n.imageOptions.margin+(i*r-t)/2),h=s+this._roundSize(n.imageOptions.margin+(i*r-e)/2),d=t-2*n.imageOptions.margin,u=e-2*n.imageOptions.margin,c=this._window.document.createElementNS(\"http://www.w3.org/2000/svg\",\"image\");c.setAttribute(\"href\",this._imageUri||\"\"),c.setAttribute(\"x\",String(a)),c.setAttribute(\"y\",String(h)),c.setAttribute(\"width\",`${d}px`),c.setAttribute(\"height\",`${u}px`),this._element.appendChild(c)}_createColor({options:t,color:e,additionalRotation:i,x:r,y:n,height:o,width:s,name:a}){const h=s>o?s:o,d=this._window.document.createElementNS(\"http://www.w3.org/2000/svg\",\"rect\");if(d.setAttribute(\"x\",String(r)),d.setAttribute(\"y\",String(n)),d.setAttribute(\"height\",String(o)),d.setAttribute(\"width\",String(s)),d.setAttribute(\"clip-path\",`url('#clip-path-${a}')`),t){let e;if(\"radial\"===t.type)e=this._window.document.createElementNS(\"http://www.w3.org/2000/svg\",\"radialGradient\"),e.setAttribute(\"id\",a),e.setAttribute(\"gradientUnits\",\"userSpaceOnUse\"),e.setAttribute(\"fx\",String(r+s/2)),e.setAttribute(\"fy\",String(n+o/2)),e.setAttribute(\"cx\",String(r+s/2)),e.setAttribute(\"cy\",String(n+o/2)),e.setAttribute(\"r\",String(h/2));else{const h=((t.rotation||0)+i)%(2*Math.PI),d=(h+2*Math.PI)%(2*Math.PI);let u=r+s/2,c=n+o/2,l=r+s/2,g=n+o/2;d>=0&&d<=.25*Math.PI||d>1.75*Math.PI&&d<=2*Math.PI?(u-=s/2,c-=o/2*Math.tan(h),l+=s/2,g+=o/2*Math.tan(h)):d>.25*Math.PI&&d<=.75*Math.PI?(c-=o/2,u-=s/2/Math.tan(h),g+=o/2,l+=s/2/Math.tan(h)):d>.75*Math.PI&&d<=1.25*Math.PI?(u+=s/2,c+=o/2*Math.tan(h),l-=s/2,g-=o/2*Math.tan(h)):d>1.25*Math.PI&&d<=1.75*Math.PI&&(c+=o/2,u+=s/2/Math.tan(h),g-=o/2,l-=s/2/Math.tan(h)),e=this._window.document.createElementNS(\"http://www.w3.org/2000/svg\",\"linearGradient\"),e.setAttribute(\"id\",a),e.setAttribute(\"gradientUnits\",\"userSpaceOnUse\"),e.setAttribute(\"x1\",String(Math.round(u))),e.setAttribute(\"y1\",String(Math.round(c))),e.setAttribute(\"x2\",String(Math.round(l))),e.setAttribute(\"y2\",String(Math.round(g)))}t.colorStops.forEach((({offset:t,color:i})=>{const r=this._window.document.createElementNS(\"http://www.w3.org/2000/svg\",\"stop\");r.setAttribute(\"offset\",100*t+\"%\"),r.setAttribute(\"stop-color\",i),e.appendChild(r)})),d.setAttribute(\"fill\",`url('#${a}')`),this._defs.appendChild(e)}else e&&d.setAttribute(\"fill\",e);this._element.appendChild(d)}}p.instanceCount=0;const v=p,_=\"canvas\",m={};for(let t=0;t<=40;t++)m[t]=t;const b={type:_,shape:\"square\",width:300,height:300,data:\"\",margin:0,qrOptions:{typeNumber:m[0],mode:void 0,errorCorrectionLevel:\"Q\"},imageOptions:{saveAsBlob:!0,hideBackgroundDots:!0,imageSize:.4,crossOrigin:void 0,margin:0},dotsOptions:{type:\"square\",color:\"#000\",roundSize:!0},backgroundOptions:{round:0,color:\"#fff\"}};function y(t){const e=Object.assign({},t);if(!e.colorStops||!e.colorStops.length)throw\"Field 'colorStops' is required in gradient\";return e.rotation?e.rotation=Number(e.rotation):e.rotation=0,e.colorStops=e.colorStops.map((t=>Object.assign(Object.assign({},t),{offset:Number(t.offset)}))),e}function x(t){const e=Object.assign({},t);return e.width=Number(e.width),e.height=Number(e.height),e.margin=Number(e.margin),e.imageOptions=Object.assign(Object.assign({},e.imageOptions),{hideBackgroundDots:Boolean(e.imageOptions.hideBackgroundDots),imageSize:Number(e.imageOptions.imageSize),margin:Number(e.imageOptions.margin)}),e.margin>Math.min(e.width,e.height)&&(e.margin=Math.min(e.width,e.height)),e.dotsOptions=Object.assign({},e.dotsOptions),e.dotsOptions.gradient&&(e.dotsOptions.gradient=y(e.dotsOptions.gradient)),e.cornersSquareOptions&&(e.cornersSquareOptions=Object.assign({},e.cornersSquareOptions),e.cornersSquareOptions.gradient&&(e.cornersSquareOptions.gradient=y(e.cornersSquareOptions.gradient))),e.cornersDotOptions&&(e.cornersDotOptions=Object.assign({},e.cornersDotOptions),e.cornersDotOptions.gradient&&(e.cornersDotOptions.gradient=y(e.cornersDotOptions.gradient))),e.backgroundOptions&&(e.backgroundOptions=Object.assign({},e.backgroundOptions),e.backgroundOptions.gradient&&(e.backgroundOptions.gradient=y(e.backgroundOptions.gradient))),e}var S=i(873),C=i.n(S);function A(t){if(!t)throw new Error(\"Extension must be defined\");\".\"===t[0]&&(t=t.substring(1));const e={bmp:\"image/bmp\",gif:\"image/gif\",ico:\"image/vnd.microsoft.icon\",jpeg:\"image/jpeg\",jpg:\"image/jpeg\",png:\"image/png\",svg:\"image/svg+xml\",tif:\"image/tiff\",tiff:\"image/tiff\",webp:\"image/webp\",pdf:\"application/pdf\"}[t.toLowerCase()];if(!e)throw new Error(`Extension \"${t}\" is not supported`);return e}class M{constructor(t){(null==t?void 0:t.jsdom)?this._window=new t.jsdom(\"\",{resources:\"usable\"}).window:this._window=window,this._options=t?x(e(b,t)):b,this.update()}static _clearContainer(t){t&&(t.innerHTML=\"\")}_setupSvg(){if(!this._qr)return;const t=new v(this._options,this._window);this._svg=t.getElement(),this._svgDrawingPromise=t.drawQR(this._qr).then((()=>{var e;this._svg&&(null===(e=this._extension)||void 0===e||e.call(this,t.getElement(),this._options))}))}_setupCanvas(){var t,e;this._qr&&((null===(t=this._options.nodeCanvas)||void 0===t?void 0:t.createCanvas)?(this._nodeCanvas=this._options.nodeCanvas.createCanvas(this._options.width,this._options.height),this._nodeCanvas.width=this._options.width,this._nodeCanvas.height=this._options.height):(this._domCanvas=document.createElement(\"canvas\"),this._domCanvas.width=this._options.width,this._domCanvas.height=this._options.height),this._setupSvg(),this._canvasDrawingPromise=null===(e=this._svgDrawingPromise)||void 0===e?void 0:e.then((()=>{var t;if(!this._svg)return;const e=this._svg,i=(new this._window.XMLSerializer).serializeToString(e),r=btoa(i),n=`data:${A(\"svg\")};base64,${r}`;if(null===(t=this._options.nodeCanvas)||void 0===t?void 0:t.loadImage)return this._options.nodeCanvas.loadImage(n).then((t=>{var e,i;t.width=this._options.width,t.height=this._options.height,null===(i=null===(e=this._nodeCanvas)||void 0===e?void 0:e.getContext(\"2d\"))||void 0===i||i.drawImage(t,0,0)}));{const t=new this._window.Image;return new Promise((e=>{t.onload=()=>{var i,r;null===(r=null===(i=this._domCanvas)||void 0===i?void 0:i.getContext(\"2d\"))||void 0===r||r.drawImage(t,0,0),e()},t.src=n}))}})))}async _getElement(t=\"png\"){if(!this._qr)throw\"QR code is empty\";return\"svg\"===t.toLowerCase()?(this._svg&&this._svgDrawingPromise||this._setupSvg(),await this._svgDrawingPromise,this._svg):((this._domCanvas||this._nodeCanvas)&&this._canvasDrawingPromise||this._setupCanvas(),await this._canvasDrawingPromise,this._domCanvas||this._nodeCanvas)}update(t){M._clearContainer(this._container),this._options=t?x(e(this._options,t)):this._options,this._options.data&&(this._qr=C()(this._options.qrOptions.typeNumber,this._options.qrOptions.errorCorrectionLevel),this._qr.addData(this._options.data,this._options.qrOptions.mode||function(t){switch(!0){case/^[0-9]*$/.test(t):return\"Numeric\";case/^[0-9A-Z $%*+\\-./:]*$/.test(t):return\"Alphanumeric\";default:return\"Byte\"}}(this._options.data)),this._qr.make(),this._options.type===_?this._setupCanvas():this._setupSvg(),this.append(this._container))}append(t){if(t){if(\"function\"!=typeof t.appendChild)throw\"Container should be a single DOM node\";this._options.type===_?this._domCanvas&&t.appendChild(this._domCanvas):this._svg&&t.appendChild(this._svg),this._container=t}}applyExtension(t){if(!t)throw\"Extension function should be defined.\";this._extension=t,this.update()}deleteExtension(){this._extension=void 0,this.update()}async getRawData(t=\"png\"){if(!this._qr)throw\"QR code is empty\";const e=await this._getElement(t),i=A(t);if(!e)return null;if(\"svg\"===t.toLowerCase()){const t=`\\r\\n${(new this._window.XMLSerializer).serializeToString(e)}`;return\"undefined\"==typeof Blob||this._options.jsdom?Buffer.from(t):new Blob([t],{type:i})}return new Promise((t=>{const r=e;if(\"toBuffer\"in r)if(\"image/png\"===i)t(r.toBuffer(i));else if(\"image/jpeg\"===i)t(r.toBuffer(i));else{if(\"application/pdf\"!==i)throw Error(\"Unsupported extension\");t(r.toBuffer(i))}else\"toBlob\"in r&&r.toBlob(t,i,1)}))}async download(t){if(!this._qr)throw\"QR code is empty\";if(\"undefined\"==typeof Blob)throw\"Cannot download in Node.js, call getRawData instead.\";let e=\"png\",i=\"qr\";\"string\"==typeof t?(e=t,console.warn(\"Extension is deprecated as argument for 'download' method, please pass object { name: '...', extension: '...' } as argument\")):\"object\"==typeof t&&null!==t&&(t.name&&(i=t.name),t.extension&&(e=t.extension));const r=await this._getElement(e);if(r)if(\"svg\"===e.toLowerCase()){let t=(new XMLSerializer).serializeToString(r);t='\\r\\n'+t,n(`data:${A(e)};charset=utf-8,${encodeURIComponent(t)}`,`${i}.svg`)}else n(r.toDataURL(A(e)),`${i}.${e}`)}}const $=M})(),r.default})()));\n//# sourceMappingURL=qr-code-styling.js.map","import React from 'react';\nimport { IconButton as MuiIconButton } from '@mui/material';\nimport withStyles from '@mui/styles/withStyles';\n\nconst IconButton = withStyles((theme: any) => ({\n root: (props: any) =>\n props.variant === 'outlined' && {\n border: `1px solid ${theme.palette.grey[400]}`,\n },\n}))((props: any) => );\n\nexport default IconButton;\n","import QRCodeStyling from 'qr-code-styling';\nimport { Space } from './Types/Space';\n\nconst [width, height] = [600, 800];\nconst [left, top] = [(window.innerWidth - width) / 2, (window.innerHeight - height) / 2];\nconst popUpOptions = `status=1,width=${width},height=${height},top=${top},left=${left}`;\n\nconst urlWithUtms = (source: any, lang: any) => {\n const url = new URL(window.location.href);\n\n url.searchParams.set('utm_source', source);\n url.searchParams.set('utm_medium', 'share');\n url.searchParams.set('utm_campaign', 'product');\n if (lang) {\n url.searchParams.set('lang', lang);\n }\n\n return url.href;\n};\n\nconst buildUrl = (source: any, lang: any) => {\n return encodeURIComponent(urlWithUtms(source, lang));\n};\n\nexport const shareFacebook = (lang?: string) => {\n window.open(\n `https://www.facebook.com/sharer/sharer.php?u=${buildUrl('facebook', lang)}`,\n 'Facebook share',\n popUpOptions,\n );\n};\n\nexport const shareLinkedIn = (lang?: string) => {\n window.open(\n `https://www.linkedin.com/sharing/share-offsite/?url=${buildUrl('linkedin', lang)}`,\n 'LinkedIn share',\n popUpOptions,\n );\n};\n\nexport const shareX = (generateContent: any = null, lang?: string) => {\n const url = buildUrl('x', lang);\n const content = generateContent ? generateContent(url) : url;\n\n window.open(`https://twitter.com/intent/tweet?text=${content}`, 'X share', popUpOptions);\n};\n\nexport const generateQrCode = (\n space: Space,\n { size = 300, lang = null, isBlackAndWhite = false },\n) => {\n const dotsColor = isBlackAndWhite ? '#000' : space.custom_colors.primary_color;\n const cornerColor = isBlackAndWhite ? '#000' : space.custom_colors.secondary_color;\n\n const qrCode = new QRCodeStyling({\n width: size,\n height: size,\n backgroundOptions: {\n color: '#ffff',\n },\n dotsOptions: {\n type: 'rounded',\n color: dotsColor || undefined,\n },\n cornersSquareOptions: {\n color: cornerColor || undefined,\n type: 'extra-rounded',\n },\n imageOptions: {\n imageSize: 0.5,\n margin: 6,\n },\n data: urlWithUtms('qr', lang),\n });\n\n return qrCode;\n};\n","import React, { useState, useRef, useEffect } from 'react';\nimport {\n Button,\n Grid2 as Grid,\n Typography,\n Menu,\n MenuItem,\n ListItemIcon,\n Box,\n Switch,\n FormControl,\n FormControlLabel,\n} from '@mui/material';\nimport {\n Facebook as FacebookIcon,\n LinkedIn as LinkedInIcon,\n QrCode2 as QrCode2Icon,\n} from '@mui/icons-material';\nimport XIcon from '@mui/icons-material/X';\nimport { FormattedMessage, useIntl } from 'react-intl';\nimport QRCodeStyling from 'qr-code-styling';\nimport { styled } from '@mui/material/styles';\n\nimport IconButton from '../../../DesignSystem/IconButton';\nimport Dialog from '../../../DesignSystem/Dialog';\nimport {\n shareFacebook,\n shareLinkedIn,\n shareX,\n generateQrCode,\n} from '../../../../Utils/SocialShare';\nimport { Icons } from '../../../../Themes';\nimport Analytics from '../../../../Services/AnalyticsService';\nimport useWidth from '../../../../Hooks/useWidth';\nimport useSpace from '../../../../Hooks/useSpace';\nimport CustomIcon from '../../../DesignSystem/CustomIcon';\n\nconst StyledIconButton = styled(IconButton)(({ theme }: any) => ({\n fontSize: 0,\n padding: 0,\n border: `1px solid ${theme.palette.primary.main}`,\n height: theme.spacing(4.5),\n width: theme.spacing(4.5),\n}));\n\ninterface ShareItProps {\n postId: number | string;\n postTitle: string | null;\n postType: string;\n}\n\nfunction ShareIt({ postId, postTitle, postType }: ShareItProps) {\n const { space } = useSpace();\n const intl = useIntl();\n const lang = intl.locale;\n const isSmallScreenSize = useWidth('down', 'sm');\n const [shareMenuAnchorEl, setShareMenuAnchorEl] = useState(null);\n const [qrCodeDialogOpen, setQrCodeDialogOpen] = useState(false);\n const [isBlackAndWhite, setIsBlackAndWhite] = useState(false);\n const qrCodeRef = useRef(null);\n\n const trackShareAction = (Channel: any) => {\n Analytics.track('Post', 'Share Content', `Shared post via ${Channel}`, {\n 'Post ID': postId,\n 'Post Type': postType,\n });\n };\n\n const onClickShareFacebook = () => {\n shareFacebook(lang);\n\n trackShareAction('Facebook');\n };\n\n const onClickShareLinkedIn = () => {\n shareLinkedIn(lang);\n\n trackShareAction('LinkedIn');\n };\n\n const onClickShareX = () => {\n if (['article', 'event', 'study', 'idea', 'ideas_request'].includes(postType)) {\n shareX((url: any) => `${postTitle} ${url}`, lang);\n } else {\n shareX((url: any) => url, lang);\n }\n\n trackShareAction('X');\n };\n\n const openQRCodeModal = () => {\n Analytics.track('Post', 'Generate QR Code', `Generated QR code for post ${postId}`, {\n 'Post ID': postId,\n 'Post Type': postType,\n });\n setQrCodeDialogOpen(true);\n };\n\n const showQRCode = (qrCode = generateQrCode(space, { isBlackAndWhite })) => {\n if (qrCodeRef.current) {\n QRCodeStyling._clearContainer(qrCodeRef.current);\n qrCode.append(qrCodeRef.current);\n }\n };\n\n useEffect(() => {\n const qrCode = generateQrCode(space, { isBlackAndWhite });\n showQRCode(qrCode);\n }, [isBlackAndWhite]);\n\n const downloadQRCode = () => {\n const qrCode = generateQrCode(space, { isBlackAndWhite, size: 500 });\n qrCode.download();\n };\n\n const handleShareMenuClick = (event: any) => {\n setShareMenuAnchorEl(event.currentTarget);\n };\n\n const handleShareMenuClose = () => {\n setShareMenuAnchorEl(null);\n };\n\n const renderShareItMenu = () => {\n return (\n \n \n \n \n\n \n {\n onClickShareFacebook();\n handleShareMenuClose();\n }}\n aria-label=\"Share on Facebook\"\n >\n \n \n \n\n Facebook\n \n\n {\n onClickShareX();\n handleShareMenuClose();\n }}\n aria-label=\"Share on X (Twitter)\"\n >\n \n \n \n\n X (Twitter)\n \n\n {\n onClickShareLinkedIn();\n handleShareMenuClose();\n }}\n aria-label=\"Share on LinkedIn\"\n >\n \n \n \n\n LinkedIn\n \n\n {\n openQRCodeModal();\n handleShareMenuClose();\n }}\n aria-label=\"QR code\"\n >\n \n \n \n\n \n \n \n \n \n \n );\n };\n\n const renderShareItButtons = () => {\n return (\n \n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n );\n };\n\n return (\n \n setQrCodeDialogOpen(false)}\n dismissible\n actions={\n \n }\n >\n {\n if (qrCodeRef.current !== element) {\n qrCodeRef.current = element;\n showQRCode();\n }\n }}\n />\n
\n \n setIsBlackAndWhite(!isBlackAndWhite)}\n />\n }\n label={intl.formatMessage({ id: 'POSTS.SHOW.QR_CODE.BLACK_AND_WHITE' })}\n />\n \n \n {isSmallScreenSize ? renderShareItMenu() : renderShareItButtons()}\n
\n );\n}\n\nexport default ShareIt;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { List, ListItem, ListItemButton, ListItemText, Typography, Divider } from '@mui/material';\nimport { FormattedMessage } from 'react-intl';\n\nimport { PostStatuses } from '../../../../../Utils/Types';\nimport Dialog from '../../../../DesignSystem/Dialog';\nimport StatusBadge from '../../../../DesignSystem/StatusBadge';\n\ninterface PostStatusHelpDialogProps {\n currentStatus: string;\n statuses: any[];\n open: boolean;\n onClose: () => void;\n}\n\nfunction PostStatusHelpDialog({\n currentStatus,\n statuses,\n open,\n onClose,\n}: PostStatusHelpDialogProps) {\n return (\n }\n disableGutters\n >\n \n {statuses\n .map((status: any) => (\n \n \n }\n secondary={\n \n }\n />\n \n \n ))\n .reduce((prev: any, curr: any) => [\n prev,\n ,\n curr,\n ])}\n \n \n );\n}\n\nPostStatusHelpDialog.propTypes = {\n statuses: PropTypes.arrayOf(\n PropTypes.shape({\n content: PropTypes.string.isRequired,\n keyword: PropTypes.oneOf(Object.values(PostStatuses)).isRequired,\n title: PropTypes.string.isRequired,\n }),\n ).isRequired,\n open: PropTypes.bool.isRequired,\n onClose: PropTypes.func.isRequired,\n};\n\nexport default PostStatusHelpDialog;\n","import React, { useState } from 'react';\nimport PostStatusHelpDialog from './PostStatusHelpDialog';\nimport StatusBadge from '../../../DesignSystem/StatusBadge';\nimport useApiQuery from '../../../../Hooks/useApiQuery';\nimport queriesConfig from '../../../../Services/queriesConfig';\n\nfunction PostStatus({ post }: any) {\n const { data: statuses = [] } = useApiQuery({\n query: queriesConfig.getPostStatus(post.id),\n });\n\n const [isDetailsDialogOpen, setDetailsDialogOpen] = useState(false);\n\n const handleDialogOpen = () => {\n setDetailsDialogOpen(true);\n };\n\n const handleDetailsDialogClose = () => {\n setDetailsDialogOpen(false);\n };\n\n return (\n <>\n {statuses && (\n \n )}\n\n {!!statuses.length && (\n \n )}\n \n );\n}\n\nexport default PostStatus;\n","import React from 'react';\nimport { Box, Container, Grid2 as Grid, Stack, Typography } from '@mui/material';\n\nimport CardHeader from '../../Components/DesignSystem/CardHeader';\nimport BaseImage from '../../Components/DesignSystem/BaseImage';\nimport MenuActions from '../../Components/DesignSystem/MenuActions';\nimport Hidden from '../../Components/DesignSystem/Hidden';\nimport PostTagsBuilder from '../../Components/Posts/PostTagsBuilder';\nimport { CloudinaryConfig, cloudinaryImageUrl } from '../../Services/Cloudinary';\nimport { Categories } from '../../Utils/Types/Posts';\nimport { isFolder } from '../../Utils/Post';\nimport PostIndicators from '../../Components/Posts/Shared/PostIndicators';\nimport PostStatus from '../../Components/Posts/Shared/PostStatus';\nimport actions from '../../Utils/Post/actions';\nimport AuditsLink from '../../Components/Posts/AuditsModal/AuditsLink';\n\ninterface PostHeaderProps {\n post: any;\n space: any;\n}\n\nfunction PostHeader({ post, space }: PostHeaderProps) {\n const hasImage = !!post.picture?.s3_key;\n const backgroundColor = isFolder(post.type) ? 'primary.light' : 'secondary.light';\n\n return (\n \n \n \n \n {!isFolder(post.type) && (\n \n }\n postId={post.id}\n alt=\"author avatar\"\n action={}\n />\n \n )}\n\n \n {/* that extra Stack is here to have the h1 before the h2 (WCAG purpose) */}\n \n {isFolder(post.type) && (\n \n \n \n )}\n \n {post.title}\n \n \n \n\n {post.problematic && (\n \n \n {post.problematic}\n \n \n )}\n\n \n\n \n {[...Categories.PARTICIPATION, ...Categories.MESSAGING].includes(post.type) && (\n \n \n \n )}\n\n \n \n \n \n \n\n {post.picture?.s3_key && (\n \n \n \n )}\n \n \n \n );\n}\n\nexport default PostHeader;\n","import React from 'react';\nimport { Box, Container, Grid2 as Grid } from '@mui/material';\nimport { styled } from '@mui/material/styles';\n\nimport PostBreadcrumbs from '../../Components/Posts/Breadcrumbs';\nimport Hidden from '../../Components/DesignSystem/Hidden';\nimport ShareIt from '../../Components/Posts/Shared/ShareIt';\nimport SubNavBar from '../../Components/SubNavBar';\nimport { PostCategories } from '../../Utils/Types';\nimport PostHeader from '../PostHeader';\nimport { Post } from '../../Utils/Types/Posts';\nimport useSpace from '../../Hooks/useSpace';\n\nconst PostSideContent = styled('div')(({ theme: { mixins, spacing } }: any) => ({\n position: 'sticky',\n top: `calc(${spacing(4)} + ${mixins.toolbar['@media (min-width:600px)'].minHeight * 2}px)`,\n willChange: 'transform', // render the sticky part in its own composite layer for performance\n marginBottom: spacing(1),\n}));\n\ninterface PostLayoutProps {\n post: Post;\n postMainContent: any;\n postSideContent?: any;\n stickyFooterButton?: any;\n}\n\nfunction PostLayout({\n post,\n postMainContent,\n postSideContent = null,\n stickyFooterButton = null,\n}: PostLayoutProps) {\n const { space } = useSpace();\n const isMessaging = PostCategories.MESSAGING.includes(post.type);\n\n const { title, id, type } = post;\n\n return (\n \n \n \n \n \n\n {!isMessaging && (\n \n \n \n )}\n \n \n }\n >\n \n\n \n \n {postMainContent}\n \n \n {postSideContent}\n \n \n \n\n {stickyFooterButton}\n \n \n );\n}\n\nexport default PostLayout;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { FormattedMessage, useIntl } from 'react-intl';\nimport { Button, Typography } from '@mui/material';\nimport LaunchIcon from '@mui/icons-material/Launch';\n\nimport CustomIcon from '../CustomIcon';\nimport EmptyState from '../EmptyState';\nimport { moment } from '../../../I18n';\nimport { Icons } from '../../../Themes';\n\nfunction EventUrlState({ startAt, endAt, url }: any) {\n const intl = useIntl();\n const future = moment(startAt).isAfter();\n const past = moment(endAt).isBefore();\n const isOngoing = !future && !past;\n\n let text = ;\n if (future) {\n const momentDefaultDate = intl.formatMessage({ id: 'MOMENT.DATE.DEFAULT' });\n text = (\n {chunks},\n }}\n />\n );\n } else if (past) {\n text = ;\n }\n\n return (\n }\n content={{text}}\n action={\n isOngoing ? (\n }\n title={intl.formatMessage({ id: 'BUTTONS.OPEN_IN_NEW_TAB' })}\n >\n \n \n ) : null\n }\n />\n );\n}\n\nEventUrlState.propTypes = {\n endAt: PropTypes.string.isRequired,\n startAt: PropTypes.string.isRequired,\n url: PropTypes.string.isRequired,\n};\n\nexport default EventUrlState;\n","type AttendancesType = 'attending' | 'declined';\ntype AttendancesTypeUppperCase = Uppercase;\n\nconst Attendances: Record = {\n ATTENDING: 'attending',\n DECLINED: 'declined',\n};\n\nexport default Attendances;\n","function t(){return t=Object.assign||function(t){for(var e=1;e=e?t:\"\"+Array(e+1-r.length).join(n)+t},$={s:h,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?\"+\":\"-\")+h(r,2,\"0\")+\":\"+h(i,2,\"0\")},m:function t(e,n){if(e.date(){const r=t[n];null!=r&&e.append(n,r)}),e.toString().replace(/\\+/g,\"%20\")}function s({startTime:t,endTime:e},n){const r=i[n];return{start:t.format(r),end:e.format(r)}}n.extend(r);const o=(e,r=!0)=>{const{start:i,end:a,duration:s}=e,o=function(t,e){if(null==t)return{};var n,r,i={},a=Object.keys(t);for(r=0;r=0||(i[n]=t[n]);return i}(e,[\"start\",\"end\",\"duration\"]),u=r?n(i).utc():n(i),c=a?r?n(a).utc():n(a):(()=>{if(e.allDay)return u.add(1,\"day\");if(s&&2==s.length){const t=Number(s[0]);return u.add(t,s[1])}return r?n().utc():n()})();return t({},o,{startTime:u,endTime:c})},u=t=>{const e=o(t),{start:n,end:r}=s(e,e.allDay?\"allDay\":\"dateTimeUTC\"),i={action:\"TEMPLATE\",text:e.title,details:e.description,location:e.location,trp:e.busy,dates:n+\"/\"+r,recur:e.rRule?\"RRULE:\"+e.rRule:void 0};return e.guests&&e.guests.length&&(i.add=e.guests.join()),`https://calendar.google.com/calendar/render?${a(i)}`},c=t=>{const e=o(t,!1),{start:n,end:r}=s(e,\"dateTimeLocal\");return`https://outlook.live.com/calendar/0/action/compose?${a({path:\"/calendar/action/compose\",rru:\"addevent\",startdt:n,enddt:r,subject:e.title,body:e.description,location:e.location,allday:e.allDay||!1})}`},l=t=>{const e=o(t,!1),{start:n,end:r}=s(e,\"dateTimeLocal\");return`https://outlook.live.com/calendar/0/deeplink/compose?${a({path:\"/calendar/action/compose\",rru:\"addevent\",startdt:n,enddt:r,subject:e.title,body:e.description,location:e.location,allday:e.allDay||!1})}`},d=t=>{const e=o(t,!1),{start:n,end:r}=s(e,\"dateTimeLocal\");return`https://outlook.office.com/calendar/0/action/compose?${a({path:\"/calendar/action/compose\",rru:\"addevent\",startdt:n,enddt:r,subject:e.title,body:e.description,location:e.location,allday:e.allDay||!1})}`},f=t=>{const e=o(t,!1),{start:n,end:r}=s(e,\"dateTimeLocal\");return`https://outlook.office.com/calendar/0/deeplink/compose?${a({path:\"/calendar/action/compose\",rru:\"addevent\",startdt:n,enddt:r,subject:e.title,body:e.description,location:e.location,allday:e.allDay||!1})}`},h=t=>{const e=o(t),{start:n,end:r}=s(e,e.allDay?\"allDay\":\"dateTimeUTC\");return`https://calendar.yahoo.com/?${a({v:60,title:e.title,st:n,et:r,desc:e.description,in_loc:e.location,dur:!!e.allDay&&\"allday\"})}`},$=t=>{const e=o(t),{start:n,end:r}=s(e,e.allDay?\"allDay\":\"dateTimeUTC\");return`https://calendar.aol.com/?${a({v:60,title:e.title,st:n,et:r,desc:e.description,in_loc:e.location,dur:!!e.allDay&&\"allday\"})}`},m=t=>{const e=o(t),n={subject:e.title,content:e.description,startTime:e.startTime.toISOString(),endTime:e.endTime.toISOString()};return e.guests&&e.guests.length&&(n.attendees=e.guests.join()),`https://teams.microsoft.com/l/meeting/new?${a(n)}`},y=t=>{const e=o(t),r=(e.description||\"\").replace(/,/gm,\",\").replace(/;/gm,\";\").replace(/\\r\\n/gm,\"\\n\").replace(/\\n/gm,\"\\\\n\").replace(/(\\\\n)[\\s\\t]+/gm,\"\\\\n\"),a=(e.location||\"\").replace(/,/gm,\",\").replace(/;/gm,\";\").replace(/\\r\\n/gm,\"\\n\").replace(/\\n/gm,\"\\\\n\").replace(/(\\\\n)[\\s\\t]+/gm,\"\\\\n\"),{start:u,end:c}=s(e,e.allDay?\"allDay\":\"dateTimeUTC\"),l=n(new Date).utc().format(i.dateTimeUTC),d=[{key:\"BEGIN\",value:\"VCALENDAR\"},{key:\"VERSION\",value:\"2.0\"},{key:\"PRODID\",value:e.title},{key:\"BEGIN\",value:\"VEVENT\"},{key:\"URL\",value:e.url},{key:\"DTSTART\",value:u},{key:\"DTEND\",value:c},{key:\"DTSTAMP\",value:l},...e.allDay?[{key:\"X-MICROSOFT-CDO-ALLDAYEVENT\",value:\"TRUE\"},{key:\"X-MICROSOFT-MSNCALENDAR-ALLDAYEVENT\",value:\"TRUE\"}]:[],{key:\"RRULE\",value:e.rRule},{key:\"SUMMARY\",value:e.title},{key:\"DESCRIPTION\",value:r},{key:\"LOCATION\",value:a},{key:\"ORGANIZER\",value:e.organizer},{key:\"STATUS\",value:e.status},{key:\"UID\",value:Math.floor(1e5*Math.random()).toString().replace(\".\",\"\")},{key:\"END\",value:\"VEVENT\"},{key:\"END\",value:\"VCALENDAR\"}];let f=\"\";return d.forEach(t=>{if(t.value)if(\"ORGANIZER\"==t.key){const e=t.value;f+=`${t.key};${encodeURIComponent(`CN=${e.name}:MAILTO:${e.email}\\r\\n`)}`}else f+=`${t.key}:${encodeURIComponent(`${t.value}\\r\\n`)}`}),`data:text/calendar;charset=utf8,${f}`};export{$ as aol,o as eventify,u as google,y as ics,m as msTeams,d as office365,f as office365Mobile,c as outlook,l as outlookMobile,h as yahoo};\n//# sourceMappingURL=index.modern.mjs.map\n","import React from 'react';\nimport { Button, ListItemIcon, Menu, MenuItem } from '@mui/material';\nimport { Add, ArrowDropDown } from '@mui/icons-material';\nimport { google, outlook, ics } from 'calendar-link';\nimport { FormattedMessage, useIntl } from 'react-intl';\nimport { stripHtml } from '../../../../../Utils';\nimport { Icons } from '../../../../../Themes';\nimport CustomIcon from '../../../../DesignSystem/CustomIcon';\n\nfunction DownloadICSButton({ post }: any) {\n const [anchorEl, setAnchorEl] = React.useState(null);\n const intl = useIntl();\n const strippedDescription = stripHtml(post.description).slice(0, 170);\n const description = !post.event_url\n ? strippedDescription\n : intl.formatMessage(\n { id: 'ADD_TO_CALENDAR.URL_WITH_EVENT' },\n { description: strippedDescription, url: post.event_url },\n );\n const event = {\n title: post.title,\n description,\n start: post.start_at,\n end: post.end_at,\n location: post.location || '',\n };\n const handleClick = (e: any) => {\n setAnchorEl(e.currentTarget);\n };\n\n const handleClose = () => {\n setAnchorEl(null);\n };\n\n return (\n <>\n }\n size=\"large\"\n onClick={handleClick}\n endIcon={}\n fullWidth\n >\n \n \n \n \n \n \n \n Google\n \n \n \n \n \n Outlook\n \n \n \n \n \n Apple\n \n \n \n );\n}\n\nexport default DownloadICSButton;\n","import React, { useState } from 'react';\nimport { get } from 'lodash';\nimport { FormattedMessage } from 'react-intl';\nimport { Check } from '@mui/icons-material';\nimport { useQueryClient } from 'react-query';\nimport { useModal } from 'mui-modal-provider';\nimport { useNavigate } from 'react-router-dom';\n\nimport Attendances from '../../../../Utils/Types/Attendances';\nimport ButtonWithLoader from '../../../ButtonWithLoader';\nimport { loginPath } from '../../../../Utils/routes';\nimport DownloadICSButton from './DownloadICSButton/DownloadICSButton';\nimport { Post } from '../../../../Utils/Types/Posts';\nimport queriesConfig from '../../../../Services/queriesConfig';\nimport useApiQuery from '../../../../Hooks/useApiQuery';\nimport useApiMutation from '../../../../Hooks/useApiMutation';\nimport EntitySubscriptionModal from '../../../EntitySubscriptionModal';\nimport useSpace from '../../../../Hooks/useSpace';\nimport useCurrentUser from '../../../../Hooks/useCurrentUser';\n\ninterface CommunicationActionsProps {\n post: Post;\n}\n\nfunction CommunicationActions({ post }: CommunicationActionsProps) {\n const queryClient = useQueryClient();\n const [attendance, setAttendance] = useState();\n const { space } = useSpace();\n const navigate = useNavigate();\n const { showModal } = useModal();\n const { isLoggedIn } = useCurrentUser();\n const attending = get(attendance, 'attendance_status') === Attendances.ATTENDING;\n\n const { isLoading: isLoadingFetch } = useApiQuery({\n query: queriesConfig.getAttendances(post.id),\n onSuccess: (data: any) => {\n setAttendance(data[0]);\n },\n });\n\n const { mutate: createAttendance, isLoading: isLoadingCreate } = useApiMutation({\n query: queriesConfig.createAttendance(post.id, Attendances.ATTENDING),\n onSuccess: (data: any) => {\n setAttendance(data[0]);\n queryClient.invalidateQueries(queriesConfig.getPost(post.id).queryKey);\n queryClient.invalidateQueries(queriesConfig.getAttendances(post.id).queryKey);\n },\n });\n\n const { mutate: updateAttendance, isLoading: isLoadingUpdate } = useApiMutation({\n query: queriesConfig.updateAttendance(attendance?.id),\n onSuccess: (data: any) => {\n setAttendance(data);\n queryClient.invalidateQueries(queriesConfig.getPost(post.id).queryKey);\n },\n });\n\n const isLoading = isLoadingFetch || isLoadingCreate || isLoadingUpdate;\n\n const create = async () => {\n if (!isLoggedIn) {\n navigate(loginPath());\n } else {\n if (!space.entity_subscription) {\n showModal(EntitySubscriptionModal);\n } else {\n createAttendance();\n }\n }\n };\n\n const changeAttendance = async (status: any) => {\n updateAttendance(status);\n };\n\n return (\n <>\n {attending ? (\n }\n isFetching={isLoading}\n onClick={() => changeAttendance(Attendances.DECLINED)}\n fullWidth\n >\n \n \n ) : (\n (attendance ? changeAttendance(Attendances.ATTENDING) : create())}\n fullWidth\n >\n \n \n )}\n\n \n \n );\n}\n\nexport default CommunicationActions;\n","import React from 'react';\nimport { Box, Card, CardContent, Stack } from '@mui/material';\n\nimport EventActions from './EventActions';\nimport PostIndicators from '../../Shared/PostIndicators';\nimport { Post } from '../../../../Utils/Types/Posts';\n\ninterface PostSidePrimaryActionsProps {\n post: Post;\n}\n\nfunction PostSidePrimaryActions({ post }: PostSidePrimaryActionsProps) {\n const attendeesCount = post.attendees_count;\n return (\n \n \n \n \n\n {attendeesCount > 0 && (\n \n \n \n )}\n \n \n \n );\n}\n\nexport default PostSidePrimaryActions;\n","import React from 'react';\nimport { Box } from '@mui/material';\n\nimport PostDescription from '../../../DesignSystem/PostDescription';\nimport PublicationAlert from '../../Shared/PublicationAlert';\nimport PostLocation from '../../Shared/PostLocation';\nimport { moment } from '../../../../I18n';\nimport VideoEmbed from '../../../DesignSystem/VideoEmbed';\nimport EventUrlState from '../../../DesignSystem/EventUrlState';\nimport AttachmentLinksList from '../../Shared/AttachmentLinksList';\nimport PostSidePrimaryActions from './PostSidePrimaryActions';\nimport useWidth from '../../../../Hooks/useWidth';\n\nfunction CommunicationShow({ post }: any) {\n const isMobile = useWidth('down', 'md');\n\n const isPublished = post.published_at && moment(post.published_at).isBefore();\n const [lat, lng] = (post.latlng || '').split(',');\n\n return (\n <>\n {!isPublished && (\n \n \n \n )}\n \n \n \n \n {post.video_embed && (\n \n \n \n )}\n {post.event_url && (\n <>\n \n \n \n {isMobile && (\n \n \n \n )}\n \n )}\n \n \n );\n}\n\nexport default CommunicationShow;\n","import React, { useEffect } from 'react';\nimport { Box } from '@mui/material';\n\nimport useWidth from '../../../Hooks/useWidth';\nimport Hidden from '../../DesignSystem/Hidden';\n\nconst DEFAULT_HEIGHT = 72;\n\nfunction StickyFooterWrapper({ height = DEFAULT_HEIGHT, children }: any) {\n const isMobile = useWidth('down', 'sm');\n\n useEffect(() => {\n // make sure styicky element doesn't hide footer\n if (children && isMobile) {\n window.document.body.style.marginBottom = `${height}px`;\n } else {\n window.document.body.style.marginBottom = '0px';\n }\n }, [isMobile]);\n\n return (\n \n theme.spacing(1.5, 2),\n boxShadow: '0px -1px 2px rgba(0, 0, 0, 0.18)',\n zIndex: (theme: any) => theme.zIndex.appBar,\n }}\n >\n {children}\n \n \n );\n}\n\nexport default StickyFooterWrapper;\n","import React from 'react';\nimport { Stack } from '@mui/material';\n\nimport StickyFooterWrapper from '../StickyFooterWrapper';\nimport EventActions from './EventActions';\nimport { Post } from '../../../../Utils/Types/Posts';\n\nexport default function CommunicationFooter({ post }: { post: Post }) {\n return (\n \n \n \n \n \n );\n}\n","import React from 'react';\n\nimport PostLayout from '../../../../Layout/PostLayout';\nimport CommunicationShow from '.';\nimport PostSidePrimaryActions from './PostSidePrimaryActions';\nimport EventFooter from './EventFooter';\nimport { isEvent } from '../../../../Utils/Post';\nimport { Post } from '../../../../Utils/Types/Posts';\nimport { Space } from '../../../../Utils/Types/Space';\n\ninterface CommunicationWrapperProps {\n post: Post;\n space: Space;\n}\n\nfunction Communication({ post, space }: CommunicationWrapperProps) {\n return (\n }\n postSideContent={isEvent(post.type) && }\n stickyFooterButton={isEvent(post.type) && }\n />\n );\n}\n\nexport default Communication;\n","import PropTypes from 'prop-types';\nimport React from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport { Box } from '@mui/material';\n\nfunction PostSideHeader({ i18nKey }: any) {\n return (\n \n \n \n );\n}\n\nPostSideHeader.propTypes = {\n i18nKey: PropTypes.string.isRequired,\n};\n\nexport default PostSideHeader;\n","import React from 'react';\nimport { List, ListItem, ListItemText, Typography } from '@mui/material';\nimport { FormattedMessage, useIntl } from 'react-intl';\n\nimport { formatLabel } from '../../../../Utils/Post/budget';\n\nfunction Budget({ post, space }: any) {\n const intl = useIntl();\n\n if (!post.budget) {\n return null;\n }\n\n return (\n \n \n (\n \n {chunks}\n \n ),\n }}\n />\n }\n />\n \n \n );\n}\n\nexport default Budget;\n","import React from 'react';\nimport { Box, Typography } from '@mui/material';\nimport { FormattedMessage, useIntl } from 'react-intl';\nimport { get, inRange, parseInt } from 'lodash';\n\nimport { formatLabel } from '../../../../Utils/Post/budget';\nimport LinearProgress from '../../../DesignSystem/LinearProgress';\n\nfunction UserVotesInfo({ post, parent, space }: any) {\n const postOrParent = (attributePath: any) => get(parent || post, attributePath);\n const votingOptions = postOrParent('voting_options');\n const budget = postOrParent('budget');\n const totalVotes = postOrParent('meta.user_votes_info.total_votes');\n const votesLeft = Math.max(0, (votingOptions?.max_votes || 0) - totalVotes);\n const budgetSpent = postOrParent('meta.user_votes_info.budget_spent');\n const budgetLeft = postOrParent('meta.user_votes_info.budget_left') || budget;\n const intl = useIntl();\n\n const percentRemaining = Math.min((parseInt(budgetSpent, 10) * 100) / parseInt(budget, 10), 100);\n\n let voteInfo;\n let budgetInfo;\n\n if (votingOptions.min_votes) {\n if (totalVotes < votingOptions.min_votes) {\n voteInfo = (\n \n \n ⚠️{' '}\n {' '}\n {chunk},\n }}\n />\n \n );\n }\n\n if (\n inRange(\n totalVotes,\n votingOptions.min_votes,\n votingOptions?.max_votes ? votingOptions.max_votes + 1 : Infinity,\n )\n ) {\n voteInfo = (\n \n \n 🎉\n {' '}\n \n {!!votesLeft && (\n <>\n {' '}\n {chunk} }}\n />\n \n )}\n \n );\n }\n }\n\n if (votingOptions.budget_rule) {\n budgetInfo = (\n \n \n \n {chunk},\n }}\n />\n \n \n \n \n );\n }\n\n return (\n <>\n {voteInfo}\n {budgetInfo}\n \n );\n}\n\nexport default UserVotesInfo;\n","import React from 'react';\nimport { Card, CardContent, Divider, Box, Typography } from '@mui/material';\nimport { FormattedMessage } from 'react-intl';\n\nimport PostStatus from '../Shared/PostStatus/PostStatus';\nimport PostIndicators from '../Shared/PostIndicators';\nimport { PostCategories } from '../../../Utils/Types';\nimport { isPostComing, postHasParent } from '../../../Utils/Post';\nimport InteractionsBox from '../Shared/InteractionsBox';\nimport PostSideHeader from '../Show/PostSideHeader';\nimport { getPostSideHeaderTextID } from './utils';\nimport Budget from '../Shared/Budget/Budget';\nimport UserVotesInfo from '../Shared/UserVotesInfo/UserVotesInfo';\nimport { allStepsEnded } from '../../../Utils/Steps';\n\nfunction PostSidePrimaryActions({ post, space }: any) {\n const isMessaging = PostCategories.MESSAGING.includes(post.type);\n const parent = post.included.source || {};\n const isPostClosedForParticipation = postHasParent(post) && allStepsEnded(post);\n const isComing = !postHasParent(post) && isPostComing(post);\n const canVote = post.actions?.find((action: any) => action.name === 'vote_support');\n\n return (\n \n {(isPostClosedForParticipation || isComing) && (\n \n )}\n\n \n \n \n \n\n \n \n \n\n {post.voting_options && post.meta && canVote && (\n \n {/* Idea view */}\n\n \n \n )}\n\n {post.budget && (\n \n \n \n )}\n\n {isMessaging && (\n \n \n \n )}\n\n \n \n \n\n {post.post_contributions_stats && (\n \n \n \n )}\n \n \n );\n}\n\nexport default PostSidePrimaryActions;\n","import React from 'react';\nimport { Box } from '@mui/material';\n\nimport StickyFooterWrapper from '../../StickyFooterWrapper';\nimport UserVotesInfo from '../../../Shared/UserVotesInfo/UserVotesInfo';\nimport { isIdea } from '../../../../../Utils/Post';\nimport InteractionsBox from '../../../Shared/InteractionsBox';\n\nfunction Footer({ post, space }: any) {\n const parent = post.included.source;\n const canVote = post.actions?.find((action: any) => action.name === 'vote_support');\n\n if (!isIdea(post.type)) {\n return null;\n }\n\n if (parent.voting_options && canVote) {\n return (\n \n \n \n \n \n \n );\n }\n\n return (\n \n \n \n );\n}\n\nexport default Footer;\n","import { Box } from '@mui/material';\nimport React from 'react';\n\nimport { Types } from '../../../Utils/Types/Posts';\nimport Posts from '../../PostList/Posts';\n\nfunction DuplicatedPostList({ post }: any) {\n return (\n \n \n \n );\n}\n\nexport default DuplicatedPostList;\n","import React from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport { Box, List, ListItem, Paper, Typography } from '@mui/material';\n\nimport usePostQuery from '../../../Hooks/usePostQuery';\nimport PostListItem from '../../DesignSystem/PostListItem';\n\nfunction OriginalPost({ post, space }: any) {\n const { post: originalPost } = usePostQuery(post.original_post_id, {\n enabled: !!post.original_post_id,\n });\n\n if (!originalPost) {\n return null;\n }\n\n return (\n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n );\n}\n\nexport default OriginalPost;\n","import React from 'react';\nimport { Box } from '@mui/material';\nimport { useIntl } from 'react-intl';\nimport { find } from 'lodash';\n\nimport PostDescription from '../../../DesignSystem/PostDescription';\nimport CommentsSection from '../../../Comments/Show';\nimport InteractionsBox from '../../Shared/InteractionsBox';\nimport DuplicatedPostList from '../../DuplicatedPostList';\nimport OriginalPost from '../../OriginalPost';\nimport ContributionFormAnswers from './FormBuilder';\n\nfunction ParticipationPostShow({ post, space }: any) {\n const intl = useIntl();\n\n // NOTE: this is a hack, we should have a better way to get the content title\n // but it's working for now since `post_record_questions` only have a `title` and a `description`\n // so the `textarea` is always the description of the Post\n const contentTitle = find(\n post.included.source.post_record_questions,\n (question: any) => question.field_type === 'textarea',\n )?.title;\n\n return (\n \n \n \n \n\n \n\n \n \n \n\n \n \n \n \n );\n}\n\nexport default ParticipationPostShow;\n","import React from 'react';\n\nimport PostLayout from '../../../../Layout/PostLayout';\nimport PostSidePrimaryActions from '../../PostSidePrimaryActions';\nimport Footer from './Footer';\nimport ParticipationPostShow from './ParticipationPostShow';\n\nfunction Wrapper({ post, space }: any) {\n return (\n }\n postSideContent={}\n stickyFooterButton={