diff --git a/build/blocks/event-date/index.asset.php b/build/blocks/event-date/index.asset.php index fb38a8c07..2d6eb79bc 100644 --- a/build/blocks/event-date/index.asset.php +++ b/build/blocks/event-date/index.asset.php @@ -1 +1 @@ - array('moment', 'react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-date', 'wp-element', 'wp-i18n'), 'version' => '2a87e9e9bf69563aeae1'); + array('moment', 'react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-date', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => '400abf5135510317d95c'); diff --git a/build/blocks/event-date/index.js b/build/blocks/event-date/index.js index 46ed97a5b..3556a8c4a 100644 --- a/build/blocks/event-date/index.js +++ b/build/blocks/event-date/index.js @@ -1,2 +1,2 @@ -(()=>{"use strict";var e,t={750:(e,t,r)=>{const n=window.wp.blocks,a=window.moment;var s=r.n(a);function i(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var a=e.length;for(t=0;te&&e[t]),GatherPress)}function f(e,t){if("object"!=typeof GatherPress)return;const r=e.split("."),n=r.pop();r.reduce(((e,t)=>{var r;return null!==(r=e[t])&&void 0!==r?r:e[t]={}}),GatherPress)[n]=t}const x=window.wp.date,v=window.ReactJSXRuntime,_="YYYY-MM-DD HH:mm:ss",T=s().tz(b()).add(1,"day").set("hour",18).set("minute",0).set("second",0).format(_),D=(s().tz(T,b()).add(2,"hours").format(_),[{label:(0,l.__)("1 hour","gatherpress"),value:1},{label:(0,l.__)("1.5 hours","gatherpress"),value:1.5},{label:(0,l.__)("2 hours","gatherpress"),value:2},{label:(0,l.__)("3 hours","gatherpress"),value:3},{label:(0,l.__)("Set an end time…","gatherpress"),value:!1}]);function j(e){return s().tz(function(){let e=g("eventDetails.dateTime.datetime_start");return e=""!==e?s().tz(e,b()).format(_):T,f("eventDetails.dateTime.datetime_start",e),e}(),b()).add(e,"hours").format(_)}function z(){return k(g("settings.dateFormat"))+" "+k(g("settings.timeFormat"))}function b(e=g("eventDetails.dateTime.timezone")){return s().tz.zone(e)?e:(0,l.__)("GMT","gatherpress")}function w(e=""){const t=/^([+-])(\d{2}):(00|15|30|45)$/,r=e.replace(t,"$1");return r!==e?"UTC"+r+parseInt(e.replace(t,"$2")).toString()+e.replace(t,"$3").replace("00","").replace("15",".25").replace("30",".5").replace("45",".75"):e}function S(e,t=null,r=null){!function(e,t=null){const r=s().tz(g("eventDetails.dateTime.datetime_end"),b()).valueOf(),n=s().tz(e,b()).valueOf();n>=r&&y(s().tz(n,b()).add(2,"hours").format(_),t)}(e,r),f("eventDetails.dateTime.datetime_start",e),"function"==typeof t&&t(e),p()}function y(e,t=null,r=null){!function(e,t=null){const r=s().tz(g("eventDetails.dateTime.datetime_start"),b()).valueOf(),n=s().tz(e,b()).valueOf();n<=r&&S(s().tz(n,b()).subtract(2,"hours").format(_),t)}(e,r),f("eventDetails.dateTime.datetime_end",e),null!==t&&t(e),p()}function k(e){const t={d:"DD",D:"ddd",j:"D",l:"dddd",N:"E",S:"o",w:"e",z:"DDD",W:"W",F:"MMMM",m:"MM",M:"MMM",n:"M",t:"",L:"",o:"YYYY",Y:"YYYY",y:"YY",a:"a",A:"A",B:"",g:"h",G:"H",h:"hh",H:"HH",i:"mm",s:"ss",u:"SSS",e:"zz",I:"",O:"",P:"",T:"",Z:"",c:"",r:"",U:"X"};return String(e).split("").map(((e,r,n)=>{const a=n[r-1];return e in t&&"\\"!==a?t[e]:e})).join("")}function C(){const e="gatherpress_event_past",t=(0,m.dispatch)("core/notices");t.removeNotice(e),function(){const e=s().tz(g("eventDetails.dateTime.datetime_end"),b());return"gatherpress_event"===(0,m.select)("core/editor")?.getCurrentPostType()&&s().tz(b()).valueOf()>e.valueOf()}()&&t.createNotice("warning",(0,l.__)("This event has already passed.","gatherpress"),{id:e,isDismissible:!1})}const O=()=>{const{dateTimeStart:e,duration:t}=(0,m.useSelect)((e=>({dateTimeStart:e("gatherpress/datetime").getDateTimeStart(),duration:e("gatherpress/datetime").getDuration()})),[]),{setDateTimeStart:r,setDateTimeEnd:n}=(0,m.useDispatch)("gatherpress/datetime"),a=(0,x.getSettings)(),i=/a(?!\\)/i.test(a.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return(0,u.useEffect)((()=>{r(s().tz(e,b()).format(_)),t&&n(j(t)),C()}),[e,t,r,n]),(0,v.jsx)(c.PanelRow,{children:(0,v.jsxs)(c.Flex,{direction:"column",gap:"1",children:[(0,v.jsx)(c.FlexItem,{children:(0,v.jsx)("h3",{style:{marginBottom:0},children:(0,v.jsx)("label",{htmlFor:"gatherpress-datetime-start",children:(0,l.__)("Date & time start","gatherpress")})})}),(0,v.jsx)(c.FlexItem,{children:(0,v.jsx)(c.Dropdown,{popoverProps:{placement:"bottom-end"},renderToggle:({isOpen:t,onToggle:r})=>(0,v.jsx)(c.Button,{id:"gatherpress-datetime-start",onClick:r,"aria-expanded":t,isLink:!0,children:s().tz(e,b()).format(z())}),renderContent:()=>(0,v.jsx)(c.DateTimePicker,{currentDate:e,onChange:e=>{S(e,r,n)},is12Hour:i})})})]})})},E=()=>{const{dateTimeEnd:e}=(0,m.useSelect)((e=>({dateTimeEnd:e("gatherpress/datetime").getDateTimeEnd()})),[]),{setDateTimeEnd:t,setDateTimeStart:r}=(0,m.useDispatch)("gatherpress/datetime"),n=(0,x.getSettings)(),a=/a(?!\\)/i.test(n.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return(0,u.useEffect)((()=>{t(s().tz(e,b()).format(_)),C()})),(0,v.jsx)(c.PanelRow,{children:(0,v.jsxs)(c.Flex,{direction:"column",gap:"1",children:[(0,v.jsx)(c.FlexItem,{children:(0,v.jsx)("h3",{style:{marginBottom:0},children:(0,v.jsx)("label",{htmlFor:"gatherpress-datetime-end",children:(0,l.__)("Date & time end","gatherpress")})})}),(0,v.jsx)(c.FlexItem,{children:(0,v.jsx)(c.Dropdown,{popoverProps:{placement:"bottom-end"},renderToggle:({isOpen:t,onToggle:r})=>(0,v.jsx)(c.Button,{id:"gatherpress-datetime-end",onClick:r,"aria-expanded":t,isLink:!0,children:s().tz(e,b()).format(z())}),renderContent:()=>(0,v.jsx)(c.DateTimePicker,{currentDate:e,onChange:e=>y(e,t,r),is12Hour:a})})})]})})},P=()=>{const{timezone:e}=(0,m.useSelect)((e=>({timezone:e("gatherpress/datetime").getTimezone()})),[]),{setTimezone:t}=(0,m.useDispatch)("gatherpress/datetime"),r=g("misc.timezoneChoices");return(0,u.useEffect)((()=>{t(g("eventDetails.dateTime.timezone"))}),[t]),(0,v.jsx)(c.PanelRow,{children:(0,v.jsx)(c.SelectControl,{label:(0,l.__)("Time Zone","gatherpress"),value:w(e),onChange:e=>{e=function(e=""){const t=/^UTC([+-])(\d+)(.\d+)?$/,r=e.replace(t,"$1");if(r!==e){const n=e.replace(t,"$2").padStart(2,"0");let a=e.replace(t,"$3");return""===a&&(a=":00"),a=a.replace(".25",":15").replace(".5",":30").replace(".75",":45"),r+n+a}return e}(e),t(e),p()},__nexthasnomarginbottom:!0,children:Object.keys(r).map((e=>(0,v.jsx)("optgroup",{label:e,children:Object.keys(r[e]).map((t=>(0,v.jsx)("option",{value:t,children:r[e][t]},t)))},e)))})})},F=()=>{const{duration:e}=(0,m.useSelect)((e=>({duration:e("gatherpress/datetime").getDuration()})),[]),t=(0,m.useDispatch)(),{setDateTimeEnd:r,setDuration:n}=t("gatherpress/datetime");return(0,v.jsx)(c.SelectControl,{label:(0,l.__)("Duration","gatherpress"),value:!!D.some((t=>t.value===e))&&e,options:D,onChange:e=>{(e="false"!==e&&parseFloat(e))&&r(j(e)),n(e)},__nexthasnomarginbottom:!0})},M=()=>{const e=(0,m.useDispatch)("core/editor").editPost;let t=(0,m.useSelect)((e=>e("core/editor").getEditedPostAttribute("meta")?.gatherpress_datetime));try{t=t?JSON.parse(t):{}}catch(e){t={}}const{dateTimeStart:r,dateTimeEnd:n,duration:a,timezone:i}=(0,m.useSelect)((e=>({dateTimeStart:e("gatherpress/datetime").getDateTimeStart(),dateTimeEnd:e("gatherpress/datetime").getDateTimeEnd(),duration:e("gatherpress/datetime").getDuration(),timezone:e("gatherpress/datetime").getTimezone()})),[]),{setDuration:o}=(0,m.useDispatch)("gatherpress/datetime");return(0,u.useEffect)((()=>{const a=JSON.stringify({...t,dateTimeStart:s().tz(r,i).format(_),dateTimeEnd:s().tz(n,i).format(_),timezone:i});e({meta:{gatherpress_datetime:a}})}),[r,n,i,t,e,o,a]),(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("section",{children:(0,v.jsx)(O,{})}),(0,v.jsx)("section",{children:a?(0,v.jsx)(F,{}):(0,v.jsx)(E,{})}),(0,v.jsx)("section",{children:(0,v.jsx)(P,{})})]})},Y=(e,t,r)=>{const n=k(g("settings.dateFormat")),a=k(g("settings.timeFormat")),i=g("settings.showTimezone")?"z":"",o=n+" "+a;r=b(r);let d=n+" "+a+" "+i;return s().tz(e,r).format(n)===s().tz(t,r).format(n)&&(d=a+" "+i),(0,l.sprintf)(/* translators: %1$s: datetime start, %2$s: datetime end, %3$s timezone. */ /* translators: %1$s: datetime start, %2$s: datetime end, %3$s timezone. */ -(0,l.__)("%1$s to %2$s %3$s","gatherpress"),s().tz(e,r).format(o),s().tz(t,r).format(d),function(e){return e=b(e),(0,l.__)("GMT","gatherpress")!==e?"":function(e=""){return e.replace(":","")}(g("eventDetails.dateTime.timezone"))}(r))},$=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"gatherpress/event-date","version":"2.0.0","title":"Event Date","category":"gatherpress","icon":"clock","example":{"viewportWidth":350},"description":"Displays the date and time for an event.","attributes":{"eventEnd":{"type":"string"},"eventStart":{"type":"string"},"textAlign":{"type":"string"}},"supports":{"html":false,"color":{"gradients":true,"link":true,"__experimentalDefaultControls":{"background":true,"text":true,"link":true}},"spacing":{"margin":true,"padding":true},"typography":{"fontSize":true,"lineHeight":true,"__experimentalFontFamily":true,"__experimentalFontWeight":true,"__experimentalFontStyle":true,"__experimentalTextTransform":true,"__experimentalTextDecoration":true,"__experimentalLetterSpacing":true,"__experimentalDefaultControls":{"fontSize":true}},"interactivity":{"clientNavigation":true},"__experimentalBorder":{"radius":true,"color":true,"width":true,"style":true,"__experimentalDefaultControls":{"radius":true,"color":true,"width":true,"style":true}}},"textdomain":"gatherpress","editorScript":"file:./index.js","style":"file:./style-index.css","render":"file:./render.php"}');(0,n.registerBlockType)($,{edit:({attributes:{textAlign:e},setAttributes:t})=>{const r=(0,d.useBlockProps)({className:o({[`has-text-align-${e}`]:e})}),{dateTimeStart:n,dateTimeEnd:a,timezone:s}=(0,m.useSelect)((e=>({dateTimeStart:e("gatherpress/datetime").getDateTimeStart(),dateTimeEnd:e("gatherpress/datetime").getDateTimeEnd(),timezone:e("gatherpress/datetime").getTimezone()})),[]);return(0,v.jsxs)("div",{...r,children:[(0,v.jsx)(d.BlockControls,{children:(0,v.jsx)(d.AlignmentToolbar,{value:e,onChange:e=>t({textAlign:e})})}),Y(n,a,s),h()&&(0,v.jsx)(d.InspectorControls,{children:(0,v.jsx)(c.PanelBody,{children:(0,v.jsx)(c.__experimentalVStack,{spacing:4,children:(0,v.jsx)(M,{})})})})]})},save:()=>null})}},r={};function n(e){var a=r[e];if(void 0!==a)return a.exports;var s=r[e]={exports:{}};return t[e](s,s.exports,n),s.exports}n.m=t,e=[],n.O=(t,r,a,s)=>{if(!r){var i=1/0;for(c=0;c=s)&&Object.keys(n.O).every((e=>n.O[e](r[l])))?r.splice(l--,1):(o=!1,s0&&e[c-1][2]>s;c--)e[c]=e[c-1];e[c]=[r,a,s]},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={532:0,4:0};n.O.j=t=>0===e[t];var t=(t,r)=>{var a,s,[i,o,l]=r,d=0;if(i.some((t=>0!==e[t]))){for(a in o)n.o(o,a)&&(n.m[a]=o[a]);if(l)var c=l(n)}for(t&&t(r);dn(750)));a=n.O(a)})(); \ No newline at end of file +(()=>{"use strict";var e,t={6244:(e,t,r)=>{const n=window.wp.blocks,a=window.moment;var s=r.n(a);function i(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var a=e.length;for(t=0;te&&e[t]),GatherPress)}function x(e,t){if("object"!=typeof GatherPress)return;const r=e.split("."),n=r.pop();r.reduce(((e,t)=>{var r;return null!==(r=e[t])&&void 0!==r?r:e[t]={}}),GatherPress)[n]=t}const v=window.wp.date,_=window.ReactJSXRuntime,T="YYYY-MM-DD HH:mm:ss",D=s().tz(b()).add(1,"day").set("hour",18).set("minute",0).set("second",0).format(T);function j(){const e=[{label:(0,l.__)("1 hour","gatherpress"),value:1},{label:(0,l.__)("1.5 hours","gatherpress"),value:1.5},{label:(0,l.__)("2 hours","gatherpress"),value:2},{label:(0,l.__)("3 hours","gatherpress"),value:3},{label:(0,l.__)("Set an end time…","gatherpress"),value:!1}];return(0,p.applyFilters)("gatherpress.durationOptions",e)}function z(e){return s().tz(function(){let e=f("eventDetails.dateTime.datetime_start");return e=""!==e?s().tz(e,b()).format(T):D,x("eventDetails.dateTime.datetime_start",e),e}(),b()).add(e,"hours").format(T)}function w(){return O(f("settings.dateFormat"))+" "+O(f("settings.timeFormat"))}function b(e=f("eventDetails.dateTime.timezone")){return s().tz.zone(e)?e:(0,l.__)("GMT","gatherpress")}function S(e=""){const t=/^([+-])(\d{2}):(00|15|30|45)$/,r=e.replace(t,"$1");return r!==e?"UTC"+r+parseInt(e.replace(t,"$2")).toString()+e.replace(t,"$3").replace("00","").replace("15",".25").replace("30",".5").replace("45",".75"):e}function y(e,t=null,r=null){!function(e,t=null){const r=s().tz(f("eventDetails.dateTime.datetime_end"),b()).valueOf(),n=s().tz(e,b()).valueOf();n>=r&&k(s().tz(n,b()).add(2,"hours").format(T),t)}(e,r),x("eventDetails.dateTime.datetime_start",e),"function"==typeof t&&t(e),h()}function k(e,t=null,r=null){!function(e,t=null){const r=s().tz(f("eventDetails.dateTime.datetime_start"),b()).valueOf(),n=s().tz(e,b()).valueOf();n<=r&&y(s().tz(n,b()).subtract(2,"hours").format(T),t)}(e,r),x("eventDetails.dateTime.datetime_end",e),null!==t&&t(e),h()}function O(e){const t={d:"DD",D:"ddd",j:"D",l:"dddd",N:"E",S:"o",w:"e",z:"DDD",W:"W",F:"MMMM",m:"MM",M:"MMM",n:"M",t:"",L:"",o:"YYYY",Y:"YYYY",y:"YY",a:"a",A:"A",B:"",g:"h",G:"H",h:"hh",H:"HH",i:"mm",s:"ss",u:"SSS",e:"zz",I:"",O:"",P:"",T:"",Z:"",c:"",r:"",U:"X"};return String(e).split("").map(((e,r,n)=>{const a=n[r-1];return e in t&&"\\"!==a?t[e]:e})).join("")}function C(){const e="gatherpress_event_past",t=(0,u.dispatch)("core/notices");t.removeNotice(e),function(){const e=s().tz(f("eventDetails.dateTime.datetime_end"),b());return"gatherpress_event"===(0,u.select)("core/editor")?.getCurrentPostType()&&s().tz(b()).valueOf()>e.valueOf()}()&&t.createNotice("warning",(0,l.__)("This event has already passed.","gatherpress"),{id:e,isDismissible:!1})}s().tz(D,b()).add(2,"hours").format(T);const E=()=>{const{dateTimeStart:e,duration:t}=(0,u.useSelect)((e=>({dateTimeStart:e("gatherpress/datetime").getDateTimeStart(),duration:e("gatherpress/datetime").getDuration()})),[]),{setDateTimeStart:r,setDateTimeEnd:n}=(0,u.useDispatch)("gatherpress/datetime"),a=(0,v.getSettings)(),i=/a(?!\\)/i.test(a.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return(0,m.useEffect)((()=>{r(s().tz(e,b()).format(T)),t&&n(z(t)),C()}),[e,t,r,n]),(0,_.jsx)(c.PanelRow,{children:(0,_.jsxs)(c.Flex,{direction:"column",gap:"1",children:[(0,_.jsx)(c.FlexItem,{children:(0,_.jsx)("h3",{style:{marginBottom:0},children:(0,_.jsx)("label",{htmlFor:"gatherpress-datetime-start",children:(0,l.__)("Date & time start","gatherpress")})})}),(0,_.jsx)(c.FlexItem,{children:(0,_.jsx)(c.Dropdown,{popoverProps:{placement:"bottom-end"},renderToggle:({isOpen:t,onToggle:r})=>(0,_.jsx)(c.Button,{id:"gatherpress-datetime-start",onClick:r,"aria-expanded":t,isLink:!0,children:s().tz(e,b()).format(w())}),renderContent:()=>(0,_.jsx)(c.DateTimePicker,{currentDate:e,onChange:e=>{y(e,r,n)},is12Hour:i})})})]})})},P=()=>{const{dateTimeEnd:e}=(0,u.useSelect)((e=>({dateTimeEnd:e("gatherpress/datetime").getDateTimeEnd()})),[]),{setDateTimeEnd:t,setDateTimeStart:r}=(0,u.useDispatch)("gatherpress/datetime"),n=(0,v.getSettings)(),a=/a(?!\\)/i.test(n.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return(0,m.useEffect)((()=>{t(s().tz(e,b()).format(T)),C()})),(0,_.jsx)(c.PanelRow,{children:(0,_.jsxs)(c.Flex,{direction:"column",gap:"1",children:[(0,_.jsx)(c.FlexItem,{children:(0,_.jsx)("h3",{style:{marginBottom:0},children:(0,_.jsx)("label",{htmlFor:"gatherpress-datetime-end",children:(0,l.__)("Date & time end","gatherpress")})})}),(0,_.jsx)(c.FlexItem,{children:(0,_.jsx)(c.Dropdown,{popoverProps:{placement:"bottom-end"},renderToggle:({isOpen:t,onToggle:r})=>(0,_.jsx)(c.Button,{id:"gatherpress-datetime-end",onClick:r,"aria-expanded":t,isLink:!0,children:s().tz(e,b()).format(w())}),renderContent:()=>(0,_.jsx)(c.DateTimePicker,{currentDate:e,onChange:e=>k(e,t,r),is12Hour:a})})})]})})},F=()=>{const{timezone:e}=(0,u.useSelect)((e=>({timezone:e("gatherpress/datetime").getTimezone()})),[]),{setTimezone:t}=(0,u.useDispatch)("gatherpress/datetime"),r=f("misc.timezoneChoices");return(0,m.useEffect)((()=>{t(f("eventDetails.dateTime.timezone"))}),[t]),(0,_.jsx)(c.PanelRow,{children:(0,_.jsx)(c.SelectControl,{label:(0,l.__)("Time Zone","gatherpress"),value:S(e),onChange:e=>{e=function(e=""){const t=/^UTC([+-])(\d+)(.\d+)?$/,r=e.replace(t,"$1");if(r!==e){const n=e.replace(t,"$2").padStart(2,"0");let a=e.replace(t,"$3");return""===a&&(a=":00"),a=a.replace(".25",":15").replace(".5",":30").replace(".75",":45"),r+n+a}return e}(e),t(e),h()},__nexthasnomarginbottom:!0,children:Object.keys(r).map((e=>(0,_.jsx)("optgroup",{label:e,children:Object.keys(r[e]).map((t=>(0,_.jsx)("option",{value:t,children:r[e][t]},t)))},e)))})})},M=()=>{const{duration:e}=(0,u.useSelect)((e=>({duration:e("gatherpress/datetime").getDuration()})),[]),t=(0,u.useDispatch)(),{setDateTimeEnd:r,setDuration:n}=t("gatherpress/datetime");return(0,_.jsx)(c.SelectControl,{label:(0,l.__)("Duration","gatherpress"),value:!!j().some((t=>t.value===e))&&e,options:j(),onChange:e=>{(e="false"!==e&&parseFloat(e))&&r(z(e)),n(e)},__nexthasnomarginbottom:!0})},Y=()=>{const e=(0,u.useDispatch)("core/editor").editPost;let t=(0,u.useSelect)((e=>e("core/editor").getEditedPostAttribute("meta")?.gatherpress_datetime));try{t=t?JSON.parse(t):{}}catch(e){t={}}const{dateTimeStart:r,dateTimeEnd:n,duration:a,timezone:i}=(0,u.useSelect)((e=>({dateTimeStart:e("gatherpress/datetime").getDateTimeStart(),dateTimeEnd:e("gatherpress/datetime").getDateTimeEnd(),duration:e("gatherpress/datetime").getDuration(),timezone:e("gatherpress/datetime").getTimezone()})),[]),{setDuration:o}=(0,u.useDispatch)("gatherpress/datetime");return(0,m.useEffect)((()=>{const a=JSON.stringify({...t,dateTimeStart:s().tz(r,i).format(T),dateTimeEnd:s().tz(n,i).format(T),timezone:i});e({meta:{gatherpress_datetime:a}})}),[r,n,i,t,e,o,a]),(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("section",{children:(0,_.jsx)(E,{})}),(0,_.jsx)("section",{children:a?(0,_.jsx)(M,{}):(0,_.jsx)(P,{})}),(0,_.jsx)("section",{children:(0,_.jsx)(F,{})})]})},$=(e,t,r)=>{const n=O(f("settings.dateFormat")),a=O(f("settings.timeFormat")),i=f("settings.showTimezone")?"z":"",o=n+" "+a;r=b(r);let d=n+" "+a+" "+i;return s().tz(e,r).format(n)===s().tz(t,r).format(n)&&(d=a+" "+i),(0,l.sprintf)(/* translators: %1$s: datetime start, %2$s: datetime end, %3$s timezone. */ /* translators: %1$s: datetime start, %2$s: datetime end, %3$s timezone. */ +(0,l.__)("%1$s to %2$s %3$s","gatherpress"),s().tz(e,r).format(o),s().tz(t,r).format(d),function(e){return e=b(e),(0,l.__)("GMT","gatherpress")!==e?"":function(e=""){return e.replace(":","")}(f("eventDetails.dateTime.timezone"))}(r))},A=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"gatherpress/event-date","version":"2.0.0","title":"Event Date","category":"gatherpress","icon":"clock","example":{"viewportWidth":350},"description":"Displays the date and time for an event.","attributes":{"eventEnd":{"type":"string"},"eventStart":{"type":"string"},"textAlign":{"type":"string"}},"supports":{"html":false,"color":{"gradients":true,"link":true,"__experimentalDefaultControls":{"background":true,"text":true,"link":true}},"spacing":{"margin":true,"padding":true},"typography":{"fontSize":true,"lineHeight":true,"__experimentalFontFamily":true,"__experimentalFontWeight":true,"__experimentalFontStyle":true,"__experimentalTextTransform":true,"__experimentalTextDecoration":true,"__experimentalLetterSpacing":true,"__experimentalDefaultControls":{"fontSize":true}},"interactivity":{"clientNavigation":true},"__experimentalBorder":{"radius":true,"color":true,"width":true,"style":true,"__experimentalDefaultControls":{"radius":true,"color":true,"width":true,"style":true}}},"textdomain":"gatherpress","editorScript":"file:./index.js","style":"file:./style-index.css","render":"file:./render.php"}');(0,n.registerBlockType)(A,{edit:({attributes:{textAlign:e},setAttributes:t})=>{const r=(0,d.useBlockProps)({className:o({[`has-text-align-${e}`]:e})}),{dateTimeStart:n,dateTimeEnd:a,timezone:s}=(0,u.useSelect)((e=>({dateTimeStart:e("gatherpress/datetime").getDateTimeStart(),dateTimeEnd:e("gatherpress/datetime").getDateTimeEnd(),timezone:e("gatherpress/datetime").getTimezone()})),[]);return(0,_.jsxs)("div",{...r,children:[(0,_.jsx)(d.BlockControls,{children:(0,_.jsx)(d.AlignmentToolbar,{value:e,onChange:e=>t({textAlign:e})})}),$(n,a,s),g()&&(0,_.jsx)(d.InspectorControls,{children:(0,_.jsx)(c.PanelBody,{children:(0,_.jsx)(c.__experimentalVStack,{spacing:4,children:(0,_.jsx)(Y,{})})})})]})},save:()=>null})}},r={};function n(e){var a=r[e];if(void 0!==a)return a.exports;var s=r[e]={exports:{}};return t[e](s,s.exports,n),s.exports}n.m=t,e=[],n.O=(t,r,a,s)=>{if(!r){var i=1/0;for(c=0;c=s)&&Object.keys(n.O).every((e=>n.O[e](r[l])))?r.splice(l--,1):(o=!1,s0&&e[c-1][2]>s;c--)e[c]=e[c-1];e[c]=[r,a,s]},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={532:0,4:0};n.O.j=t=>0===e[t];var t=(t,r)=>{var a,s,[i,o,l]=r,d=0;if(i.some((t=>0!==e[t]))){for(a in o)n.o(o,a)&&(n.m[a]=o[a]);if(l)var c=l(n)}for(t&&t(r);dn(6244)));a=n.O(a)})(); \ No newline at end of file diff --git a/build/blocks/venue/index.asset.php b/build/blocks/venue/index.asset.php index 324d0b56e..e6641bca9 100644 --- a/build/blocks/venue/index.asset.php +++ b/build/blocks/venue/index.asset.php @@ -1 +1 @@ - array('moment', 'react', 'react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-element', 'wp-i18n'), 'version' => '48c337124ea797af392b'); + array('moment', 'react', 'react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => '7a389cf0120f005a0791'); diff --git a/build/blocks/venue/index.js b/build/blocks/venue/index.js index 8705ba9a9..81ff04134 100644 --- a/build/blocks/venue/index.js +++ b/build/blocks/venue/index.js @@ -1,3 +1,3 @@ -(()=>{var e,t,n,r,o,i={7701:(e,t,n)=>{"use strict";const r=window.wp.blocks,o=window.wp.i18n,i=window.wp.blockEditor,l=window.wp.components,s=window.wp.data,a=window.wp.element,c=window.ReactJSXRuntime,u=e=>{const{zoom:t,type:n,className:r,location:o,height:i}=e,l={border:0,height:i,width:"100%"},s="https://maps.google.com/maps?"+new URLSearchParams({q:o,z:t||10,t:n||"m",output:"embed"}).toString();return(0,c.jsx)("iframe",{src:s,style:l,className:r,title:o})};function d(){const e=(0,s.select)("core/editor")?.getCurrentPostType();return"gatherpress_event"===e||"gatherpress_venue"===e}function p(e){if("object"==typeof GatherPress)return e.split(".").reduce(((e,t)=>e&&e[t]),GatherPress)}const f=e=>{const{zoom:t=10,className:r,location:i,height:l=300,latitude:s,longitude:u}=e,[d,f]=(0,a.useState)(null),h={height:l};return(0,a.useEffect)((()=>{(async()=>{const{default:e}=await n.e(481).then(n.t.bind(n,3481,23));await n.e(535).then(n.bind(n,1535)),await n.e(272).then(n.t.bind(n,1272,17)),await n.e(980).then(n.t.bind(n,8980,17)),f(e)})()}),[]),(0,a.useEffect)((()=>{if(!d||!s||!u)return;const e=d.map("map").setView([s,u],t);return d.Icon.Default.imagePath=p("urls.pluginUrl")+"build/images/",d.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:(0,o.sprintf)(/* translators: %s: Link to OpenStreetMap contributors. */ /* translators: %s: Link to OpenStreetMap contributors. */ -(0,o.__)("© %s contributors","gatherpress"),'OpenStreetMap')}).addTo(e),d.marker([s,u]).addTo(e).bindPopup(i),()=>{e.remove()}}),[d,s,i,u,t]),d&&s&&u?(0,c.jsx)("div",{className:r,id:"map",style:h}):null},h=e=>{const t=(0,s.select)("core")?.canUser("create","posts"),n=Boolean((0,s.select)("core/edit-post")),{zoom:r,type:o,className:i,latitude:l,longitude:a}=e;let{location:d,height:h}=e;h||(h=300),!t||n||d||(d="660 4th Street #119 San Francisco CA 94107, USA");const m=p("settings.mapPlatform");return d&&m?"google"===m?(0,c.jsx)(u,{location:d,className:i,zoom:r,type:o,height:h}):"osm"===m?(0,c.jsx)(f,{location:d,latitude:l,longitude:a,className:i,zoom:r,height:h}):(0,c.jsx)(c.Fragment,{}):(0,c.jsx)(c.Fragment,{})};var m=n(1609);const g=Math.min,v=Math.max,y=Math.round,b=Math.floor,w=e=>({x:e,y:e}),x={left:"right",right:"left",bottom:"top",top:"bottom"},_={start:"end",end:"start"};function E(e,t,n){return v(e,g(t,n))}function S(e,t){return"function"==typeof e?e(t):e}function T(e){return e.split("-")[0]}function k(e){return e.split("-")[1]}function A(e){return"x"===e?"y":"x"}function O(e){return"y"===e?"height":"width"}function C(e){return["top","bottom"].includes(T(e))?"y":"x"}function j(e){return A(C(e))}function N(e){return e.replace(/start|end/g,(e=>_[e]))}function P(e){return e.replace(/left|right|bottom|top/g,(e=>x[e]))}function R(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function L(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function I(e,t,n){let{reference:r,floating:o}=e;const i=C(t),l=j(t),s=O(l),a=T(t),c="y"===i,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[s]/2-o[s]/2;let f;switch(a){case"top":f={x:u,y:r.y-o.height};break;case"bottom":f={x:u,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-o.width,y:d};break;default:f={x:r.x,y:r.y}}switch(k(t)){case"start":f[l]-=p*(n&&c?-1:1);break;case"end":f[l]+=p*(n&&c?-1:1)}return f}async function D(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:l,elements:s,strategy:a}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:f=0}=S(t,e),h=R(f),m=s[p?"floating"===d?"reference":"floating":d],g=L(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:a})),v="floating"===d?{x:r,y:o,width:l.floating.width,height:l.floating.height}:l.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),b=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},w=L(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:y,strategy:a}):v);return{top:(g.top-w.top+h.top)/b.y,bottom:(w.bottom-g.bottom+h.bottom)/b.y,left:(g.left-w.left+h.left)/b.x,right:(w.right-g.right+h.right)/b.x}}function M(e){return B(e)?(e.nodeName||"").toLowerCase():"#document"}function F(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function z(e){var t;return null==(t=(B(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function B(e){return e instanceof Node||e instanceof F(e).Node}function H(e){return e instanceof Element||e instanceof F(e).Element}function V(e){return e instanceof HTMLElement||e instanceof F(e).HTMLElement}function W(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof F(e).ShadowRoot)}function q(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=K(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function $(e){return["table","td","th"].includes(M(e))}function U(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function X(e){const t=G(),n=H(e)?K(e):e;return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function G(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Y(e){return["html","body","#document"].includes(M(e))}function K(e){return F(e).getComputedStyle(e)}function Z(e){return H(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function J(e){if("html"===M(e))return e;const t=e.assignedSlot||e.parentNode||W(e)&&e.host||z(e);return W(t)?t.host:t}function Q(e){const t=J(e);return Y(t)?e.ownerDocument?e.ownerDocument.body:e.body:V(t)&&q(t)?t:Q(t)}function ee(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=Q(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),l=F(o);return i?t.concat(l,l.visualViewport||[],q(o)?o:[],l.frameElement&&n?ee(l.frameElement):[]):t.concat(o,ee(o,[],n))}function te(e){const t=K(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=V(e),i=o?e.offsetWidth:n,l=o?e.offsetHeight:r,s=y(n)!==i||y(r)!==l;return s&&(n=i,r=l),{width:n,height:r,$:s}}function ne(e){return H(e)?e:e.contextElement}function re(e){const t=ne(e);if(!V(t))return w(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=te(t);let l=(i?y(n.width):n.width)/r,s=(i?y(n.height):n.height)/o;return l&&Number.isFinite(l)||(l=1),s&&Number.isFinite(s)||(s=1),{x:l,y:s}}const oe=w(0);function ie(e){const t=F(e);return G()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:oe}function le(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=ne(e);let l=w(1);t&&(r?H(r)&&(l=re(r)):l=re(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==F(e))&&t}(i,n,r)?ie(i):w(0);let a=(o.left+s.x)/l.x,c=(o.top+s.y)/l.y,u=o.width/l.x,d=o.height/l.y;if(i){const e=F(i),t=r&&H(r)?F(r):r;let n=e,o=n.frameElement;for(;o&&r&&t!==n;){const e=re(o),t=o.getBoundingClientRect(),r=K(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,l=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;a*=e.x,c*=e.y,u*=e.x,d*=e.y,a+=i,c+=l,n=F(o),o=n.frameElement}}return L({width:u,height:d,x:a,y:c})}function se(e){return le(z(e)).left+Z(e).scrollLeft}function ae(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=F(e),r=z(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,s=0,a=0;if(o){i=o.width,l=o.height;const e=G();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,a=o.offsetTop)}return{width:i,height:l,x:s,y:a}}(e,n);else if("document"===t)r=function(e){const t=z(e),n=Z(e),r=e.ownerDocument.body,o=v(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=v(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+se(e);const s=-n.scrollTop;return"rtl"===K(r).direction&&(l+=v(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:s}}(z(e));else if(H(t))r=function(e,t){const n=le(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=V(e)?re(e):w(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=ie(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return L(r)}function ce(e,t){const n=J(e);return!(n===t||!H(n)||Y(n))&&("fixed"===K(n).position||ce(n,t))}function ue(e,t,n){const r=V(t),o=z(t),i="fixed"===n,l=le(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const a=w(0);if(r||!r&&!i)if(("body"!==M(t)||q(o))&&(s=Z(t)),r){const e=le(t,!0,i,t);a.x=e.x+t.clientLeft,a.y=e.y+t.clientTop}else o&&(a.x=se(o));return{x:l.left+s.scrollLeft-a.x,y:l.top+s.scrollTop-a.y,width:l.width,height:l.height}}function de(e){return"static"===K(e).position}function pe(e,t){return V(e)&&"fixed"!==K(e).position?t?t(e):e.offsetParent:null}function fe(e,t){const n=F(e);if(U(e))return n;if(!V(e)){let t=J(e);for(;t&&!Y(t);){if(H(t)&&!de(t))return t;t=J(t)}return n}let r=pe(e,t);for(;r&&$(r)&&de(r);)r=pe(r,t);return r&&Y(r)&&de(r)&&!X(r)?n:r||function(e){let t=J(e);for(;V(t)&&!Y(t);){if(X(t))return t;if(U(t))return null;t=J(t)}return null}(e)||n}const he={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,l=z(r),s=!!t&&U(t.floating);if(r===l||s&&i)return n;let a={scrollLeft:0,scrollTop:0},c=w(1);const u=w(0),d=V(r);if((d||!d&&!i)&&(("body"!==M(r)||q(l))&&(a=Z(r)),V(r))){const e=le(r);c=re(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-a.scrollLeft*c.x+u.x,y:n.y*c.y-a.scrollTop*c.y+u.y}},getDocumentElement:z,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?U(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=ee(e,[],!1).filter((e=>H(e)&&"body"!==M(e))),o=null;const i="fixed"===K(e).position;let l=i?J(e):e;for(;H(l)&&!Y(l);){const t=K(l),n=X(l);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||q(l)&&!n&&ce(e,l))?r=r.filter((e=>e!==l)):o=t,l=J(l)}return t.set(e,r),r}(t,this._c):[].concat(n),r],l=i[0],s=i.reduce(((e,n)=>{const r=ae(t,n,o);return e.top=v(r.top,e.top),e.right=g(r.right,e.right),e.bottom=g(r.bottom,e.bottom),e.left=v(r.left,e.left),e}),ae(t,l,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:fe,getElementRects:async function(e){const t=this.getOffsetParent||fe,n=this.getDimensions,r=await n(e.floating);return{reference:ue(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=te(e);return{width:t,height:n}},getScale:re,isElement:H,isRTL:function(e){return"rtl"===K(e).direction}};const me=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:l,middlewareData:s}=t,a=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),l=T(n),s=k(n),a="y"===C(n),c=["left","top"].includes(l)?-1:1,u=i&&a?-1:1,d=S(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&"number"==typeof h&&(f="end"===s?-1*h:h),a?{x:f*u,y:p*c}:{x:p*c,y:f*u}}(t,e);return l===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:o+a.x,y:i+a.y,data:{...a,placement:l}}}}},ge=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...a}=S(e,t),c={x:n,y:r},u=await D(t,a),d=C(T(o)),p=A(d);let f=c[p],h=c[d];if(i){const e="y"===p?"bottom":"right";f=E(f+u["y"===p?"top":"left"],f,f-u[e])}if(l){const e="y"===d?"bottom":"right";h=E(h+u["y"===d?"top":"left"],h,h-u[e])}const m=s.fn({...t,[p]:f,[d]:h});return{...m,data:{x:m.x-n,y:m.y-r}}}}},ve=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:l,initialPlacement:s,platform:a,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...g}=S(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=T(o),y=C(s),b=T(s)===s,w=await(null==a.isRTL?void 0:a.isRTL(c.floating)),x=p||(b||!m?[P(s)]:function(e){const t=P(e);return[N(e),t,N(t)]}(s)),_="none"!==h;!p&&_&&x.push(...function(e,t,n,r){const o=k(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:l;default:return[]}}(T(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(N)))),i}(s,m,h,w));const E=[s,...x],A=await D(t,g),R=[];let L=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&R.push(A[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=k(e),o=j(e),i=O(o);let l="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=P(l)),[l,P(l)]}(o,l,w);R.push(A[e[0]],A[e[1]])}if(L=[...L,{placement:o,overflows:R}],!R.every((e=>e<=0))){var I,M;const e=((null==(I=i.flip)?void 0:I.index)||0)+1,t=E[e];if(t)return{data:{index:e,overflows:L},reset:{placement:t}};let n=null==(M=L.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:M.placement;if(!n)switch(f){case"bestFit":{var F;const e=null==(F=L.filter((e=>{if(_){const t=C(e.placement);return t===y||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:F[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}},ye=(e,t,n)=>{const r=new Map,o={platform:he,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,s=i.filter(Boolean),a=await(null==l.isRTL?void 0:l.isRTL(t));let c=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=I(c,r,a),p=r,f={},h=0;for(let n=0;n{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{},place:r};if(null===t)return{tooltipStyles:{},tooltipArrowStyles:{},place:r};const a=l;return n?(a.push({name:"arrow",options:c={element:n,padding:5},async fn(e){const{x:t,y:n,placement:r,rects:o,platform:i,elements:l,middlewareData:s}=e,{element:a,padding:u=0}=S(c,e)||{};if(null==a)return{};const d=R(u),p={x:t,y:n},f=j(r),h=O(f),m=await i.getDimensions(a),v="y"===f,y=v?"top":"left",b=v?"bottom":"right",w=v?"clientHeight":"clientWidth",x=o.reference[h]+o.reference[f]-p[f]-o.floating[h],_=p[f]-o.reference[f],T=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a));let A=T?T[w]:0;A&&await(null==i.isElement?void 0:i.isElement(T))||(A=l.floating[w]||o.floating[h]);const C=x/2-_/2,N=A/2-m[h]/2-1,P=g(d[y],N),L=g(d[b],N),I=P,D=A-m[h]-L,M=A/2-m[h]/2+C,F=E(I,M,D),z=!s.arrow&&null!=k(r)&&M!==F&&o.reference[h]/2-(M{var o,i;const l={left:`${e}px`,top:`${t}px`,border:s},{x:a,y:c}=null!==(o=r.arrow)&&void 0!==o?o:{x:0,y:0},u=null!==(i={top:"bottom",right:"left",bottom:"top",left:"right"}[n.split("-")[0]])&&void 0!==i?i:"bottom",d=s&&{borderBottom:s,borderRight:s};let p=0;if(s){const e=`${s}`.match(/(\d+)px/);p=(null==e?void 0:e[1])?Number(e[1]):1}return{tooltipStyles:l,tooltipArrowStyles:{left:null!=a?`${a}px`:"",top:null!=c?`${c}px`:"",right:"",bottom:"",...d,[u]:`-${4+p}px`},place:n}}))):ye(e,t,{placement:"bottom",strategy:i,middleware:a}).then((({x:e,y:t,placement:n})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{},place:n})));var c},Ee=(e,t)=>!("CSS"in window&&"supports"in window.CSS)||window.CSS.supports(e,t),Se=(e,t,n)=>{let r=null;const o=function(...o){const i=()=>{r=null,n||e.apply(this,o)};n&&!r&&(e.apply(this,o),r=setTimeout(i,t)),n||(r&&clearTimeout(r),r=setTimeout(i,t))};return o.cancel=()=>{r&&(clearTimeout(r),r=null)},o},Te=e=>null!==e&&!Array.isArray(e)&&"object"==typeof e,ke=(e,t)=>{if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every(((e,n)=>ke(e,t[n])));if(Array.isArray(e)!==Array.isArray(t))return!1;if(!Te(e)||!Te(t))return e===t;const n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every((n=>ke(e[n],t[n])))},Ae=e=>{if(!(e instanceof HTMLElement||e instanceof SVGElement))return!1;const t=getComputedStyle(e);return["overflow","overflow-x","overflow-y"].some((e=>{const n=t.getPropertyValue(e);return"auto"===n||"scroll"===n}))},Oe=e=>{if(!e)return null;let t=e.parentElement;for(;t;){if(Ae(t))return t;t=t.parentElement}return document.scrollingElement||document.documentElement},Ce="undefined"!=typeof window?m.useLayoutEffect:m.useEffect,je=e=>{e.current&&(clearTimeout(e.current),e.current=null)},Ne={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},Pe=(0,m.createContext)({getTooltipData:()=>Ne});function Re(e="DEFAULT_TOOLTIP_ID"){return(0,m.useContext)(Pe).getTooltipData(e)}var Le={tooltip:"core-styles-module_tooltip__3vRRp",fixed:"core-styles-module_fixed__pcSol",arrow:"core-styles-module_arrow__cvMwQ",noArrow:"core-styles-module_noArrow__xock6",clickable:"core-styles-module_clickable__ZuTTB",show:"core-styles-module_show__Nt9eE",closing:"core-styles-module_closing__sGnxF"},Ie={tooltip:"styles-module_tooltip__mnnfp",arrow:"styles-module_arrow__K0L3T",dark:"styles-module_dark__xNqje",light:"styles-module_light__Z6W-X",success:"styles-module_success__A2AKt",warning:"styles-module_warning__SCK0X",error:"styles-module_error__JvumD",info:"styles-module_info__BWdHW"};const De=({forwardRef:e,id:t,className:n,classNameArrow:r,variant:o="dark",anchorId:i,anchorSelect:l,place:s="top",offset:a=10,events:c=["hover"],openOnClick:u=!1,positionStrategy:d="absolute",middlewares:p,wrapper:f,delayShow:h=0,delayHide:y=0,float:w=!1,hidden:x=!1,noArrow:_=!1,clickable:E=!1,closeOnEsc:S=!1,closeOnScroll:T=!1,closeOnResize:k=!1,openEvents:A,closeEvents:O,globalCloseEvents:C,imperativeModeOnly:j,style:N,position:P,afterShow:R,afterHide:L,content:I,contentWrapperRef:D,isOpen:M,defaultIsOpen:F=!1,setIsOpen:B,activeAnchor:H,setActiveAnchor:V,border:W,opacity:q,arrowColor:$,role:U="tooltip"})=>{var X;const G=(0,m.useRef)(null),Y=(0,m.useRef)(null),K=(0,m.useRef)(null),Z=(0,m.useRef)(null),J=(0,m.useRef)(null),[Q,te]=(0,m.useState)({tooltipStyles:{},tooltipArrowStyles:{},place:s}),[re,oe]=(0,m.useState)(!1),[ie,se]=(0,m.useState)(!1),[ae,ce]=(0,m.useState)(null),ue=(0,m.useRef)(!1),de=(0,m.useRef)(null),{anchorRefs:pe,setActiveAnchor:fe}=Re(t),he=(0,m.useRef)(!1),[me,ge]=(0,m.useState)([]),ve=(0,m.useRef)(!1),ye=u||c.includes("click"),we=ye||(null==A?void 0:A.click)||(null==A?void 0:A.dblclick)||(null==A?void 0:A.mousedown),xe=A?{...A}:{mouseover:!0,focus:!0,mouseenter:!1,click:!1,dblclick:!1,mousedown:!1};!A&&ye&&Object.assign(xe,{mouseenter:!1,focus:!1,mouseover:!1,click:!0});const Ee=O?{...O}:{mouseout:!0,blur:!0,mouseleave:!1,click:!1,dblclick:!1,mouseup:!1};!O&&ye&&Object.assign(Ee,{mouseleave:!1,blur:!1,mouseout:!1});const Te=C?{...C}:{escape:S||!1,scroll:T||!1,resize:k||!1,clickOutsideAnchor:we||!1};j&&(Object.assign(xe,{mouseenter:!1,focus:!1,click:!1,dblclick:!1,mousedown:!1}),Object.assign(Ee,{mouseleave:!1,blur:!1,click:!1,dblclick:!1,mouseup:!1}),Object.assign(Te,{escape:!1,scroll:!1,resize:!1,clickOutsideAnchor:!1})),Ce((()=>(ve.current=!0,()=>{ve.current=!1})),[]);const Ae=e=>{ve.current&&(e&&se(!0),setTimeout((()=>{ve.current&&(null==B||B(e),void 0===M&&oe(e))}),10))};(0,m.useEffect)((()=>{if(void 0===M)return()=>null;M&&se(!0);const e=setTimeout((()=>{oe(M)}),10);return()=>{clearTimeout(e)}}),[M]),(0,m.useEffect)((()=>{if(re!==ue.current)if(je(J),ue.current=re,re)null==R||R();else{const e=(()=>{const e=getComputedStyle(document.body).getPropertyValue("--rt-transition-show-delay").match(/^([\d.]+)(ms|s)$/);if(!e)return 0;const[,t,n]=e;return Number(t)*("ms"===n?1:1e3)})();J.current=setTimeout((()=>{se(!1),ce(null),null==L||L()}),e+25)}}),[re]);const Ne=e=>{te((t=>ke(t,e)?t:e))},Pe=(e=h)=>{je(K),ie?Ae(!0):K.current=setTimeout((()=>{Ae(!0)}),e)},De=(e=y)=>{je(Z),Z.current=setTimeout((()=>{he.current||Ae(!1)}),e)},Me=e=>{var t;if(!e)return;const n=null!==(t=e.currentTarget)&&void 0!==t?t:e.target;if(!(null==n?void 0:n.isConnected))return V(null),void fe({current:null});h?Pe():Ae(!0),V(n),fe({current:n}),je(Z)},Fe=()=>{E?De(y||100):y?De():Ae(!1),je(K)},ze=({x:e,y:t})=>{var n;const r={getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,left:e,right:e,bottom:t})};_e({place:null!==(n=null==ae?void 0:ae.place)&&void 0!==n?n:s,offset:a,elementReference:r,tooltipReference:G.current,tooltipArrowReference:Y.current,strategy:d,middlewares:p,border:W}).then((e=>{Ne(e)}))},Be=e=>{if(!e)return;const t=e,n={x:t.clientX,y:t.clientY};ze(n),de.current=n},He=e=>{var t;if(!re)return;const n=e.target;n.isConnected&&((null===(t=G.current)||void 0===t?void 0:t.contains(n))||[document.querySelector(`[id='${i}']`),...me].some((e=>null==e?void 0:e.contains(n)))||(Ae(!1),je(K)))},Ve=Se(Me,50,!0),We=Se(Fe,50,!0),qe=e=>{We.cancel(),Ve(e)},$e=()=>{Ve.cancel(),We()},Ue=(0,m.useCallback)((()=>{var e,t;const n=null!==(e=null==ae?void 0:ae.position)&&void 0!==e?e:P;n?ze(n):w?de.current&&ze(de.current):(null==H?void 0:H.isConnected)&&_e({place:null!==(t=null==ae?void 0:ae.place)&&void 0!==t?t:s,offset:a,elementReference:H,tooltipReference:G.current,tooltipArrowReference:Y.current,strategy:d,middlewares:p,border:W}).then((e=>{ve.current&&Ne(e)}))}),[re,H,I,N,s,null==ae?void 0:ae.place,a,d,P,null==ae?void 0:ae.position,w]);(0,m.useEffect)((()=>{var e,t;const n=new Set(pe);me.forEach((e=>{n.add({current:e})}));const r=document.querySelector(`[id='${i}']`);r&&n.add({current:r});const o=()=>{Ae(!1)},l=Oe(H),s=Oe(G.current);Te.scroll&&(window.addEventListener("scroll",o),null==l||l.addEventListener("scroll",o),null==s||s.addEventListener("scroll",o));let a=null;Te.resize?window.addEventListener("resize",o):H&&G.current&&(a=function(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:a=!1}=r,c=ne(e),u=o||i?[...c?ee(c):[],...ee(t)]:[];u.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=c&&s?function(e,t){let n,r=null;const o=z(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function l(s,a){void 0===s&&(s=!1),void 0===a&&(a=1),i();const{left:c,top:u,width:d,height:p}=e.getBoundingClientRect();if(s||t(),!d||!p)return;const f={rootMargin:-b(u)+"px "+-b(o.clientWidth-(c+d))+"px "+-b(o.clientHeight-(u+p))+"px "+-b(c)+"px",threshold:v(0,g(1,a))||1};let h=!0;function m(e){const t=e[0].intersectionRatio;if(t!==a){if(!h)return l();t?l(!1,t):n=setTimeout((()=>{l(!1,1e-7)}),1e3)}h=!1}try{r=new IntersectionObserver(m,{...f,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(m,f)}r.observe(e)}(!0),i}(c,n):null;let p,f=-1,h=null;l&&(h=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame((()=>{var e;null==(e=h)||e.observe(t)}))),n()})),c&&!a&&h.observe(c),h.observe(t));let m=a?le(e):null;return a&&function t(){const r=le(e);!m||r.x===m.x&&r.y===m.y&&r.width===m.width&&r.height===m.height||n(),m=r,p=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=h)||e.disconnect(),h=null,a&&cancelAnimationFrame(p)}}(H,G.current,Ue,{ancestorResize:!0,elementResize:!0,layoutShift:!0}));const c=e=>{"Escape"===e.key&&Ae(!1)};Te.escape&&window.addEventListener("keydown",c),Te.clickOutsideAnchor&&window.addEventListener("click",He);const u=[],d=e=>{re&&(null==e?void 0:e.target)===H||Me(e)},p=e=>{re&&(null==e?void 0:e.target)===H&&Fe()},f=["mouseover","mouseout","mouseenter","mouseleave","focus","blur"],h=["click","dblclick","mousedown","mouseup"];Object.entries(xe).forEach((([e,t])=>{t&&(f.includes(e)?u.push({event:e,listener:qe}):h.includes(e)&&u.push({event:e,listener:d}))})),Object.entries(Ee).forEach((([e,t])=>{t&&(f.includes(e)?u.push({event:e,listener:$e}):h.includes(e)&&u.push({event:e,listener:p}))})),w&&u.push({event:"pointermove",listener:Be});const m=()=>{he.current=!0},y=()=>{he.current=!1,Fe()};return E&&!we&&(null===(e=G.current)||void 0===e||e.addEventListener("mouseenter",m),null===(t=G.current)||void 0===t||t.addEventListener("mouseleave",y)),u.forEach((({event:e,listener:t})=>{n.forEach((n=>{var r;null===(r=n.current)||void 0===r||r.addEventListener(e,t)}))})),()=>{var e,t;Te.scroll&&(window.removeEventListener("scroll",o),null==l||l.removeEventListener("scroll",o),null==s||s.removeEventListener("scroll",o)),Te.resize?window.removeEventListener("resize",o):null==a||a(),Te.clickOutsideAnchor&&window.removeEventListener("click",He),Te.escape&&window.removeEventListener("keydown",c),E&&!we&&(null===(e=G.current)||void 0===e||e.removeEventListener("mouseenter",m),null===(t=G.current)||void 0===t||t.removeEventListener("mouseleave",y)),u.forEach((({event:e,listener:t})=>{n.forEach((n=>{var r;null===(r=n.current)||void 0===r||r.removeEventListener(e,t)}))}))}}),[H,Ue,ie,pe,me,A,O,C,ye,h,y]),(0,m.useEffect)((()=>{var e,n;let r=null!==(n=null!==(e=null==ae?void 0:ae.anchorSelect)&&void 0!==e?e:l)&&void 0!==n?n:"";!r&&t&&(r=`[data-tooltip-id='${t.replace(/'/g,"\\'")}']`);const o=new MutationObserver((e=>{const n=[],o=[];e.forEach((e=>{if("attributes"===e.type&&"data-tooltip-id"===e.attributeName&&(e.target.getAttribute("data-tooltip-id")===t?n.push(e.target):e.oldValue===t&&o.push(e.target)),"childList"===e.type){if(H){const t=[...e.removedNodes].filter((e=>1===e.nodeType));if(r)try{o.push(...t.filter((e=>e.matches(r)))),o.push(...t.flatMap((e=>[...e.querySelectorAll(r)])))}catch(e){}t.some((e=>{var t;return!!(null===(t=null==e?void 0:e.contains)||void 0===t?void 0:t.call(e,H))&&(se(!1),Ae(!1),V(null),je(K),je(Z),!0)}))}if(r)try{const t=[...e.addedNodes].filter((e=>1===e.nodeType));n.push(...t.filter((e=>e.matches(r)))),n.push(...t.flatMap((e=>[...e.querySelectorAll(r)])))}catch(e){}}})),(n.length||o.length)&&ge((e=>[...e.filter((e=>!o.includes(e))),...n]))}));return o.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-tooltip-id"],attributeOldValue:!0}),()=>{o.disconnect()}}),[t,l,null==ae?void 0:ae.anchorSelect,H]),(0,m.useEffect)((()=>{Ue()}),[Ue]),(0,m.useEffect)((()=>{if(!(null==D?void 0:D.current))return()=>null;const e=new ResizeObserver((()=>{setTimeout((()=>Ue()))}));return e.observe(D.current),()=>{e.disconnect()}}),[I,null==D?void 0:D.current]),(0,m.useEffect)((()=>{var e;const t=document.querySelector(`[id='${i}']`),n=[...me,t];H&&n.includes(H)||V(null!==(e=me[0])&&void 0!==e?e:t)}),[i,me,H]),(0,m.useEffect)((()=>(F&&Ae(!0),()=>{je(K),je(Z)})),[]),(0,m.useEffect)((()=>{var e;let n=null!==(e=null==ae?void 0:ae.anchorSelect)&&void 0!==e?e:l;if(!n&&t&&(n=`[data-tooltip-id='${t.replace(/'/g,"\\'")}']`),n)try{const e=Array.from(document.querySelectorAll(n));ge(e)}catch(e){ge([])}}),[t,l,null==ae?void 0:ae.anchorSelect]),(0,m.useEffect)((()=>{K.current&&(je(K),Pe(h))}),[h]);const Xe=null!==(X=null==ae?void 0:ae.content)&&void 0!==X?X:I,Ge=re&&Object.keys(Q.tooltipStyles).length>0;return(0,m.useImperativeHandle)(e,(()=>({open:e=>{if(null==e?void 0:e.anchorSelect)try{document.querySelector(e.anchorSelect)}catch(t){return void console.warn(`[react-tooltip] "${e.anchorSelect}" is not a valid CSS selector`)}ce(null!=e?e:null),(null==e?void 0:e.delay)?Pe(e.delay):Ae(!0)},close:e=>{(null==e?void 0:e.delay)?De(e.delay):Ae(!1)},activeAnchor:H,place:Q.place,isOpen:Boolean(ie&&!x&&Xe&&Ge)}))),ie&&!x&&Xe?m.createElement(f,{id:t,role:U,className:be("react-tooltip",Le.tooltip,Ie.tooltip,Ie[o],n,`react-tooltip__place-${Q.place}`,Le[Ge?"show":"closing"],Ge?"react-tooltip__show":"react-tooltip__closing","fixed"===d&&Le.fixed,E&&Le.clickable),onTransitionEnd:e=>{je(J),re||"opacity"!==e.propertyName||(se(!1),ce(null),null==L||L())},style:{...N,...Q.tooltipStyles,opacity:void 0!==q&&Ge?q:void 0},ref:G},Xe,m.createElement(f,{className:be("react-tooltip-arrow",Le.arrow,Ie.arrow,r,_&&Le.noArrow),style:{...Q.tooltipArrowStyles,background:$?`linear-gradient(to right bottom, transparent 50%, ${$} 50%)`:void 0},ref:Y})):null},Me=({content:e})=>m.createElement("span",{dangerouslySetInnerHTML:{__html:e}}),Fe=m.forwardRef((({id:e,anchorId:t,anchorSelect:n,content:r,html:o,render:i,className:l,classNameArrow:s,variant:a="dark",place:c="top",offset:u=10,wrapper:d="div",children:p=null,events:f=["hover"],openOnClick:h=!1,positionStrategy:g="absolute",middlewares:v,delayShow:y=0,delayHide:b=0,float:w=!1,hidden:x=!1,noArrow:_=!1,clickable:E=!1,closeOnEsc:S=!1,closeOnScroll:T=!1,closeOnResize:k=!1,openEvents:A,closeEvents:O,globalCloseEvents:C,imperativeModeOnly:j=!1,style:N,position:P,isOpen:R,defaultIsOpen:L=!1,disableStyleInjection:I=!1,border:D,opacity:M,arrowColor:F,setIsOpen:z,afterShow:B,afterHide:H,role:V="tooltip"},W)=>{const[q,$]=(0,m.useState)(r),[U,X]=(0,m.useState)(o),[G,Y]=(0,m.useState)(c),[K,Z]=(0,m.useState)(a),[J,Q]=(0,m.useState)(u),[ee,te]=(0,m.useState)(y),[ne,re]=(0,m.useState)(b),[oe,ie]=(0,m.useState)(w),[le,se]=(0,m.useState)(x),[ae,ce]=(0,m.useState)(d),[ue,de]=(0,m.useState)(f),[pe,fe]=(0,m.useState)(g),[he,me]=(0,m.useState)(null),[ge,ve]=(0,m.useState)(null),ye=(0,m.useRef)(I),{anchorRefs:we,activeAnchor:xe}=Re(e),_e=e=>null==e?void 0:e.getAttributeNames().reduce(((t,n)=>{var r;return n.startsWith("data-tooltip-")&&(t[n.replace(/^data-tooltip-/,"")]=null!==(r=null==e?void 0:e.getAttribute(n))&&void 0!==r?r:null),t}),{}),Se=e=>{const t={place:e=>{var t;Y(null!==(t=e)&&void 0!==t?t:c)},content:e=>{$(null!=e?e:r)},html:e=>{X(null!=e?e:o)},variant:e=>{var t;Z(null!==(t=e)&&void 0!==t?t:a)},offset:e=>{Q(null===e?u:Number(e))},wrapper:e=>{var t;ce(null!==(t=e)&&void 0!==t?t:d)},events:e=>{const t=null==e?void 0:e.split(" ");de(null!=t?t:f)},"position-strategy":e=>{var t;fe(null!==(t=e)&&void 0!==t?t:g)},"delay-show":e=>{te(null===e?y:Number(e))},"delay-hide":e=>{re(null===e?b:Number(e))},float:e=>{ie(null===e?w:"true"===e)},hidden:e=>{se(null===e?x:"true"===e)},"class-name":e=>{me(e)}};Object.values(t).forEach((e=>e(null))),Object.entries(e).forEach((([e,n])=>{var r;null===(r=t[e])||void 0===r||r.call(t,n)}))};(0,m.useEffect)((()=>{$(r)}),[r]),(0,m.useEffect)((()=>{X(o)}),[o]),(0,m.useEffect)((()=>{Y(c)}),[c]),(0,m.useEffect)((()=>{Z(a)}),[a]),(0,m.useEffect)((()=>{Q(u)}),[u]),(0,m.useEffect)((()=>{te(y)}),[y]),(0,m.useEffect)((()=>{re(b)}),[b]),(0,m.useEffect)((()=>{ie(w)}),[w]),(0,m.useEffect)((()=>{se(x)}),[x]),(0,m.useEffect)((()=>{fe(g)}),[g]),(0,m.useEffect)((()=>{ye.current!==I&&console.warn("[react-tooltip] Do not change `disableStyleInjection` dynamically.")}),[I]),(0,m.useEffect)((()=>{"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent("react-tooltip-inject-styles",{detail:{disableCore:"core"===I,disableBase:I}}))}),[]),(0,m.useEffect)((()=>{var r;const o=new Set(we);let i=n;if(!i&&e&&(i=`[data-tooltip-id='${e.replace(/'/g,"\\'")}']`),i)try{document.querySelectorAll(i).forEach((e=>{o.add({current:e})}))}catch(r){console.warn(`[react-tooltip] "${i}" is not a valid CSS selector`)}const l=document.querySelector(`[id='${t}']`);if(l&&o.add({current:l}),!o.size)return()=>null;const s=null!==(r=null!=ge?ge:l)&&void 0!==r?r:xe.current,a=new MutationObserver((e=>{e.forEach((e=>{var t;if(!s||"attributes"!==e.type||!(null===(t=e.attributeName)||void 0===t?void 0:t.startsWith("data-tooltip-")))return;const n=_e(s);Se(n)}))})),c={attributes:!0,childList:!1,subtree:!1};if(s){const e=_e(s);Se(e),a.observe(s,c)}return()=>{a.disconnect()}}),[we,xe,ge,t,n]),(0,m.useEffect)((()=>{(null==N?void 0:N.border)&&console.warn("[react-tooltip] Do not set `style.border`. Use `border` prop instead."),D&&!Ee("border",`${D}`)&&console.warn(`[react-tooltip] "${D}" is not a valid \`border\`.`),(null==N?void 0:N.opacity)&&console.warn("[react-tooltip] Do not set `style.opacity`. Use `opacity` prop instead."),M&&!Ee("opacity",`${M}`)&&console.warn(`[react-tooltip] "${M}" is not a valid \`opacity\`.`)}),[]);let Te=p;const ke=(0,m.useRef)(null);if(i){const e=i({content:(null==ge?void 0:ge.getAttribute("data-tooltip-content"))||q||null,activeAnchor:ge});Te=e?m.createElement("div",{ref:ke,className:"react-tooltip-content-wrapper"},e):null}else q&&(Te=q);U&&(Te=m.createElement(Me,{content:U}));const Ae={forwardRef:W,id:e,anchorId:t,anchorSelect:n,className:be(l,he),classNameArrow:s,content:Te,contentWrapperRef:ke,place:G,variant:K,offset:J,wrapper:ae,events:ue,openOnClick:h,positionStrategy:pe,middlewares:v,delayShow:ee,delayHide:ne,float:oe,hidden:le,noArrow:_,clickable:E,closeOnEsc:S,closeOnScroll:T,closeOnResize:k,openEvents:A,closeEvents:O,globalCloseEvents:C,imperativeModeOnly:j,style:N,position:P,isOpen:R,defaultIsOpen:L,border:D,opacity:M,arrowColor:F,setIsOpen:z,afterShow:B,afterHide:H,activeAnchor:ge,setActiveAnchor:e=>ve(e),role:V};return m.createElement(De,{...Ae})}));"undefined"!=typeof window&&window.addEventListener("react-tooltip-inject-styles",(e=>{e.detail.disableCore||xe({css:":root{--rt-color-white:#fff;--rt-color-dark:#222;--rt-color-success:#8dc572;--rt-color-error:#be6464;--rt-color-warning:#f0ad4e;--rt-color-info:#337ab7;--rt-opacity:0.9;--rt-transition-show-delay:0.15s;--rt-transition-closing-delay:0.15s}.core-styles-module_tooltip__3vRRp{position:absolute;top:0;left:0;pointer-events:none;opacity:0;will-change:opacity}.core-styles-module_fixed__pcSol{position:fixed}.core-styles-module_arrow__cvMwQ{position:absolute;background:inherit}.core-styles-module_noArrow__xock6{display:none}.core-styles-module_clickable__ZuTTB{pointer-events:auto}.core-styles-module_show__Nt9eE{opacity:var(--rt-opacity);transition:opacity var(--rt-transition-show-delay)ease-out}.core-styles-module_closing__sGnxF{opacity:0;transition:opacity var(--rt-transition-closing-delay)ease-in}",type:"core"}),e.detail.disableBase||xe({css:"\n.styles-module_tooltip__mnnfp{padding:8px 16px;border-radius:3px;font-size:90%;width:max-content}.styles-module_arrow__K0L3T{width:8px;height:8px}[class*='react-tooltip__place-top']>.styles-module_arrow__K0L3T{transform:rotate(45deg)}[class*='react-tooltip__place-right']>.styles-module_arrow__K0L3T{transform:rotate(135deg)}[class*='react-tooltip__place-bottom']>.styles-module_arrow__K0L3T{transform:rotate(225deg)}[class*='react-tooltip__place-left']>.styles-module_arrow__K0L3T{transform:rotate(315deg)}.styles-module_dark__xNqje{background:var(--rt-color-dark);color:var(--rt-color-white)}.styles-module_light__Z6W-X{background-color:var(--rt-color-white);color:var(--rt-color-dark)}.styles-module_success__A2AKt{background-color:var(--rt-color-success);color:var(--rt-color-white)}.styles-module_warning__SCK0X{background-color:var(--rt-color-warning);color:var(--rt-color-white)}.styles-module_error__JvumD{background-color:var(--rt-color-error);color:var(--rt-color-white)}.styles-module_info__BWdHW{background-color:var(--rt-color-info);color:var(--rt-color-white)}",type:"base"})}));const ze=(e,t="")=>{for(const[n,r]of Object.entries(e)){let e=n;t&&(e+="_"+String(t));const o=new CustomEvent(e,{detail:r});dispatchEvent(o)}},Be=(e,t="")=>{for(const[n,r]of Object.entries(e)){let e=n;t&&(e+="_"+String(t)),addEventListener(e,(e=>{r(e.detail)}),!1)}},He=({onlineEventLinkDefault:e=""})=>{const t=(0,o.__)("Online event","gatherpress"),[n,r]=(0,a.useState)(e);return Be({setOnlineEventLink:r},p("eventDetails.postId")),(0,c.jsxs)(l.Flex,{justify:"normal",gap:"3",children:[(0,c.jsx)(l.FlexItem,{display:"flex",children:(0,c.jsx)(l.Icon,{icon:"video-alt2"})}),(0,c.jsxs)(l.FlexItem,{children:[!n&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("span",{tabIndex:"0",className:"gatherpress-tooltip","data-tooltip-id":"gatherpress-online-event-tooltip","data-tooltip-content":(0,o.__)("Link available for attendees only.","gatherpress"),children:t}),(0,c.jsx)(Fe,{id:"gatherpress-online-event-tooltip"})]}),n&&(0,c.jsx)("a",{href:n,rel:"noreferrer",target:"_blank",children:t})]})]})};var Ve=n(442);const We=Ve.default||Ve,qe=({name:e,fullAddress:t,phoneNumber:n,website:r})=>(0,c.jsxs)(c.Fragment,{children:[(e||t)&&(0,c.jsxs)(l.Flex,{justify:"normal",align:"flex-start",gap:"4",children:[(0,c.jsx)(l.FlexItem,{display:"flex",className:"gatherpress-venue__icon",children:(0,c.jsx)(l.Icon,{icon:"location"})}),(0,c.jsxs)(l.FlexItem,{children:[e&&(0,c.jsx)("div",{className:"gatherpress-venue__name",children:(0,c.jsx)("strong",{children:We(e)})}),t&&(0,c.jsx)("div",{className:"gatherpress-venue__full-address",children:We(t)})]})]}),(n||r)&&(0,c.jsxs)(l.Flex,{justify:"normal",gap:"8",children:[n&&(0,c.jsx)(l.FlexItem,{children:(0,c.jsxs)(l.Flex,{justify:"normal",gap:"4",children:[(0,c.jsx)(l.FlexItem,{display:"flex",className:"gatherpress-venue__icon",children:(0,c.jsx)(l.Icon,{icon:"phone"})}),(0,c.jsx)(l.FlexItem,{children:(0,c.jsx)("div",{className:"gatherpress-venue__phone-number",children:n})})]})}),r&&(0,c.jsx)(l.FlexItem,{children:(0,c.jsxs)(l.Flex,{justify:"normal",gap:"4",children:[(0,c.jsx)(l.FlexItem,{display:"flex",className:"gatherpress-venue__icon",children:(0,c.jsx)(l.Icon,{icon:"admin-site-alt3"})}),(0,c.jsx)(l.FlexItem,{children:(0,c.jsx)("div",{className:"gatherpress-venue__website",children:(0,c.jsx)("a",{href:r,target:"_blank",rel:"noreferrer noopener",children:r})})})]})})]})]}),$e=({name:e="",fullAddress:t,phoneNumber:n,website:r,isOnlineEventTerm:o=!1,onlineEventLink:i=""})=>(0,c.jsxs)(c.Fragment,{children:[!o&&(0,c.jsx)(qe,{name:e,fullAddress:t,phoneNumber:n,website:r}),o&&(0,c.jsx)(He,{onlineEventLinkDefault:i})]}),Ue=e=>{const{isSelected:t}=e,n=t?"none":"block";return(0,c.jsxs)("div",{style:{position:"relative"},children:[e.children,(0,c.jsx)("div",{style:{position:"absolute",top:"0",right:"0",bottom:"0",left:"0",display:n}})]})};function Xe(){return"gatherpress_venue"===(0,s.select)("core/editor")?.getCurrentPostType()}const Ge=()=>{const[e,t]=(0,a.useState)(""),[n,r]=(0,a.useState)(""),[i,u]=(0,a.useState)(""),[d,p]=(0,a.useState)(""),[f,h]=(0,a.useState)(!1),[m,g]=(0,a.useState)(""),[v,y]=(0,a.useState)(""),[b,w]=(0,a.useState)(""),x=(0,s.useDispatch)("core/editor").editPost,{unlockPostSaving:_}=(0,s.useDispatch)("core/editor"),E=(0,s.useSelect)((e=>e("core/editor").getEditedPostAttribute("_gatherpress_venue"))),S=(0,s.useSelect)((e=>e("core").getEntityRecord("taxonomy","_gatherpress_venue",E))),T=S?.slug.replace(/^_/,""),[k,A]=(0,a.useState)(""),O=E+":"+k,C=(0,s.useSelect)((e=>e("core").getEntityRecords("postType","gatherpress_venue",{per_page:1,slug:k})));(0,a.useEffect)((()=>{var e,n,i,l,s,a;let c={};if(k&&Array.isArray(C)){var d;const e=null!==(d=C[0]?.meta?.gatherpress_venue_information)&&void 0!==d?d:"{}";var f;e&&(c=JSON.parse(e),c.name=null!==(f=C[0]?.title.rendered)&&void 0!==f?f:"")}const h=null!==(e=c?.name)&&void 0!==e?e:(0,o.__)("No venue selected.","gatherpress"),m=null!==(n=c?.fullAddress)&&void 0!==n?n:"",v=null!==(i=c?.phoneNumber)&&void 0!==i?i:"",b=null!==(l=c?.website)&&void 0!==l?l:"",x=null!==(s=c?.latitude)&&void 0!==s?s:"0",_=null!==(a=c?.longitude)&&void 0!==a?a:"0";T&&A(T),w(O?String(O):""),t(h),r(m),u(v),p(b),g(x),y(_),ze({setName:h,setFullAddress:m,setPhoneNumber:v,setWebsite:b,setLatitude:x,setLongitude:_,setIsOnlineEventTerm:"online-event"===k})}),[k,C,T,O]);let j=(0,s.useSelect)((e=>e("core").getEntityRecords("taxonomy","_gatherpress_venue",{per_page:-1,context:"view"})),[]);return j?(j=j.map((e=>({label:e.name,value:e.id+":"+e.slug.replace(/^_/,"")}))),j.unshift({value:":",label:(0,o.__)("Choose a venue","gatherpress")})):j=[],(0,c.jsx)(l.PanelRow,{children:(0,c.jsx)(l.SelectControl,{label:(0,o.__)("Venue Selector","gatherpress"),value:b,onChange:e=>{(e=>{w(e);const t=""!==(e=e.split(":"))[0]?[e[0]]:[];x({_gatherpress_venue:t}),A(e[1]),_()})(e)},options:j})})},Ye=window.wp.compose,Ke=()=>{var e,t,n;const r=(0,s.useDispatch)("core/editor").editPost,i=e=>{const t=JSON.stringify({...u,...e});r({meta:{gatherpress_venue_information:t}})};let u=(0,s.useSelect)((e=>e("core/editor").getEditedPostAttribute("meta").gatherpress_venue_information));u=u?JSON.parse(u):{};const[d,p]=(0,a.useState)(null!==(e=u.fullAddress)&&void 0!==e?e:""),[f,h]=(0,a.useState)(null!==(t=u.phoneNumber)&&void 0!==t?t:""),[m,g]=(0,a.useState)(null!==(n=u.website)&&void 0!==n?n:"");Be({setFullAddress:p,setPhoneNumber:h,setWebsite:g});const v=(0,a.useRef)(i),y=(0,a.useCallback)((()=>{let e=null,t=null;fetch(`https://nominatim.openstreetmap.org/search?q=${d}&format=geojson`).then((e=>{if(!e.ok)throw new Error((0,o.sprintf)(/* translators: %s: Error message */ /* translators: %s: Error message */ -(0,o.__)("Network response was not ok %s","gatherpress"),e.statusText));return e.json()})).then((n=>{n.features.length>0&&(e=n.features[0].geometry.coordinates[1],t=n.features[0].geometry.coordinates[0]),v.current({latitude:e,longitude:t})}))}),[d]),b=(0,Ye.useDebounce)(y,300);return(0,a.useEffect)((()=>{v.current=i}),[i]),(0,a.useEffect)((()=>{b()}),[d,b]),(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(l.TextControl,{label:(0,o.__)("Full Address","gatherpress"),value:d,onChange:e=>{ze({setFullAddress:e}),i({fullAddress:e})}}),(0,c.jsx)(l.TextControl,{label:(0,o.__)("Phone Number","gatherpress"),value:f,onChange:e=>{ze({setPhoneNumber:e}),i({phoneNumber:e})}}),(0,c.jsx)(l.TextControl,{label:(0,o.__)("Website","gatherpress"),value:m,type:"url",onChange:e=>{ze({setWebsite:e}),i({website:e})}})]})},Ze=()=>(0,c.jsx)("section",{children:(0,c.jsx)(Ke,{})}),Je=()=>{const{editPost:e,unlockPostSaving:t}=(0,s.useDispatch)("core/editor"),n=(0,s.useSelect)((e=>e("core/editor").getEditedPostAttribute("meta").gatherpress_online_event_link)),[r,i]=(0,a.useState)(n);return Be({setOnlineEventLink:i},p("eventDetails.postId")),(0,c.jsx)(l.TextControl,{label:(0,o.__)("Online event link","gatherpress"),value:r,placeholder:(0,o.__)("Add link to online event","gatherpress"),onChange:n=>{(n=>{e({meta:{gatherpress_online_event_link:n}}),i(n),ze({setOnlineEventLink:n},p("eventDetails.postId")),t()})(n)}})},Qe=window.moment;var et=n.n(Qe);window.wp.date;const tt="YYYY-MM-DD HH:mm:ss",nt=et().tz(rt()).add(1,"day").set("hour",18).set("minute",0).set("second",0).format(tt);function rt(e=p("eventDetails.dateTime.timezone")){return et().tz.zone(e)?e:(0,o.__)("GMT","gatherpress")}et().tz(nt,rt()).add(2,"hours").format(tt),(0,o.__)("1 hour","gatherpress"),(0,o.__)("1.5 hours","gatherpress"),(0,o.__)("2 hours","gatherpress"),(0,o.__)("3 hours","gatherpress"),(0,o.__)("Set an end time…","gatherpress");const ot=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"gatherpress/venue","version":"1.1.0","title":"Venue","category":"gatherpress","icon":"location","example":{},"description":"Provides information about an event venue.","attributes":{"mapShow":{"type":"boolean","default":true},"mapAlign":{"type":"string","default":""},"mapZoomLevel":{"type":"number","default":10},"mapType":{"type":"string","default":"m"},"mapHeight":{"type":"number","default":300}},"supports":{"align":["wide"],"html":false},"textdomain":"gatherpress","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","viewScript":"file:./venue.js","viewStyle":"file:./venue.css","render":"file:./render.php"}');(0,r.registerBlockType)(ot,{edit:({attributes:e,setAttributes:t,isSelected:n})=>{const{mapZoomLevel:r,mapType:u,mapHeight:f}=e,[m,g]=(0,a.useState)(""),[v,y]=(0,a.useState)(""),[b,w]=(0,a.useState)(""),[x,_]=(0,a.useState)(""),[E,S]=(0,a.useState)(""),[T,k]=(0,a.useState)(""),[A,O]=(0,a.useState)(!1),C=(0,i.useBlockProps)(),j=p("settings.mapPlatform"),N=(0,s.useSelect)((e=>e("core/editor")?.getEditedPostAttribute("meta")?.gatherpress_online_event_link));let{mapShow:P}=e,R=(0,s.useSelect)((e=>e("core/editor")?.getEditedPostAttribute("meta")?.gatherpress_venue_information));return R=R?JSON.parse(R):{},P&&v&&(P=!0),P&&!d()&&(P=!0),Be({setName:g,setFullAddress:y,setPhoneNumber:S,setWebsite:k,setIsOnlineEventTerm:O,setLatitude:w,setLongitude:_}),(0,a.useEffect)((()=>{Xe()&&(y(R.fullAddress),S(R.phoneNumber),k(R.website),w(R.latitude),_(R.longitude),g(v||E||T?"":(0,o.__)("Add venue information.","gatherpress"))),"gatherpress_event"!==(0,s.select)("core/editor")?.getCurrentPostType()&&d()||g(v||E||T?"":(0,o.__)("No venue selected.","gatherpress"))}),[R.fullAddress,R.phoneNumber,R.website,R.latitude,R.longitude,v,E,T,b,x]),(0,a.useEffect)((()=>{const e=new Event("resize");window.dispatchEvent(e)}),[f]),(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(i.InspectorControls,{children:[d()&&(0,c.jsxs)(l.PanelBody,{title:(0,o.__)("Venue settings","gatherpress"),initialOpen:!0,children:[(0,c.jsxs)(l.PanelRow,{children:[!Xe()&&(0,c.jsx)(Ge,{}),Xe()&&(0,c.jsx)(Ze,{})]}),A&&(0,c.jsx)(l.PanelRow,{children:(0,c.jsx)(Je,{})})]}),!A&&(0,c.jsxs)(l.PanelBody,{title:(0,o.__)("Map settings","gatherpress"),initialOpen:!0,children:[(0,c.jsx)(l.PanelRow,{children:(0,o.__)("Show map on venue","gatherpress")}),(0,c.jsx)(l.PanelRow,{children:(0,c.jsx)(l.ToggleControl,{label:P?(0,o.__)("Display the map","gatherpress"):(0,o.__)("Hide the map","gatherpress"),checked:P,onChange:e=>{t({mapShow:e})}})}),(0,c.jsx)(l.RangeControl,{label:(0,o.__)("Zoom level","gatherpress"),beforeIcon:"search",value:r,onChange:e=>t({mapZoomLevel:e}),min:1,max:22}),"google"===j&&(0,c.jsx)(l.RadioControl,{label:(0,o.__)("Map type","gatherpress"),selected:u,options:[{label:(0,o.__)("Roadmap","gatherpress"),value:"m"},{label:(0,o.__)("Satellite","gatherpress"),value:"k"}],onChange:e=>{t({mapType:e})}}),(0,c.jsx)(l.RangeControl,{label:(0,o.__)("Map height","gatherpress"),beforeIcon:"location",value:f,onChange:e=>t({mapHeight:e}),min:100,max:1e3})]})]}),(0,c.jsx)("div",{...C,children:(0,c.jsx)(Ue,{isSelected:n,children:(0,c.jsxs)("div",{className:"gatherpress-venue",children:[(0,c.jsx)($e,{name:m,fullAddress:v,phoneNumber:E,website:T,isOnlineEventTerm:A,onlineEventLink:N}),P&&!A&&(0,c.jsx)(h,{location:v,latitude:b,longitude:x,zoom:r,type:u,height:f})]})})})]})},save:()=>{}})},5413:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Doctype=t.CDATA=t.Tag=t.Style=t.Script=t.Comment=t.Directive=t.Text=t.Root=t.isTag=t.ElementType=void 0,function(e){e.Root="root",e.Text="text",e.Directive="directive",e.Comment="comment",e.Script="script",e.Style="style",e.Tag="tag",e.CDATA="cdata",e.Doctype="doctype"}(n=t.ElementType||(t.ElementType={})),t.isTag=function(e){return e.type===n.Tag||e.type===n.Script||e.type===n.Style},t.Root=n.Root,t.Text=n.Text,t.Directive=n.Directive,t.Comment=n.Comment,t.Script=n.Script,t.Style=n.Style,t.Tag=n.Tag,t.CDATA=n.CDATA,t.Doctype=n.Doctype},1141:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.DomHandler=void 0;var i=n(5413),l=n(6957);o(n(6957),t);var s={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},a=function(){function e(e,t,n){this.dom=[],this.root=new l.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,"function"==typeof t&&(n=t,t=s),"object"==typeof e&&(t=e,e=void 0),this.callback=null!=e?e:null,this.options=null!=t?t:s,this.elementCB=null!=n?n:null}return e.prototype.onparserinit=function(e){this.parser=e},e.prototype.onreset=function(){this.dom=[],this.root=new l.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},e.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},e.prototype.onerror=function(e){this.handleCallback(e)},e.prototype.onclosetag=function(){this.lastNode=null;var e=this.tagStack.pop();this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(e)},e.prototype.onopentag=function(e,t){var n=this.options.xmlMode?i.ElementType.Tag:void 0,r=new l.Element(e,t,void 0,n);this.addNode(r),this.tagStack.push(r)},e.prototype.ontext=function(e){var t=this.lastNode;if(t&&t.type===i.ElementType.Text)t.data+=e,this.options.withEndIndices&&(t.endIndex=this.parser.endIndex);else{var n=new l.Text(e);this.addNode(n),this.lastNode=n}},e.prototype.oncomment=function(e){if(this.lastNode&&this.lastNode.type===i.ElementType.Comment)this.lastNode.data+=e;else{var t=new l.Comment(e);this.addNode(t),this.lastNode=t}},e.prototype.oncommentend=function(){this.lastNode=null},e.prototype.oncdatastart=function(){var e=new l.Text(""),t=new l.CDATA([e]);this.addNode(t),e.parent=t,this.lastNode=e},e.prototype.oncdataend=function(){this.lastNode=null},e.prototype.onprocessinginstruction=function(e,t){var n=new l.ProcessingInstruction(e,t);this.addNode(n)},e.prototype.handleCallback=function(e){if("function"==typeof this.callback)this.callback(e,this.dom);else if(e)throw e},e.prototype.addNode=function(e){var t=this.tagStack[this.tagStack.length-1],n=t.children[t.children.length-1];this.options.withStartIndices&&(e.startIndex=this.parser.startIndex),this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),t.children.push(e),n&&(e.prev=n,n.next=e),e.parent=t,this.lastNode=null},e}();t.DomHandler=a,t.default=a},6957:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"childNodes",{get:function(){return this.children},set:function(e){this.children=e},enumerable:!1,configurable:!0}),t}(s);t.NodeWithChildren=p;var f=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=l.ElementType.CDATA,t}return o(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),t}(p);t.CDATA=f;var h=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=l.ElementType.Root,t}return o(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),t}(p);t.Document=h;var m=function(e){function t(t,n,r,o){void 0===r&&(r=[]),void 0===o&&(o="script"===t?l.ElementType.Script:"style"===t?l.ElementType.Style:l.ElementType.Tag);var i=e.call(this,r)||this;return i.name=t,i.attribs=n,i.type=o,i}return o(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tagName",{get:function(){return this.name},set:function(e){this.name=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"attributes",{get:function(){var e=this;return Object.keys(this.attribs).map((function(t){var n,r;return{name:t,value:e.attribs[t],namespace:null===(n=e["x-attribsNamespace"])||void 0===n?void 0:n[t],prefix:null===(r=e["x-attribsPrefix"])||void 0===r?void 0:r[t]}}))},enumerable:!1,configurable:!0}),t}(p);function g(e){return(0,l.isTag)(e)}function v(e){return e.type===l.ElementType.CDATA}function y(e){return e.type===l.ElementType.Text}function b(e){return e.type===l.ElementType.Comment}function w(e){return e.type===l.ElementType.Directive}function x(e){return e.type===l.ElementType.Root}function _(e,t){var n;if(void 0===t&&(t=!1),y(e))n=new c(e.data);else if(b(e))n=new u(e.data);else if(g(e)){var r=t?E(e.children):[],o=new m(e.name,i({},e.attribs),r);r.forEach((function(e){return e.parent=o})),null!=e.namespace&&(o.namespace=e.namespace),e["x-attribsNamespace"]&&(o["x-attribsNamespace"]=i({},e["x-attribsNamespace"])),e["x-attribsPrefix"]&&(o["x-attribsPrefix"]=i({},e["x-attribsPrefix"])),n=o}else if(v(e)){r=t?E(e.children):[];var l=new f(r);r.forEach((function(e){return e.parent=l})),n=l}else if(x(e)){r=t?E(e.children):[];var s=new h(r);r.forEach((function(e){return e.parent=s})),e["x-mode"]&&(s["x-mode"]=e["x-mode"]),n=s}else{if(!w(e))throw new Error("Not implemented yet: ".concat(e.type));var a=new d(e.name,e.data);null!=e["x-name"]&&(a["x-name"]=e["x-name"],a["x-publicId"]=e["x-publicId"],a["x-systemId"]=e["x-systemId"]),n=a}return n.startIndex=e.startIndex,n.endIndex=e.endIndex,null!=e.sourceCodeLocation&&(n.sourceCodeLocation=e.sourceCodeLocation),n}function E(e){for(var t=e.map((function(e){return _(e,!0)})),n=1;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CASE_SENSITIVE_TAG_NAMES_MAP=t.CASE_SENSITIVE_TAG_NAMES=void 0,t.CASE_SENSITIVE_TAG_NAMES=["animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"],t.CASE_SENSITIVE_TAG_NAMES_MAP=t.CASE_SENSITIVE_TAG_NAMES.reduce((function(e,t){return e[t.toLowerCase()]=t,e}),{})},5496:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,u,d=e.match(i),p=d&&d[1]?d[1].toLowerCase():"";switch(p){case n:var h=c(e);return l.test(e)||null===(t=null==(g=h.querySelector(r))?void 0:g.parentNode)||void 0===t||t.removeChild(g),s.test(e)||null===(u=null==(g=h.querySelector(o))?void 0:g.parentNode)||void 0===u||u.removeChild(g),h.querySelectorAll(n);case r:case o:var m=a(e).querySelectorAll(p);return s.test(e)&&l.test(e)?m[0].parentNode.childNodes:m;default:return f?f(e):(g=a(e,o).querySelector(o)).childNodes;var g}};var n="html",r="head",o="body",i=/<([a-zA-Z]+[0-9]?)/,l=//i,s=//i,a=function(e,t){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},c=function(e,t){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")},u="object"==typeof window&&window.DOMParser;if("function"==typeof u){var d=new u;a=c=function(e,t){return t&&(e="<".concat(t,">").concat(e,"")),d.parseFromString(e,"text/html")}}if("object"==typeof document&&document.implementation){var p=document.implementation.createHTMLDocument();a=function(e,t){if(t){var n=p.documentElement.querySelector(t);return n&&(n.innerHTML=e),p}return p.documentElement.innerHTML=e,p}}var f,h="object"==typeof document&&document.createElement("template");h&&h.content&&(f=function(e){return h.innerHTML=e,h.content.childNodes})},2471:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];var t=e.match(l),n=t?t[1]:void 0;return(0,i.formatDOM)((0,o.default)(e),null,n)};var o=r(n(5496)),i=n(7731),l=/<(![a-zA-Z\s]+)>/},7731:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatAttributes=i,t.formatDOM=function e(t,n,o){void 0===n&&(n=null);for(var s,a=[],c=0,u=t.length;c{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){void 0===e&&(e={});var n={},c=Boolean(e.type&&s[e.type]);for(var u in e){var d=e[u];if((0,r.isCustomAttribute)(u))n[u]=d;else{var p=u.toLowerCase(),f=a(p);if(f){var h=(0,r.getPropertyInfo)(f);switch(i.includes(f)&&l.includes(t)&&!c&&(f=a("default"+p)),n[f]=d,h&&h.type){case r.BOOLEAN:n[f]=!0;break;case r.OVERLOADED_BOOLEAN:""===d&&(n[f]=!0)}}else o.PRESERVE_CUSTOM_ATTRIBUTES&&(n[u]=d)}}return(0,o.setStyleProp)(e.style,n),n};var r=n(4210),o=n(4958),i=["checked","value"],l=["input","select","textarea"],s={reset:!0,submit:!0};function a(e){return r.possibleStandardNames[e]}},308:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t,n){void 0===n&&(n={});for(var r=[],o="function"==typeof n.replace,c=n.transform||l.returnFirstArg,u=n.library||s,d=u.cloneElement,p=u.createElement,f=u.isValidElement,h=t.length,m=0;m1&&(v=d(v,{key:v.key||m})),r.push(c(v,g,m));continue}}if("text"!==g.type){var y=g,b={};a(y)?((0,l.setStyleProp)(y.attribs.style,y.attribs),b=y.attribs):y.attribs&&(b=(0,i.default)(y.attribs,y.name));var w=void 0;switch(g.type){case"script":case"style":g.children[0]&&(b.dangerouslySetInnerHTML={__html:g.children[0].data});break;case"tag":"textarea"===g.name&&g.children[0]?b.defaultValue=g.children[0].data:g.children&&g.children.length&&(w=e(g.children,n));break;default:continue}h>1&&(b.key=m),r.push(c(p(g.name,b,w),g,m))}else{var x=!g.data.trim().length;if(x&&g.parent&&!(0,l.canTextBeChildOfNode)(g.parent))continue;if(n.trim&&x)continue;r.push(c(g.data,g,m))}}return 1===r.length?r[0]:r};var o=n(1609),i=r(n(840)),l=n(4958),s={cloneElement:o.cloneElement,createElement:o.createElement,isValidElement:o.isValidElement};function a(e){return l.PRESERVE_CUSTOM_ATTRIBUTES&&"tag"===e.type&&(0,l.isCustomComponent)(e.name,e.attribs)}},442:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.htmlToDOM=t.domToReact=t.attributesToProps=t.Text=t.ProcessingInstruction=t.Element=t.Comment=void 0,t.default=function(e,t){if("string"!=typeof e)throw new TypeError("First argument must be a string");return e?(0,l.default)((0,o.default)(e,(null==t?void 0:t.htmlparser2)||a),t):[]};var o=r(n(2471));t.htmlToDOM=o.default;var i=r(n(840));t.attributesToProps=i.default;var l=r(n(308));t.domToReact=l.default;var s=n(1141);Object.defineProperty(t,"Comment",{enumerable:!0,get:function(){return s.Comment}}),Object.defineProperty(t,"Element",{enumerable:!0,get:function(){return s.Element}}),Object.defineProperty(t,"ProcessingInstruction",{enumerable:!0,get:function(){return s.ProcessingInstruction}}),Object.defineProperty(t,"Text",{enumerable:!0,get:function(){return s.Text}});var a={lowerCaseAttributeNames:!1}},4958:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.returnFirstArg=t.canTextBeChildOfNode=t.ELEMENTS_WITH_NO_TEXT_CHILDREN=t.PRESERVE_CUSTOM_ATTRIBUTES=void 0,t.isCustomComponent=function(e,t){return e.includes("-")?!l.has(e):Boolean(t&&"string"==typeof t.is)},t.setStyleProp=function(e,t){if("string"==typeof e)if(e.trim())try{t.style=(0,i.default)(e,s)}catch(e){t.style={}}else t.style={}};var o=n(1609),i=r(n(5229)),l=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]),s={reactCompat:!0};t.PRESERVE_CUSTOM_ATTRIBUTES=Number(o.version.split(".")[0])>=16,t.ELEMENTS_WITH_NO_TEXT_CHILDREN=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]),t.canTextBeChildOfNode=function(e){return!t.ELEMENTS_WITH_NO_TEXT_CHILDREN.has(e.name)},t.returnFirstArg=function(e){return e}},9788:e=>{var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,r=/^\s*/,o=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,a=/^\s+|\s+$/g,c="";function u(e){return e?e.replace(a,c):c}e.exports=function(e,a){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];a=a||{};var d=1,p=1;function f(e){var t=e.match(n);t&&(d+=t.length);var r=e.lastIndexOf("\n");p=~r?e.length-r:p+e.length}function h(){var e={line:d,column:p};return function(t){return t.position=new m(e),b(),t}}function m(e){this.start=e,this.end={line:d,column:p},this.source=a.source}m.prototype.content=e;var g=[];function v(t){var n=new Error(a.source+":"+d+":"+p+": "+t);if(n.reason=t,n.filename=a.source,n.line=d,n.column=p,n.source=e,!a.silent)throw n;g.push(n)}function y(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function b(){y(r)}function w(e){var t;for(e=e||[];t=x();)!1!==t&&e.push(t);return e}function x(){var t=h();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;c!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,c===e.charAt(n-1))return v("End of comment missing");var r=e.slice(2,n-2);return p+=2,f(r),e=e.slice(n),p+=2,t({type:"comment",comment:r})}}function _(){var e=h(),n=y(o);if(n){if(x(),!y(i))return v("property missing ':'");var r=y(l),a=e({type:"declaration",property:u(n[0].replace(t,c)),value:r?u(r[0].replace(t,c)):c});return y(s),a}}return b(),function(){var e,t=[];for(w(t);e=_();)!1!==e&&(t.push(e),w(t));return t}()}},4210:(e,t,n)=>{"use strict";function r(e,t,n,r,o,i,l){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=l}const o={};["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"].forEach((e=>{o[e]=new r(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((([e,t])=>{o[e]=new r(e,1,!1,t,null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((e=>{o[e]=new r(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((e=>{o[e]=new r(e,2,!1,e,null,!1,!1)})),["allowFullScreen","async","autoFocus","autoPlay","controls","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"].forEach((e=>{o[e]=new r(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((e=>{o[e]=new r(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((e=>{o[e]=new r(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((e=>{o[e]=new r(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((e=>{o[e]=new r(e,5,!1,e.toLowerCase(),null,!1,!1)}));const i=/[\-\:]([a-z])/g,l=e=>e[1].toUpperCase();["accent-height","alignment-baseline","arabic-form","baseline-shift","cap-height","clip-path","clip-rule","color-interpolation","color-interpolation-filters","color-profile","color-rendering","dominant-baseline","enable-background","fill-opacity","fill-rule","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","horiz-adv-x","horiz-origin-x","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","overline-position","overline-thickness","paint-order","panose-1","pointer-events","rendering-intent","shape-rendering","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-rendering","underline-position","underline-thickness","unicode-bidi","unicode-range","units-per-em","v-alphabetic","v-hanging","v-ideographic","v-mathematical","vector-effect","vert-adv-y","vert-origin-x","vert-origin-y","word-spacing","writing-mode","xmlns:xlink","x-height"].forEach((e=>{const t=e.replace(i,l);o[t]=new r(t,1,!1,e,null,!1,!1)})),["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach((e=>{const t=e.replace(i,l);o[t]=new r(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((e=>{const t=e.replace(i,l);o[t]=new r(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((e=>{o[e]=new r(e,1,!1,e.toLowerCase(),null,!1,!1)})),o.xlinkHref=new r("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((e=>{o[e]=new r(e,1,!1,e.toLowerCase(),null,!0,!0)}));const{CAMELCASE:s,SAME:a,possibleStandardNames:c}=n(6811),u=RegExp.prototype.test.bind(new RegExp("^(data|aria)-[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$")),d=Object.keys(c).reduce(((e,t)=>{const n=c[t];return n===a?e[t]=t:n===s?e[t.toLowerCase()]=t:e[t]=n,e}),{});t.BOOLEAN=3,t.BOOLEANISH_STRING=2,t.NUMERIC=5,t.OVERLOADED_BOOLEAN=4,t.POSITIVE_NUMERIC=6,t.RESERVED=0,t.STRING=1,t.getPropertyInfo=function(e){return o.hasOwnProperty(e)?o[e]:null},t.isCustomAttribute=u,t.possibleStandardNames=d},6811:(e,t)=>{t.SAME=0,t.CAMELCASE=1,t.possibleStandardNames={accept:0,acceptCharset:1,"accept-charset":"acceptCharset",accessKey:1,action:0,allowFullScreen:1,alt:0,as:0,async:0,autoCapitalize:1,autoComplete:1,autoCorrect:1,autoFocus:1,autoPlay:1,autoSave:1,capture:0,cellPadding:1,cellSpacing:1,challenge:0,charSet:1,checked:0,children:0,cite:0,class:"className",classID:1,className:1,cols:0,colSpan:1,content:0,contentEditable:1,contextMenu:1,controls:0,controlsList:1,coords:0,crossOrigin:1,dangerouslySetInnerHTML:1,data:0,dateTime:1,default:0,defaultChecked:1,defaultValue:1,defer:0,dir:0,disabled:0,disablePictureInPicture:1,disableRemotePlayback:1,download:0,draggable:0,encType:1,enterKeyHint:1,for:"htmlFor",form:0,formMethod:1,formAction:1,formEncType:1,formNoValidate:1,formTarget:1,frameBorder:1,headers:0,height:0,hidden:0,high:0,href:0,hrefLang:1,htmlFor:1,httpEquiv:1,"http-equiv":"httpEquiv",icon:0,id:0,innerHTML:1,inputMode:1,integrity:0,is:0,itemID:1,itemProp:1,itemRef:1,itemScope:1,itemType:1,keyParams:1,keyType:1,kind:0,label:0,lang:0,list:0,loop:0,low:0,manifest:0,marginWidth:1,marginHeight:1,max:0,maxLength:1,media:0,mediaGroup:1,method:0,min:0,minLength:1,multiple:0,muted:0,name:0,noModule:1,nonce:0,noValidate:1,open:0,optimum:0,pattern:0,placeholder:0,playsInline:1,poster:0,preload:0,profile:0,radioGroup:1,readOnly:1,referrerPolicy:1,rel:0,required:0,reversed:0,role:0,rows:0,rowSpan:1,sandbox:0,scope:0,scoped:0,scrolling:0,seamless:0,selected:0,shape:0,size:0,sizes:0,span:0,spellCheck:1,src:0,srcDoc:1,srcLang:1,srcSet:1,start:0,step:0,style:0,summary:0,tabIndex:1,target:0,title:0,type:0,useMap:1,value:0,width:0,wmode:0,wrap:0,about:0,accentHeight:1,"accent-height":"accentHeight",accumulate:0,additive:0,alignmentBaseline:1,"alignment-baseline":"alignmentBaseline",allowReorder:1,alphabetic:0,amplitude:0,arabicForm:1,"arabic-form":"arabicForm",ascent:0,attributeName:1,attributeType:1,autoReverse:1,azimuth:0,baseFrequency:1,baselineShift:1,"baseline-shift":"baselineShift",baseProfile:1,bbox:0,begin:0,bias:0,by:0,calcMode:1,capHeight:1,"cap-height":"capHeight",clip:0,clipPath:1,"clip-path":"clipPath",clipPathUnits:1,clipRule:1,"clip-rule":"clipRule",color:0,colorInterpolation:1,"color-interpolation":"colorInterpolation",colorInterpolationFilters:1,"color-interpolation-filters":"colorInterpolationFilters",colorProfile:1,"color-profile":"colorProfile",colorRendering:1,"color-rendering":"colorRendering",contentScriptType:1,contentStyleType:1,cursor:0,cx:0,cy:0,d:0,datatype:0,decelerate:0,descent:0,diffuseConstant:1,direction:0,display:0,divisor:0,dominantBaseline:1,"dominant-baseline":"dominantBaseline",dur:0,dx:0,dy:0,edgeMode:1,elevation:0,enableBackground:1,"enable-background":"enableBackground",end:0,exponent:0,externalResourcesRequired:1,fill:0,fillOpacity:1,"fill-opacity":"fillOpacity",fillRule:1,"fill-rule":"fillRule",filter:0,filterRes:1,filterUnits:1,floodOpacity:1,"flood-opacity":"floodOpacity",floodColor:1,"flood-color":"floodColor",focusable:0,fontFamily:1,"font-family":"fontFamily",fontSize:1,"font-size":"fontSize",fontSizeAdjust:1,"font-size-adjust":"fontSizeAdjust",fontStretch:1,"font-stretch":"fontStretch",fontStyle:1,"font-style":"fontStyle",fontVariant:1,"font-variant":"fontVariant",fontWeight:1,"font-weight":"fontWeight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:1,"glyph-name":"glyphName",glyphOrientationHorizontal:1,"glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphOrientationVertical:1,"glyph-orientation-vertical":"glyphOrientationVertical",glyphRef:1,gradientTransform:1,gradientUnits:1,hanging:0,horizAdvX:1,"horiz-adv-x":"horizAdvX",horizOriginX:1,"horiz-origin-x":"horizOriginX",ideographic:0,imageRendering:1,"image-rendering":"imageRendering",in2:0,in:0,inlist:0,intercept:0,k1:0,k2:0,k3:0,k4:0,k:0,kernelMatrix:1,kernelUnitLength:1,kerning:0,keyPoints:1,keySplines:1,keyTimes:1,lengthAdjust:1,letterSpacing:1,"letter-spacing":"letterSpacing",lightingColor:1,"lighting-color":"lightingColor",limitingConeAngle:1,local:0,markerEnd:1,"marker-end":"markerEnd",markerHeight:1,markerMid:1,"marker-mid":"markerMid",markerStart:1,"marker-start":"markerStart",markerUnits:1,markerWidth:1,mask:0,maskContentUnits:1,maskUnits:1,mathematical:0,mode:0,numOctaves:1,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:1,"overline-position":"overlinePosition",overlineThickness:1,"overline-thickness":"overlineThickness",paintOrder:1,"paint-order":"paintOrder",panose1:0,"panose-1":"panose1",pathLength:1,patternContentUnits:1,patternTransform:1,patternUnits:1,pointerEvents:1,"pointer-events":"pointerEvents",points:0,pointsAtX:1,pointsAtY:1,pointsAtZ:1,prefix:0,preserveAlpha:1,preserveAspectRatio:1,primitiveUnits:1,property:0,r:0,radius:0,refX:1,refY:1,renderingIntent:1,"rendering-intent":"renderingIntent",repeatCount:1,repeatDur:1,requiredExtensions:1,requiredFeatures:1,resource:0,restart:0,result:0,results:0,rotate:0,rx:0,ry:0,scale:0,security:0,seed:0,shapeRendering:1,"shape-rendering":"shapeRendering",slope:0,spacing:0,specularConstant:1,specularExponent:1,speed:0,spreadMethod:1,startOffset:1,stdDeviation:1,stemh:0,stemv:0,stitchTiles:1,stopColor:1,"stop-color":"stopColor",stopOpacity:1,"stop-opacity":"stopOpacity",strikethroughPosition:1,"strikethrough-position":"strikethroughPosition",strikethroughThickness:1,"strikethrough-thickness":"strikethroughThickness",string:0,stroke:0,strokeDasharray:1,"stroke-dasharray":"strokeDasharray",strokeDashoffset:1,"stroke-dashoffset":"strokeDashoffset",strokeLinecap:1,"stroke-linecap":"strokeLinecap",strokeLinejoin:1,"stroke-linejoin":"strokeLinejoin",strokeMiterlimit:1,"stroke-miterlimit":"strokeMiterlimit",strokeWidth:1,"stroke-width":"strokeWidth",strokeOpacity:1,"stroke-opacity":"strokeOpacity",suppressContentEditableWarning:1,suppressHydrationWarning:1,surfaceScale:1,systemLanguage:1,tableValues:1,targetX:1,targetY:1,textAnchor:1,"text-anchor":"textAnchor",textDecoration:1,"text-decoration":"textDecoration",textLength:1,textRendering:1,"text-rendering":"textRendering",to:0,transform:0,typeof:0,u1:0,u2:0,underlinePosition:1,"underline-position":"underlinePosition",underlineThickness:1,"underline-thickness":"underlineThickness",unicode:0,unicodeBidi:1,"unicode-bidi":"unicodeBidi",unicodeRange:1,"unicode-range":"unicodeRange",unitsPerEm:1,"units-per-em":"unitsPerEm",unselectable:0,vAlphabetic:1,"v-alphabetic":"vAlphabetic",values:0,vectorEffect:1,"vector-effect":"vectorEffect",version:0,vertAdvY:1,"vert-adv-y":"vertAdvY",vertOriginX:1,"vert-origin-x":"vertOriginX",vertOriginY:1,"vert-origin-y":"vertOriginY",vHanging:1,"v-hanging":"vHanging",vIdeographic:1,"v-ideographic":"vIdeographic",viewBox:1,viewTarget:1,visibility:0,vMathematical:1,"v-mathematical":"vMathematical",vocab:0,widths:0,wordSpacing:1,"word-spacing":"wordSpacing",writingMode:1,"writing-mode":"writingMode",x1:0,x2:0,x:0,xChannelSelector:1,xHeight:1,"x-height":"xHeight",xlinkActuate:1,"xlink:actuate":"xlinkActuate",xlinkArcrole:1,"xlink:arcrole":"xlinkArcrole",xlinkHref:1,"xlink:href":"xlinkHref",xlinkRole:1,"xlink:role":"xlinkRole",xlinkShow:1,"xlink:show":"xlinkShow",xlinkTitle:1,"xlink:title":"xlinkTitle",xlinkType:1,"xlink:type":"xlinkType",xmlBase:1,"xml:base":"xmlBase",xmlLang:1,"xml:lang":"xmlLang",xmlns:0,"xml:space":"xmlSpace",xmlnsXlink:1,"xmlns:xlink":"xmlnsXlink",xmlSpace:1,y1:0,y2:0,y:0,yChannelSelector:1,z:0,zoomAndPan:1}},5229:function(e,t,n){"use strict";var r=(this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(n(1133)),o=n(8917);function i(e,t){var n={};return e&&"string"==typeof e?((0,r.default)(e,(function(e,r){e&&r&&(n[(0,o.camelCase)(e,t)]=r)})),n):n}i.default=i,e.exports=i},8917:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.camelCase=void 0;var n=/^--[a-zA-Z0-9-]+$/,r=/-([a-z])/g,o=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,l=/^-(ms)-/,s=function(e,t){return t.toUpperCase()},a=function(e,t){return"".concat(t,"-")};t.camelCase=function(e,t){return void 0===t&&(t={}),function(e){return!e||o.test(e)||n.test(e)}(e)?e:(e=e.toLowerCase(),(e=t.reactCompat?e.replace(l,a):e.replace(i,a)).replace(r,s))}},1133:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=r(n(9788));t.default=function(e,t){var n=null;if(!e||"string"!=typeof e)return n;var r=(0,o.default)(e),i="function"==typeof t;return r.forEach((function(e){if("declaration"===e.type){var r=e.property,o=e.value;i?t(r,o,e):o&&((n=n||{})[r]=o)}})),n}},1609:e=>{"use strict";e.exports=window.React},6942:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e="",t=0;t{if(!n){var i=1/0;for(u=0;u=o)&&Object.keys(s.O).every((e=>s.O[e](n[a])))?n.splice(a--,1):(l=!1,o0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[n,r,o]},s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},n=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,s.t=function(e,r){if(1&r&&(e=this(e)),8&r)return e;if("object"==typeof e&&e){if(4&r&&e.__esModule)return e;if(16&r&&"function"==typeof e.then)return e}var o=Object.create(null);s.r(o);var i={};t=t||[null,n({}),n([]),n(n)];for(var l=2&r&&e;"object"==typeof l&&!~t.indexOf(l);l=n(l))Object.getOwnPropertyNames(l).forEach((t=>i[t]=()=>e[t]));return i.default=()=>e,s.d(o,i),o},s.d=(e,t)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce(((t,n)=>(s.f[n](e,t),t)),[])),s.u=e=>e+".js",s.miniCssF=e=>e+".css",s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r={},o="gatherpress:",s.l=(e,t,n,i)=>{if(r[e])r[e].push(t);else{var l,a;if(void 0!==n)for(var c=document.getElementsByTagName("script"),u=0;u{l.onerror=l.onload=null,clearTimeout(f);var o=r[e];if(delete r[e],l.parentNode&&l.parentNode.removeChild(l),o&&o.forEach((e=>e(n))),t)return t(n)},f=setTimeout(p.bind(null,void 0,{type:"timeout",target:l}),12e4);l.onerror=p.bind(null,l.onerror),l.onload=p.bind(null,l.onload),a&&document.head.appendChild(l)}},s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;s.g.importScripts&&(e=s.g.location+"");var t=s.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var r=n.length-1;r>-1&&(!e||!/^http(s?):/.test(e));)e=n[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),s.p=e+"../../"})(),(()=>{if("undefined"!=typeof document){var e={908:0};s.f.miniCss=(t,n)=>{e[t]?n.push(e[t]):0!==e[t]&&{535:1}[t]&&n.push(e[t]=(e=>new Promise(((t,n)=>{var r=s.miniCssF(e),o=s.p+r;if(((e,t)=>{for(var n=document.getElementsByTagName("link"),r=0;r{var i=document.createElement("link");i.rel="stylesheet",i.type="text/css",s.nc&&(i.nonce=s.nc),i.onerror=i.onload=n=>{if(i.onerror=i.onload=null,"load"===n.type)r();else{var l=n&&n.type,s=n&&n.target&&n.target.href||t,a=new Error("Loading CSS chunk "+e+" failed.\n("+l+": "+s+")");a.name="ChunkLoadError",a.code="CSS_CHUNK_LOAD_FAILED",a.type=l,a.request=s,i.parentNode&&i.parentNode.removeChild(i),o(a)}},i.href=t,document.head.appendChild(i)})(e,o,0,t,n)})))(t).then((()=>{e[t]=0}),(n=>{throw delete e[t],n})))}}})(),(()=>{var e={908:0,812:0};s.f.j=(t,n)=>{var r=s.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else if(812!=t){var o=new Promise(((n,o)=>r=e[t]=[n,o]));n.push(r[2]=o);var i=s.p+s.u(t),l=new Error;s.l(i,(n=>{if(s.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var o=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;l.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",l.name="ChunkLoadError",l.type=o,l.request=i,r[1](l)}}),"chunk-"+t,t)}else e[t]=0},s.O.j=t=>0===e[t];var t=(t,n)=>{var r,o,[i,l,a]=n,c=0;if(i.some((t=>0!==e[t]))){for(r in l)s.o(l,r)&&(s.m[r]=l[r]);if(a)var u=a(s)}for(t&&t(n);cs(7701)));a=s.O(a)})(); \ No newline at end of file +(()=>{var e,t,n,r,o,i={5949:(e,t,n)=>{"use strict";const r=window.wp.blocks,o=window.wp.i18n,i=window.wp.blockEditor,l=window.wp.components,s=window.wp.data,a=window.wp.element,c=window.ReactJSXRuntime,u=e=>{const{zoom:t,type:n,className:r,location:o,height:i}=e,l={border:0,height:i,width:"100%"},s="https://maps.google.com/maps?"+new URLSearchParams({q:o,z:t||10,t:n||"m",output:"embed"}).toString();return(0,c.jsx)("iframe",{src:s,style:l,className:r,title:o})};function d(){const e=(0,s.select)("core/editor")?.getCurrentPostType();return"gatherpress_event"===e||"gatherpress_venue"===e}function p(e){if("object"==typeof GatherPress)return e.split(".").reduce(((e,t)=>e&&e[t]),GatherPress)}const f=e=>{const{zoom:t=10,className:r,location:i,height:l=300,latitude:s,longitude:u}=e,[d,f]=(0,a.useState)(null),h={height:l};return(0,a.useEffect)((()=>{(async()=>{const{default:e}=await n.e(481).then(n.t.bind(n,3481,23));await n.e(535).then(n.bind(n,1535)),await n.e(272).then(n.t.bind(n,1272,17)),await n.e(980).then(n.t.bind(n,8980,17)),f(e)})()}),[]),(0,a.useEffect)((()=>{if(!d||!s||!u)return;const e=d.map("map").setView([s,u],t);return d.Icon.Default.imagePath=p("urls.pluginUrl")+"build/images/",d.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:(0,o.sprintf)(/* translators: %s: Link to OpenStreetMap contributors. */ /* translators: %s: Link to OpenStreetMap contributors. */ +(0,o.__)("© %s contributors","gatherpress"),'OpenStreetMap')}).addTo(e),d.marker([s,u]).addTo(e).bindPopup(i),()=>{e.remove()}}),[d,s,i,u,t]),d&&s&&u?(0,c.jsx)("div",{className:r,id:"map",style:h}):null},h=e=>{const t=(0,s.select)("core")?.canUser("create","posts"),n=Boolean((0,s.select)("core/edit-post")),{zoom:r,type:o,className:i,latitude:l,longitude:a}=e;let{location:d,height:h}=e;h||(h=300),!t||n||d||(d="660 4th Street #119 San Francisco CA 94107, USA");const m=p("settings.mapPlatform");return d&&m?"google"===m?(0,c.jsx)(u,{location:d,className:i,zoom:r,type:o,height:h}):"osm"===m?(0,c.jsx)(f,{location:d,latitude:l,longitude:a,className:i,zoom:r,height:h}):(0,c.jsx)(c.Fragment,{}):(0,c.jsx)(c.Fragment,{})};var m=n(1609);const g=Math.min,v=Math.max,y=Math.round,b=Math.floor,w=e=>({x:e,y:e}),x={left:"right",right:"left",bottom:"top",top:"bottom"},_={start:"end",end:"start"};function E(e,t,n){return v(e,g(t,n))}function S(e,t){return"function"==typeof e?e(t):e}function k(e){return e.split("-")[0]}function T(e){return e.split("-")[1]}function A(e){return"x"===e?"y":"x"}function O(e){return"y"===e?"height":"width"}function C(e){return["top","bottom"].includes(k(e))?"y":"x"}function j(e){return A(C(e))}function N(e){return e.replace(/start|end/g,(e=>_[e]))}function P(e){return e.replace(/left|right|bottom|top/g,(e=>x[e]))}function R(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function L(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function I(e,t,n){let{reference:r,floating:o}=e;const i=C(t),l=j(t),s=O(l),a=k(t),c="y"===i,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[s]/2-o[s]/2;let f;switch(a){case"top":f={x:u,y:r.y-o.height};break;case"bottom":f={x:u,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-o.width,y:d};break;default:f={x:r.x,y:r.y}}switch(T(t)){case"start":f[l]-=p*(n&&c?-1:1);break;case"end":f[l]+=p*(n&&c?-1:1)}return f}async function D(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:l,elements:s,strategy:a}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:f=0}=S(t,e),h=R(f),m=s[p?"floating"===d?"reference":"floating":d],g=L(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:a})),v="floating"===d?{x:r,y:o,width:l.floating.width,height:l.floating.height}:l.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),b=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},w=L(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:y,strategy:a}):v);return{top:(g.top-w.top+h.top)/b.y,bottom:(w.bottom-g.bottom+h.bottom)/b.y,left:(g.left-w.left+h.left)/b.x,right:(w.right-g.right+h.right)/b.x}}function M(e){return B(e)?(e.nodeName||"").toLowerCase():"#document"}function F(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function z(e){var t;return null==(t=(B(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function B(e){return e instanceof Node||e instanceof F(e).Node}function H(e){return e instanceof Element||e instanceof F(e).Element}function V(e){return e instanceof HTMLElement||e instanceof F(e).HTMLElement}function W(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof F(e).ShadowRoot)}function q(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=K(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function $(e){return["table","td","th"].includes(M(e))}function U(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function X(e){const t=G(),n=H(e)?K(e):e;return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function G(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Y(e){return["html","body","#document"].includes(M(e))}function K(e){return F(e).getComputedStyle(e)}function Z(e){return H(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function J(e){if("html"===M(e))return e;const t=e.assignedSlot||e.parentNode||W(e)&&e.host||z(e);return W(t)?t.host:t}function Q(e){const t=J(e);return Y(t)?e.ownerDocument?e.ownerDocument.body:e.body:V(t)&&q(t)?t:Q(t)}function ee(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=Q(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),l=F(o);return i?t.concat(l,l.visualViewport||[],q(o)?o:[],l.frameElement&&n?ee(l.frameElement):[]):t.concat(o,ee(o,[],n))}function te(e){const t=K(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=V(e),i=o?e.offsetWidth:n,l=o?e.offsetHeight:r,s=y(n)!==i||y(r)!==l;return s&&(n=i,r=l),{width:n,height:r,$:s}}function ne(e){return H(e)?e:e.contextElement}function re(e){const t=ne(e);if(!V(t))return w(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=te(t);let l=(i?y(n.width):n.width)/r,s=(i?y(n.height):n.height)/o;return l&&Number.isFinite(l)||(l=1),s&&Number.isFinite(s)||(s=1),{x:l,y:s}}const oe=w(0);function ie(e){const t=F(e);return G()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:oe}function le(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=ne(e);let l=w(1);t&&(r?H(r)&&(l=re(r)):l=re(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==F(e))&&t}(i,n,r)?ie(i):w(0);let a=(o.left+s.x)/l.x,c=(o.top+s.y)/l.y,u=o.width/l.x,d=o.height/l.y;if(i){const e=F(i),t=r&&H(r)?F(r):r;let n=e,o=n.frameElement;for(;o&&r&&t!==n;){const e=re(o),t=o.getBoundingClientRect(),r=K(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,l=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;a*=e.x,c*=e.y,u*=e.x,d*=e.y,a+=i,c+=l,n=F(o),o=n.frameElement}}return L({width:u,height:d,x:a,y:c})}function se(e){return le(z(e)).left+Z(e).scrollLeft}function ae(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=F(e),r=z(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,s=0,a=0;if(o){i=o.width,l=o.height;const e=G();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,a=o.offsetTop)}return{width:i,height:l,x:s,y:a}}(e,n);else if("document"===t)r=function(e){const t=z(e),n=Z(e),r=e.ownerDocument.body,o=v(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=v(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+se(e);const s=-n.scrollTop;return"rtl"===K(r).direction&&(l+=v(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:s}}(z(e));else if(H(t))r=function(e,t){const n=le(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=V(e)?re(e):w(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=ie(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return L(r)}function ce(e,t){const n=J(e);return!(n===t||!H(n)||Y(n))&&("fixed"===K(n).position||ce(n,t))}function ue(e,t,n){const r=V(t),o=z(t),i="fixed"===n,l=le(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const a=w(0);if(r||!r&&!i)if(("body"!==M(t)||q(o))&&(s=Z(t)),r){const e=le(t,!0,i,t);a.x=e.x+t.clientLeft,a.y=e.y+t.clientTop}else o&&(a.x=se(o));return{x:l.left+s.scrollLeft-a.x,y:l.top+s.scrollTop-a.y,width:l.width,height:l.height}}function de(e){return"static"===K(e).position}function pe(e,t){return V(e)&&"fixed"!==K(e).position?t?t(e):e.offsetParent:null}function fe(e,t){const n=F(e);if(U(e))return n;if(!V(e)){let t=J(e);for(;t&&!Y(t);){if(H(t)&&!de(t))return t;t=J(t)}return n}let r=pe(e,t);for(;r&&$(r)&&de(r);)r=pe(r,t);return r&&Y(r)&&de(r)&&!X(r)?n:r||function(e){let t=J(e);for(;V(t)&&!Y(t);){if(X(t))return t;if(U(t))return null;t=J(t)}return null}(e)||n}const he={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,l=z(r),s=!!t&&U(t.floating);if(r===l||s&&i)return n;let a={scrollLeft:0,scrollTop:0},c=w(1);const u=w(0),d=V(r);if((d||!d&&!i)&&(("body"!==M(r)||q(l))&&(a=Z(r)),V(r))){const e=le(r);c=re(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-a.scrollLeft*c.x+u.x,y:n.y*c.y-a.scrollTop*c.y+u.y}},getDocumentElement:z,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?U(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=ee(e,[],!1).filter((e=>H(e)&&"body"!==M(e))),o=null;const i="fixed"===K(e).position;let l=i?J(e):e;for(;H(l)&&!Y(l);){const t=K(l),n=X(l);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||q(l)&&!n&&ce(e,l))?r=r.filter((e=>e!==l)):o=t,l=J(l)}return t.set(e,r),r}(t,this._c):[].concat(n),r],l=i[0],s=i.reduce(((e,n)=>{const r=ae(t,n,o);return e.top=v(r.top,e.top),e.right=g(r.right,e.right),e.bottom=g(r.bottom,e.bottom),e.left=v(r.left,e.left),e}),ae(t,l,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:fe,getElementRects:async function(e){const t=this.getOffsetParent||fe,n=this.getDimensions,r=await n(e.floating);return{reference:ue(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=te(e);return{width:t,height:n}},getScale:re,isElement:H,isRTL:function(e){return"rtl"===K(e).direction}};const me=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:l,middlewareData:s}=t,a=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),l=k(n),s=T(n),a="y"===C(n),c=["left","top"].includes(l)?-1:1,u=i&&a?-1:1,d=S(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&"number"==typeof h&&(f="end"===s?-1*h:h),a?{x:f*u,y:p*c}:{x:p*c,y:f*u}}(t,e);return l===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:o+a.x,y:i+a.y,data:{...a,placement:l}}}}},ge=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...a}=S(e,t),c={x:n,y:r},u=await D(t,a),d=C(k(o)),p=A(d);let f=c[p],h=c[d];if(i){const e="y"===p?"bottom":"right";f=E(f+u["y"===p?"top":"left"],f,f-u[e])}if(l){const e="y"===d?"bottom":"right";h=E(h+u["y"===d?"top":"left"],h,h-u[e])}const m=s.fn({...t,[p]:f,[d]:h});return{...m,data:{x:m.x-n,y:m.y-r}}}}},ve=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:l,initialPlacement:s,platform:a,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...g}=S(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=k(o),y=C(s),b=k(s)===s,w=await(null==a.isRTL?void 0:a.isRTL(c.floating)),x=p||(b||!m?[P(s)]:function(e){const t=P(e);return[N(e),t,N(t)]}(s)),_="none"!==h;!p&&_&&x.push(...function(e,t,n,r){const o=T(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:l;default:return[]}}(k(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(N)))),i}(s,m,h,w));const E=[s,...x],A=await D(t,g),R=[];let L=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&R.push(A[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=T(e),o=j(e),i=O(o);let l="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=P(l)),[l,P(l)]}(o,l,w);R.push(A[e[0]],A[e[1]])}if(L=[...L,{placement:o,overflows:R}],!R.every((e=>e<=0))){var I,M;const e=((null==(I=i.flip)?void 0:I.index)||0)+1,t=E[e];if(t)return{data:{index:e,overflows:L},reset:{placement:t}};let n=null==(M=L.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:M.placement;if(!n)switch(f){case"bestFit":{var F;const e=null==(F=L.filter((e=>{if(_){const t=C(e.placement);return t===y||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:F[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}},ye=(e,t,n)=>{const r=new Map,o={platform:he,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,s=i.filter(Boolean),a=await(null==l.isRTL?void 0:l.isRTL(t));let c=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=I(c,r,a),p=r,f={},h=0;for(let n=0;n{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{},place:r};if(null===t)return{tooltipStyles:{},tooltipArrowStyles:{},place:r};const a=l;return n?(a.push({name:"arrow",options:c={element:n,padding:5},async fn(e){const{x:t,y:n,placement:r,rects:o,platform:i,elements:l,middlewareData:s}=e,{element:a,padding:u=0}=S(c,e)||{};if(null==a)return{};const d=R(u),p={x:t,y:n},f=j(r),h=O(f),m=await i.getDimensions(a),v="y"===f,y=v?"top":"left",b=v?"bottom":"right",w=v?"clientHeight":"clientWidth",x=o.reference[h]+o.reference[f]-p[f]-o.floating[h],_=p[f]-o.reference[f],k=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a));let A=k?k[w]:0;A&&await(null==i.isElement?void 0:i.isElement(k))||(A=l.floating[w]||o.floating[h]);const C=x/2-_/2,N=A/2-m[h]/2-1,P=g(d[y],N),L=g(d[b],N),I=P,D=A-m[h]-L,M=A/2-m[h]/2+C,F=E(I,M,D),z=!s.arrow&&null!=T(r)&&M!==F&&o.reference[h]/2-(M{var o,i;const l={left:`${e}px`,top:`${t}px`,border:s},{x:a,y:c}=null!==(o=r.arrow)&&void 0!==o?o:{x:0,y:0},u=null!==(i={top:"bottom",right:"left",bottom:"top",left:"right"}[n.split("-")[0]])&&void 0!==i?i:"bottom",d=s&&{borderBottom:s,borderRight:s};let p=0;if(s){const e=`${s}`.match(/(\d+)px/);p=(null==e?void 0:e[1])?Number(e[1]):1}return{tooltipStyles:l,tooltipArrowStyles:{left:null!=a?`${a}px`:"",top:null!=c?`${c}px`:"",right:"",bottom:"",...d,[u]:`-${4+p}px`},place:n}}))):ye(e,t,{placement:"bottom",strategy:i,middleware:a}).then((({x:e,y:t,placement:n})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{},place:n})));var c},Ee=(e,t)=>!("CSS"in window&&"supports"in window.CSS)||window.CSS.supports(e,t),Se=(e,t,n)=>{let r=null;const o=function(...o){const i=()=>{r=null,n||e.apply(this,o)};n&&!r&&(e.apply(this,o),r=setTimeout(i,t)),n||(r&&clearTimeout(r),r=setTimeout(i,t))};return o.cancel=()=>{r&&(clearTimeout(r),r=null)},o},ke=e=>null!==e&&!Array.isArray(e)&&"object"==typeof e,Te=(e,t)=>{if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every(((e,n)=>Te(e,t[n])));if(Array.isArray(e)!==Array.isArray(t))return!1;if(!ke(e)||!ke(t))return e===t;const n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every((n=>Te(e[n],t[n])))},Ae=e=>{if(!(e instanceof HTMLElement||e instanceof SVGElement))return!1;const t=getComputedStyle(e);return["overflow","overflow-x","overflow-y"].some((e=>{const n=t.getPropertyValue(e);return"auto"===n||"scroll"===n}))},Oe=e=>{if(!e)return null;let t=e.parentElement;for(;t;){if(Ae(t))return t;t=t.parentElement}return document.scrollingElement||document.documentElement},Ce="undefined"!=typeof window?m.useLayoutEffect:m.useEffect,je=e=>{e.current&&(clearTimeout(e.current),e.current=null)},Ne={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},Pe=(0,m.createContext)({getTooltipData:()=>Ne});function Re(e="DEFAULT_TOOLTIP_ID"){return(0,m.useContext)(Pe).getTooltipData(e)}var Le={tooltip:"core-styles-module_tooltip__3vRRp",fixed:"core-styles-module_fixed__pcSol",arrow:"core-styles-module_arrow__cvMwQ",noArrow:"core-styles-module_noArrow__xock6",clickable:"core-styles-module_clickable__ZuTTB",show:"core-styles-module_show__Nt9eE",closing:"core-styles-module_closing__sGnxF"},Ie={tooltip:"styles-module_tooltip__mnnfp",arrow:"styles-module_arrow__K0L3T",dark:"styles-module_dark__xNqje",light:"styles-module_light__Z6W-X",success:"styles-module_success__A2AKt",warning:"styles-module_warning__SCK0X",error:"styles-module_error__JvumD",info:"styles-module_info__BWdHW"};const De=({forwardRef:e,id:t,className:n,classNameArrow:r,variant:o="dark",anchorId:i,anchorSelect:l,place:s="top",offset:a=10,events:c=["hover"],openOnClick:u=!1,positionStrategy:d="absolute",middlewares:p,wrapper:f,delayShow:h=0,delayHide:y=0,float:w=!1,hidden:x=!1,noArrow:_=!1,clickable:E=!1,closeOnEsc:S=!1,closeOnScroll:k=!1,closeOnResize:T=!1,openEvents:A,closeEvents:O,globalCloseEvents:C,imperativeModeOnly:j,style:N,position:P,afterShow:R,afterHide:L,content:I,contentWrapperRef:D,isOpen:M,defaultIsOpen:F=!1,setIsOpen:B,activeAnchor:H,setActiveAnchor:V,border:W,opacity:q,arrowColor:$,role:U="tooltip"})=>{var X;const G=(0,m.useRef)(null),Y=(0,m.useRef)(null),K=(0,m.useRef)(null),Z=(0,m.useRef)(null),J=(0,m.useRef)(null),[Q,te]=(0,m.useState)({tooltipStyles:{},tooltipArrowStyles:{},place:s}),[re,oe]=(0,m.useState)(!1),[ie,se]=(0,m.useState)(!1),[ae,ce]=(0,m.useState)(null),ue=(0,m.useRef)(!1),de=(0,m.useRef)(null),{anchorRefs:pe,setActiveAnchor:fe}=Re(t),he=(0,m.useRef)(!1),[me,ge]=(0,m.useState)([]),ve=(0,m.useRef)(!1),ye=u||c.includes("click"),we=ye||(null==A?void 0:A.click)||(null==A?void 0:A.dblclick)||(null==A?void 0:A.mousedown),xe=A?{...A}:{mouseover:!0,focus:!0,mouseenter:!1,click:!1,dblclick:!1,mousedown:!1};!A&&ye&&Object.assign(xe,{mouseenter:!1,focus:!1,mouseover:!1,click:!0});const Ee=O?{...O}:{mouseout:!0,blur:!0,mouseleave:!1,click:!1,dblclick:!1,mouseup:!1};!O&&ye&&Object.assign(Ee,{mouseleave:!1,blur:!1,mouseout:!1});const ke=C?{...C}:{escape:S||!1,scroll:k||!1,resize:T||!1,clickOutsideAnchor:we||!1};j&&(Object.assign(xe,{mouseenter:!1,focus:!1,click:!1,dblclick:!1,mousedown:!1}),Object.assign(Ee,{mouseleave:!1,blur:!1,click:!1,dblclick:!1,mouseup:!1}),Object.assign(ke,{escape:!1,scroll:!1,resize:!1,clickOutsideAnchor:!1})),Ce((()=>(ve.current=!0,()=>{ve.current=!1})),[]);const Ae=e=>{ve.current&&(e&&se(!0),setTimeout((()=>{ve.current&&(null==B||B(e),void 0===M&&oe(e))}),10))};(0,m.useEffect)((()=>{if(void 0===M)return()=>null;M&&se(!0);const e=setTimeout((()=>{oe(M)}),10);return()=>{clearTimeout(e)}}),[M]),(0,m.useEffect)((()=>{if(re!==ue.current)if(je(J),ue.current=re,re)null==R||R();else{const e=(()=>{const e=getComputedStyle(document.body).getPropertyValue("--rt-transition-show-delay").match(/^([\d.]+)(ms|s)$/);if(!e)return 0;const[,t,n]=e;return Number(t)*("ms"===n?1:1e3)})();J.current=setTimeout((()=>{se(!1),ce(null),null==L||L()}),e+25)}}),[re]);const Ne=e=>{te((t=>Te(t,e)?t:e))},Pe=(e=h)=>{je(K),ie?Ae(!0):K.current=setTimeout((()=>{Ae(!0)}),e)},De=(e=y)=>{je(Z),Z.current=setTimeout((()=>{he.current||Ae(!1)}),e)},Me=e=>{var t;if(!e)return;const n=null!==(t=e.currentTarget)&&void 0!==t?t:e.target;if(!(null==n?void 0:n.isConnected))return V(null),void fe({current:null});h?Pe():Ae(!0),V(n),fe({current:n}),je(Z)},Fe=()=>{E?De(y||100):y?De():Ae(!1),je(K)},ze=({x:e,y:t})=>{var n;const r={getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,left:e,right:e,bottom:t})};_e({place:null!==(n=null==ae?void 0:ae.place)&&void 0!==n?n:s,offset:a,elementReference:r,tooltipReference:G.current,tooltipArrowReference:Y.current,strategy:d,middlewares:p,border:W}).then((e=>{Ne(e)}))},Be=e=>{if(!e)return;const t=e,n={x:t.clientX,y:t.clientY};ze(n),de.current=n},He=e=>{var t;if(!re)return;const n=e.target;n.isConnected&&((null===(t=G.current)||void 0===t?void 0:t.contains(n))||[document.querySelector(`[id='${i}']`),...me].some((e=>null==e?void 0:e.contains(n)))||(Ae(!1),je(K)))},Ve=Se(Me,50,!0),We=Se(Fe,50,!0),qe=e=>{We.cancel(),Ve(e)},$e=()=>{Ve.cancel(),We()},Ue=(0,m.useCallback)((()=>{var e,t;const n=null!==(e=null==ae?void 0:ae.position)&&void 0!==e?e:P;n?ze(n):w?de.current&&ze(de.current):(null==H?void 0:H.isConnected)&&_e({place:null!==(t=null==ae?void 0:ae.place)&&void 0!==t?t:s,offset:a,elementReference:H,tooltipReference:G.current,tooltipArrowReference:Y.current,strategy:d,middlewares:p,border:W}).then((e=>{ve.current&&Ne(e)}))}),[re,H,I,N,s,null==ae?void 0:ae.place,a,d,P,null==ae?void 0:ae.position,w]);(0,m.useEffect)((()=>{var e,t;const n=new Set(pe);me.forEach((e=>{n.add({current:e})}));const r=document.querySelector(`[id='${i}']`);r&&n.add({current:r});const o=()=>{Ae(!1)},l=Oe(H),s=Oe(G.current);ke.scroll&&(window.addEventListener("scroll",o),null==l||l.addEventListener("scroll",o),null==s||s.addEventListener("scroll",o));let a=null;ke.resize?window.addEventListener("resize",o):H&&G.current&&(a=function(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:a=!1}=r,c=ne(e),u=o||i?[...c?ee(c):[],...ee(t)]:[];u.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=c&&s?function(e,t){let n,r=null;const o=z(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function l(s,a){void 0===s&&(s=!1),void 0===a&&(a=1),i();const{left:c,top:u,width:d,height:p}=e.getBoundingClientRect();if(s||t(),!d||!p)return;const f={rootMargin:-b(u)+"px "+-b(o.clientWidth-(c+d))+"px "+-b(o.clientHeight-(u+p))+"px "+-b(c)+"px",threshold:v(0,g(1,a))||1};let h=!0;function m(e){const t=e[0].intersectionRatio;if(t!==a){if(!h)return l();t?l(!1,t):n=setTimeout((()=>{l(!1,1e-7)}),1e3)}h=!1}try{r=new IntersectionObserver(m,{...f,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(m,f)}r.observe(e)}(!0),i}(c,n):null;let p,f=-1,h=null;l&&(h=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame((()=>{var e;null==(e=h)||e.observe(t)}))),n()})),c&&!a&&h.observe(c),h.observe(t));let m=a?le(e):null;return a&&function t(){const r=le(e);!m||r.x===m.x&&r.y===m.y&&r.width===m.width&&r.height===m.height||n(),m=r,p=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=h)||e.disconnect(),h=null,a&&cancelAnimationFrame(p)}}(H,G.current,Ue,{ancestorResize:!0,elementResize:!0,layoutShift:!0}));const c=e=>{"Escape"===e.key&&Ae(!1)};ke.escape&&window.addEventListener("keydown",c),ke.clickOutsideAnchor&&window.addEventListener("click",He);const u=[],d=e=>{re&&(null==e?void 0:e.target)===H||Me(e)},p=e=>{re&&(null==e?void 0:e.target)===H&&Fe()},f=["mouseover","mouseout","mouseenter","mouseleave","focus","blur"],h=["click","dblclick","mousedown","mouseup"];Object.entries(xe).forEach((([e,t])=>{t&&(f.includes(e)?u.push({event:e,listener:qe}):h.includes(e)&&u.push({event:e,listener:d}))})),Object.entries(Ee).forEach((([e,t])=>{t&&(f.includes(e)?u.push({event:e,listener:$e}):h.includes(e)&&u.push({event:e,listener:p}))})),w&&u.push({event:"pointermove",listener:Be});const m=()=>{he.current=!0},y=()=>{he.current=!1,Fe()};return E&&!we&&(null===(e=G.current)||void 0===e||e.addEventListener("mouseenter",m),null===(t=G.current)||void 0===t||t.addEventListener("mouseleave",y)),u.forEach((({event:e,listener:t})=>{n.forEach((n=>{var r;null===(r=n.current)||void 0===r||r.addEventListener(e,t)}))})),()=>{var e,t;ke.scroll&&(window.removeEventListener("scroll",o),null==l||l.removeEventListener("scroll",o),null==s||s.removeEventListener("scroll",o)),ke.resize?window.removeEventListener("resize",o):null==a||a(),ke.clickOutsideAnchor&&window.removeEventListener("click",He),ke.escape&&window.removeEventListener("keydown",c),E&&!we&&(null===(e=G.current)||void 0===e||e.removeEventListener("mouseenter",m),null===(t=G.current)||void 0===t||t.removeEventListener("mouseleave",y)),u.forEach((({event:e,listener:t})=>{n.forEach((n=>{var r;null===(r=n.current)||void 0===r||r.removeEventListener(e,t)}))}))}}),[H,Ue,ie,pe,me,A,O,C,ye,h,y]),(0,m.useEffect)((()=>{var e,n;let r=null!==(n=null!==(e=null==ae?void 0:ae.anchorSelect)&&void 0!==e?e:l)&&void 0!==n?n:"";!r&&t&&(r=`[data-tooltip-id='${t.replace(/'/g,"\\'")}']`);const o=new MutationObserver((e=>{const n=[],o=[];e.forEach((e=>{if("attributes"===e.type&&"data-tooltip-id"===e.attributeName&&(e.target.getAttribute("data-tooltip-id")===t?n.push(e.target):e.oldValue===t&&o.push(e.target)),"childList"===e.type){if(H){const t=[...e.removedNodes].filter((e=>1===e.nodeType));if(r)try{o.push(...t.filter((e=>e.matches(r)))),o.push(...t.flatMap((e=>[...e.querySelectorAll(r)])))}catch(e){}t.some((e=>{var t;return!!(null===(t=null==e?void 0:e.contains)||void 0===t?void 0:t.call(e,H))&&(se(!1),Ae(!1),V(null),je(K),je(Z),!0)}))}if(r)try{const t=[...e.addedNodes].filter((e=>1===e.nodeType));n.push(...t.filter((e=>e.matches(r)))),n.push(...t.flatMap((e=>[...e.querySelectorAll(r)])))}catch(e){}}})),(n.length||o.length)&&ge((e=>[...e.filter((e=>!o.includes(e))),...n]))}));return o.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-tooltip-id"],attributeOldValue:!0}),()=>{o.disconnect()}}),[t,l,null==ae?void 0:ae.anchorSelect,H]),(0,m.useEffect)((()=>{Ue()}),[Ue]),(0,m.useEffect)((()=>{if(!(null==D?void 0:D.current))return()=>null;const e=new ResizeObserver((()=>{setTimeout((()=>Ue()))}));return e.observe(D.current),()=>{e.disconnect()}}),[I,null==D?void 0:D.current]),(0,m.useEffect)((()=>{var e;const t=document.querySelector(`[id='${i}']`),n=[...me,t];H&&n.includes(H)||V(null!==(e=me[0])&&void 0!==e?e:t)}),[i,me,H]),(0,m.useEffect)((()=>(F&&Ae(!0),()=>{je(K),je(Z)})),[]),(0,m.useEffect)((()=>{var e;let n=null!==(e=null==ae?void 0:ae.anchorSelect)&&void 0!==e?e:l;if(!n&&t&&(n=`[data-tooltip-id='${t.replace(/'/g,"\\'")}']`),n)try{const e=Array.from(document.querySelectorAll(n));ge(e)}catch(e){ge([])}}),[t,l,null==ae?void 0:ae.anchorSelect]),(0,m.useEffect)((()=>{K.current&&(je(K),Pe(h))}),[h]);const Xe=null!==(X=null==ae?void 0:ae.content)&&void 0!==X?X:I,Ge=re&&Object.keys(Q.tooltipStyles).length>0;return(0,m.useImperativeHandle)(e,(()=>({open:e=>{if(null==e?void 0:e.anchorSelect)try{document.querySelector(e.anchorSelect)}catch(t){return void console.warn(`[react-tooltip] "${e.anchorSelect}" is not a valid CSS selector`)}ce(null!=e?e:null),(null==e?void 0:e.delay)?Pe(e.delay):Ae(!0)},close:e=>{(null==e?void 0:e.delay)?De(e.delay):Ae(!1)},activeAnchor:H,place:Q.place,isOpen:Boolean(ie&&!x&&Xe&&Ge)}))),ie&&!x&&Xe?m.createElement(f,{id:t,role:U,className:be("react-tooltip",Le.tooltip,Ie.tooltip,Ie[o],n,`react-tooltip__place-${Q.place}`,Le[Ge?"show":"closing"],Ge?"react-tooltip__show":"react-tooltip__closing","fixed"===d&&Le.fixed,E&&Le.clickable),onTransitionEnd:e=>{je(J),re||"opacity"!==e.propertyName||(se(!1),ce(null),null==L||L())},style:{...N,...Q.tooltipStyles,opacity:void 0!==q&&Ge?q:void 0},ref:G},Xe,m.createElement(f,{className:be("react-tooltip-arrow",Le.arrow,Ie.arrow,r,_&&Le.noArrow),style:{...Q.tooltipArrowStyles,background:$?`linear-gradient(to right bottom, transparent 50%, ${$} 50%)`:void 0},ref:Y})):null},Me=({content:e})=>m.createElement("span",{dangerouslySetInnerHTML:{__html:e}}),Fe=m.forwardRef((({id:e,anchorId:t,anchorSelect:n,content:r,html:o,render:i,className:l,classNameArrow:s,variant:a="dark",place:c="top",offset:u=10,wrapper:d="div",children:p=null,events:f=["hover"],openOnClick:h=!1,positionStrategy:g="absolute",middlewares:v,delayShow:y=0,delayHide:b=0,float:w=!1,hidden:x=!1,noArrow:_=!1,clickable:E=!1,closeOnEsc:S=!1,closeOnScroll:k=!1,closeOnResize:T=!1,openEvents:A,closeEvents:O,globalCloseEvents:C,imperativeModeOnly:j=!1,style:N,position:P,isOpen:R,defaultIsOpen:L=!1,disableStyleInjection:I=!1,border:D,opacity:M,arrowColor:F,setIsOpen:z,afterShow:B,afterHide:H,role:V="tooltip"},W)=>{const[q,$]=(0,m.useState)(r),[U,X]=(0,m.useState)(o),[G,Y]=(0,m.useState)(c),[K,Z]=(0,m.useState)(a),[J,Q]=(0,m.useState)(u),[ee,te]=(0,m.useState)(y),[ne,re]=(0,m.useState)(b),[oe,ie]=(0,m.useState)(w),[le,se]=(0,m.useState)(x),[ae,ce]=(0,m.useState)(d),[ue,de]=(0,m.useState)(f),[pe,fe]=(0,m.useState)(g),[he,me]=(0,m.useState)(null),[ge,ve]=(0,m.useState)(null),ye=(0,m.useRef)(I),{anchorRefs:we,activeAnchor:xe}=Re(e),_e=e=>null==e?void 0:e.getAttributeNames().reduce(((t,n)=>{var r;return n.startsWith("data-tooltip-")&&(t[n.replace(/^data-tooltip-/,"")]=null!==(r=null==e?void 0:e.getAttribute(n))&&void 0!==r?r:null),t}),{}),Se=e=>{const t={place:e=>{var t;Y(null!==(t=e)&&void 0!==t?t:c)},content:e=>{$(null!=e?e:r)},html:e=>{X(null!=e?e:o)},variant:e=>{var t;Z(null!==(t=e)&&void 0!==t?t:a)},offset:e=>{Q(null===e?u:Number(e))},wrapper:e=>{var t;ce(null!==(t=e)&&void 0!==t?t:d)},events:e=>{const t=null==e?void 0:e.split(" ");de(null!=t?t:f)},"position-strategy":e=>{var t;fe(null!==(t=e)&&void 0!==t?t:g)},"delay-show":e=>{te(null===e?y:Number(e))},"delay-hide":e=>{re(null===e?b:Number(e))},float:e=>{ie(null===e?w:"true"===e)},hidden:e=>{se(null===e?x:"true"===e)},"class-name":e=>{me(e)}};Object.values(t).forEach((e=>e(null))),Object.entries(e).forEach((([e,n])=>{var r;null===(r=t[e])||void 0===r||r.call(t,n)}))};(0,m.useEffect)((()=>{$(r)}),[r]),(0,m.useEffect)((()=>{X(o)}),[o]),(0,m.useEffect)((()=>{Y(c)}),[c]),(0,m.useEffect)((()=>{Z(a)}),[a]),(0,m.useEffect)((()=>{Q(u)}),[u]),(0,m.useEffect)((()=>{te(y)}),[y]),(0,m.useEffect)((()=>{re(b)}),[b]),(0,m.useEffect)((()=>{ie(w)}),[w]),(0,m.useEffect)((()=>{se(x)}),[x]),(0,m.useEffect)((()=>{fe(g)}),[g]),(0,m.useEffect)((()=>{ye.current!==I&&console.warn("[react-tooltip] Do not change `disableStyleInjection` dynamically.")}),[I]),(0,m.useEffect)((()=>{"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent("react-tooltip-inject-styles",{detail:{disableCore:"core"===I,disableBase:I}}))}),[]),(0,m.useEffect)((()=>{var r;const o=new Set(we);let i=n;if(!i&&e&&(i=`[data-tooltip-id='${e.replace(/'/g,"\\'")}']`),i)try{document.querySelectorAll(i).forEach((e=>{o.add({current:e})}))}catch(r){console.warn(`[react-tooltip] "${i}" is not a valid CSS selector`)}const l=document.querySelector(`[id='${t}']`);if(l&&o.add({current:l}),!o.size)return()=>null;const s=null!==(r=null!=ge?ge:l)&&void 0!==r?r:xe.current,a=new MutationObserver((e=>{e.forEach((e=>{var t;if(!s||"attributes"!==e.type||!(null===(t=e.attributeName)||void 0===t?void 0:t.startsWith("data-tooltip-")))return;const n=_e(s);Se(n)}))})),c={attributes:!0,childList:!1,subtree:!1};if(s){const e=_e(s);Se(e),a.observe(s,c)}return()=>{a.disconnect()}}),[we,xe,ge,t,n]),(0,m.useEffect)((()=>{(null==N?void 0:N.border)&&console.warn("[react-tooltip] Do not set `style.border`. Use `border` prop instead."),D&&!Ee("border",`${D}`)&&console.warn(`[react-tooltip] "${D}" is not a valid \`border\`.`),(null==N?void 0:N.opacity)&&console.warn("[react-tooltip] Do not set `style.opacity`. Use `opacity` prop instead."),M&&!Ee("opacity",`${M}`)&&console.warn(`[react-tooltip] "${M}" is not a valid \`opacity\`.`)}),[]);let ke=p;const Te=(0,m.useRef)(null);if(i){const e=i({content:(null==ge?void 0:ge.getAttribute("data-tooltip-content"))||q||null,activeAnchor:ge});ke=e?m.createElement("div",{ref:Te,className:"react-tooltip-content-wrapper"},e):null}else q&&(ke=q);U&&(ke=m.createElement(Me,{content:U}));const Ae={forwardRef:W,id:e,anchorId:t,anchorSelect:n,className:be(l,he),classNameArrow:s,content:ke,contentWrapperRef:Te,place:G,variant:K,offset:J,wrapper:ae,events:ue,openOnClick:h,positionStrategy:pe,middlewares:v,delayShow:ee,delayHide:ne,float:oe,hidden:le,noArrow:_,clickable:E,closeOnEsc:S,closeOnScroll:k,closeOnResize:T,openEvents:A,closeEvents:O,globalCloseEvents:C,imperativeModeOnly:j,style:N,position:P,isOpen:R,defaultIsOpen:L,border:D,opacity:M,arrowColor:F,setIsOpen:z,afterShow:B,afterHide:H,activeAnchor:ge,setActiveAnchor:e=>ve(e),role:V};return m.createElement(De,{...Ae})}));"undefined"!=typeof window&&window.addEventListener("react-tooltip-inject-styles",(e=>{e.detail.disableCore||xe({css:":root{--rt-color-white:#fff;--rt-color-dark:#222;--rt-color-success:#8dc572;--rt-color-error:#be6464;--rt-color-warning:#f0ad4e;--rt-color-info:#337ab7;--rt-opacity:0.9;--rt-transition-show-delay:0.15s;--rt-transition-closing-delay:0.15s}.core-styles-module_tooltip__3vRRp{position:absolute;top:0;left:0;pointer-events:none;opacity:0;will-change:opacity}.core-styles-module_fixed__pcSol{position:fixed}.core-styles-module_arrow__cvMwQ{position:absolute;background:inherit}.core-styles-module_noArrow__xock6{display:none}.core-styles-module_clickable__ZuTTB{pointer-events:auto}.core-styles-module_show__Nt9eE{opacity:var(--rt-opacity);transition:opacity var(--rt-transition-show-delay)ease-out}.core-styles-module_closing__sGnxF{opacity:0;transition:opacity var(--rt-transition-closing-delay)ease-in}",type:"core"}),e.detail.disableBase||xe({css:"\n.styles-module_tooltip__mnnfp{padding:8px 16px;border-radius:3px;font-size:90%;width:max-content}.styles-module_arrow__K0L3T{width:8px;height:8px}[class*='react-tooltip__place-top']>.styles-module_arrow__K0L3T{transform:rotate(45deg)}[class*='react-tooltip__place-right']>.styles-module_arrow__K0L3T{transform:rotate(135deg)}[class*='react-tooltip__place-bottom']>.styles-module_arrow__K0L3T{transform:rotate(225deg)}[class*='react-tooltip__place-left']>.styles-module_arrow__K0L3T{transform:rotate(315deg)}.styles-module_dark__xNqje{background:var(--rt-color-dark);color:var(--rt-color-white)}.styles-module_light__Z6W-X{background-color:var(--rt-color-white);color:var(--rt-color-dark)}.styles-module_success__A2AKt{background-color:var(--rt-color-success);color:var(--rt-color-white)}.styles-module_warning__SCK0X{background-color:var(--rt-color-warning);color:var(--rt-color-white)}.styles-module_error__JvumD{background-color:var(--rt-color-error);color:var(--rt-color-white)}.styles-module_info__BWdHW{background-color:var(--rt-color-info);color:var(--rt-color-white)}",type:"base"})}));const ze=(e,t="")=>{for(const[n,r]of Object.entries(e)){let e=n;t&&(e+="_"+String(t));const o=new CustomEvent(e,{detail:r});dispatchEvent(o)}},Be=(e,t="")=>{for(const[n,r]of Object.entries(e)){let e=n;t&&(e+="_"+String(t)),addEventListener(e,(e=>{r(e.detail)}),!1)}},He=({onlineEventLinkDefault:e=""})=>{const t=(0,o.__)("Online event","gatherpress"),[n,r]=(0,a.useState)(e);return Be({setOnlineEventLink:r},p("eventDetails.postId")),(0,c.jsxs)(l.Flex,{justify:"normal",gap:"3",children:[(0,c.jsx)(l.FlexItem,{display:"flex",children:(0,c.jsx)(l.Icon,{icon:"video-alt2"})}),(0,c.jsxs)(l.FlexItem,{children:[!n&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("span",{tabIndex:"0",className:"gatherpress-tooltip","data-tooltip-id":"gatherpress-online-event-tooltip","data-tooltip-content":(0,o.__)("Link available for attendees only.","gatherpress"),children:t}),(0,c.jsx)(Fe,{id:"gatherpress-online-event-tooltip"})]}),n&&(0,c.jsx)("a",{href:n,rel:"noreferrer",target:"_blank",children:t})]})]})};var Ve=n(442);const We=Ve.default||Ve,qe=({name:e,fullAddress:t,phoneNumber:n,website:r})=>(0,c.jsxs)(c.Fragment,{children:[(e||t)&&(0,c.jsxs)(l.Flex,{justify:"normal",align:"flex-start",gap:"4",children:[(0,c.jsx)(l.FlexItem,{display:"flex",className:"gatherpress-venue__icon",children:(0,c.jsx)(l.Icon,{icon:"location"})}),(0,c.jsxs)(l.FlexItem,{children:[e&&(0,c.jsx)("div",{className:"gatherpress-venue__name",children:(0,c.jsx)("strong",{children:We(e)})}),t&&(0,c.jsx)("div",{className:"gatherpress-venue__full-address",children:We(t)})]})]}),(n||r)&&(0,c.jsxs)(l.Flex,{justify:"normal",gap:"8",children:[n&&(0,c.jsx)(l.FlexItem,{children:(0,c.jsxs)(l.Flex,{justify:"normal",gap:"4",children:[(0,c.jsx)(l.FlexItem,{display:"flex",className:"gatherpress-venue__icon",children:(0,c.jsx)(l.Icon,{icon:"phone"})}),(0,c.jsx)(l.FlexItem,{children:(0,c.jsx)("div",{className:"gatherpress-venue__phone-number",children:n})})]})}),r&&(0,c.jsx)(l.FlexItem,{children:(0,c.jsxs)(l.Flex,{justify:"normal",gap:"4",children:[(0,c.jsx)(l.FlexItem,{display:"flex",className:"gatherpress-venue__icon",children:(0,c.jsx)(l.Icon,{icon:"admin-site-alt3"})}),(0,c.jsx)(l.FlexItem,{children:(0,c.jsx)("div",{className:"gatherpress-venue__website",children:(0,c.jsx)("a",{href:r,target:"_blank",rel:"noreferrer noopener",children:r})})})]})})]})]}),$e=({name:e="",fullAddress:t,phoneNumber:n,website:r,isOnlineEventTerm:o=!1,onlineEventLink:i=""})=>(0,c.jsxs)(c.Fragment,{children:[!o&&(0,c.jsx)(qe,{name:e,fullAddress:t,phoneNumber:n,website:r}),o&&(0,c.jsx)(He,{onlineEventLinkDefault:i})]}),Ue=e=>{const{isSelected:t}=e,n=t?"none":"block";return(0,c.jsxs)("div",{style:{position:"relative"},children:[e.children,(0,c.jsx)("div",{style:{position:"absolute",top:"0",right:"0",bottom:"0",left:"0",display:n}})]})};function Xe(){return"gatherpress_venue"===(0,s.select)("core/editor")?.getCurrentPostType()}const Ge=()=>{const[e,t]=(0,a.useState)(""),[n,r]=(0,a.useState)(""),[i,u]=(0,a.useState)(""),[d,p]=(0,a.useState)(""),[f,h]=(0,a.useState)(!1),[m,g]=(0,a.useState)(""),[v,y]=(0,a.useState)(""),[b,w]=(0,a.useState)(""),x=(0,s.useDispatch)("core/editor").editPost,{unlockPostSaving:_}=(0,s.useDispatch)("core/editor"),E=(0,s.useSelect)((e=>e("core/editor").getEditedPostAttribute("_gatherpress_venue"))),S=(0,s.useSelect)((e=>e("core").getEntityRecord("taxonomy","_gatherpress_venue",E))),k=S?.slug.replace(/^_/,""),[T,A]=(0,a.useState)(""),O=E+":"+T,C=(0,s.useSelect)((e=>e("core").getEntityRecords("postType","gatherpress_venue",{per_page:1,slug:T})));(0,a.useEffect)((()=>{var e,n,i,l,s,a;let c={};if(T&&Array.isArray(C)){var d;const e=null!==(d=C[0]?.meta?.gatherpress_venue_information)&&void 0!==d?d:"{}";var f;e&&(c=JSON.parse(e),c.name=null!==(f=C[0]?.title.rendered)&&void 0!==f?f:"")}const h=null!==(e=c?.name)&&void 0!==e?e:(0,o.__)("No venue selected.","gatherpress"),m=null!==(n=c?.fullAddress)&&void 0!==n?n:"",v=null!==(i=c?.phoneNumber)&&void 0!==i?i:"",b=null!==(l=c?.website)&&void 0!==l?l:"",x=null!==(s=c?.latitude)&&void 0!==s?s:"0",_=null!==(a=c?.longitude)&&void 0!==a?a:"0";k&&A(k),w(O?String(O):""),t(h),r(m),u(v),p(b),g(x),y(_),ze({setName:h,setFullAddress:m,setPhoneNumber:v,setWebsite:b,setLatitude:x,setLongitude:_,setIsOnlineEventTerm:"online-event"===T})}),[T,C,k,O]);let j=(0,s.useSelect)((e=>e("core").getEntityRecords("taxonomy","_gatherpress_venue",{per_page:-1,context:"view"})),[]);return j?(j=j.map((e=>({label:e.name,value:e.id+":"+e.slug.replace(/^_/,"")}))),j.unshift({value:":",label:(0,o.__)("Choose a venue","gatherpress")})):j=[],(0,c.jsx)(l.PanelRow,{children:(0,c.jsx)(l.SelectControl,{label:(0,o.__)("Venue Selector","gatherpress"),value:b,onChange:e=>{(e=>{w(e);const t=""!==(e=e.split(":"))[0]?[e[0]]:[];x({_gatherpress_venue:t}),A(e[1]),_()})(e)},options:j})})},Ye=window.wp.compose,Ke=()=>{var e,t,n;const r=(0,s.useDispatch)("core/editor").editPost,i=e=>{const t=JSON.stringify({...u,...e});r({meta:{gatherpress_venue_information:t}})};let u=(0,s.useSelect)((e=>e("core/editor").getEditedPostAttribute("meta").gatherpress_venue_information));u=u?JSON.parse(u):{};const[d,p]=(0,a.useState)(null!==(e=u.fullAddress)&&void 0!==e?e:""),[f,h]=(0,a.useState)(null!==(t=u.phoneNumber)&&void 0!==t?t:""),[m,g]=(0,a.useState)(null!==(n=u.website)&&void 0!==n?n:"");Be({setFullAddress:p,setPhoneNumber:h,setWebsite:g});const v=(0,a.useRef)(i),y=(0,a.useCallback)((()=>{let e=null,t=null;fetch(`https://nominatim.openstreetmap.org/search?q=${d}&format=geojson`).then((e=>{if(!e.ok)throw new Error((0,o.sprintf)(/* translators: %s: Error message */ /* translators: %s: Error message */ +(0,o.__)("Network response was not ok %s","gatherpress"),e.statusText));return e.json()})).then((n=>{n.features.length>0&&(e=n.features[0].geometry.coordinates[1],t=n.features[0].geometry.coordinates[0]),v.current({latitude:e,longitude:t})}))}),[d]),b=(0,Ye.useDebounce)(y,300);return(0,a.useEffect)((()=>{v.current=i}),[i]),(0,a.useEffect)((()=>{b()}),[d,b]),(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(l.TextControl,{label:(0,o.__)("Full Address","gatherpress"),value:d,onChange:e=>{ze({setFullAddress:e}),i({fullAddress:e})}}),(0,c.jsx)(l.TextControl,{label:(0,o.__)("Phone Number","gatherpress"),value:f,onChange:e=>{ze({setPhoneNumber:e}),i({phoneNumber:e})}}),(0,c.jsx)(l.TextControl,{label:(0,o.__)("Website","gatherpress"),value:m,type:"url",onChange:e=>{ze({setWebsite:e}),i({website:e})}})]})},Ze=()=>(0,c.jsx)("section",{children:(0,c.jsx)(Ke,{})}),Je=()=>{const{editPost:e,unlockPostSaving:t}=(0,s.useDispatch)("core/editor"),n=(0,s.useSelect)((e=>e("core/editor").getEditedPostAttribute("meta").gatherpress_online_event_link)),[r,i]=(0,a.useState)(n);return Be({setOnlineEventLink:i},p("eventDetails.postId")),(0,c.jsx)(l.TextControl,{label:(0,o.__)("Online event link","gatherpress"),value:r,placeholder:(0,o.__)("Add link to online event","gatherpress"),onChange:n=>{(n=>{e({meta:{gatherpress_online_event_link:n}}),i(n),ze({setOnlineEventLink:n},p("eventDetails.postId")),t()})(n)}})},Qe=window.moment;var et=n.n(Qe);window.wp.hooks,window.wp.date;const tt="YYYY-MM-DD HH:mm:ss",nt=et().tz(rt()).add(1,"day").set("hour",18).set("minute",0).set("second",0).format(tt);function rt(e=p("eventDetails.dateTime.timezone")){return et().tz.zone(e)?e:(0,o.__)("GMT","gatherpress")}et().tz(nt,rt()).add(2,"hours").format(tt);const ot=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"gatherpress/venue","version":"1.1.0","title":"Venue","category":"gatherpress","icon":"location","example":{},"description":"Provides information about an event venue.","attributes":{"mapShow":{"type":"boolean","default":true},"mapAlign":{"type":"string","default":""},"mapZoomLevel":{"type":"number","default":10},"mapType":{"type":"string","default":"m"},"mapHeight":{"type":"number","default":300}},"supports":{"align":["wide"],"html":false},"textdomain":"gatherpress","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","viewScript":"file:./venue.js","viewStyle":"file:./venue.css","render":"file:./render.php"}');(0,r.registerBlockType)(ot,{edit:({attributes:e,setAttributes:t,isSelected:n})=>{const{mapZoomLevel:r,mapType:u,mapHeight:f}=e,[m,g]=(0,a.useState)(""),[v,y]=(0,a.useState)(""),[b,w]=(0,a.useState)(""),[x,_]=(0,a.useState)(""),[E,S]=(0,a.useState)(""),[k,T]=(0,a.useState)(""),[A,O]=(0,a.useState)(!1),C=(0,i.useBlockProps)(),j=p("settings.mapPlatform"),N=(0,s.useSelect)((e=>e("core/editor")?.getEditedPostAttribute("meta")?.gatherpress_online_event_link));let{mapShow:P}=e,R=(0,s.useSelect)((e=>e("core/editor")?.getEditedPostAttribute("meta")?.gatherpress_venue_information));return R=R?JSON.parse(R):{},P&&v&&(P=!0),P&&!d()&&(P=!0),Be({setName:g,setFullAddress:y,setPhoneNumber:S,setWebsite:T,setIsOnlineEventTerm:O,setLatitude:w,setLongitude:_}),(0,a.useEffect)((()=>{Xe()&&(y(R.fullAddress),S(R.phoneNumber),T(R.website),w(R.latitude),_(R.longitude),g(v||E||k?"":(0,o.__)("Add venue information.","gatherpress"))),"gatherpress_event"!==(0,s.select)("core/editor")?.getCurrentPostType()&&d()||g(v||E||k?"":(0,o.__)("No venue selected.","gatherpress"))}),[R.fullAddress,R.phoneNumber,R.website,R.latitude,R.longitude,v,E,k,b,x]),(0,a.useEffect)((()=>{const e=new Event("resize");window.dispatchEvent(e)}),[f]),(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(i.InspectorControls,{children:[d()&&(0,c.jsxs)(l.PanelBody,{title:(0,o.__)("Venue settings","gatherpress"),initialOpen:!0,children:[(0,c.jsxs)(l.PanelRow,{children:[!Xe()&&(0,c.jsx)(Ge,{}),Xe()&&(0,c.jsx)(Ze,{})]}),A&&(0,c.jsx)(l.PanelRow,{children:(0,c.jsx)(Je,{})})]}),!A&&(0,c.jsxs)(l.PanelBody,{title:(0,o.__)("Map settings","gatherpress"),initialOpen:!0,children:[(0,c.jsx)(l.PanelRow,{children:(0,o.__)("Show map on venue","gatherpress")}),(0,c.jsx)(l.PanelRow,{children:(0,c.jsx)(l.ToggleControl,{label:P?(0,o.__)("Display the map","gatherpress"):(0,o.__)("Hide the map","gatherpress"),checked:P,onChange:e=>{t({mapShow:e})}})}),(0,c.jsx)(l.RangeControl,{label:(0,o.__)("Zoom level","gatherpress"),beforeIcon:"search",value:r,onChange:e=>t({mapZoomLevel:e}),min:1,max:22}),"google"===j&&(0,c.jsx)(l.RadioControl,{label:(0,o.__)("Map type","gatherpress"),selected:u,options:[{label:(0,o.__)("Roadmap","gatherpress"),value:"m"},{label:(0,o.__)("Satellite","gatherpress"),value:"k"}],onChange:e=>{t({mapType:e})}}),(0,c.jsx)(l.RangeControl,{label:(0,o.__)("Map height","gatherpress"),beforeIcon:"location",value:f,onChange:e=>t({mapHeight:e}),min:100,max:1e3})]})]}),(0,c.jsx)("div",{...C,children:(0,c.jsx)(Ue,{isSelected:n,children:(0,c.jsxs)("div",{className:"gatherpress-venue",children:[(0,c.jsx)($e,{name:m,fullAddress:v,phoneNumber:E,website:k,isOnlineEventTerm:A,onlineEventLink:N}),P&&!A&&(0,c.jsx)(h,{location:v,latitude:b,longitude:x,zoom:r,type:u,height:f})]})})})]})},save:()=>{}})},5413:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Doctype=t.CDATA=t.Tag=t.Style=t.Script=t.Comment=t.Directive=t.Text=t.Root=t.isTag=t.ElementType=void 0,function(e){e.Root="root",e.Text="text",e.Directive="directive",e.Comment="comment",e.Script="script",e.Style="style",e.Tag="tag",e.CDATA="cdata",e.Doctype="doctype"}(n=t.ElementType||(t.ElementType={})),t.isTag=function(e){return e.type===n.Tag||e.type===n.Script||e.type===n.Style},t.Root=n.Root,t.Text=n.Text,t.Directive=n.Directive,t.Comment=n.Comment,t.Script=n.Script,t.Style=n.Style,t.Tag=n.Tag,t.CDATA=n.CDATA,t.Doctype=n.Doctype},1141:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.DomHandler=void 0;var i=n(5413),l=n(6957);o(n(6957),t);var s={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},a=function(){function e(e,t,n){this.dom=[],this.root=new l.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,"function"==typeof t&&(n=t,t=s),"object"==typeof e&&(t=e,e=void 0),this.callback=null!=e?e:null,this.options=null!=t?t:s,this.elementCB=null!=n?n:null}return e.prototype.onparserinit=function(e){this.parser=e},e.prototype.onreset=function(){this.dom=[],this.root=new l.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},e.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},e.prototype.onerror=function(e){this.handleCallback(e)},e.prototype.onclosetag=function(){this.lastNode=null;var e=this.tagStack.pop();this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(e)},e.prototype.onopentag=function(e,t){var n=this.options.xmlMode?i.ElementType.Tag:void 0,r=new l.Element(e,t,void 0,n);this.addNode(r),this.tagStack.push(r)},e.prototype.ontext=function(e){var t=this.lastNode;if(t&&t.type===i.ElementType.Text)t.data+=e,this.options.withEndIndices&&(t.endIndex=this.parser.endIndex);else{var n=new l.Text(e);this.addNode(n),this.lastNode=n}},e.prototype.oncomment=function(e){if(this.lastNode&&this.lastNode.type===i.ElementType.Comment)this.lastNode.data+=e;else{var t=new l.Comment(e);this.addNode(t),this.lastNode=t}},e.prototype.oncommentend=function(){this.lastNode=null},e.prototype.oncdatastart=function(){var e=new l.Text(""),t=new l.CDATA([e]);this.addNode(t),e.parent=t,this.lastNode=e},e.prototype.oncdataend=function(){this.lastNode=null},e.prototype.onprocessinginstruction=function(e,t){var n=new l.ProcessingInstruction(e,t);this.addNode(n)},e.prototype.handleCallback=function(e){if("function"==typeof this.callback)this.callback(e,this.dom);else if(e)throw e},e.prototype.addNode=function(e){var t=this.tagStack[this.tagStack.length-1],n=t.children[t.children.length-1];this.options.withStartIndices&&(e.startIndex=this.parser.startIndex),this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),t.children.push(e),n&&(e.prev=n,n.next=e),e.parent=t,this.lastNode=null},e}();t.DomHandler=a,t.default=a},6957:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"childNodes",{get:function(){return this.children},set:function(e){this.children=e},enumerable:!1,configurable:!0}),t}(s);t.NodeWithChildren=p;var f=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=l.ElementType.CDATA,t}return o(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),t}(p);t.CDATA=f;var h=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=l.ElementType.Root,t}return o(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),t}(p);t.Document=h;var m=function(e){function t(t,n,r,o){void 0===r&&(r=[]),void 0===o&&(o="script"===t?l.ElementType.Script:"style"===t?l.ElementType.Style:l.ElementType.Tag);var i=e.call(this,r)||this;return i.name=t,i.attribs=n,i.type=o,i}return o(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tagName",{get:function(){return this.name},set:function(e){this.name=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"attributes",{get:function(){var e=this;return Object.keys(this.attribs).map((function(t){var n,r;return{name:t,value:e.attribs[t],namespace:null===(n=e["x-attribsNamespace"])||void 0===n?void 0:n[t],prefix:null===(r=e["x-attribsPrefix"])||void 0===r?void 0:r[t]}}))},enumerable:!1,configurable:!0}),t}(p);function g(e){return(0,l.isTag)(e)}function v(e){return e.type===l.ElementType.CDATA}function y(e){return e.type===l.ElementType.Text}function b(e){return e.type===l.ElementType.Comment}function w(e){return e.type===l.ElementType.Directive}function x(e){return e.type===l.ElementType.Root}function _(e,t){var n;if(void 0===t&&(t=!1),y(e))n=new c(e.data);else if(b(e))n=new u(e.data);else if(g(e)){var r=t?E(e.children):[],o=new m(e.name,i({},e.attribs),r);r.forEach((function(e){return e.parent=o})),null!=e.namespace&&(o.namespace=e.namespace),e["x-attribsNamespace"]&&(o["x-attribsNamespace"]=i({},e["x-attribsNamespace"])),e["x-attribsPrefix"]&&(o["x-attribsPrefix"]=i({},e["x-attribsPrefix"])),n=o}else if(v(e)){r=t?E(e.children):[];var l=new f(r);r.forEach((function(e){return e.parent=l})),n=l}else if(x(e)){r=t?E(e.children):[];var s=new h(r);r.forEach((function(e){return e.parent=s})),e["x-mode"]&&(s["x-mode"]=e["x-mode"]),n=s}else{if(!w(e))throw new Error("Not implemented yet: ".concat(e.type));var a=new d(e.name,e.data);null!=e["x-name"]&&(a["x-name"]=e["x-name"],a["x-publicId"]=e["x-publicId"],a["x-systemId"]=e["x-systemId"]),n=a}return n.startIndex=e.startIndex,n.endIndex=e.endIndex,null!=e.sourceCodeLocation&&(n.sourceCodeLocation=e.sourceCodeLocation),n}function E(e){for(var t=e.map((function(e){return _(e,!0)})),n=1;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CASE_SENSITIVE_TAG_NAMES_MAP=t.CASE_SENSITIVE_TAG_NAMES=void 0,t.CASE_SENSITIVE_TAG_NAMES=["animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"],t.CASE_SENSITIVE_TAG_NAMES_MAP=t.CASE_SENSITIVE_TAG_NAMES.reduce((function(e,t){return e[t.toLowerCase()]=t,e}),{})},5496:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,u,d=e.match(i),p=d&&d[1]?d[1].toLowerCase():"";switch(p){case n:var h=c(e);return l.test(e)||null===(t=null==(g=h.querySelector(r))?void 0:g.parentNode)||void 0===t||t.removeChild(g),s.test(e)||null===(u=null==(g=h.querySelector(o))?void 0:g.parentNode)||void 0===u||u.removeChild(g),h.querySelectorAll(n);case r:case o:var m=a(e).querySelectorAll(p);return s.test(e)&&l.test(e)?m[0].parentNode.childNodes:m;default:return f?f(e):(g=a(e,o).querySelector(o)).childNodes;var g}};var n="html",r="head",o="body",i=/<([a-zA-Z]+[0-9]?)/,l=//i,s=//i,a=function(e,t){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},c=function(e,t){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")},u="object"==typeof window&&window.DOMParser;if("function"==typeof u){var d=new u;a=c=function(e,t){return t&&(e="<".concat(t,">").concat(e,"")),d.parseFromString(e,"text/html")}}if("object"==typeof document&&document.implementation){var p=document.implementation.createHTMLDocument();a=function(e,t){if(t){var n=p.documentElement.querySelector(t);return n&&(n.innerHTML=e),p}return p.documentElement.innerHTML=e,p}}var f,h="object"==typeof document&&document.createElement("template");h&&h.content&&(f=function(e){return h.innerHTML=e,h.content.childNodes})},2471:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];var t=e.match(l),n=t?t[1]:void 0;return(0,i.formatDOM)((0,o.default)(e),null,n)};var o=r(n(5496)),i=n(7731),l=/<(![a-zA-Z\s]+)>/},7731:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatAttributes=i,t.formatDOM=function e(t,n,o){void 0===n&&(n=null);for(var s,a=[],c=0,u=t.length;c{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){void 0===e&&(e={});var n={},c=Boolean(e.type&&s[e.type]);for(var u in e){var d=e[u];if((0,r.isCustomAttribute)(u))n[u]=d;else{var p=u.toLowerCase(),f=a(p);if(f){var h=(0,r.getPropertyInfo)(f);switch(i.includes(f)&&l.includes(t)&&!c&&(f=a("default"+p)),n[f]=d,h&&h.type){case r.BOOLEAN:n[f]=!0;break;case r.OVERLOADED_BOOLEAN:""===d&&(n[f]=!0)}}else o.PRESERVE_CUSTOM_ATTRIBUTES&&(n[u]=d)}}return(0,o.setStyleProp)(e.style,n),n};var r=n(4210),o=n(4958),i=["checked","value"],l=["input","select","textarea"],s={reset:!0,submit:!0};function a(e){return r.possibleStandardNames[e]}},308:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t,n){void 0===n&&(n={});for(var r=[],o="function"==typeof n.replace,c=n.transform||l.returnFirstArg,u=n.library||s,d=u.cloneElement,p=u.createElement,f=u.isValidElement,h=t.length,m=0;m1&&(v=d(v,{key:v.key||m})),r.push(c(v,g,m));continue}}if("text"!==g.type){var y=g,b={};a(y)?((0,l.setStyleProp)(y.attribs.style,y.attribs),b=y.attribs):y.attribs&&(b=(0,i.default)(y.attribs,y.name));var w=void 0;switch(g.type){case"script":case"style":g.children[0]&&(b.dangerouslySetInnerHTML={__html:g.children[0].data});break;case"tag":"textarea"===g.name&&g.children[0]?b.defaultValue=g.children[0].data:g.children&&g.children.length&&(w=e(g.children,n));break;default:continue}h>1&&(b.key=m),r.push(c(p(g.name,b,w),g,m))}else{var x=!g.data.trim().length;if(x&&g.parent&&!(0,l.canTextBeChildOfNode)(g.parent))continue;if(n.trim&&x)continue;r.push(c(g.data,g,m))}}return 1===r.length?r[0]:r};var o=n(1609),i=r(n(840)),l=n(4958),s={cloneElement:o.cloneElement,createElement:o.createElement,isValidElement:o.isValidElement};function a(e){return l.PRESERVE_CUSTOM_ATTRIBUTES&&"tag"===e.type&&(0,l.isCustomComponent)(e.name,e.attribs)}},442:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.htmlToDOM=t.domToReact=t.attributesToProps=t.Text=t.ProcessingInstruction=t.Element=t.Comment=void 0,t.default=function(e,t){if("string"!=typeof e)throw new TypeError("First argument must be a string");return e?(0,l.default)((0,o.default)(e,(null==t?void 0:t.htmlparser2)||a),t):[]};var o=r(n(2471));t.htmlToDOM=o.default;var i=r(n(840));t.attributesToProps=i.default;var l=r(n(308));t.domToReact=l.default;var s=n(1141);Object.defineProperty(t,"Comment",{enumerable:!0,get:function(){return s.Comment}}),Object.defineProperty(t,"Element",{enumerable:!0,get:function(){return s.Element}}),Object.defineProperty(t,"ProcessingInstruction",{enumerable:!0,get:function(){return s.ProcessingInstruction}}),Object.defineProperty(t,"Text",{enumerable:!0,get:function(){return s.Text}});var a={lowerCaseAttributeNames:!1}},4958:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.returnFirstArg=t.canTextBeChildOfNode=t.ELEMENTS_WITH_NO_TEXT_CHILDREN=t.PRESERVE_CUSTOM_ATTRIBUTES=void 0,t.isCustomComponent=function(e,t){return e.includes("-")?!l.has(e):Boolean(t&&"string"==typeof t.is)},t.setStyleProp=function(e,t){if("string"==typeof e)if(e.trim())try{t.style=(0,i.default)(e,s)}catch(e){t.style={}}else t.style={}};var o=n(1609),i=r(n(5229)),l=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]),s={reactCompat:!0};t.PRESERVE_CUSTOM_ATTRIBUTES=Number(o.version.split(".")[0])>=16,t.ELEMENTS_WITH_NO_TEXT_CHILDREN=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]),t.canTextBeChildOfNode=function(e){return!t.ELEMENTS_WITH_NO_TEXT_CHILDREN.has(e.name)},t.returnFirstArg=function(e){return e}},9788:e=>{var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,r=/^\s*/,o=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,a=/^\s+|\s+$/g,c="";function u(e){return e?e.replace(a,c):c}e.exports=function(e,a){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];a=a||{};var d=1,p=1;function f(e){var t=e.match(n);t&&(d+=t.length);var r=e.lastIndexOf("\n");p=~r?e.length-r:p+e.length}function h(){var e={line:d,column:p};return function(t){return t.position=new m(e),b(),t}}function m(e){this.start=e,this.end={line:d,column:p},this.source=a.source}m.prototype.content=e;var g=[];function v(t){var n=new Error(a.source+":"+d+":"+p+": "+t);if(n.reason=t,n.filename=a.source,n.line=d,n.column=p,n.source=e,!a.silent)throw n;g.push(n)}function y(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function b(){y(r)}function w(e){var t;for(e=e||[];t=x();)!1!==t&&e.push(t);return e}function x(){var t=h();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;c!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,c===e.charAt(n-1))return v("End of comment missing");var r=e.slice(2,n-2);return p+=2,f(r),e=e.slice(n),p+=2,t({type:"comment",comment:r})}}function _(){var e=h(),n=y(o);if(n){if(x(),!y(i))return v("property missing ':'");var r=y(l),a=e({type:"declaration",property:u(n[0].replace(t,c)),value:r?u(r[0].replace(t,c)):c});return y(s),a}}return b(),function(){var e,t=[];for(w(t);e=_();)!1!==e&&(t.push(e),w(t));return t}()}},4210:(e,t,n)=>{"use strict";function r(e,t,n,r,o,i,l){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=l}const o={};["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"].forEach((e=>{o[e]=new r(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((([e,t])=>{o[e]=new r(e,1,!1,t,null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((e=>{o[e]=new r(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((e=>{o[e]=new r(e,2,!1,e,null,!1,!1)})),["allowFullScreen","async","autoFocus","autoPlay","controls","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"].forEach((e=>{o[e]=new r(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((e=>{o[e]=new r(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((e=>{o[e]=new r(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((e=>{o[e]=new r(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((e=>{o[e]=new r(e,5,!1,e.toLowerCase(),null,!1,!1)}));const i=/[\-\:]([a-z])/g,l=e=>e[1].toUpperCase();["accent-height","alignment-baseline","arabic-form","baseline-shift","cap-height","clip-path","clip-rule","color-interpolation","color-interpolation-filters","color-profile","color-rendering","dominant-baseline","enable-background","fill-opacity","fill-rule","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","horiz-adv-x","horiz-origin-x","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","overline-position","overline-thickness","paint-order","panose-1","pointer-events","rendering-intent","shape-rendering","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-rendering","underline-position","underline-thickness","unicode-bidi","unicode-range","units-per-em","v-alphabetic","v-hanging","v-ideographic","v-mathematical","vector-effect","vert-adv-y","vert-origin-x","vert-origin-y","word-spacing","writing-mode","xmlns:xlink","x-height"].forEach((e=>{const t=e.replace(i,l);o[t]=new r(t,1,!1,e,null,!1,!1)})),["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach((e=>{const t=e.replace(i,l);o[t]=new r(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((e=>{const t=e.replace(i,l);o[t]=new r(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((e=>{o[e]=new r(e,1,!1,e.toLowerCase(),null,!1,!1)})),o.xlinkHref=new r("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((e=>{o[e]=new r(e,1,!1,e.toLowerCase(),null,!0,!0)}));const{CAMELCASE:s,SAME:a,possibleStandardNames:c}=n(6811),u=RegExp.prototype.test.bind(new RegExp("^(data|aria)-[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$")),d=Object.keys(c).reduce(((e,t)=>{const n=c[t];return n===a?e[t]=t:n===s?e[t.toLowerCase()]=t:e[t]=n,e}),{});t.BOOLEAN=3,t.BOOLEANISH_STRING=2,t.NUMERIC=5,t.OVERLOADED_BOOLEAN=4,t.POSITIVE_NUMERIC=6,t.RESERVED=0,t.STRING=1,t.getPropertyInfo=function(e){return o.hasOwnProperty(e)?o[e]:null},t.isCustomAttribute=u,t.possibleStandardNames=d},6811:(e,t)=>{t.SAME=0,t.CAMELCASE=1,t.possibleStandardNames={accept:0,acceptCharset:1,"accept-charset":"acceptCharset",accessKey:1,action:0,allowFullScreen:1,alt:0,as:0,async:0,autoCapitalize:1,autoComplete:1,autoCorrect:1,autoFocus:1,autoPlay:1,autoSave:1,capture:0,cellPadding:1,cellSpacing:1,challenge:0,charSet:1,checked:0,children:0,cite:0,class:"className",classID:1,className:1,cols:0,colSpan:1,content:0,contentEditable:1,contextMenu:1,controls:0,controlsList:1,coords:0,crossOrigin:1,dangerouslySetInnerHTML:1,data:0,dateTime:1,default:0,defaultChecked:1,defaultValue:1,defer:0,dir:0,disabled:0,disablePictureInPicture:1,disableRemotePlayback:1,download:0,draggable:0,encType:1,enterKeyHint:1,for:"htmlFor",form:0,formMethod:1,formAction:1,formEncType:1,formNoValidate:1,formTarget:1,frameBorder:1,headers:0,height:0,hidden:0,high:0,href:0,hrefLang:1,htmlFor:1,httpEquiv:1,"http-equiv":"httpEquiv",icon:0,id:0,innerHTML:1,inputMode:1,integrity:0,is:0,itemID:1,itemProp:1,itemRef:1,itemScope:1,itemType:1,keyParams:1,keyType:1,kind:0,label:0,lang:0,list:0,loop:0,low:0,manifest:0,marginWidth:1,marginHeight:1,max:0,maxLength:1,media:0,mediaGroup:1,method:0,min:0,minLength:1,multiple:0,muted:0,name:0,noModule:1,nonce:0,noValidate:1,open:0,optimum:0,pattern:0,placeholder:0,playsInline:1,poster:0,preload:0,profile:0,radioGroup:1,readOnly:1,referrerPolicy:1,rel:0,required:0,reversed:0,role:0,rows:0,rowSpan:1,sandbox:0,scope:0,scoped:0,scrolling:0,seamless:0,selected:0,shape:0,size:0,sizes:0,span:0,spellCheck:1,src:0,srcDoc:1,srcLang:1,srcSet:1,start:0,step:0,style:0,summary:0,tabIndex:1,target:0,title:0,type:0,useMap:1,value:0,width:0,wmode:0,wrap:0,about:0,accentHeight:1,"accent-height":"accentHeight",accumulate:0,additive:0,alignmentBaseline:1,"alignment-baseline":"alignmentBaseline",allowReorder:1,alphabetic:0,amplitude:0,arabicForm:1,"arabic-form":"arabicForm",ascent:0,attributeName:1,attributeType:1,autoReverse:1,azimuth:0,baseFrequency:1,baselineShift:1,"baseline-shift":"baselineShift",baseProfile:1,bbox:0,begin:0,bias:0,by:0,calcMode:1,capHeight:1,"cap-height":"capHeight",clip:0,clipPath:1,"clip-path":"clipPath",clipPathUnits:1,clipRule:1,"clip-rule":"clipRule",color:0,colorInterpolation:1,"color-interpolation":"colorInterpolation",colorInterpolationFilters:1,"color-interpolation-filters":"colorInterpolationFilters",colorProfile:1,"color-profile":"colorProfile",colorRendering:1,"color-rendering":"colorRendering",contentScriptType:1,contentStyleType:1,cursor:0,cx:0,cy:0,d:0,datatype:0,decelerate:0,descent:0,diffuseConstant:1,direction:0,display:0,divisor:0,dominantBaseline:1,"dominant-baseline":"dominantBaseline",dur:0,dx:0,dy:0,edgeMode:1,elevation:0,enableBackground:1,"enable-background":"enableBackground",end:0,exponent:0,externalResourcesRequired:1,fill:0,fillOpacity:1,"fill-opacity":"fillOpacity",fillRule:1,"fill-rule":"fillRule",filter:0,filterRes:1,filterUnits:1,floodOpacity:1,"flood-opacity":"floodOpacity",floodColor:1,"flood-color":"floodColor",focusable:0,fontFamily:1,"font-family":"fontFamily",fontSize:1,"font-size":"fontSize",fontSizeAdjust:1,"font-size-adjust":"fontSizeAdjust",fontStretch:1,"font-stretch":"fontStretch",fontStyle:1,"font-style":"fontStyle",fontVariant:1,"font-variant":"fontVariant",fontWeight:1,"font-weight":"fontWeight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:1,"glyph-name":"glyphName",glyphOrientationHorizontal:1,"glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphOrientationVertical:1,"glyph-orientation-vertical":"glyphOrientationVertical",glyphRef:1,gradientTransform:1,gradientUnits:1,hanging:0,horizAdvX:1,"horiz-adv-x":"horizAdvX",horizOriginX:1,"horiz-origin-x":"horizOriginX",ideographic:0,imageRendering:1,"image-rendering":"imageRendering",in2:0,in:0,inlist:0,intercept:0,k1:0,k2:0,k3:0,k4:0,k:0,kernelMatrix:1,kernelUnitLength:1,kerning:0,keyPoints:1,keySplines:1,keyTimes:1,lengthAdjust:1,letterSpacing:1,"letter-spacing":"letterSpacing",lightingColor:1,"lighting-color":"lightingColor",limitingConeAngle:1,local:0,markerEnd:1,"marker-end":"markerEnd",markerHeight:1,markerMid:1,"marker-mid":"markerMid",markerStart:1,"marker-start":"markerStart",markerUnits:1,markerWidth:1,mask:0,maskContentUnits:1,maskUnits:1,mathematical:0,mode:0,numOctaves:1,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:1,"overline-position":"overlinePosition",overlineThickness:1,"overline-thickness":"overlineThickness",paintOrder:1,"paint-order":"paintOrder",panose1:0,"panose-1":"panose1",pathLength:1,patternContentUnits:1,patternTransform:1,patternUnits:1,pointerEvents:1,"pointer-events":"pointerEvents",points:0,pointsAtX:1,pointsAtY:1,pointsAtZ:1,prefix:0,preserveAlpha:1,preserveAspectRatio:1,primitiveUnits:1,property:0,r:0,radius:0,refX:1,refY:1,renderingIntent:1,"rendering-intent":"renderingIntent",repeatCount:1,repeatDur:1,requiredExtensions:1,requiredFeatures:1,resource:0,restart:0,result:0,results:0,rotate:0,rx:0,ry:0,scale:0,security:0,seed:0,shapeRendering:1,"shape-rendering":"shapeRendering",slope:0,spacing:0,specularConstant:1,specularExponent:1,speed:0,spreadMethod:1,startOffset:1,stdDeviation:1,stemh:0,stemv:0,stitchTiles:1,stopColor:1,"stop-color":"stopColor",stopOpacity:1,"stop-opacity":"stopOpacity",strikethroughPosition:1,"strikethrough-position":"strikethroughPosition",strikethroughThickness:1,"strikethrough-thickness":"strikethroughThickness",string:0,stroke:0,strokeDasharray:1,"stroke-dasharray":"strokeDasharray",strokeDashoffset:1,"stroke-dashoffset":"strokeDashoffset",strokeLinecap:1,"stroke-linecap":"strokeLinecap",strokeLinejoin:1,"stroke-linejoin":"strokeLinejoin",strokeMiterlimit:1,"stroke-miterlimit":"strokeMiterlimit",strokeWidth:1,"stroke-width":"strokeWidth",strokeOpacity:1,"stroke-opacity":"strokeOpacity",suppressContentEditableWarning:1,suppressHydrationWarning:1,surfaceScale:1,systemLanguage:1,tableValues:1,targetX:1,targetY:1,textAnchor:1,"text-anchor":"textAnchor",textDecoration:1,"text-decoration":"textDecoration",textLength:1,textRendering:1,"text-rendering":"textRendering",to:0,transform:0,typeof:0,u1:0,u2:0,underlinePosition:1,"underline-position":"underlinePosition",underlineThickness:1,"underline-thickness":"underlineThickness",unicode:0,unicodeBidi:1,"unicode-bidi":"unicodeBidi",unicodeRange:1,"unicode-range":"unicodeRange",unitsPerEm:1,"units-per-em":"unitsPerEm",unselectable:0,vAlphabetic:1,"v-alphabetic":"vAlphabetic",values:0,vectorEffect:1,"vector-effect":"vectorEffect",version:0,vertAdvY:1,"vert-adv-y":"vertAdvY",vertOriginX:1,"vert-origin-x":"vertOriginX",vertOriginY:1,"vert-origin-y":"vertOriginY",vHanging:1,"v-hanging":"vHanging",vIdeographic:1,"v-ideographic":"vIdeographic",viewBox:1,viewTarget:1,visibility:0,vMathematical:1,"v-mathematical":"vMathematical",vocab:0,widths:0,wordSpacing:1,"word-spacing":"wordSpacing",writingMode:1,"writing-mode":"writingMode",x1:0,x2:0,x:0,xChannelSelector:1,xHeight:1,"x-height":"xHeight",xlinkActuate:1,"xlink:actuate":"xlinkActuate",xlinkArcrole:1,"xlink:arcrole":"xlinkArcrole",xlinkHref:1,"xlink:href":"xlinkHref",xlinkRole:1,"xlink:role":"xlinkRole",xlinkShow:1,"xlink:show":"xlinkShow",xlinkTitle:1,"xlink:title":"xlinkTitle",xlinkType:1,"xlink:type":"xlinkType",xmlBase:1,"xml:base":"xmlBase",xmlLang:1,"xml:lang":"xmlLang",xmlns:0,"xml:space":"xmlSpace",xmlnsXlink:1,"xmlns:xlink":"xmlnsXlink",xmlSpace:1,y1:0,y2:0,y:0,yChannelSelector:1,z:0,zoomAndPan:1}},5229:function(e,t,n){"use strict";var r=(this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(n(1133)),o=n(8917);function i(e,t){var n={};return e&&"string"==typeof e?((0,r.default)(e,(function(e,r){e&&r&&(n[(0,o.camelCase)(e,t)]=r)})),n):n}i.default=i,e.exports=i},8917:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.camelCase=void 0;var n=/^--[a-zA-Z0-9-]+$/,r=/-([a-z])/g,o=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,l=/^-(ms)-/,s=function(e,t){return t.toUpperCase()},a=function(e,t){return"".concat(t,"-")};t.camelCase=function(e,t){return void 0===t&&(t={}),function(e){return!e||o.test(e)||n.test(e)}(e)?e:(e=e.toLowerCase(),(e=t.reactCompat?e.replace(l,a):e.replace(i,a)).replace(r,s))}},1133:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=r(n(9788));t.default=function(e,t){var n=null;if(!e||"string"!=typeof e)return n;var r=(0,o.default)(e),i="function"==typeof t;return r.forEach((function(e){if("declaration"===e.type){var r=e.property,o=e.value;i?t(r,o,e):o&&((n=n||{})[r]=o)}})),n}},1609:e=>{"use strict";e.exports=window.React},6942:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e="",t=0;t{if(!n){var i=1/0;for(u=0;u=o)&&Object.keys(s.O).every((e=>s.O[e](n[a])))?n.splice(a--,1):(l=!1,o0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[n,r,o]},s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},n=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,s.t=function(e,r){if(1&r&&(e=this(e)),8&r)return e;if("object"==typeof e&&e){if(4&r&&e.__esModule)return e;if(16&r&&"function"==typeof e.then)return e}var o=Object.create(null);s.r(o);var i={};t=t||[null,n({}),n([]),n(n)];for(var l=2&r&&e;"object"==typeof l&&!~t.indexOf(l);l=n(l))Object.getOwnPropertyNames(l).forEach((t=>i[t]=()=>e[t]));return i.default=()=>e,s.d(o,i),o},s.d=(e,t)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce(((t,n)=>(s.f[n](e,t),t)),[])),s.u=e=>e+".js",s.miniCssF=e=>e+".css",s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r={},o="gatherpress:",s.l=(e,t,n,i)=>{if(r[e])r[e].push(t);else{var l,a;if(void 0!==n)for(var c=document.getElementsByTagName("script"),u=0;u{l.onerror=l.onload=null,clearTimeout(f);var o=r[e];if(delete r[e],l.parentNode&&l.parentNode.removeChild(l),o&&o.forEach((e=>e(n))),t)return t(n)},f=setTimeout(p.bind(null,void 0,{type:"timeout",target:l}),12e4);l.onerror=p.bind(null,l.onerror),l.onload=p.bind(null,l.onload),a&&document.head.appendChild(l)}},s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;s.g.importScripts&&(e=s.g.location+"");var t=s.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var r=n.length-1;r>-1&&(!e||!/^http(s?):/.test(e));)e=n[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),s.p=e+"../../"})(),(()=>{if("undefined"!=typeof document){var e={908:0};s.f.miniCss=(t,n)=>{e[t]?n.push(e[t]):0!==e[t]&&{535:1}[t]&&n.push(e[t]=(e=>new Promise(((t,n)=>{var r=s.miniCssF(e),o=s.p+r;if(((e,t)=>{for(var n=document.getElementsByTagName("link"),r=0;r{var i=document.createElement("link");i.rel="stylesheet",i.type="text/css",s.nc&&(i.nonce=s.nc),i.onerror=i.onload=n=>{if(i.onerror=i.onload=null,"load"===n.type)r();else{var l=n&&n.type,s=n&&n.target&&n.target.href||t,a=new Error("Loading CSS chunk "+e+" failed.\n("+l+": "+s+")");a.name="ChunkLoadError",a.code="CSS_CHUNK_LOAD_FAILED",a.type=l,a.request=s,i.parentNode&&i.parentNode.removeChild(i),o(a)}},i.href=t,document.head.appendChild(i)})(e,o,0,t,n)})))(t).then((()=>{e[t]=0}),(n=>{throw delete e[t],n})))}}})(),(()=>{var e={908:0,812:0};s.f.j=(t,n)=>{var r=s.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else if(812!=t){var o=new Promise(((n,o)=>r=e[t]=[n,o]));n.push(r[2]=o);var i=s.p+s.u(t),l=new Error;s.l(i,(n=>{if(s.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var o=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;l.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",l.name="ChunkLoadError",l.type=o,l.request=i,r[1](l)}}),"chunk-"+t,t)}else e[t]=0},s.O.j=t=>0===e[t];var t=(t,n)=>{var r,o,[i,l,a]=n,c=0;if(i.some((t=>0!==e[t]))){for(r in l)s.o(l,r)&&(s.m[r]=l[r]);if(a)var u=a(s)}for(t&&t(n);cs(5949)));a=s.O(a)})(); \ No newline at end of file diff --git a/build/editor.asset.php b/build/editor.asset.php index 78488352f..f7a0705c0 100644 --- a/build/editor.asset.php +++ b/build/editor.asset.php @@ -1 +1 @@ - array('moment', 'react-jsx-runtime', 'wp-blocks', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-element', 'wp-i18n'), 'version' => '78fc112bbc2194a14d45'); + array('moment', 'react-jsx-runtime', 'wp-blocks', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => '527068ffe7026f7bf7ce'); diff --git a/build/editor.js b/build/editor.js index dfab7182d..6c725a198 100644 --- a/build/editor.js +++ b/build/editor.js @@ -1 +1 @@ -(()=>{"use strict";var e={n:t=>{var s=t&&t.__esModule?()=>t.default:()=>t;return e.d(s,{a:s}),s},d:(t,s)=>{for(var a in s)e.o(s,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:s[a]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.domReady;var s=e.n(t);const a=window.wp.data,r=window.moment;var i=e.n(r);const n=window.wp.i18n;function o(e){if("object"==typeof GatherPress)return e.split(".").reduce(((e,t)=>e&&e[t]),GatherPress)}function d(e,t){if("object"!=typeof GatherPress)return;const s=e.split("."),a=s.pop();s.reduce(((e,t)=>{var s;return null!==(s=e[t])&&void 0!==s?s:e[t]={}}),GatherPress)[a]=t}window.wp.element,window.wp.date,window.ReactJSXRuntime;const c="YYYY-MM-DD HH:mm:ss",m=i().tz(p()).add(1,"day").set("hour",18).set("minute",0).set("second",0).format(c),l=i().tz(m,p()).add(2,"hours").format(c),u=[{label:(0,n.__)("1 hour","gatherpress"),value:1},{label:(0,n.__)("1.5 hours","gatherpress"),value:1.5},{label:(0,n.__)("2 hours","gatherpress"),value:2},{label:(0,n.__)("3 hours","gatherpress"),value:3},{label:(0,n.__)("Set an end time…","gatherpress"),value:!1}];function p(e=o("eventDetails.dateTime.timezone")){return i().tz.zone(e)?e:(0,n.__)("GMT","gatherpress")}function T(){const e=i().tz(o("eventDetails.dateTime.datetime_end"),p());return"gatherpress_event"===(0,a.select)("core/editor")?.getCurrentPostType()&&i().tz(p()).valueOf()>e.valueOf()}let _=!1;function v(){const e="gatherpress_event_communication",t=(0,a.dispatch)("core/notices"),s=(0,a.select)("core/editor").isSavingPost(),r=(0,a.select)("core/editor").isAutosavingPost();"publish"!==(0,a.select)("core/editor").getEditedPostAttribute("status")||"gatherpress_event"!==(0,a.select)("core/editor")?.getCurrentPostType()||!s||r||T()||_||(_=!0,t.removeNotice(e),t.createNotice("success",(0,n.__)("Send an event update to members via email?","gatherpress"),{id:e,isDismissible:!0,actions:[{onClick:()=>{((e,t="")=>{for(const[s,a]of Object.entries(e)){let e=s;t&&(e+="_"+String(t));const r=new CustomEvent(e,{detail:a});dispatchEvent(r)}})({setOpen:!0})},label:(0,n.__)("Compose Message","gatherpress")}]})),s||(_=!1)}const g=window.wp.blocks,h={dateTimeStart:o("eventDetails.dateTime.datetime_start")?o("eventDetails.dateTime.datetime_start"):m,dateTimeEnd:o("eventDetails.dateTime.datetime_end")?o("eventDetails.dateTime.datetime_end"):l,duration:u.find((e=>{return t=e.value,i().tz(function(){let e=o("eventDetails.dateTime.datetime_start");return e=""!==e?i().tz(e,p()).format(c):m,d("eventDetails.dateTime.datetime_start",e),e}(),p()).add(t,"hours").format(c)===function(){let e=o("eventDetails.dateTime.datetime_end");return e=""!==e?i().tz(e,p()).format(c):l,d("eventDetails.dateTime.datetime_end",e),e}();var t}))?.value||!1,timezone:o("eventDetails.dateTime.timezone")},E={setDateTimeStart:e=>(d("eventDetails.dateTime.datetime_start",e),{type:"SET_DATETIME_START",dateTimeStart:e}),setDateTimeEnd:e=>(d("eventDetails.dateTime.datetime_end",e),{type:"SET_DATETIME_END",dateTimeEnd:e}),setDuration:e=>({type:"SET_DURATION",duration:e}),setTimezone:e=>(d("eventDetails.dateTime.timezone",e),{type:"SET_TIMEZONE",timezone:e})},D=(0,a.createReduxStore)("gatherpress/datetime",{reducer:(e=h,t)=>{switch(t.type){case"SET_DATETIME_START":return{...e,dateTimeStart:t.dateTimeStart};case"SET_DATETIME_END":return{...e,dateTimeEnd:t.dateTimeEnd};case"SET_DURATION":return{...e,duration:t.duration};case"SET_TIMEZONE":return{...e,timezone:t.timezone};default:return e}},actions:E,selectors:{getDateTimeStart:e=>e.dateTimeStart,getDateTimeEnd:e=>e.dateTimeEnd,getDuration:e=>e.duration,getTimezone:e=>e.timezone}});(0,a.register)(D),s()((()=>{const e=(0,a.select)("core/edit-post");if(!e)return;const t=(0,a.dispatch)("core/edit-post");e.isEditorSidebarOpened()?(t.openGeneralSidebar("edit-post/document"),t.toggleEditorPanelOpened("gatherpress-event-settings/gatherpress-event-settings")):(t.openGeneralSidebar(),t.toggleEditorPanelOpened("gatherpress-event-settings/gatherpress-event-settings")),(0,a.subscribe)(v),function(){const e="gatherpress_event_past",t=(0,a.dispatch)("core/notices");t.removeNotice(e),T()&&t.createNotice("warning",(0,n.__)("This event has already passed.","gatherpress"),{id:e,isDismissible:!1})}()})),s()((()=>{Object.keys(o("misc.unregisterBlocks")).forEach((e=>{const t=o("misc.unregisterBlocks")[e];t&&void 0!==(0,g.getBlockType)(t)&&(0,g.unregisterBlockType)(t)}))}))})(); \ No newline at end of file +(()=>{"use strict";var e={n:t=>{var s=t&&t.__esModule?()=>t.default:()=>t;return e.d(s,{a:s}),s},d:(t,s)=>{for(var r in s)e.o(s,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:s[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.domReady;var s=e.n(t);const r=window.wp.data,a=window.moment;var i=e.n(a);const n=window.wp.i18n,o=(window.wp.element,window.wp.hooks);function d(e){if("object"==typeof GatherPress)return e.split(".").reduce(((e,t)=>e&&e[t]),GatherPress)}function c(e,t){if("object"!=typeof GatherPress)return;const s=e.split("."),r=s.pop();s.reduce(((e,t)=>{var s;return null!==(s=e[t])&&void 0!==s?s:e[t]={}}),GatherPress)[r]=t}window.wp.date,window.ReactJSXRuntime;const l="YYYY-MM-DD HH:mm:ss",m=i().tz(T()).add(1,"day").set("hour",18).set("minute",0).set("second",0).format(l),u=i().tz(m,T()).add(2,"hours").format(l);function p(){return function(){const e=[{label:(0,n.__)("1 hour","gatherpress"),value:1},{label:(0,n.__)("1.5 hours","gatherpress"),value:1.5},{label:(0,n.__)("2 hours","gatherpress"),value:2},{label:(0,n.__)("3 hours","gatherpress"),value:3},{label:(0,n.__)("Set an end time…","gatherpress"),value:!1}];return(0,o.applyFilters)("gatherpress.durationOptions",e)}().find((e=>{return t=e.value,i().tz(function(){let e=d("eventDetails.dateTime.datetime_start");return e=""!==e?i().tz(e,T()).format(l):m,c("eventDetails.dateTime.datetime_start",e),e}(),T()).add(t,"hours").format(l)===function(){let e=d("eventDetails.dateTime.datetime_end");return e=""!==e?i().tz(e,T()).format(l):u,c("eventDetails.dateTime.datetime_end",e),e}();var t}))?.value||!1}function T(e=d("eventDetails.dateTime.timezone")){return i().tz.zone(e)?e:(0,n.__)("GMT","gatherpress")}function _(){const e=i().tz(d("eventDetails.dateTime.datetime_end"),T());return"gatherpress_event"===(0,r.select)("core/editor")?.getCurrentPostType()&&i().tz(T()).valueOf()>e.valueOf()}let v=!1;function g(){const e="gatherpress_event_communication",t=(0,r.dispatch)("core/notices"),s=(0,r.select)("core/editor").isSavingPost(),a=(0,r.select)("core/editor").isAutosavingPost();"publish"!==(0,r.select)("core/editor").getEditedPostAttribute("status")||"gatherpress_event"!==(0,r.select)("core/editor")?.getCurrentPostType()||!s||a||_()||v||(v=!0,t.removeNotice(e),t.createNotice("success",(0,n.__)("Send an event update to members via email?","gatherpress"),{id:e,isDismissible:!0,actions:[{onClick:()=>{((e,t="")=>{for(const[s,r]of Object.entries(e)){let e=s;t&&(e+="_"+String(t));const a=new CustomEvent(e,{detail:r});dispatchEvent(a)}})({setOpen:!0})},label:(0,n.__)("Compose Message","gatherpress")}]})),s||(v=!1)}const h=window.wp.blocks,E={dateTimeStart:d("eventDetails.dateTime.datetime_start")?d("eventDetails.dateTime.datetime_start"):m,dateTimeEnd:d("eventDetails.dateTime.datetime_end")?d("eventDetails.dateTime.datetime_end"):u,duration:null,timezone:d("eventDetails.dateTime.timezone")},D={setDateTimeStart:e=>(c("eventDetails.dateTime.datetime_start",e),{type:"SET_DATETIME_START",dateTimeStart:e}),setDateTimeEnd:e=>(c("eventDetails.dateTime.datetime_end",e),{type:"SET_DATETIME_END",dateTimeEnd:e}),setDuration:e=>({type:"SET_DURATION",duration:e}),setTimezone:e=>(c("eventDetails.dateTime.timezone",e),{type:"SET_TIMEZONE",timezone:e})},f=(0,r.createReduxStore)("gatherpress/datetime",{reducer:(e=E,t)=>{switch(t.type){case"SET_DATETIME_START":return{...e,dateTimeStart:t.dateTimeStart};case"SET_DATETIME_END":return{...e,dateTimeEnd:t.dateTimeEnd};case"SET_DURATION":return{...e,duration:t.duration};case"SET_TIMEZONE":return{...e,timezone:t.timezone};default:return e}},actions:D,selectors:{getDateTimeStart:e=>e.dateTimeStart,getDateTimeEnd:e=>e.dateTimeEnd,getDuration:e=>!1!==e.duration&&p(),getTimezone:e=>e.timezone}});(0,r.register)(f),s()((()=>{const e=(0,r.select)("core/edit-post");if(!e)return;const t=(0,r.dispatch)("core/edit-post");e.isEditorSidebarOpened()?(t.openGeneralSidebar("edit-post/document"),t.toggleEditorPanelOpened("gatherpress-event-settings/gatherpress-event-settings")):(t.openGeneralSidebar(),t.toggleEditorPanelOpened("gatherpress-event-settings/gatherpress-event-settings")),(0,r.subscribe)(g),function(){const e="gatherpress_event_past",t=(0,r.dispatch)("core/notices");t.removeNotice(e),_()&&t.createNotice("warning",(0,n.__)("This event has already passed.","gatherpress"),{id:e,isDismissible:!1})}()})),s()((()=>{Object.keys(d("misc.unregisterBlocks")).forEach((e=>{const t=d("misc.unregisterBlocks")[e];t&&void 0!==(0,h.getBlockType)(t)&&(0,h.unregisterBlockType)(t)}))}))})(); \ No newline at end of file diff --git a/build/panels.asset.php b/build/panels.asset.php index ebed91ed7..19129be4c 100644 --- a/build/panels.asset.php +++ b/build/panels.asset.php @@ -1 +1 @@ - array('moment', 'react-jsx-runtime', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-plugins'), 'version' => 'c6c09a92287f347e9ae0'); + array('moment', 'react-jsx-runtime', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-edit-post', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-plugins'), 'version' => '6a8f36ed49cc719228f3'); diff --git a/build/panels.js b/build/panels.js index 0f9f51927..8d4b96567 100644 --- a/build/panels.js +++ b/build/panels.js @@ -1,2 +1,2 @@ -(()=>{"use strict";var e={n:t=>{var s=t&&t.__esModule?()=>t.default:()=>t;return e.d(s,{a:s}),s},d:(t,s)=>{for(var n in s)e.o(s,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:s[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.i18n,s=window.wp.data,n=window.wp.components,r=window.wp.plugins,a=window.wp.editPost,i=window.moment;var o=e.n(i);const l=window.wp.element;function c(){(0,s.dispatch)("core/editor")?.editPost({meta:{_non_existing_meta:!0}})}function d(e){if("object"==typeof GatherPress)return e.split(".").reduce(((e,t)=>e&&e[t]),GatherPress)}function u(e,t){if("object"!=typeof GatherPress)return;const s=e.split("."),n=s.pop();s.reduce(((e,t)=>{var s;return null!==(s=e[t])&&void 0!==s?s:e[t]={}}),GatherPress)[n]=t}const m=window.wp.date,p=window.ReactJSXRuntime,g="YYYY-MM-DD HH:mm:ss",h=o().tz(f()).add(1,"day").set("hour",18).set("minute",0).set("second",0).format(g),_=(o().tz(h,f()).add(2,"hours").format(g),[{label:(0,t.__)("1 hour","gatherpress"),value:1},{label:(0,t.__)("1.5 hours","gatherpress"),value:1.5},{label:(0,t.__)("2 hours","gatherpress"),value:2},{label:(0,t.__)("3 hours","gatherpress"),value:3},{label:(0,t.__)("Set an end time…","gatherpress"),value:!1}]);function v(e){return o().tz(function(){let e=d("eventDetails.dateTime.datetime_start");return e=""!==e?o().tz(e,f()).format(g):h,u("eventDetails.dateTime.datetime_start",e),e}(),f()).add(e,"hours").format(g)}function x(){return D(d("settings.dateFormat"))+" "+D(d("settings.timeFormat"))}function f(e=d("eventDetails.dateTime.timezone")){return o().tz.zone(e)?e:(0,t.__)("GMT","gatherpress")}function j(e=""){const t=/^([+-])(\d{2}):(00|15|30|45)$/,s=e.replace(t,"$1");return s!==e?"UTC"+s+parseInt(e.replace(t,"$2")).toString()+e.replace(t,"$3").replace("00","").replace("15",".25").replace("30",".5").replace("45",".75"):e}function b(e,t=null,s=null){!function(e,t=null){const s=o().tz(d("eventDetails.dateTime.datetime_end"),f()).valueOf(),n=o().tz(e,f()).valueOf();n>=s&&S(o().tz(n,f()).add(2,"hours").format(g),t)}(e,s),u("eventDetails.dateTime.datetime_start",e),"function"==typeof t&&t(e),c()}function S(e,t=null,s=null){!function(e,t=null){const s=o().tz(d("eventDetails.dateTime.datetime_start"),f()).valueOf(),n=o().tz(e,f()).valueOf();n<=s&&b(o().tz(n,f()).subtract(2,"hours").format(g),t)}(e,s),u("eventDetails.dateTime.datetime_end",e),null!==t&&t(e),c()}function D(e){const t={d:"DD",D:"ddd",j:"D",l:"dddd",N:"E",S:"o",w:"e",z:"DDD",W:"W",F:"MMMM",m:"MM",M:"MMM",n:"M",t:"",L:"",o:"YYYY",Y:"YYYY",y:"YY",a:"a",A:"A",B:"",g:"h",G:"H",h:"hh",H:"HH",i:"mm",s:"ss",u:"SSS",e:"zz",I:"",O:"",P:"",T:"",Z:"",c:"",r:"",U:"X"};return String(e).split("").map(((e,s,n)=>{const r=n[s-1];return e in t&&"\\"!==r?t[e]:e})).join("")}function P(){const e=o().tz(d("eventDetails.dateTime.datetime_end"),f());return"gatherpress_event"===(0,s.select)("core/editor")?.getCurrentPostType()&&o().tz(f()).valueOf()>e.valueOf()}function T(){const e="gatherpress_event_past",n=(0,s.dispatch)("core/notices");n.removeNotice(e),P()&&n.createNotice("warning",(0,t.__)("This event has already passed.","gatherpress"),{id:e,isDismissible:!1})}const w=()=>{const{editPost:e,unlockPostSaving:r}=(0,s.useDispatch)("core/editor"),a=(0,s.useSelect)((e=>e("core/editor").isCleanNewPost()),[]);let i=(0,s.useSelect)((e=>e("core/editor").getEditedPostAttribute("meta").gatherpress_enable_anonymous_rsvp),[]);a&&(i=d("settings.enableAnonymousRsvp"));const[o,c]=(0,l.useState)(i),u=(0,l.useCallback)((t=>{const s={gatherpress_enable_anonymous_rsvp:Number(t)};c(t),e({meta:s}),r()}),[e,r]);return(0,l.useEffect)((()=>{a&&0!==i&&u(i)}),[a,i,u]),(0,p.jsx)(n.CheckboxControl,{label:(0,t.__)("Enable Anonymous RSVP","gatherpress"),checked:o,onChange:e=>{u(e)}})},C=()=>(0,p.jsx)("section",{children:(0,p.jsx)(w,{})}),E=()=>{const{editPost:e,unlockPostSaving:r}=(0,s.useDispatch)("core/editor"),a=(0,s.useSelect)((e=>e("core/editor").isCleanNewPost()),[]);let i=(0,s.useSelect)((e=>e("core/editor").getEditedPostAttribute("meta").gatherpress_enable_initial_decline),[]);a&&(i=d("settings.enableInitialDecline"));const[o,c]=(0,l.useState)(i),u=(0,l.useCallback)((t=>{const s={gatherpress_enable_initial_decline:Number(t)};c(t),e({meta:s}),r()}),[e,r]);return(0,l.useEffect)((()=>{a&&0!==i&&u(i)}),[a,i,u]),(0,p.jsx)(n.CheckboxControl,{label:(0,t.__)('Enable Immediate "Not Attending" Option for Attendees',"gatherpress"),checked:o,onChange:e=>{u(e)}})},y=()=>(0,p.jsx)("section",{children:(0,p.jsx)(E,{})}),k=()=>{const{dateTimeStart:e,duration:r}=(0,s.useSelect)((e=>({dateTimeStart:e("gatherpress/datetime").getDateTimeStart(),duration:e("gatherpress/datetime").getDuration()})),[]),{setDateTimeStart:a,setDateTimeEnd:i}=(0,s.useDispatch)("gatherpress/datetime"),c=(0,m.getSettings)(),d=/a(?!\\)/i.test(c.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return(0,l.useEffect)((()=>{a(o().tz(e,f()).format(g)),r&&i(v(r)),T()}),[e,r,a,i]),(0,p.jsx)(n.PanelRow,{children:(0,p.jsxs)(n.Flex,{direction:"column",gap:"1",children:[(0,p.jsx)(n.FlexItem,{children:(0,p.jsx)("h3",{style:{marginBottom:0},children:(0,p.jsx)("label",{htmlFor:"gatherpress-datetime-start",children:(0,t.__)("Date & time start","gatherpress")})})}),(0,p.jsx)(n.FlexItem,{children:(0,p.jsx)(n.Dropdown,{popoverProps:{placement:"bottom-end"},renderToggle:({isOpen:t,onToggle:s})=>(0,p.jsx)(n.Button,{id:"gatherpress-datetime-start",onClick:s,"aria-expanded":t,isLink:!0,children:o().tz(e,f()).format(x())}),renderContent:()=>(0,p.jsx)(n.DateTimePicker,{currentDate:e,onChange:e=>{b(e,a,i)},is12Hour:d})})})]})})},z=()=>{const{dateTimeEnd:e}=(0,s.useSelect)((e=>({dateTimeEnd:e("gatherpress/datetime").getDateTimeEnd()})),[]),{setDateTimeEnd:r,setDateTimeStart:a}=(0,s.useDispatch)("gatherpress/datetime"),i=(0,m.getSettings)(),c=/a(?!\\)/i.test(i.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return(0,l.useEffect)((()=>{r(o().tz(e,f()).format(g)),T()})),(0,p.jsx)(n.PanelRow,{children:(0,p.jsxs)(n.Flex,{direction:"column",gap:"1",children:[(0,p.jsx)(n.FlexItem,{children:(0,p.jsx)("h3",{style:{marginBottom:0},children:(0,p.jsx)("label",{htmlFor:"gatherpress-datetime-end",children:(0,t.__)("Date & time end","gatherpress")})})}),(0,p.jsx)(n.FlexItem,{children:(0,p.jsx)(n.Dropdown,{popoverProps:{placement:"bottom-end"},renderToggle:({isOpen:t,onToggle:s})=>(0,p.jsx)(n.Button,{id:"gatherpress-datetime-end",onClick:s,"aria-expanded":t,isLink:!0,children:o().tz(e,f()).format(x())}),renderContent:()=>(0,p.jsx)(n.DateTimePicker,{currentDate:e,onChange:e=>S(e,r,a),is12Hour:c})})})]})})},N=()=>{const{timezone:e}=(0,s.useSelect)((e=>({timezone:e("gatherpress/datetime").getTimezone()})),[]),{setTimezone:r}=(0,s.useDispatch)("gatherpress/datetime"),a=d("misc.timezoneChoices");return(0,l.useEffect)((()=>{r(d("eventDetails.dateTime.timezone"))}),[r]),(0,p.jsx)(n.PanelRow,{children:(0,p.jsx)(n.SelectControl,{label:(0,t.__)("Time Zone","gatherpress"),value:j(e),onChange:e=>{e=function(e=""){const t=/^UTC([+-])(\d+)(.\d+)?$/,s=e.replace(t,"$1");if(s!==e){const n=e.replace(t,"$2").padStart(2,"0");let r=e.replace(t,"$3");return""===r&&(r=":00"),r=r.replace(".25",":15").replace(".5",":30").replace(".75",":45"),s+n+r}return e}(e),r(e),c()},__nexthasnomarginbottom:!0,children:Object.keys(a).map((e=>(0,p.jsx)("optgroup",{label:e,children:Object.keys(a[e]).map((t=>(0,p.jsx)("option",{value:t,children:a[e][t]},t)))},e)))})})},O=()=>{const{duration:e}=(0,s.useSelect)((e=>({duration:e("gatherpress/datetime").getDuration()})),[]),r=(0,s.useDispatch)(),{setDateTimeEnd:a,setDuration:i}=r("gatherpress/datetime");return(0,p.jsx)(n.SelectControl,{label:(0,t.__)("Duration","gatherpress"),value:!!_.some((t=>t.value===e))&&e,options:_,onChange:e=>{(e="false"!==e&&parseFloat(e))&&a(v(e)),i(e)},__nexthasnomarginbottom:!0})},A=()=>{const e=(0,s.useDispatch)("core/editor").editPost;let t=(0,s.useSelect)((e=>e("core/editor").getEditedPostAttribute("meta")?.gatherpress_datetime));try{t=t?JSON.parse(t):{}}catch(e){t={}}const{dateTimeStart:n,dateTimeEnd:r,duration:a,timezone:i}=(0,s.useSelect)((e=>({dateTimeStart:e("gatherpress/datetime").getDateTimeStart(),dateTimeEnd:e("gatherpress/datetime").getDateTimeEnd(),duration:e("gatherpress/datetime").getDuration(),timezone:e("gatherpress/datetime").getTimezone()})),[]),{setDuration:c}=(0,s.useDispatch)("gatherpress/datetime");return(0,l.useEffect)((()=>{const s=JSON.stringify({...t,dateTimeStart:o().tz(n,i).format(g),dateTimeEnd:o().tz(r,i).format(g),timezone:i});e({meta:{gatherpress_datetime:s}})}),[n,r,i,t,e,c,a]),(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("section",{children:(0,p.jsx)(k,{})}),(0,p.jsx)("section",{children:a?(0,p.jsx)(O,{}):(0,p.jsx)(z,{})}),(0,p.jsx)("section",{children:(0,p.jsx)(N,{})})]})},F=()=>(0,p.jsx)(A,{}),M=()=>{const{editPost:e,unlockPostSaving:r}=(0,s.useDispatch)("core/editor"),a=(0,s.useSelect)((e=>e("core/editor").isCleanNewPost()),[]);let i=(0,s.useSelect)((e=>e("core/editor").getEditedPostAttribute("meta").gatherpress_max_guest_limit),[]);a&&(i=d("settings.maxGuestLimit")),!1===i&&(i=0);const[o,c]=(0,l.useState)(i),u=(0,l.useCallback)((t=>{const s={gatherpress_max_guest_limit:Number(t)};c(t),e({meta:s}),r()}),[e,r]);return(0,l.useEffect)((()=>{a&&0!==i&&u(i)}),[a,i,u]),(0,p.jsx)(n.__experimentalNumberControl,{label:(0,t.__)("Maximum Number of Guests","gatherpress"),value:o,min:0,max:5,onChange:e=>{u(e)}})},Y=()=>(0,p.jsx)("section",{children:(0,p.jsx)(M,{})}),L=()=>{const{editPost:e,unlockPostSaving:r}=(0,s.useDispatch)("core/editor"),a=(0,s.useSelect)((e=>e("core/editor").isCleanNewPost()),[]);let i=(0,s.useSelect)((e=>e("core/editor").getEditedPostAttribute("meta").gatherpress_max_attendance_limit),[]);a&&(i=d("settings.maxAttendanceLimit")),!1===i&&(i=0);const[o,c]=(0,l.useState)(i),u=(0,l.useCallback)((t=>{const s={gatherpress_max_attendance_limit:Number(t)};c(t),e({meta:s}),r()}),[e,r]);return(0,l.useEffect)((()=>{a&&0!==i&&u(i)}),[a,i,u]),(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(n.__experimentalNumberControl,{label:(0,t.__)("Maximum Attendance Limit","gatherpress"),value:o,min:0,onChange:e=>{u(e)}}),(0,p.jsx)("p",{className:"description",children:(0,t.__)("A value of 0 indicates no limit.","gatherpress")})]})},R=()=>(0,p.jsx)("section",{children:(0,p.jsx)(L,{})}),I=(e,t="")=>{for(const[s,n]of Object.entries(e)){let e=s;t&&(e+="_"+String(t));const r=new CustomEvent(e,{detail:n});dispatchEvent(r)}},$=(e,t="")=>{for(const[s,n]of Object.entries(e)){let e=s;t&&(e+="_"+String(t)),addEventListener(e,(e=>{n(e.detail)}),!1)}},G=()=>"publish"===(0,s.select)("core/editor").getEditedPostAttribute("status")&&!P()&&(0,p.jsxs)("section",{children:[(0,p.jsx)("h3",{style:{marginBottom:"0.5rem"},children:(0,t.__)("Send an event update","gatherpress")}),(0,p.jsx)(n.Button,{variant:"secondary",onClick:()=>I({setOpen:!0}),children:(0,t.__)("Compose Message","gatherpress")})]}),H=()=>{const{editPost:e,unlockPostSaving:r}=(0,s.useDispatch)("core/editor"),a=(0,s.useSelect)((e=>e("core/editor").getEditedPostAttribute("meta").gatherpress_online_event_link)),[i,o]=(0,l.useState)(a);return $({setOnlineEventLink:o},d("eventDetails.postId")),(0,p.jsx)(n.TextControl,{label:(0,t.__)("Online event link","gatherpress"),value:i,placeholder:(0,t.__)("Add link to online event","gatherpress"),onChange:t=>{(t=>{e({meta:{gatherpress_online_event_link:t}}),o(t),I({setOnlineEventLink:t},d("eventDetails.postId")),r()})(t)}})},B=()=>(0,p.jsx)("section",{children:(0,p.jsx)(H,{})}),J=()=>{const[e,r]=(0,l.useState)(""),[a,i]=(0,l.useState)(""),[o,c]=(0,l.useState)(""),[d,u]=(0,l.useState)(""),[m,g]=(0,l.useState)(!1),[h,_]=(0,l.useState)(""),[v,x]=(0,l.useState)(""),[f,j]=(0,l.useState)(""),b=(0,s.useDispatch)("core/editor").editPost,{unlockPostSaving:S}=(0,s.useDispatch)("core/editor"),D=(0,s.useSelect)((e=>e("core/editor").getEditedPostAttribute("_gatherpress_venue"))),P=(0,s.useSelect)((e=>e("core").getEntityRecord("taxonomy","_gatherpress_venue",D))),T=P?.slug.replace(/^_/,""),[w,C]=(0,l.useState)(""),E=D+":"+w,y=(0,s.useSelect)((e=>e("core").getEntityRecords("postType","gatherpress_venue",{per_page:1,slug:w})));(0,l.useEffect)((()=>{var e,s,n,a,o,l;let d={};if(w&&Array.isArray(y)){var m;const e=null!==(m=y[0]?.meta?.gatherpress_venue_information)&&void 0!==m?m:"{}";var p;e&&(d=JSON.parse(e),d.name=null!==(p=y[0]?.title.rendered)&&void 0!==p?p:"")}const g=null!==(e=d?.name)&&void 0!==e?e:(0,t.__)("No venue selected.","gatherpress"),h=null!==(s=d?.fullAddress)&&void 0!==s?s:"",v=null!==(n=d?.phoneNumber)&&void 0!==n?n:"",f=null!==(a=d?.website)&&void 0!==a?a:"",b=null!==(o=d?.latitude)&&void 0!==o?o:"0",S=null!==(l=d?.longitude)&&void 0!==l?l:"0";T&&C(T),j(E?String(E):""),r(g),i(h),c(v),u(f),_(b),x(S),I({setName:g,setFullAddress:h,setPhoneNumber:v,setWebsite:f,setLatitude:b,setLongitude:S,setIsOnlineEventTerm:"online-event"===w})}),[w,y,T,E]);let k=(0,s.useSelect)((e=>e("core").getEntityRecords("taxonomy","_gatherpress_venue",{per_page:-1,context:"view"})),[]);return k?(k=k.map((e=>({label:e.name,value:e.id+":"+e.slug.replace(/^_/,"")}))),k.unshift({value:":",label:(0,t.__)("Choose a venue","gatherpress")})):k=[],(0,p.jsx)(n.PanelRow,{children:(0,p.jsx)(n.SelectControl,{label:(0,t.__)("Venue Selector","gatherpress"),value:f,onChange:e=>{(e=>{j(e);const t=""!==(e=e.split(":"))[0]?[e[0]]:[];b({_gatherpress_venue:t}),C(e[1]),S()})(e)},options:k})})},W=()=>(0,p.jsx)("section",{children:(0,p.jsx)(J,{})});(0,r.registerPlugin)("gatherpress-event-settings",{render:()=>"gatherpress_event"===(0,s.select)("core/editor")?.getCurrentPostType()&&(0,p.jsx)(a.PluginDocumentSettingPanel,{name:"gatherpress-event-settings",title:(0,t.__)("Event settings","gatherpress"),initialOpen:!0,className:"gatherpress-event-settings",children:(0,p.jsxs)(n.__experimentalVStack,{spacing:4,children:[(0,p.jsx)(F,{}),(0,p.jsx)(W,{}),(0,p.jsx)(B,{}),(0,p.jsx)(Y,{}),(0,p.jsx)(R,{}),(0,p.jsx)(C,{}),(0,p.jsx)(y,{}),(0,p.jsx)(G,{})]})})}),(0,s.dispatch)("core/edit-post").toggleEditorPanelOpened("gatherpress-event-settings/gatherpress-event-settings");const V=window.wp.compose,U=()=>{var e,r,a;const i=(0,s.useDispatch)("core/editor").editPost,o=e=>{const t=JSON.stringify({...c,...e});i({meta:{gatherpress_venue_information:t}})};let c=(0,s.useSelect)((e=>e("core/editor").getEditedPostAttribute("meta").gatherpress_venue_information));c=c?JSON.parse(c):{};const[d,u]=(0,l.useState)(null!==(e=c.fullAddress)&&void 0!==e?e:""),[m,g]=(0,l.useState)(null!==(r=c.phoneNumber)&&void 0!==r?r:""),[h,_]=(0,l.useState)(null!==(a=c.website)&&void 0!==a?a:"");$({setFullAddress:u,setPhoneNumber:g,setWebsite:_});const v=(0,l.useRef)(o),x=(0,l.useCallback)((()=>{let e=null,s=null;fetch(`https://nominatim.openstreetmap.org/search?q=${d}&format=geojson`).then((e=>{if(!e.ok)throw new Error((0,t.sprintf)(/* translators: %s: Error message */ /* translators: %s: Error message */ -(0,t.__)("Network response was not ok %s","gatherpress"),e.statusText));return e.json()})).then((t=>{t.features.length>0&&(e=t.features[0].geometry.coordinates[1],s=t.features[0].geometry.coordinates[0]),v.current({latitude:e,longitude:s})}))}),[d]),f=(0,V.useDebounce)(x,300);return(0,l.useEffect)((()=>{v.current=o}),[o]),(0,l.useEffect)((()=>{f()}),[d,f]),(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(n.TextControl,{label:(0,t.__)("Full Address","gatherpress"),value:d,onChange:e=>{I({setFullAddress:e}),o({fullAddress:e})}}),(0,p.jsx)(n.TextControl,{label:(0,t.__)("Phone Number","gatherpress"),value:m,onChange:e=>{I({setPhoneNumber:e}),o({phoneNumber:e})}}),(0,p.jsx)(n.TextControl,{label:(0,t.__)("Website","gatherpress"),value:h,type:"url",onChange:e=>{I({setWebsite:e}),o({website:e})}})]})},X=()=>(0,p.jsx)("section",{children:(0,p.jsx)(U,{})});(0,r.registerPlugin)("gatherpress-venue-settings",{render:()=>"gatherpress_venue"===(0,s.select)("core/editor")?.getCurrentPostType()&&(0,p.jsx)(a.PluginDocumentSettingPanel,{name:"gatherpress-venue-settings",title:(0,t.__)("Venue settings","gatherpress"),initialOpen:!0,className:"gatherpress-venue-settings",children:(0,p.jsx)(n.__experimentalVStack,{spacing:6,children:(0,p.jsx)(X,{})})})}),(0,s.dispatch)("core/edit-post").toggleEditorPanelOpened("gatherpress-venue-settings/gatherpress-venue-settings")})(); \ No newline at end of file +(()=>{"use strict";var e={n:t=>{var s=t&&t.__esModule?()=>t.default:()=>t;return e.d(s,{a:s}),s},d:(t,s)=>{for(var n in s)e.o(s,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:s[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.i18n,s=window.wp.data,n=window.wp.components,r=window.wp.plugins,a=window.wp.editPost,i=window.moment;var o=e.n(i);const l=window.wp.element,c=window.wp.hooks;function d(){(0,s.dispatch)("core/editor")?.editPost({meta:{_non_existing_meta:!0}})}function u(e){if("object"==typeof GatherPress)return e.split(".").reduce(((e,t)=>e&&e[t]),GatherPress)}function m(e,t){if("object"!=typeof GatherPress)return;const s=e.split("."),n=s.pop();s.reduce(((e,t)=>{var s;return null!==(s=e[t])&&void 0!==s?s:e[t]={}}),GatherPress)[n]=t}const p=window.wp.date,g=window.ReactJSXRuntime,h="YYYY-MM-DD HH:mm:ss",_=o().tz(j()).add(1,"day").set("hour",18).set("minute",0).set("second",0).format(h);function v(){const e=[{label:(0,t.__)("1 hour","gatherpress"),value:1},{label:(0,t.__)("1.5 hours","gatherpress"),value:1.5},{label:(0,t.__)("2 hours","gatherpress"),value:2},{label:(0,t.__)("3 hours","gatherpress"),value:3},{label:(0,t.__)("Set an end time…","gatherpress"),value:!1}];return(0,c.applyFilters)("gatherpress.durationOptions",e)}function x(e){return o().tz(function(){let e=u("eventDetails.dateTime.datetime_start");return e=""!==e?o().tz(e,j()).format(h):_,m("eventDetails.dateTime.datetime_start",e),e}(),j()).add(e,"hours").format(h)}function f(){return P(u("settings.dateFormat"))+" "+P(u("settings.timeFormat"))}function j(e=u("eventDetails.dateTime.timezone")){return o().tz.zone(e)?e:(0,t.__)("GMT","gatherpress")}function b(e=""){const t=/^([+-])(\d{2}):(00|15|30|45)$/,s=e.replace(t,"$1");return s!==e?"UTC"+s+parseInt(e.replace(t,"$2")).toString()+e.replace(t,"$3").replace("00","").replace("15",".25").replace("30",".5").replace("45",".75"):e}function S(e,t=null,s=null){!function(e,t=null){const s=o().tz(u("eventDetails.dateTime.datetime_end"),j()).valueOf(),n=o().tz(e,j()).valueOf();n>=s&&D(o().tz(n,j()).add(2,"hours").format(h),t)}(e,s),m("eventDetails.dateTime.datetime_start",e),"function"==typeof t&&t(e),d()}function D(e,t=null,s=null){!function(e,t=null){const s=o().tz(u("eventDetails.dateTime.datetime_start"),j()).valueOf(),n=o().tz(e,j()).valueOf();n<=s&&S(o().tz(n,j()).subtract(2,"hours").format(h),t)}(e,s),m("eventDetails.dateTime.datetime_end",e),null!==t&&t(e),d()}function P(e){const t={d:"DD",D:"ddd",j:"D",l:"dddd",N:"E",S:"o",w:"e",z:"DDD",W:"W",F:"MMMM",m:"MM",M:"MMM",n:"M",t:"",L:"",o:"YYYY",Y:"YYYY",y:"YY",a:"a",A:"A",B:"",g:"h",G:"H",h:"hh",H:"HH",i:"mm",s:"ss",u:"SSS",e:"zz",I:"",O:"",P:"",T:"",Z:"",c:"",r:"",U:"X"};return String(e).split("").map(((e,s,n)=>{const r=n[s-1];return e in t&&"\\"!==r?t[e]:e})).join("")}function w(){const e=o().tz(u("eventDetails.dateTime.datetime_end"),j());return"gatherpress_event"===(0,s.select)("core/editor")?.getCurrentPostType()&&o().tz(j()).valueOf()>e.valueOf()}function T(){const e="gatherpress_event_past",n=(0,s.dispatch)("core/notices");n.removeNotice(e),w()&&n.createNotice("warning",(0,t.__)("This event has already passed.","gatherpress"),{id:e,isDismissible:!1})}o().tz(_,j()).add(2,"hours").format(h);const C=()=>{const{editPost:e,unlockPostSaving:r}=(0,s.useDispatch)("core/editor"),a=(0,s.useSelect)((e=>e("core/editor").isCleanNewPost()),[]);let i=(0,s.useSelect)((e=>e("core/editor").getEditedPostAttribute("meta").gatherpress_enable_anonymous_rsvp),[]);a&&(i=u("settings.enableAnonymousRsvp"));const[o,c]=(0,l.useState)(i),d=(0,l.useCallback)((t=>{const s={gatherpress_enable_anonymous_rsvp:Number(t)};c(t),e({meta:s}),r()}),[e,r]);return(0,l.useEffect)((()=>{a&&0!==i&&d(i)}),[a,i,d]),(0,g.jsx)(n.CheckboxControl,{label:(0,t.__)("Enable Anonymous RSVP","gatherpress"),checked:o,onChange:e=>{d(e)}})},E=()=>(0,g.jsx)("section",{children:(0,g.jsx)(C,{})}),y=()=>{const{editPost:e,unlockPostSaving:r}=(0,s.useDispatch)("core/editor"),a=(0,s.useSelect)((e=>e("core/editor").isCleanNewPost()),[]);let i=(0,s.useSelect)((e=>e("core/editor").getEditedPostAttribute("meta").gatherpress_enable_initial_decline),[]);a&&(i=u("settings.enableInitialDecline"));const[o,c]=(0,l.useState)(i),d=(0,l.useCallback)((t=>{const s={gatherpress_enable_initial_decline:Number(t)};c(t),e({meta:s}),r()}),[e,r]);return(0,l.useEffect)((()=>{a&&0!==i&&d(i)}),[a,i,d]),(0,g.jsx)(n.CheckboxControl,{label:(0,t.__)('Enable Immediate "Not Attending" Option for Attendees',"gatherpress"),checked:o,onChange:e=>{d(e)}})},k=()=>(0,g.jsx)("section",{children:(0,g.jsx)(y,{})}),z=()=>{const{dateTimeStart:e,duration:r}=(0,s.useSelect)((e=>({dateTimeStart:e("gatherpress/datetime").getDateTimeStart(),duration:e("gatherpress/datetime").getDuration()})),[]),{setDateTimeStart:a,setDateTimeEnd:i}=(0,s.useDispatch)("gatherpress/datetime"),c=(0,p.getSettings)(),d=/a(?!\\)/i.test(c.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return(0,l.useEffect)((()=>{a(o().tz(e,j()).format(h)),r&&i(x(r)),T()}),[e,r,a,i]),(0,g.jsx)(n.PanelRow,{children:(0,g.jsxs)(n.Flex,{direction:"column",gap:"1",children:[(0,g.jsx)(n.FlexItem,{children:(0,g.jsx)("h3",{style:{marginBottom:0},children:(0,g.jsx)("label",{htmlFor:"gatherpress-datetime-start",children:(0,t.__)("Date & time start","gatherpress")})})}),(0,g.jsx)(n.FlexItem,{children:(0,g.jsx)(n.Dropdown,{popoverProps:{placement:"bottom-end"},renderToggle:({isOpen:t,onToggle:s})=>(0,g.jsx)(n.Button,{id:"gatherpress-datetime-start",onClick:s,"aria-expanded":t,isLink:!0,children:o().tz(e,j()).format(f())}),renderContent:()=>(0,g.jsx)(n.DateTimePicker,{currentDate:e,onChange:e=>{S(e,a,i)},is12Hour:d})})})]})})},N=()=>{const{dateTimeEnd:e}=(0,s.useSelect)((e=>({dateTimeEnd:e("gatherpress/datetime").getDateTimeEnd()})),[]),{setDateTimeEnd:r,setDateTimeStart:a}=(0,s.useDispatch)("gatherpress/datetime"),i=(0,p.getSettings)(),c=/a(?!\\)/i.test(i.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return(0,l.useEffect)((()=>{r(o().tz(e,j()).format(h)),T()})),(0,g.jsx)(n.PanelRow,{children:(0,g.jsxs)(n.Flex,{direction:"column",gap:"1",children:[(0,g.jsx)(n.FlexItem,{children:(0,g.jsx)("h3",{style:{marginBottom:0},children:(0,g.jsx)("label",{htmlFor:"gatherpress-datetime-end",children:(0,t.__)("Date & time end","gatherpress")})})}),(0,g.jsx)(n.FlexItem,{children:(0,g.jsx)(n.Dropdown,{popoverProps:{placement:"bottom-end"},renderToggle:({isOpen:t,onToggle:s})=>(0,g.jsx)(n.Button,{id:"gatherpress-datetime-end",onClick:s,"aria-expanded":t,isLink:!0,children:o().tz(e,j()).format(f())}),renderContent:()=>(0,g.jsx)(n.DateTimePicker,{currentDate:e,onChange:e=>D(e,r,a),is12Hour:c})})})]})})},O=()=>{const{timezone:e}=(0,s.useSelect)((e=>({timezone:e("gatherpress/datetime").getTimezone()})),[]),{setTimezone:r}=(0,s.useDispatch)("gatherpress/datetime"),a=u("misc.timezoneChoices");return(0,l.useEffect)((()=>{r(u("eventDetails.dateTime.timezone"))}),[r]),(0,g.jsx)(n.PanelRow,{children:(0,g.jsx)(n.SelectControl,{label:(0,t.__)("Time Zone","gatherpress"),value:b(e),onChange:e=>{e=function(e=""){const t=/^UTC([+-])(\d+)(.\d+)?$/,s=e.replace(t,"$1");if(s!==e){const n=e.replace(t,"$2").padStart(2,"0");let r=e.replace(t,"$3");return""===r&&(r=":00"),r=r.replace(".25",":15").replace(".5",":30").replace(".75",":45"),s+n+r}return e}(e),r(e),d()},__nexthasnomarginbottom:!0,children:Object.keys(a).map((e=>(0,g.jsx)("optgroup",{label:e,children:Object.keys(a[e]).map((t=>(0,g.jsx)("option",{value:t,children:a[e][t]},t)))},e)))})})},A=()=>{const{duration:e}=(0,s.useSelect)((e=>({duration:e("gatherpress/datetime").getDuration()})),[]),r=(0,s.useDispatch)(),{setDateTimeEnd:a,setDuration:i}=r("gatherpress/datetime");return(0,g.jsx)(n.SelectControl,{label:(0,t.__)("Duration","gatherpress"),value:!!v().some((t=>t.value===e))&&e,options:v(),onChange:e=>{(e="false"!==e&&parseFloat(e))&&a(x(e)),i(e)},__nexthasnomarginbottom:!0})},F=()=>{const e=(0,s.useDispatch)("core/editor").editPost;let t=(0,s.useSelect)((e=>e("core/editor").getEditedPostAttribute("meta")?.gatherpress_datetime));try{t=t?JSON.parse(t):{}}catch(e){t={}}const{dateTimeStart:n,dateTimeEnd:r,duration:a,timezone:i}=(0,s.useSelect)((e=>({dateTimeStart:e("gatherpress/datetime").getDateTimeStart(),dateTimeEnd:e("gatherpress/datetime").getDateTimeEnd(),duration:e("gatherpress/datetime").getDuration(),timezone:e("gatherpress/datetime").getTimezone()})),[]),{setDuration:c}=(0,s.useDispatch)("gatherpress/datetime");return(0,l.useEffect)((()=>{const s=JSON.stringify({...t,dateTimeStart:o().tz(n,i).format(h),dateTimeEnd:o().tz(r,i).format(h),timezone:i});e({meta:{gatherpress_datetime:s}})}),[n,r,i,t,e,c,a]),(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("section",{children:(0,g.jsx)(z,{})}),(0,g.jsx)("section",{children:a?(0,g.jsx)(A,{}):(0,g.jsx)(N,{})}),(0,g.jsx)("section",{children:(0,g.jsx)(O,{})})]})},M=()=>(0,g.jsx)(F,{}),Y=()=>{const{editPost:e,unlockPostSaving:r}=(0,s.useDispatch)("core/editor"),a=(0,s.useSelect)((e=>e("core/editor").isCleanNewPost()),[]);let i=(0,s.useSelect)((e=>e("core/editor").getEditedPostAttribute("meta").gatherpress_max_guest_limit),[]);a&&(i=u("settings.maxGuestLimit")),!1===i&&(i=0);const[o,c]=(0,l.useState)(i),d=(0,l.useCallback)((t=>{const s={gatherpress_max_guest_limit:Number(t)};c(t),e({meta:s}),r()}),[e,r]);return(0,l.useEffect)((()=>{a&&0!==i&&d(i)}),[a,i,d]),(0,g.jsx)(n.__experimentalNumberControl,{label:(0,t.__)("Maximum Number of Guests","gatherpress"),value:o,min:0,max:5,onChange:e=>{d(e)}})},L=()=>(0,g.jsx)("section",{children:(0,g.jsx)(Y,{})}),R=()=>{const{editPost:e,unlockPostSaving:r}=(0,s.useDispatch)("core/editor"),a=(0,s.useSelect)((e=>e("core/editor").isCleanNewPost()),[]);let i=(0,s.useSelect)((e=>e("core/editor").getEditedPostAttribute("meta").gatherpress_max_attendance_limit),[]);a&&(i=u("settings.maxAttendanceLimit")),!1===i&&(i=0);const[o,c]=(0,l.useState)(i),d=(0,l.useCallback)((t=>{const s={gatherpress_max_attendance_limit:Number(t)};c(t),e({meta:s}),r()}),[e,r]);return(0,l.useEffect)((()=>{a&&0!==i&&d(i)}),[a,i,d]),(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(n.__experimentalNumberControl,{label:(0,t.__)("Maximum Attendance Limit","gatherpress"),value:o,min:0,onChange:e=>{d(e)}}),(0,g.jsx)("p",{className:"description",children:(0,t.__)("A value of 0 indicates no limit.","gatherpress")})]})},I=()=>(0,g.jsx)("section",{children:(0,g.jsx)(R,{})}),$=(e,t="")=>{for(const[s,n]of Object.entries(e)){let e=s;t&&(e+="_"+String(t));const r=new CustomEvent(e,{detail:n});dispatchEvent(r)}},G=(e,t="")=>{for(const[s,n]of Object.entries(e)){let e=s;t&&(e+="_"+String(t)),addEventListener(e,(e=>{n(e.detail)}),!1)}},H=()=>"publish"===(0,s.select)("core/editor").getEditedPostAttribute("status")&&!w()&&(0,g.jsxs)("section",{children:[(0,g.jsx)("h3",{style:{marginBottom:"0.5rem"},children:(0,t.__)("Send an event update","gatherpress")}),(0,g.jsx)(n.Button,{variant:"secondary",onClick:()=>$({setOpen:!0}),children:(0,t.__)("Compose Message","gatherpress")})]}),B=()=>{const{editPost:e,unlockPostSaving:r}=(0,s.useDispatch)("core/editor"),a=(0,s.useSelect)((e=>e("core/editor").getEditedPostAttribute("meta").gatherpress_online_event_link)),[i,o]=(0,l.useState)(a);return G({setOnlineEventLink:o},u("eventDetails.postId")),(0,g.jsx)(n.TextControl,{label:(0,t.__)("Online event link","gatherpress"),value:i,placeholder:(0,t.__)("Add link to online event","gatherpress"),onChange:t=>{(t=>{e({meta:{gatherpress_online_event_link:t}}),o(t),$({setOnlineEventLink:t},u("eventDetails.postId")),r()})(t)}})},J=()=>(0,g.jsx)("section",{children:(0,g.jsx)(B,{})}),W=()=>{const[e,r]=(0,l.useState)(""),[a,i]=(0,l.useState)(""),[o,c]=(0,l.useState)(""),[d,u]=(0,l.useState)(""),[m,p]=(0,l.useState)(!1),[h,_]=(0,l.useState)(""),[v,x]=(0,l.useState)(""),[f,j]=(0,l.useState)(""),b=(0,s.useDispatch)("core/editor").editPost,{unlockPostSaving:S}=(0,s.useDispatch)("core/editor"),D=(0,s.useSelect)((e=>e("core/editor").getEditedPostAttribute("_gatherpress_venue"))),P=(0,s.useSelect)((e=>e("core").getEntityRecord("taxonomy","_gatherpress_venue",D))),w=P?.slug.replace(/^_/,""),[T,C]=(0,l.useState)(""),E=D+":"+T,y=(0,s.useSelect)((e=>e("core").getEntityRecords("postType","gatherpress_venue",{per_page:1,slug:T})));(0,l.useEffect)((()=>{var e,s,n,a,o,l;let d={};if(T&&Array.isArray(y)){var m;const e=null!==(m=y[0]?.meta?.gatherpress_venue_information)&&void 0!==m?m:"{}";var p;e&&(d=JSON.parse(e),d.name=null!==(p=y[0]?.title.rendered)&&void 0!==p?p:"")}const g=null!==(e=d?.name)&&void 0!==e?e:(0,t.__)("No venue selected.","gatherpress"),h=null!==(s=d?.fullAddress)&&void 0!==s?s:"",v=null!==(n=d?.phoneNumber)&&void 0!==n?n:"",f=null!==(a=d?.website)&&void 0!==a?a:"",b=null!==(o=d?.latitude)&&void 0!==o?o:"0",S=null!==(l=d?.longitude)&&void 0!==l?l:"0";w&&C(w),j(E?String(E):""),r(g),i(h),c(v),u(f),_(b),x(S),$({setName:g,setFullAddress:h,setPhoneNumber:v,setWebsite:f,setLatitude:b,setLongitude:S,setIsOnlineEventTerm:"online-event"===T})}),[T,y,w,E]);let k=(0,s.useSelect)((e=>e("core").getEntityRecords("taxonomy","_gatherpress_venue",{per_page:-1,context:"view"})),[]);return k?(k=k.map((e=>({label:e.name,value:e.id+":"+e.slug.replace(/^_/,"")}))),k.unshift({value:":",label:(0,t.__)("Choose a venue","gatherpress")})):k=[],(0,g.jsx)(n.PanelRow,{children:(0,g.jsx)(n.SelectControl,{label:(0,t.__)("Venue Selector","gatherpress"),value:f,onChange:e=>{(e=>{j(e);const t=""!==(e=e.split(":"))[0]?[e[0]]:[];b({_gatherpress_venue:t}),C(e[1]),S()})(e)},options:k})})},V=()=>(0,g.jsx)("section",{children:(0,g.jsx)(W,{})});(0,r.registerPlugin)("gatherpress-event-settings",{render:()=>"gatherpress_event"===(0,s.select)("core/editor")?.getCurrentPostType()&&(0,g.jsx)(a.PluginDocumentSettingPanel,{name:"gatherpress-event-settings",title:(0,t.__)("Event settings","gatherpress"),initialOpen:!0,className:"gatherpress-event-settings",children:(0,g.jsxs)(n.__experimentalVStack,{spacing:4,children:[(0,g.jsx)(M,{}),(0,g.jsx)(V,{}),(0,g.jsx)(J,{}),(0,g.jsx)(L,{}),(0,g.jsx)(I,{}),(0,g.jsx)(E,{}),(0,g.jsx)(k,{}),(0,g.jsx)(H,{})]})})}),(0,s.dispatch)("core/edit-post").toggleEditorPanelOpened("gatherpress-event-settings/gatherpress-event-settings");const U=window.wp.compose,X=()=>{var e,r,a;const i=(0,s.useDispatch)("core/editor").editPost,o=e=>{const t=JSON.stringify({...c,...e});i({meta:{gatherpress_venue_information:t}})};let c=(0,s.useSelect)((e=>e("core/editor").getEditedPostAttribute("meta").gatherpress_venue_information));c=c?JSON.parse(c):{};const[d,u]=(0,l.useState)(null!==(e=c.fullAddress)&&void 0!==e?e:""),[m,p]=(0,l.useState)(null!==(r=c.phoneNumber)&&void 0!==r?r:""),[h,_]=(0,l.useState)(null!==(a=c.website)&&void 0!==a?a:"");G({setFullAddress:u,setPhoneNumber:p,setWebsite:_});const v=(0,l.useRef)(o),x=(0,l.useCallback)((()=>{let e=null,s=null;fetch(`https://nominatim.openstreetmap.org/search?q=${d}&format=geojson`).then((e=>{if(!e.ok)throw new Error((0,t.sprintf)(/* translators: %s: Error message */ /* translators: %s: Error message */ +(0,t.__)("Network response was not ok %s","gatherpress"),e.statusText));return e.json()})).then((t=>{t.features.length>0&&(e=t.features[0].geometry.coordinates[1],s=t.features[0].geometry.coordinates[0]),v.current({latitude:e,longitude:s})}))}),[d]),f=(0,U.useDebounce)(x,300);return(0,l.useEffect)((()=>{v.current=o}),[o]),(0,l.useEffect)((()=>{f()}),[d,f]),(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(n.TextControl,{label:(0,t.__)("Full Address","gatherpress"),value:d,onChange:e=>{$({setFullAddress:e}),o({fullAddress:e})}}),(0,g.jsx)(n.TextControl,{label:(0,t.__)("Phone Number","gatherpress"),value:m,onChange:e=>{$({setPhoneNumber:e}),o({phoneNumber:e})}}),(0,g.jsx)(n.TextControl,{label:(0,t.__)("Website","gatherpress"),value:h,type:"url",onChange:e=>{$({setWebsite:e}),o({website:e})}})]})},Z=()=>(0,g.jsx)("section",{children:(0,g.jsx)(X,{})});(0,r.registerPlugin)("gatherpress-venue-settings",{render:()=>"gatherpress_venue"===(0,s.select)("core/editor")?.getCurrentPostType()&&(0,g.jsx)(a.PluginDocumentSettingPanel,{name:"gatherpress-venue-settings",title:(0,t.__)("Venue settings","gatherpress"),initialOpen:!0,className:"gatherpress-venue-settings",children:(0,g.jsx)(n.__experimentalVStack,{spacing:6,children:(0,g.jsx)(Z,{})})})}),(0,s.dispatch)("core/edit-post").toggleEditorPanelOpened("gatherpress-venue-settings/gatherpress-venue-settings")})(); \ No newline at end of file diff --git a/build/profile.asset.php b/build/profile.asset.php index 36a8cd159..40545182a 100644 --- a/build/profile.asset.php +++ b/build/profile.asset.php @@ -1 +1 @@ - array('moment', 'react-jsx-runtime', 'wp-data', 'wp-date', 'wp-element', 'wp-i18n'), 'version' => 'ce11c202561cd38c9284'); + array('moment', 'react-jsx-runtime', 'wp-data', 'wp-date', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => '315af37ba53ac822bbb8'); diff --git a/build/profile.js b/build/profile.js index fb8bdc1a7..c53afbd17 100644 --- a/build/profile.js +++ b/build/profile.js @@ -1 +1 @@ -(()=>{"use strict";var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.moment;var r=e.n(t);const n=window.wp.i18n,a=window.wp.element;window.wp.data;const o=window.wp.date,s=window.ReactJSXRuntime,d=e=>{const{name:t,value:r}=e.attrs,[n,d]=(0,a.useState)(r);return document.querySelector(`[name="${t}"]`).addEventListener("input",(e=>{d(e.target.value)}),{once:!0}),(0,s.jsx)(s.Fragment,{children:n&&(0,o.format)(n)})},u="YYYY-MM-DD HH:mm:ss",c=r().tz(i()).add(1,"day").set("hour",18).set("minute",0).set("second",0).format(u);function i(e=function(){if("object"==typeof GatherPress)return"eventDetails.dateTime.timezone".split(".").reduce(((e,t)=>e&&e[t]),GatherPress)}()){return r().tz.zone(e)?e:(0,n.__)("GMT","gatherpress")}r().tz(c,i()).add(2,"hours").format(u),(0,n.__)("1 hour","gatherpress"),(0,n.__)("1.5 hours","gatherpress"),(0,n.__)("2 hours","gatherpress"),(0,n.__)("3 hours","gatherpress"),(0,n.__)("Set an end time…","gatherpress"),function(){const e=document.querySelectorAll('[data-gatherpress_component_name="datetime-preview"]');for(let t=0;t{"use strict";var e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.moment;var n=e.n(t);const r=window.wp.i18n,o=window.wp.element;window.wp.hooks,window.wp.data;const a=window.wp.date,s=window.ReactJSXRuntime,d=e=>{const{name:t,value:n}=e.attrs,[r,d]=(0,o.useState)(n);return document.querySelector(`[name="${t}"]`).addEventListener("input",(e=>{d(e.target.value)}),{once:!0}),(0,s.jsx)(s.Fragment,{children:r&&(0,a.format)(r)})},c="YYYY-MM-DD HH:mm:ss",i=n().tz(u()).add(1,"day").set("hour",18).set("minute",0).set("second",0).format(c);function u(e=function(){if("object"==typeof GatherPress)return"eventDetails.dateTime.timezone".split(".").reduce(((e,t)=>e&&e[t]),GatherPress)}()){return n().tz.zone(e)?e:(0,r.__)("GMT","gatherpress")}n().tz(i,u()).add(2,"hours").format(c),function(){const e=document.querySelectorAll('[data-gatherpress_component_name="datetime-preview"]');for(let t=0;t array('lodash', 'moment', 'react-jsx-runtime', 'wp-components', 'wp-core-data', 'wp-data', 'wp-date', 'wp-element', 'wp-i18n'), 'version' => 'ef523de62b19725db635'); + array('lodash', 'moment', 'react-jsx-runtime', 'wp-components', 'wp-core-data', 'wp-data', 'wp-date', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => 'e2ebd95c8f4f0f51c8a7'); diff --git a/build/settings.js b/build/settings.js index 2f7b3fa1a..a86ba34e1 100644 --- a/build/settings.js +++ b/build/settings.js @@ -1 +1 @@ -(()=>{"use strict";var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.element,r=window.lodash,n=window.wp.components,s=window.wp.i18n,o=window.wp.coreData,a=window.wp.data,i=window.ReactJSXRuntime,l=e=>{var l,d;const{name:u,option:c,value:p,fieldOptions:m}=e.attrs,g=1!==m.limit,[h,_]=(0,t.useState)(null!==(l=JSON.parse(p))&&void 0!==l?l:"[]"),{contentList:w}=(0,a.useSelect)((e=>{const{getEntityRecords:t}=e(o.store);return{contentList:t("user"!==m.type?"postType":"root",m.type||"post",{per_page:-1,context:"view"})}}),[m.type]),v=null!==(d=w?.reduce(((e,t)=>({...e,[t.title?.rendered||t.name]:t})),{}))&&void 0!==d?d:{};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.FormTokenField,{label:m.label||(0,s.__)("Select Posts","gatherpress"),name:u,value:h&&h.map((e=>({id:e.id,slug:e.slug,value:e.title?.rendered||e.name||e.value}))),suggestions:Object.keys(v),onChange:e=>{if(e.some((e=>"string"==typeof e&&!v[e])))return;const t=e.map((e=>"string"==typeof e?v[e]:e));if((0,r.includes)(t,null))return!1;_(t)},maxSuggestions:m.max_suggestions||20,maxLength:m.limit||0,__experimentalShowHowTo:g},c),!1===g&&(0,i.jsx)("p",{className:"description",children:(0,s.__)("Choose only one item.","gatherpress")}),(0,i.jsx)("input",{type:"hidden",id:c,name:u,value:h&&JSON.stringify(h.map((e=>({id:e.id,slug:e.slug,value:e.title?.rendered||e.name||e.value}))))})]})},d=window.moment;var u=e.n(d);function c(e){if("object"==typeof GatherPress)return e.split(".").reduce(((e,t)=>e&&e[t]),GatherPress)}const p=window.wp.date,m=e=>{const{name:r,value:n}=e.attrs,[s,o]=(0,t.useState)(n);return document.querySelector(`[name="${r}"]`).addEventListener("input",(e=>{o(e.target.value)}),{once:!0}),(0,i.jsx)(i.Fragment,{children:s&&(0,p.format)(s)})},g="YYYY-MM-DD HH:mm:ss",h=u().tz(_()).add(1,"day").set("hour",18).set("minute",0).set("second",0).format(g);function _(e=c("eventDetails.dateTime.timezone")){return u().tz.zone(e)?e:(0,s.__)("GMT","gatherpress")}u().tz(h,_()).add(2,"hours").format(g),(0,s.__)("1 hour","gatherpress"),(0,s.__)("1.5 hours","gatherpress"),(0,s.__)("2 hours","gatherpress"),(0,s.__)("3 hours","gatherpress"),(0,s.__)("Set an end time…","gatherpress");const w=e=>{const{name:r,value:n,suffix:s}=e.attrs,[o,a]=(0,t.useState)(n),l=document.querySelector(`[name="${r}"]`),d=c("urls.homeUrl");return l.addEventListener("input",(e=>{a(e.target.value)}),{once:!0}),(0,i.jsxs)(i.Fragment,{children:[d+"/",(0,i.jsx)("strong",{children:o}),"/"+s]})},v=document.querySelectorAll('[data-gatherpress_component_name="autocomplete"]');for(let e=0;e{"use strict";var e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.element,n=window.lodash,r=window.wp.components,o=window.wp.i18n,s=window.wp.coreData,a=window.wp.data,i=window.ReactJSXRuntime,l=e=>{var l,d;const{name:u,option:c,value:p,fieldOptions:m}=e.attrs,g=1!==m.limit,[w,h]=(0,t.useState)(null!==(l=JSON.parse(p))&&void 0!==l?l:"[]"),{contentList:v}=(0,a.useSelect)((e=>{const{getEntityRecords:t}=e(s.store);return{contentList:t("user"!==m.type?"postType":"root",m.type||"post",{per_page:-1,context:"view"})}}),[m.type]),_=null!==(d=v?.reduce(((e,t)=>({...e,[t.title?.rendered||t.name]:t})),{}))&&void 0!==d?d:{};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.FormTokenField,{label:m.label||(0,o.__)("Select Posts","gatherpress"),name:u,value:w&&w.map((e=>({id:e.id,slug:e.slug,value:e.title?.rendered||e.name||e.value}))),suggestions:Object.keys(_),onChange:e=>{if(e.some((e=>"string"==typeof e&&!_[e])))return;const t=e.map((e=>"string"==typeof e?_[e]:e));if((0,n.includes)(t,null))return!1;h(t)},maxSuggestions:m.max_suggestions||20,maxLength:m.limit||0,__experimentalShowHowTo:g},c),!1===g&&(0,i.jsx)("p",{className:"description",children:(0,o.__)("Choose only one item.","gatherpress")}),(0,i.jsx)("input",{type:"hidden",id:c,name:u,value:w&&JSON.stringify(w.map((e=>({id:e.id,slug:e.slug,value:e.title?.rendered||e.name||e.value}))))})]})},d=window.moment;var u=e.n(d);function c(e){if("object"==typeof GatherPress)return e.split(".").reduce(((e,t)=>e&&e[t]),GatherPress)}window.wp.hooks;const p=window.wp.date,m=e=>{const{name:n,value:r}=e.attrs,[o,s]=(0,t.useState)(r);return document.querySelector(`[name="${n}"]`).addEventListener("input",(e=>{s(e.target.value)}),{once:!0}),(0,i.jsx)(i.Fragment,{children:o&&(0,p.format)(o)})},g="YYYY-MM-DD HH:mm:ss",w=u().tz(h()).add(1,"day").set("hour",18).set("minute",0).set("second",0).format(g);function h(e=c("eventDetails.dateTime.timezone")){return u().tz.zone(e)?e:(0,o.__)("GMT","gatherpress")}u().tz(w,h()).add(2,"hours").format(g);const v=e=>{const{name:n,value:r,suffix:o}=e.attrs,[s,a]=(0,t.useState)(r),l=document.querySelector(`[name="${n}"]`),d=c("urls.homeUrl");return l.addEventListener("input",(e=>{a(e.target.value)}),{once:!0}),(0,i.jsxs)(i.Fragment,{children:[d+"/",(0,i.jsx)("strong",{children:s}),"/"+o]})},_=document.querySelectorAll('[data-gatherpress_component_name="autocomplete"]');for(let e=0;e<_.length;e++){const n=JSON.parse(_[e].dataset.gatherpress_component_attrs);(0,t.createRoot)(_[e]).render((0,i.jsx)(l,{attrs:n}))}!function(){const e=document.querySelectorAll('[data-gatherpress_component_name="datetime-preview"]');for(let n=0;n { option.value === duration) + durationOptions().some((option) => option.value === duration) ? duration : false } - options={durationOptions} + options={durationOptions()} onChange={(value) => { value = 'false' === value ? false : parseFloat(value); diff --git a/src/helpers/datetime.js b/src/helpers/datetime.js index 73d4a8476..a02370218 100644 --- a/src/helpers/datetime.js +++ b/src/helpers/datetime.js @@ -8,6 +8,7 @@ import moment from 'moment'; */ import { __ } from '@wordpress/i18n'; import { createRoot } from '@wordpress/element'; +import { applyFilters } from '@wordpress/hooks'; /** * Internal dependencies. @@ -66,32 +67,36 @@ export const defaultDateTimeEnd = moment * * @since 1.0.0 * - * @type {Array} durationOptions * @property {string} label - The human-readable label for the duration option. * @property {number|boolean} value - The value representing the duration in hours, or `false` if a custom end time is to be set. */ -export const durationOptions = [ - { - label: __('1 hour', 'gatherpress'), - value: 1, - }, - { - label: __('1.5 hours', 'gatherpress'), - value: 1.5, - }, - { - label: __('2 hours', 'gatherpress'), - value: 2, - }, - { - label: __('3 hours', 'gatherpress'), - value: 3, - }, - { - label: __('Set an end time…', 'gatherpress'), - value: false, - }, -]; + +export function durationOptions() { + const options = [ + { + label: __('1 hour', 'gatherpress'), + value: 1, + }, + { + label: __('1.5 hours', 'gatherpress'), + value: 1.5, + }, + { + label: __('2 hours', 'gatherpress'), + value: 2, + }, + { + label: __('3 hours', 'gatherpress'), + value: 3, + }, + { + label: __('Set an end time…', 'gatherpress'), + value: false, + }, + ] + + return applyFilters('gatherpress.durationOptions', options); +} /** * Calculates an offset in hours from the start date and time of an event. @@ -126,7 +131,7 @@ export function dateTimeOffset(hours) { */ export function getDateTimeOffset() { return ( - durationOptions.find( + durationOptions().find( (option) => dateTimeOffset(option.value) === getDateTimeEnd() )?.value || false ); diff --git a/src/stores/datetime.js b/src/stores/datetime.js index 706792455..d324aa4bc 100644 --- a/src/stores/datetime.js +++ b/src/stores/datetime.js @@ -20,7 +20,7 @@ const DEFAULT_STATE = { dateTimeEnd: getFromGlobal('eventDetails.dateTime.datetime_end') ? getFromGlobal('eventDetails.dateTime.datetime_end') : defaultDateTimeEnd, - duration: getDateTimeOffset(), + duration: null, timezone: getFromGlobal('eventDetails.dateTime.timezone'), }; @@ -78,7 +78,7 @@ const store = createReduxStore('gatherpress/datetime', { selectors: { getDateTimeStart: (state) => state.dateTimeStart, getDateTimeEnd: (state) => state.dateTimeEnd, - getDuration: (state) => state.duration, + getDuration: (state) => false === state.duration ? false : getDateTimeOffset(), getTimezone: (state) => state.timezone, }, });