diff --git a/build/blocks/event-date/index.asset.php b/build/blocks/event-date/index.asset.php index 70c8292f4..9ee1ea272 100644 --- a/build/blocks/event-date/index.asset.php +++ b/build/blocks/event-date/index.asset.php @@ -1 +1 @@ - array('moment', 'react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-date', 'wp-element', 'wp-i18n'), 'version' => '06cbe5a0c90c103f8a14'); + array('moment', 'react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-date', 'wp-element', 'wp-i18n'), 'version' => '5b3f6595bd8408889334'); diff --git a/build/blocks/event-date/index.js b/build/blocks/event-date/index.js index ac6215110..8b723aa1e 100644 --- a/build/blocks/event-date/index.js +++ b/build/blocks/event-date/index.js @@ -1,2 +1,2 @@ -(()=>{"use strict";var e,t={8617:(e,t,n)=>{const r=window.wp.blocks,a=window.React,i=window.moment;var s=n.n(i);const o=window.wp.i18n,l=window.wp.blockEditor,c=window.wp.components,m=window.wp.element,d=(e,t="")=>{for(const[n,r]of Object.entries(e)){let e=n;t&&(e+="_"+String(t));const a=new CustomEvent(e,{detail:r});dispatchEvent(a)}},p=window.wp.data,u=window.wp.apiFetch;var f=n.n(u);function v(){(0,p.dispatch)("core/editor")?.editPost({meta:{_non_existing_meta:!0}})}function g(e){if("object"==typeof GatherPress)return e.split(".").reduce(((e,t)=>e&&e[t]),GatherPress)}function T(e,t){if("object"!=typeof GatherPress)return;const n=e.split("."),r=n.pop();n.reduce(((e,t)=>{var n;return null!==(n=e[t])&&void 0!==n?n:e[t]={}}),GatherPress)[r]=t}function E(){const e=s().tz(g("eventDetails.dateTime.datetime_end"),S());return"gp_event"===(0,p.select)("core/editor")?.getCurrentPostType()&&s().tz(S()).valueOf()>e.valueOf()}function h(){const e="gp_event_past",t=(0,p.dispatch)("core/notices");t.removeNotice(e),E()&&t.createNotice("warning",(0,o.__)("This event has already past.","gatherpress"),{id:e,isDismissible:!1})}const D="YYYY-MM-DDTHH:mm:ss",_="YYYY-MM-DD HH:mm:ss",w=s().tz(S()).add(1,"day").set("hour",18).set("minute",0).set("second",0).format(D),z=s().tz(w,S()).add(2,"hours").format(D);function b(){return C(g("settings.dateFormat"))+" "+C(g("settings.timeFormat"))}function S(e=g("eventDetails.dateTime.timezone")){return s().tz.zone(e)?e:(0,o.__)("GMT","gatherpress")}function y(e=""){const t=/^([+-])(\d{2}):(00|15|30|45)$/,n=e.replace(t,"$1");return n!==e?"UTC"+n+parseInt(e.replace(t,"$2")).toString()+e.replace(t,"$3").replace("00","").replace("15",".25").replace("30",".5").replace("45",".75"):e}function O(e,t=null){!function(e){const t=s().tz(g("eventDetails.dateTime.datetime_end"),S()).valueOf(),n=s().tz(e,S()).valueOf();n>=t&&k(s().tz(n,S()).add(2,"hours").format(D))}(e),T("eventDetails.dateTime.datetime_start",e),"function"==typeof t&&t(e),v()}function k(e,t=null){!function(e){const t=s().tz(g("eventDetails.dateTime.datetime_start"),S()).valueOf(),n=s().tz(e,S()).valueOf();n<=t&&O(s().tz(n,S()).subtract(2,"hours").format(D))}(e),T("eventDetails.dateTime.datetime_end",e),null!==t&&t(e),v()}function P(){const e=(0,p.select)("core/editor").isSavingPost(),t=(0,p.select)("core/editor").isAutosavingPost();"gp_event"===(0,p.select)("core/editor").getCurrentPostType()&&e&&!t&&f()({path:g("urls.eventRestApi")+"/datetime",method:"POST",data:{post_id:g("eventDetails.postId"),datetime_start:s().tz(g("eventDetails.dateTime.datetime_start"),S()).format(_),datetime_end:s().tz(g("eventDetails.dateTime.datetime_end"),S()).format(_),timezone:g("eventDetails.dateTime.timezone"),_wpnonce:g("misc.nonce")}}).then((()=>{!function(){const e="gp_event_communcation",t=(0,p.dispatch)("core/notices");t.removeNotice(e),"publish"!==(0,p.select)("core/editor").getEditedPostAttribute("status")||E()||t.createNotice("success",(0,o.__)("Send an event update to members via email?","gatherpress"),{id:e,isDismissible:!0,actions:[{onClick:()=>{d({setOpen:!0})},label:(0,o.__)("Compose Message","gatherpress")}]})}()}))}function C(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=>e in t?t[e]:e)).join("")}const x=e=>{const{isSelected:t}=e,n=t?"none":"block";return(0,a.createElement)("div",{style:{position:"relative"}},e.children,(0,a.createElement)("div",{style:{position:"absolute",top:"0",right:"0",bottom:"0",left:"0",display:n}}))},M=window.wp.date,Y=e=>{const{dateTimeStart:t}=e;return s().tz(t,S()).format(b())},F=e=>{const{dateTimeEnd:t}=e;return s().tz(t,S()).format(b())},j=e=>{const{dateTimeStart:t,setDateTimeStart:n}=e,r=(0,M.getSettings)(),i=/a(?!\\)/i.test(r.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return(0,a.createElement)(c.DateTimePicker,{currentDate:t,onChange:e=>O(e,n),is12Hour:i})},$=e=>{const{dateTimeEnd:t,setDateTimeEnd:n}=e,r=(0,M.getSettings)(),i=/a(?!\\)/i.test(r.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return(0,a.createElement)(c.DateTimePicker,{currentDate:t,onChange:e=>k(e,n),is12Hour:i})},I=e=>{const{dateTimeStart:t,setDateTimeStart:n}=e;return(0,m.useEffect)((()=>{n(s().tz(function(){let e=g("eventDetails.dateTime.datetime_start");return e=""!==e?s().tz(e,S()).format(D):w,T("eventDetails.dateTime.datetime_start",e),e}(),S()).format(D)),d({setDateTimeStart:t}),h()})),(0,a.createElement)(c.PanelRow,null,(0,a.createElement)(c.Flex,{direction:"column",gap:"0"},(0,a.createElement)(c.FlexItem,null,(0,a.createElement)("label",{htmlFor:"gp-datetime-start"},(0,o.__)("Start","gatherpress"))),(0,a.createElement)(c.FlexItem,null,(0,a.createElement)(c.Dropdown,{popoverProps:{placement:"bottom-end"},renderToggle:({isOpen:e,onToggle:n})=>(0,a.createElement)(c.Button,{id:"gp-datetime-start",onClick:n,"aria-expanded":e,isLink:!0},(0,a.createElement)(Y,{dateTimeStart:t})),renderContent:()=>(0,a.createElement)(j,{dateTimeStart:t,setDateTimeStart:n})}))))},H=e=>{const{dateTimeEnd:t,setDateTimeEnd:n}=e;return(0,m.useEffect)((()=>{n(s().tz(function(){let e=g("eventDetails.dateTime.datetime_end");return e=""!==e?s().tz(e,S()).format(D):z,T("eventDetails.dateTime.datetime_end",e),e}(),S()).format(D)),d({setDateTimeEnd:t}),h()})),(0,a.createElement)(c.PanelRow,null,(0,a.createElement)(c.Flex,{direction:"column",gap:"0"},(0,a.createElement)(c.FlexItem,null,(0,a.createElement)("label",{htmlFor:"gp-datetime-end"},(0,o.__)("End","gatherpress"))),(0,a.createElement)(c.FlexItem,null,(0,a.createElement)(c.Dropdown,{popoverProps:{placement:"bottom-end"},renderToggle:({isOpen:e,onToggle:n})=>(0,a.createElement)(c.Button,{id:"gp-datetime-end",onClick:n,"aria-expanded":e,isLink:!0},(0,a.createElement)(F,{dateTimeEnd:t})),renderContent:()=>(0,a.createElement)($,{dateTimeEnd:t,setDateTimeEnd:n})}))))},G=e=>{const{timezone:t,setTimezone:n}=e,r=g("misc.timezoneChoices");return(0,m.useEffect)((()=>{n(g("eventDetails.dateTime.timezone"))}),[n]),(0,m.useEffect)((()=>{d({setTimezone:g("eventDetails.dateTime.timezone")})})),(0,a.createElement)(c.PanelRow,null,(0,a.createElement)(c.SelectControl,{label:(0,o.__)("Time Zone","gatherpress"),value:y(t),onChange:e=>{e=function(e=""){const t=/^UTC([+-])(\d+)(.\d+)?$/,n=e.replace(t,"$1");if(n!==e){const r=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"),n+r+a}return e}(e),n(e),T("eventDetails.dateTime.timezone",e),v()}},Object.keys(r).map((e=>(0,a.createElement)("optgroup",{key:e,label:e},Object.keys(r[e]).map((t=>(0,a.createElement)("option",{key:t,value:t},r[e][t]))))))))},N=()=>{const[e,t]=(0,m.useState)(),[n,r]=(0,m.useState)(),[i,s]=(0,m.useState)();return(0,p.subscribe)(P),(0,a.createElement)(a.Fragment,null,(0,a.createElement)("h3",null,(0,o.__)("Date & time","gatherpress")),(0,a.createElement)(I,{dateTimeStart:e,setDateTimeStart:t}),(0,a.createElement)(H,{dateTimeEnd:n,setDateTimeEnd:r}),(0,a.createElement)(G,{timezone:i,setTimezone:s}))},B=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"gatherpress/event-date","version":"1.0.0","title":"Event Date","category":"gatherpress","icon":"clock","example":{},"description":"Displays the date and time for an event.","attributes":{"eventEnd":{"type":"string"},"eventStart":{"type":"string"}},"supports":{"html":false},"textdomain":"gatherpress","editorScript":"file:./index.js","style":"file:./style-index.css","render":"file:./render.php"}');(0,r.registerBlockType)(B,{edit:()=>{const e=(0,l.useBlockProps)(),[t,n]=(0,m.useState)(w),[r,i]=(0,m.useState)(z),[d,u]=(0,m.useState)(S());return((e,t="")=>{for(const[n,r]of Object.entries(e)){let e=n;t&&(e+="_"+String(t)),addEventListener(e,(e=>{r(e.detail)}),!1)}})({setDateTimeEnd:i,setDateTimeStart:n,setTimezone:u}),(0,a.createElement)("div",{...e},(0,a.createElement)(x,null,(0,a.createElement)(c.Flex,{justify:"normal",align:"center",gap:"4"},(0,a.createElement)(c.FlexItem,{display:"flex",className:"gp-event-date__icon"},(0,a.createElement)(c.Icon,{icon:"clock"})),(0,a.createElement)(c.FlexItem,null,((e,t,n)=>{const r=C(g("settings.dateFormat")),a=C(g("settings.timeFormat")),i=g("settings.showTimezone")?"z":"",l=r+" "+a,c=S(n);let m=r+" "+a+" "+i;return s().tz(e,c).format(r)===s().tz(t,c).format(r)&&(m=a+" "+i),(0,o.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,o.__)("%1$s to %2$s %3$s"),s().tz(e,c).format(l),s().tz(t,c).format(m),(d=S(d=c),(0,o.__)("GMT","gatherpress")!==d?"":function(e=""){return e.replace(":","")}(g("eventDetails.dateTime.timezone"))));var d})(t,r,d)),"string"==typeof(0,p.select)("core/editor")?.getCurrentPostType()&&(0,a.createElement)(l.InspectorControls,null,(0,a.createElement)(c.PanelBody,null,(0,a.createElement)(N,null))))))},save:()=>null})}},n={};function r(e){var a=n[e];if(void 0!==a)return a.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,r),i.exports}r.m=t,e=[],r.O=(t,n,a,i)=>{if(!n){var s=1/0;for(m=0;m=i)&&Object.keys(r.O).every((e=>r.O[e](n[l])))?n.splice(l--,1):(o=!1,i0&&e[m-1][2]>i;m--)e[m]=e[m-1];e[m]=[n,a,i]},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={532:0,4:0};r.O.j=t=>0===e[t];var t=(t,n)=>{var a,i,[s,o,l]=n,c=0;if(s.some((t=>0!==e[t]))){for(a in o)r.o(o,a)&&(r.m[a]=o[a]);if(l)var m=l(r)}for(t&&t(n);cr(8617)));a=r.O(a)})(); \ No newline at end of file +(()=>{"use strict";var e,t={9554:(e,t,n)=>{const r=window.wp.blocks,a=window.React,i=window.moment;var s=n.n(i);const o=window.wp.i18n,l=window.wp.blockEditor,c=window.wp.components,m=window.wp.element,d=(e,t="")=>{for(const[n,r]of Object.entries(e)){let e=n;t&&(e+="_"+String(t));const a=new CustomEvent(e,{detail:r});dispatchEvent(a)}},p=window.wp.data,u=window.wp.apiFetch;var f=n.n(u);function v(){(0,p.dispatch)("core/editor")?.editPost({meta:{_non_existing_meta:!0}})}function g(e){if("object"==typeof GatherPress)return e.split(".").reduce(((e,t)=>e&&e[t]),GatherPress)}function T(e,t){if("object"!=typeof GatherPress)return;const n=e.split("."),r=n.pop();n.reduce(((e,t)=>{var n;return null!==(n=e[t])&&void 0!==n?n:e[t]={}}),GatherPress)[r]=t}function E(){const e=s().tz(g("eventDetails.dateTime.datetime_end"),y());return"gp_event"===(0,p.select)("core/editor")?.getCurrentPostType()&&s().tz(y()).valueOf()>e.valueOf()}function h(){const e="gp_event_past",t=(0,p.dispatch)("core/notices");t.removeNotice(e),E()&&t.createNotice("warning",(0,o.__)("This event has already past.","gatherpress"),{id:e,isDismissible:!1})}const D=window.wp.date,_="YYYY-MM-DDTHH:mm:ss",w="YYYY-MM-DD HH:mm:ss",z=s().tz(y()).add(1,"day").set("hour",18).set("minute",0).set("second",0).format(_),b=s().tz(z,y()).add(2,"hours").format(_);function S(){return x(g("settings.dateFormat"))+" "+x(g("settings.timeFormat"))}function y(e=g("eventDetails.dateTime.timezone")){return s().tz.zone(e)?e:(0,o.__)("GMT","gatherpress")}function O(e=""){const t=/^([+-])(\d{2}):(00|15|30|45)$/,n=e.replace(t,"$1");return n!==e?"UTC"+n+parseInt(e.replace(t,"$2")).toString()+e.replace(t,"$3").replace("00","").replace("15",".25").replace("30",".5").replace("45",".75"):e}function k(e,t=null){!function(e){const t=s().tz(g("eventDetails.dateTime.datetime_end"),y()).valueOf(),n=s().tz(e,y()).valueOf();n>=t&&P(s().tz(n,y()).add(2,"hours").format(_))}(e),T("eventDetails.dateTime.datetime_start",e),"function"==typeof t&&t(e),v()}function P(e,t=null){!function(e){const t=s().tz(g("eventDetails.dateTime.datetime_start"),y()).valueOf(),n=s().tz(e,y()).valueOf();n<=t&&k(s().tz(n,y()).subtract(2,"hours").format(_))}(e),T("eventDetails.dateTime.datetime_end",e),null!==t&&t(e),v()}function C(){const e=(0,p.select)("core/editor").isSavingPost(),t=(0,p.select)("core/editor").isAutosavingPost();"gp_event"===(0,p.select)("core/editor").getCurrentPostType()&&e&&!t&&f()({path:g("urls.eventRestApi")+"/datetime",method:"POST",data:{post_id:g("eventDetails.postId"),datetime_start:s().tz(g("eventDetails.dateTime.datetime_start"),y()).format(w),datetime_end:s().tz(g("eventDetails.dateTime.datetime_end"),y()).format(w),timezone:g("eventDetails.dateTime.timezone"),_wpnonce:g("misc.nonce")}}).then((()=>{!function(){const e="gp_event_communcation",t=(0,p.dispatch)("core/notices");t.removeNotice(e),"publish"!==(0,p.select)("core/editor").getEditedPostAttribute("status")||E()||t.createNotice("success",(0,o.__)("Send an event update to members via email?","gatherpress"),{id:e,isDismissible:!0,actions:[{onClick:()=>{d({setOpen:!0})},label:(0,o.__)("Compose Message","gatherpress")}]})}()}))}function x(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=>e in t?t[e]:e)).join("")}const M=e=>{const{isSelected:t}=e,n=t?"none":"block";return(0,a.createElement)("div",{style:{position:"relative"}},e.children,(0,a.createElement)("div",{style:{position:"absolute",top:"0",right:"0",bottom:"0",left:"0",display:n}}))},Y=e=>{const{dateTimeStart:t}=e;return s().tz(t,y()).format(S())},F=e=>{const{dateTimeEnd:t}=e;return s().tz(t,y()).format(S())},j=e=>{const{dateTimeStart:t,setDateTimeStart:n}=e,r=(0,D.getSettings)(),i=/a(?!\\)/i.test(r.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return(0,a.createElement)(c.DateTimePicker,{currentDate:t,onChange:e=>k(e,n),is12Hour:i})},$=e=>{const{dateTimeEnd:t,setDateTimeEnd:n}=e,r=(0,D.getSettings)(),i=/a(?!\\)/i.test(r.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return(0,a.createElement)(c.DateTimePicker,{currentDate:t,onChange:e=>P(e,n),is12Hour:i})},I=e=>{const{dateTimeStart:t,setDateTimeStart:n}=e;return(0,m.useEffect)((()=>{n(s().tz(function(){let e=g("eventDetails.dateTime.datetime_start");return e=""!==e?s().tz(e,y()).format(_):z,T("eventDetails.dateTime.datetime_start",e),e}(),y()).format(_)),d({setDateTimeStart:t}),h()})),(0,a.createElement)(c.PanelRow,null,(0,a.createElement)(c.Flex,{direction:"column",gap:"0"},(0,a.createElement)(c.FlexItem,null,(0,a.createElement)("label",{htmlFor:"gp-datetime-start"},(0,o.__)("Start","gatherpress"))),(0,a.createElement)(c.FlexItem,null,(0,a.createElement)(c.Dropdown,{popoverProps:{placement:"bottom-end"},renderToggle:({isOpen:e,onToggle:n})=>(0,a.createElement)(c.Button,{id:"gp-datetime-start",onClick:n,"aria-expanded":e,isLink:!0},(0,a.createElement)(Y,{dateTimeStart:t})),renderContent:()=>(0,a.createElement)(j,{dateTimeStart:t,setDateTimeStart:n})}))))},H=e=>{const{dateTimeEnd:t,setDateTimeEnd:n}=e;return(0,m.useEffect)((()=>{n(s().tz(function(){let e=g("eventDetails.dateTime.datetime_end");return e=""!==e?s().tz(e,y()).format(_):b,T("eventDetails.dateTime.datetime_end",e),e}(),y()).format(_)),d({setDateTimeEnd:t}),h()})),(0,a.createElement)(c.PanelRow,null,(0,a.createElement)(c.Flex,{direction:"column",gap:"0"},(0,a.createElement)(c.FlexItem,null,(0,a.createElement)("label",{htmlFor:"gp-datetime-end"},(0,o.__)("End","gatherpress"))),(0,a.createElement)(c.FlexItem,null,(0,a.createElement)(c.Dropdown,{popoverProps:{placement:"bottom-end"},renderToggle:({isOpen:e,onToggle:n})=>(0,a.createElement)(c.Button,{id:"gp-datetime-end",onClick:n,"aria-expanded":e,isLink:!0},(0,a.createElement)(F,{dateTimeEnd:t})),renderContent:()=>(0,a.createElement)($,{dateTimeEnd:t,setDateTimeEnd:n})}))))},G=e=>{const{timezone:t,setTimezone:n}=e,r=g("misc.timezoneChoices");return(0,m.useEffect)((()=>{n(g("eventDetails.dateTime.timezone"))}),[n]),(0,m.useEffect)((()=>{d({setTimezone:g("eventDetails.dateTime.timezone")})})),(0,a.createElement)(c.PanelRow,null,(0,a.createElement)(c.SelectControl,{label:(0,o.__)("Time Zone","gatherpress"),value:O(t),onChange:e=>{e=function(e=""){const t=/^UTC([+-])(\d+)(.\d+)?$/,n=e.replace(t,"$1");if(n!==e){const r=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"),n+r+a}return e}(e),n(e),T("eventDetails.dateTime.timezone",e),v()}},Object.keys(r).map((e=>(0,a.createElement)("optgroup",{key:e,label:e},Object.keys(r[e]).map((t=>(0,a.createElement)("option",{key:t,value:t},r[e][t]))))))))},N=()=>{const[e,t]=(0,m.useState)(),[n,r]=(0,m.useState)(),[i,s]=(0,m.useState)();return(0,p.subscribe)(C),(0,a.createElement)(a.Fragment,null,(0,a.createElement)("h3",null,(0,o.__)("Date & time","gatherpress")),(0,a.createElement)(I,{dateTimeStart:e,setDateTimeStart:t}),(0,a.createElement)(H,{dateTimeEnd:n,setDateTimeEnd:r}),(0,a.createElement)(G,{timezone:i,setTimezone:s}))},B=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"gatherpress/event-date","version":"1.0.0","title":"Event Date","category":"gatherpress","icon":"clock","example":{},"description":"Displays the date and time for an event.","attributes":{"eventEnd":{"type":"string"},"eventStart":{"type":"string"}},"supports":{"html":false},"textdomain":"gatherpress","editorScript":"file:./index.js","style":"file:./style-index.css","render":"file:./render.php"}');(0,r.registerBlockType)(B,{edit:()=>{const e=(0,l.useBlockProps)(),[t,n]=(0,m.useState)(z),[r,i]=(0,m.useState)(b),[d,u]=(0,m.useState)(y());return((e,t="")=>{for(const[n,r]of Object.entries(e)){let e=n;t&&(e+="_"+String(t)),addEventListener(e,(e=>{r(e.detail)}),!1)}})({setDateTimeEnd:i,setDateTimeStart:n,setTimezone:u}),(0,a.createElement)("div",{...e},(0,a.createElement)(M,null,(0,a.createElement)(c.Flex,{justify:"normal",align:"center",gap:"4"},(0,a.createElement)(c.FlexItem,{display:"flex",className:"gp-event-date__icon"},(0,a.createElement)(c.Icon,{icon:"clock"})),(0,a.createElement)(c.FlexItem,null,((e,t,n)=>{const r=x(g("settings.dateFormat")),a=x(g("settings.timeFormat")),i=g("settings.showTimezone")?"z":"",l=r+" "+a,c=y(n);let m=r+" "+a+" "+i;return s().tz(e,c).format(r)===s().tz(t,c).format(r)&&(m=a+" "+i),(0,o.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,o.__)("%1$s to %2$s %3$s"),s().tz(e,c).format(l),s().tz(t,c).format(m),(d=y(d=c),(0,o.__)("GMT","gatherpress")!==d?"":function(e=""){return e.replace(":","")}(g("eventDetails.dateTime.timezone"))));var d})(t,r,d)),"string"==typeof(0,p.select)("core/editor")?.getCurrentPostType()&&(0,a.createElement)(l.InspectorControls,null,(0,a.createElement)(c.PanelBody,null,(0,a.createElement)(N,null))))))},save:()=>null})}},n={};function r(e){var a=n[e];if(void 0!==a)return a.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,r),i.exports}r.m=t,e=[],r.O=(t,n,a,i)=>{if(!n){var s=1/0;for(m=0;m=i)&&Object.keys(r.O).every((e=>r.O[e](n[l])))?n.splice(l--,1):(o=!1,i0&&e[m-1][2]>i;m--)e[m]=e[m-1];e[m]=[n,a,i]},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={532:0,4:0};r.O.j=t=>0===e[t];var t=(t,n)=>{var a,i,[s,o,l]=n,c=0;if(s.some((t=>0!==e[t]))){for(a in o)r.o(o,a)&&(r.m[a]=o[a]);if(l)var m=l(r)}for(t&&t(n);cr(9554)));a=r.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 c46fb8a2c..a4c6a30f9 100644 --- a/build/blocks/venue/index.asset.php +++ b/build/blocks/venue/index.asset.php @@ -1 +1 @@ - array('moment', 'react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => 'cd674d27cc727af7427f'); + array('moment', 'react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-date', 'wp-element', 'wp-i18n'), 'version' => 'a3a00c3d5e84977f6a07'); diff --git a/build/blocks/venue/index.js b/build/blocks/venue/index.js index ad875baa4..d6f7b377a 100644 --- a/build/blocks/venue/index.js +++ b/build/blocks/venue/index.js @@ -1 +1 @@ -(()=>{var e,t={9778:(e,t,n)=>{"use strict";const r=window.wp.blocks;var o=n(1609);const i=window.wp.i18n,l=window.wp.blockEditor,a=window.wp.components,s=window.wp.data,c=window.wp.element;function u(){return"string"==typeof(0,s.select)("core/editor")?.getCurrentPostType()}function d(e){if("object"==typeof GatherPress)return e.split(".").reduce(((e,t)=>e&&e[t]),GatherPress)}const p=e=>{const{zoom:t,type:n,className:r}=e;let{location:i,height:l}=e;if(l||(l=300),u()||i||(i="60 29th Street #343, San Francisco, CA 94110, USA"),!i)return(0,o.createElement)(o.Fragment,null);const a={border:0,height:l,width:"100%"},s="https://maps.google.com/maps?"+new URLSearchParams({q:i,z:t||10,t:n||"m",output:"embed"}).toString();return(0,o.createElement)("iframe",{src:s,style:a,className:r,title:i})},f=Math.min,m=Math.max,h=Math.round,v=Math.floor,y=e=>({x:e,y:e}),g={left:"right",right:"left",bottom:"top",top:"bottom"},b={start:"end",end:"start"};function w(e,t,n){return m(e,f(t,n))}function E(e,t){return"function"==typeof e?e(t):e}function x(e){return e.split("-")[0]}function _(e){return e.split("-")[1]}function S(e){return"x"===e?"y":"x"}function T(e){return"y"===e?"height":"width"}function k(e){return["top","bottom"].includes(x(e))?"y":"x"}function A(e){return S(k(e))}function O(e){return e.replace(/start|end/g,(e=>b[e]))}function C(e){return e.replace(/left|right|bottom|top/g,(e=>g[e]))}function N(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 R(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function P(e,t,n){let{reference:r,floating:o}=e;const i=k(t),l=A(t),a=T(l),s=x(t),c="y"===i,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[a]/2-o[a]/2;let f;switch(s){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)){case"start":f[l]-=p*(n&&c?-1:1);break;case"end":f[l]+=p*(n&&c?-1:1)}return f}async function L(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:l,elements:a,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:f=0}=E(t,e),m=N(f),h=a[p?"floating"===d?"reference":"floating":d],v=R(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(h)))||n?h:h.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:s})),y="floating"===d?{...l.floating,x:r,y:o}:l.reference,g=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),b=await(null==i.isElement?void 0:i.isElement(g))&&await(null==i.getScale?void 0:i.getScale(g))||{x:1,y:1},w=R(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:g,strategy:s}):y);return{top:(v.top-w.top+m.top)/b.y,bottom:(w.bottom-v.bottom+m.bottom)/b.y,left:(v.left-w.left+m.left)/b.x,right:(w.right-v.right+m.right)/b.x}}const I=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:a}=t,s=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=x(n),a=_(n),s="y"===k(n),c=["left","top"].includes(l)?-1:1,u=i&&s?-1:1,d=E(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:m}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&"number"==typeof m&&(f="end"===a?-1*m:m),s?{x:f*u,y:p*c}:{x:p*c,y:f*u}}(t,e);return l===(null==(n=a.offset)?void 0:n.placement)&&null!=(r=a.arrow)&&r.alignmentOffset?{}:{x:o+s.x,y:i+s.y,data:{...s,placement:l}}}}};function D(e){return j(e)?(e.nodeName||"").toLowerCase():"#document"}function M(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function F(e){var t;return null==(t=(j(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function j(e){return e instanceof Node||e instanceof M(e).Node}function H(e){return e instanceof Element||e instanceof M(e).Element}function z(e){return e instanceof HTMLElement||e instanceof M(e).HTMLElement}function B(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof M(e).ShadowRoot)}function V(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=X(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function W(e){return["table","td","th"].includes(D(e))}function q(e){const t=$(),n=X(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 $(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function U(e){return["html","body","#document"].includes(D(e))}function X(e){return M(e).getComputedStyle(e)}function G(e){return H(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Y(e){if("html"===D(e))return e;const t=e.assignedSlot||e.parentNode||B(e)&&e.host||F(e);return B(t)?t.host:t}function Z(e){const t=Y(e);return U(t)?e.ownerDocument?e.ownerDocument.body:e.body:z(t)&&V(t)?t:Z(t)}function K(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=Z(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),l=M(o);return i?t.concat(l,l.visualViewport||[],V(o)?o:[],l.frameElement&&n?K(l.frameElement):[]):t.concat(o,K(o,[],n))}function J(e){const t=X(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=z(e),i=o?e.offsetWidth:n,l=o?e.offsetHeight:r,a=h(n)!==i||h(r)!==l;return a&&(n=i,r=l),{width:n,height:r,$:a}}function Q(e){return H(e)?e:e.contextElement}function ee(e){const t=Q(e);if(!z(t))return y(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=J(t);let l=(i?h(n.width):n.width)/r,a=(i?h(n.height):n.height)/o;return l&&Number.isFinite(l)||(l=1),a&&Number.isFinite(a)||(a=1),{x:l,y:a}}const te=y(0);function ne(e){const t=M(e);return $()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:te}function re(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Q(e);let l=y(1);t&&(r?H(r)&&(l=ee(r)):l=ee(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==M(e))&&t}(i,n,r)?ne(i):y(0);let s=(o.left+a.x)/l.x,c=(o.top+a.y)/l.y,u=o.width/l.x,d=o.height/l.y;if(i){const e=M(i),t=r&&H(r)?M(r):r;let n=e,o=n.frameElement;for(;o&&r&&t!==n;){const e=ee(o),t=o.getBoundingClientRect(),r=X(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,l=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;s*=e.x,c*=e.y,u*=e.x,d*=e.y,s+=i,c+=l,n=M(o),o=n.frameElement}}return R({width:u,height:d,x:s,y:c})}const oe=[":popover-open",":modal"];function ie(e){return oe.some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function le(e){return re(F(e)).left+G(e).scrollLeft}function ae(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=M(e),r=F(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,a=0,s=0;if(o){i=o.width,l=o.height;const e=$();(!e||e&&"fixed"===t)&&(a=o.offsetLeft,s=o.offsetTop)}return{width:i,height:l,x:a,y:s}}(e,n);else if("document"===t)r=function(e){const t=F(e),n=G(e),r=e.ownerDocument.body,o=m(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=m(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+le(e);const a=-n.scrollTop;return"rtl"===X(r).direction&&(l+=m(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:a}}(F(e));else if(H(t))r=function(e,t){const n=re(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=z(e)?ee(e):y(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=ne(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return R(r)}function se(e,t){const n=Y(e);return!(n===t||!H(n)||U(n))&&("fixed"===X(n).position||se(n,t))}function ce(e,t,n){const r=z(t),o=F(t),i="fixed"===n,l=re(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const s=y(0);if(r||!r&&!i)if(("body"!==D(t)||V(o))&&(a=G(t)),r){const e=re(t,!0,i,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else o&&(s.x=le(o));return{x:l.left+a.scrollLeft-s.x,y:l.top+a.scrollTop-s.y,width:l.width,height:l.height}}function ue(e,t){return z(e)&&"fixed"!==X(e).position?t?t(e):e.offsetParent:null}function de(e,t){const n=M(e);if(!z(e)||ie(e))return n;let r=ue(e,t);for(;r&&W(r)&&"static"===X(r).position;)r=ue(r,t);return r&&("html"===D(r)||"body"===D(r)&&"static"===X(r).position&&!q(r))?n:r||function(e){let t=Y(e);for(;z(t)&&!U(t);){if(q(t))return t;t=Y(t)}return null}(e)||n}const pe={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,l=F(r),a=!!t&&ie(t.floating);if(r===l||a&&i)return n;let s={scrollLeft:0,scrollTop:0},c=y(1);const u=y(0),d=z(r);if((d||!d&&!i)&&(("body"!==D(r)||V(l))&&(s=G(r)),z(r))){const e=re(r);c=ee(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-s.scrollLeft*c.x+u.x,y:n.y*c.y-s.scrollTop*c.y+u.y}},getDocumentElement:F,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?function(e,t){const n=t.get(e);if(n)return n;let r=K(e,[],!1).filter((e=>H(e)&&"body"!==D(e))),o=null;const i="fixed"===X(e).position;let l=i?Y(e):e;for(;H(l)&&!U(l);){const t=X(l),n=q(l);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||V(l)&&!n&&se(e,l))?r=r.filter((e=>e!==l)):o=t,l=Y(l)}return t.set(e,r),r}(t,this._c):[].concat(n),r],l=i[0],a=i.reduce(((e,n)=>{const r=ae(t,n,o);return e.top=m(r.top,e.top),e.right=f(r.right,e.right),e.bottom=f(r.bottom,e.bottom),e.left=m(r.left,e.left),e}),ae(t,l,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:de,getElementRects:async function(e){const t=this.getOffsetParent||de,n=this.getDimensions;return{reference:ce(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,...await n(e.floating)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=J(e);return{width:t,height:n}},getScale:ee,isElement:H,isRTL:function(e){return"rtl"===X(e).direction}};const fe=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:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...s}=E(e,t),c={x:n,y:r},u=await L(t,s),d=k(x(o)),p=S(d);let f=c[p],m=c[d];if(i){const e="y"===p?"bottom":"right";f=w(f+u["y"===p?"top":"left"],f,f-u[e])}if(l){const e="y"===d?"bottom":"right";m=w(m+u["y"===d?"top":"left"],m,m-u[e])}const h=a.fn({...t,[p]:f,[d]:m});return{...h,data:{x:h.x-n,y:h.y-r}}}}},me=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:a,platform:s,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:h=!0,...v}=E(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const y=x(o),g=x(a)===a,b=await(null==s.isRTL?void 0:s.isRTL(c.floating)),w=p||(g||!h?[C(a)]:function(e){const t=C(e);return[O(e),t,O(t)]}(a));p||"none"===m||w.push(...function(e,t,n,r){const o=_(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[]}}(x(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(O)))),i}(a,h,m,b));const S=[a,...w],k=await L(t,v),N=[];let R=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&N.push(k[y]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=_(e),o=A(e),i=T(o);let l="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=C(l)),[l,C(l)]}(o,l,b);N.push(k[e[0]],k[e[1]])}if(R=[...R,{placement:o,overflows:N}],!N.every((e=>e<=0))){var P,I;const e=((null==(P=i.flip)?void 0:P.index)||0)+1,t=S[e];if(t)return{data:{index:e,overflows:R},reset:{placement:t}};let n=null==(I=R.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:I.placement;if(!n)switch(f){case"bestFit":{var D;const e=null==(D=R.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:D[0];e&&(n=e);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},he=(e,t,n)=>{const r=new Map,o={platform:pe,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,a=i.filter(Boolean),s=await(null==l.isRTL?void 0:l.isRTL(t));let c=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=P(c,r,s),p=r,f={},m=0;for(let n=0;n{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{},place:r};if(null===t)return{tooltipStyles:{},tooltipArrowStyles:{},place:r};const s=l;return n?(s.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:a}=e,{element:s,padding:u=0}=E(c,e)||{};if(null==s)return{};const d=N(u),p={x:t,y:n},m=A(r),h=T(m),v=await i.getDimensions(s),y="y"===m,g=y?"top":"left",b=y?"bottom":"right",x=y?"clientHeight":"clientWidth",S=o.reference[h]+o.reference[m]-p[m]-o.floating[h],k=p[m]-o.reference[m],O=await(null==i.getOffsetParent?void 0:i.getOffsetParent(s));let C=O?O[x]:0;C&&await(null==i.isElement?void 0:i.isElement(O))||(C=l.floating[x]||o.floating[h]);const R=S/2-k/2,P=C/2-v[h]/2-1,L=f(d[g],P),I=f(d[b],P),D=L,M=C-v[h]-I,F=C/2-v[h]/2+R,j=w(D,F,M),H=!a.arrow&&null!=_(r)&&F!==j&&o.reference[h]/2-(F{var o,i;const l={left:`${e}px`,top:`${t}px`,border:a},{x:s,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=a&&{borderBottom:a,borderRight:a};let p=0;if(a){const e=`${a}`.match(/(\d+)px/);p=(null==e?void 0:e[1])?Number(e[1]):1}return{tooltipStyles:l,tooltipArrowStyles:{left:null!=s?`${s}px`:"",top:null!=c?`${c}px`:"",right:"",bottom:"",...d,[u]:`-${4+p}px`},place:n}}))):he(e,t,{placement:"bottom",strategy:i,middleware:s}).then((({x:e,y:t,placement:n})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{},place:n})));var c},we=(e,t)=>!("CSS"in window&&"supports"in window.CSS)||window.CSS.supports(e,t),Ee=(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},xe=e=>null!==e&&!Array.isArray(e)&&"object"==typeof e,_e=(e,t)=>{if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every(((e,n)=>_e(e,t[n])));if(Array.isArray(e)!==Array.isArray(t))return!1;if(!xe(e)||!xe(t))return e===t;const n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every((n=>_e(e[n],t[n])))},Se=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}))},Te=e=>{if(!e)return null;let t=e.parentElement;for(;t;){if(Se(t))return t;t=t.parentElement}return document.scrollingElement||document.documentElement},ke="undefined"!=typeof window?o.useLayoutEffect:o.useEffect,Ae={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},Oe=(0,o.createContext)({getTooltipData:()=>Ae});function Ce(e="DEFAULT_TOOLTIP_ID"){return(0,o.useContext)(Oe).getTooltipData(e)}var Ne={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"},Re={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 Pe=({forwardRef:e,id:t,className:n,classNameArrow:r,variant:i="dark",anchorId:l,anchorSelect:a,place:s="top",offset:c=10,events:u=["hover"],openOnClick:d=!1,positionStrategy:p="absolute",middlewares:h,wrapper:y,delayShow:g=0,delayHide:b=0,float:w=!1,hidden:E=!1,noArrow:x=!1,clickable:_=!1,closeOnEsc:S=!1,closeOnScroll:T=!1,closeOnResize:k=!1,openEvents:A,closeEvents:O,globalCloseEvents:C,imperativeModeOnly:N,style:R,position:P,afterShow:L,afterHide:I,content:D,contentWrapperRef:M,isOpen:j,defaultIsOpen:H=!1,setIsOpen:z,activeAnchor:B,setActiveAnchor:V,border:W,opacity:q,arrowColor:$,role:U="tooltip"})=>{var X;const G=(0,o.useRef)(null),Y=(0,o.useRef)(null),Z=(0,o.useRef)(null),J=(0,o.useRef)(null),ee=(0,o.useRef)(null),[te,ne]=(0,o.useState)({tooltipStyles:{},tooltipArrowStyles:{},place:s}),[oe,ie]=(0,o.useState)(!1),[le,ae]=(0,o.useState)(!1),[se,ce]=(0,o.useState)(null),ue=(0,o.useRef)(!1),de=(0,o.useRef)(null),{anchorRefs:pe,setActiveAnchor:fe}=Ce(t),me=(0,o.useRef)(!1),[he,ye]=(0,o.useState)([]),ge=(0,o.useRef)(!1),we=d||u.includes("click"),xe=we||(null==A?void 0:A.click)||(null==A?void 0:A.dblclick)||(null==A?void 0:A.mousedown),Se=A?{...A}:{mouseenter:!0,focus:!0,click:!1,dblclick:!1,mousedown:!1};!A&&we&&Object.assign(Se,{mouseenter:!1,focus:!1,click:!0});const Ae=O?{...O}:{mouseleave:!0,blur:!0,click:!1,dblclick:!1,mouseup:!1};!O&&we&&Object.assign(Ae,{mouseleave:!1,blur:!1});const Oe=C?{...C}:{escape:S||!1,scroll:T||!1,resize:k||!1,clickOutsideAnchor:xe||!1};N&&(Object.assign(Se,{mouseenter:!1,focus:!1,click:!1,dblclick:!1,mousedown:!1}),Object.assign(Ae,{mouseleave:!1,blur:!1,click:!1,dblclick:!1,mouseup:!1}),Object.assign(Oe,{escape:!1,scroll:!1,resize:!1,clickOutsideAnchor:!1})),ke((()=>(ge.current=!0,()=>{ge.current=!1})),[]);const Pe=e=>{ge.current&&(e&&ae(!0),setTimeout((()=>{ge.current&&(null==z||z(e),void 0===j&&ie(e))}),10))};(0,o.useEffect)((()=>{if(void 0===j)return()=>null;j&&ae(!0);const e=setTimeout((()=>{ie(j)}),10);return()=>{clearTimeout(e)}}),[j]),(0,o.useEffect)((()=>{if(oe!==ue.current)if(ee.current&&clearTimeout(ee.current),ue.current=oe,oe)null==L||L();else{const e=(e=>{const t=getComputedStyle(document.body).getPropertyValue("--rt-transition-show-delay").match(/^([\d.]+)(ms|s)$/);if(!t)return 0;const[,n,r]=t;return Number(n)*("ms"===r?1:1e3)})();ee.current=setTimeout((()=>{ae(!1),ce(null),null==I||I()}),e+25)}}),[oe]);const Le=e=>{ne((t=>_e(t,e)?t:e))},Ie=(e=g)=>{Z.current&&clearTimeout(Z.current),le?Pe(!0):Z.current=setTimeout((()=>{Pe(!0)}),e)},De=(e=b)=>{J.current&&clearTimeout(J.current),J.current=setTimeout((()=>{me.current||Pe(!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});g?Ie():Pe(!0),V(n),fe({current:n}),J.current&&clearTimeout(J.current)},Fe=()=>{_?De(b||100):b?De():Pe(!1),Z.current&&clearTimeout(Z.current)},je=({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})};be({place:null!==(n=null==se?void 0:se.place)&&void 0!==n?n:s,offset:c,elementReference:r,tooltipReference:G.current,tooltipArrowReference:Y.current,strategy:p,middlewares:h,border:W}).then((e=>{Le(e)}))},He=e=>{if(!e)return;const t=e,n={x:t.clientX,y:t.clientY};je(n),de.current=n},ze=e=>{var t;if(!oe)return;const n=e.target;n.isConnected&&((null===(t=G.current)||void 0===t?void 0:t.contains(n))||[document.querySelector(`[id='${l}']`),...he].some((e=>null==e?void 0:e.contains(n)))||(Pe(!1),Z.current&&clearTimeout(Z.current)))},Be=Ee(Me,50,!0),Ve=Ee(Fe,50,!0),We=e=>{Ve.cancel(),Be(e)},qe=()=>{Be.cancel(),Ve()},$e=(0,o.useCallback)((()=>{var e,t;const n=null!==(e=null==se?void 0:se.position)&&void 0!==e?e:P;n?je(n):w?de.current&&je(de.current):(null==B?void 0:B.isConnected)&&be({place:null!==(t=null==se?void 0:se.place)&&void 0!==t?t:s,offset:c,elementReference:B,tooltipReference:G.current,tooltipArrowReference:Y.current,strategy:p,middlewares:h,border:W}).then((e=>{ge.current&&Le(e)}))}),[oe,B,D,R,s,null==se?void 0:se.place,c,p,P,null==se?void 0:se.position,w]);(0,o.useEffect)((()=>{var e,t;const n=new Set(pe);he.forEach((e=>{n.add({current:e})}));const r=document.querySelector(`[id='${l}']`);r&&n.add({current:r});const o=()=>{Pe(!1)},i=Te(B),a=Te(G.current);Oe.scroll&&(window.addEventListener("scroll",o),null==i||i.addEventListener("scroll",o),null==a||a.addEventListener("scroll",o));let s=null;Oe.resize?window.addEventListener("resize",o):B&&G.current&&(s=function(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:s=!1}=r,c=Q(e),u=o||i?[...c?K(c):[],...K(t)]:[];u.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=c&&a?function(e,t){let n,r=null;const o=F(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function l(a,s){void 0===a&&(a=!1),void 0===s&&(s=1),i();const{left:c,top:u,width:d,height:p}=e.getBoundingClientRect();if(a||t(),!d||!p)return;const h={rootMargin:-v(u)+"px "+-v(o.clientWidth-(c+d))+"px "+-v(o.clientHeight-(u+p))+"px "+-v(c)+"px",threshold:m(0,f(1,s))||1};let y=!0;function g(e){const t=e[0].intersectionRatio;if(t!==s){if(!y)return l();t?l(!1,t):n=setTimeout((()=>{l(!1,1e-7)}),100)}y=!1}try{r=new IntersectionObserver(g,{...h,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(g,h)}r.observe(e)}(!0),i}(c,n):null;let p,h=-1,y=null;l&&(y=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&y&&(y.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame((()=>{var e;null==(e=y)||e.observe(t)}))),n()})),c&&!s&&y.observe(c),y.observe(t));let g=s?re(e):null;return s&&function t(){const r=re(e);!g||r.x===g.x&&r.y===g.y&&r.width===g.width&&r.height===g.height||n(),g=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=y)||e.disconnect(),y=null,s&&cancelAnimationFrame(p)}}(B,G.current,$e,{ancestorResize:!0,elementResize:!0,layoutShift:!0}));const c=e=>{"Escape"===e.key&&Pe(!1)};Oe.escape&&window.addEventListener("keydown",c),Oe.clickOutsideAnchor&&window.addEventListener("click",ze);const u=[],d=e=>{oe&&(null==e?void 0:e.target)===B||Me(e)},p=e=>{oe&&(null==e?void 0:e.target)===B&&Fe()},h=["mouseenter","mouseleave","focus","blur"],y=["click","dblclick","mousedown","mouseup"];Object.entries(Se).forEach((([e,t])=>{t&&(h.includes(e)?u.push({event:e,listener:We}):y.includes(e)&&u.push({event:e,listener:d}))})),Object.entries(Ae).forEach((([e,t])=>{t&&(h.includes(e)?u.push({event:e,listener:qe}):y.includes(e)&&u.push({event:e,listener:p}))})),w&&u.push({event:"pointermove",listener:He});const g=()=>{me.current=!0},b=()=>{me.current=!1,Fe()};return _&&!xe&&(null===(e=G.current)||void 0===e||e.addEventListener("mouseenter",g),null===(t=G.current)||void 0===t||t.addEventListener("mouseleave",b)),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;Oe.scroll&&(window.removeEventListener("scroll",o),null==i||i.removeEventListener("scroll",o),null==a||a.removeEventListener("scroll",o)),Oe.resize?window.removeEventListener("resize",o):null==s||s(),Oe.clickOutsideAnchor&&window.removeEventListener("click",ze),Oe.escape&&window.removeEventListener("keydown",c),_&&!xe&&(null===(e=G.current)||void 0===e||e.removeEventListener("mouseenter",g),null===(t=G.current)||void 0===t||t.removeEventListener("mouseleave",b)),u.forEach((({event:e,listener:t})=>{n.forEach((n=>{var r;null===(r=n.current)||void 0===r||r.removeEventListener(e,t)}))}))}}),[B,$e,le,pe,he,A,O,C,we,g,b]),(0,o.useEffect)((()=>{var e,n;let r=null!==(n=null!==(e=null==se?void 0:se.anchorSelect)&&void 0!==e?e:a)&&void 0!==n?n:"";!r&&t&&(r=`[data-tooltip-id='${t}']`);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(B){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,B))&&(ae(!1),Pe(!1),V(null),Z.current&&clearTimeout(Z.current),J.current&&clearTimeout(J.current),!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)&&ye((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,a,null==se?void 0:se.anchorSelect,B]),(0,o.useEffect)((()=>{$e()}),[$e]),(0,o.useEffect)((()=>{if(!(null==M?void 0:M.current))return()=>null;const e=new ResizeObserver((()=>{setTimeout((()=>$e()))}));return e.observe(M.current),()=>{e.disconnect()}}),[D,null==M?void 0:M.current]),(0,o.useEffect)((()=>{var e;const t=document.querySelector(`[id='${l}']`),n=[...he,t];B&&n.includes(B)||V(null!==(e=he[0])&&void 0!==e?e:t)}),[l,he,B]),(0,o.useEffect)((()=>(H&&Pe(!0),()=>{Z.current&&clearTimeout(Z.current),J.current&&clearTimeout(J.current)})),[]),(0,o.useEffect)((()=>{var e;let n=null!==(e=null==se?void 0:se.anchorSelect)&&void 0!==e?e:a;if(!n&&t&&(n=`[data-tooltip-id='${t}']`),n)try{const e=Array.from(document.querySelectorAll(n));ye(e)}catch(e){ye([])}}),[t,a,null==se?void 0:se.anchorSelect]),(0,o.useEffect)((()=>{Z.current&&(clearTimeout(Z.current),Ie(g))}),[g]);const Ue=null!==(X=null==se?void 0:se.content)&&void 0!==X?X:D,Xe=oe&&Object.keys(te.tooltipStyles).length>0;return(0,o.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)?Ie(e.delay):Pe(!0)},close:e=>{(null==e?void 0:e.delay)?De(e.delay):Pe(!1)},activeAnchor:B,place:te.place,isOpen:Boolean(le&&!E&&Ue&&Xe)}))),le&&!E&&Ue?o.createElement(y,{id:t,role:U,className:ve("react-tooltip",Ne.tooltip,Re.tooltip,Re[i],n,`react-tooltip__place-${te.place}`,Ne[Xe?"show":"closing"],Xe?"react-tooltip__show":"react-tooltip__closing","fixed"===p&&Ne.fixed,_&&Ne.clickable),onTransitionEnd:e=>{ee.current&&clearTimeout(ee.current),oe||"opacity"!==e.propertyName||(ae(!1),ce(null),null==I||I())},style:{...R,...te.tooltipStyles,opacity:void 0!==q&&Xe?q:void 0},ref:G},Ue,o.createElement(y,{className:ve("react-tooltip-arrow",Ne.arrow,Re.arrow,r,x&&Ne.noArrow),style:{...te.tooltipArrowStyles,background:$?`linear-gradient(to right bottom, transparent 50%, ${$} 50%)`:void 0},ref:Y})):null},Le=({content:e})=>o.createElement("span",{dangerouslySetInnerHTML:{__html:e}}),Ie=o.forwardRef((({id:e,anchorId:t,anchorSelect:n,content:r,html:i,render:l,className:a,classNameArrow:s,variant:c="dark",place:u="top",offset:d=10,wrapper:p="div",children:f=null,events:m=["hover"],openOnClick:h=!1,positionStrategy:v="absolute",middlewares:y,delayShow:g=0,delayHide:b=0,float:w=!1,hidden:E=!1,noArrow:x=!1,clickable:_=!1,closeOnEsc:S=!1,closeOnScroll:T=!1,closeOnResize:k=!1,openEvents:A,closeEvents:O,globalCloseEvents:C,imperativeModeOnly:N=!1,style:R,position:P,isOpen:L,defaultIsOpen:I=!1,disableStyleInjection:D=!1,border:M,opacity:F,arrowColor:j,setIsOpen:H,afterShow:z,afterHide:B,role:V="tooltip"},W)=>{const[q,$]=(0,o.useState)(r),[U,X]=(0,o.useState)(i),[G,Y]=(0,o.useState)(u),[Z,K]=(0,o.useState)(c),[J,Q]=(0,o.useState)(d),[ee,te]=(0,o.useState)(g),[ne,re]=(0,o.useState)(b),[oe,ie]=(0,o.useState)(w),[le,ae]=(0,o.useState)(E),[se,ce]=(0,o.useState)(p),[ue,de]=(0,o.useState)(m),[pe,fe]=(0,o.useState)(v),[me,he]=(0,o.useState)(null),[ye,ge]=(0,o.useState)(null),be=(0,o.useRef)(D),{anchorRefs:Ee,activeAnchor:xe}=Ce(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:u)},content:e=>{$(null!=e?e:r)},html:e=>{X(null!=e?e:i)},variant:e=>{var t;K(null!==(t=e)&&void 0!==t?t:c)},offset:e=>{Q(null===e?d:Number(e))},wrapper:e=>{var t;ce(null!==(t=e)&&void 0!==t?t:p)},events:e=>{const t=null==e?void 0:e.split(" ");de(null!=t?t:m)},"position-strategy":e=>{var t;fe(null!==(t=e)&&void 0!==t?t:v)},"delay-show":e=>{te(null===e?g:Number(e))},"delay-hide":e=>{re(null===e?b:Number(e))},float:e=>{ie(null===e?w:"true"===e)},hidden:e=>{ae(null===e?E:"true"===e)},"class-name":e=>{he(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,o.useEffect)((()=>{$(r)}),[r]),(0,o.useEffect)((()=>{X(i)}),[i]),(0,o.useEffect)((()=>{Y(u)}),[u]),(0,o.useEffect)((()=>{K(c)}),[c]),(0,o.useEffect)((()=>{Q(d)}),[d]),(0,o.useEffect)((()=>{te(g)}),[g]),(0,o.useEffect)((()=>{re(b)}),[b]),(0,o.useEffect)((()=>{ie(w)}),[w]),(0,o.useEffect)((()=>{ae(E)}),[E]),(0,o.useEffect)((()=>{fe(v)}),[v]),(0,o.useEffect)((()=>{be.current!==D&&console.warn("[react-tooltip] Do not change `disableStyleInjection` dynamically.")}),[D]),(0,o.useEffect)((()=>{"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent("react-tooltip-inject-styles",{detail:{disableCore:"core"===D,disableBase:D}}))}),[]),(0,o.useEffect)((()=>{var r;const o=new Set(Ee);let i=n;if(!i&&e&&(i=`[data-tooltip-id='${e}']`),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 a=null!==(r=null!=ye?ye:l)&&void 0!==r?r:xe.current,s=new MutationObserver((e=>{e.forEach((e=>{var t;if(!a||"attributes"!==e.type||!(null===(t=e.attributeName)||void 0===t?void 0:t.startsWith("data-tooltip-")))return;const n=_e(a);Se(n)}))})),c={attributes:!0,childList:!1,subtree:!1};if(a){const e=_e(a);Se(e),s.observe(a,c)}return()=>{s.disconnect()}}),[Ee,xe,ye,t,n]),(0,o.useEffect)((()=>{(null==R?void 0:R.border)&&console.warn("[react-tooltip] Do not set `style.border`. Use `border` prop instead."),M&&!we("border",`${M}`)&&console.warn(`[react-tooltip] "${M}" is not a valid \`border\`.`),(null==R?void 0:R.opacity)&&console.warn("[react-tooltip] Do not set `style.opacity`. Use `opacity` prop instead."),F&&!we("opacity",`${F}`)&&console.warn(`[react-tooltip] "${F}" is not a valid \`opacity\`.`)}),[]);let Te=f;const ke=(0,o.useRef)(null);if(l){const e=l({content:(null==ye?void 0:ye.getAttribute("data-tooltip-content"))||q||null,activeAnchor:ye});Te=e?o.createElement("div",{ref:ke,className:"react-tooltip-content-wrapper"},e):null}else q&&(Te=q);U&&(Te=o.createElement(Le,{content:U}));const Ae={forwardRef:W,id:e,anchorId:t,anchorSelect:n,className:ve(a,me),classNameArrow:s,content:Te,contentWrapperRef:ke,place:G,variant:Z,offset:J,wrapper:se,events:ue,openOnClick:h,positionStrategy:pe,middlewares:y,delayShow:ee,delayHide:ne,float:oe,hidden:le,noArrow:x,clickable:_,closeOnEsc:S,closeOnScroll:T,closeOnResize:k,openEvents:A,closeEvents:O,globalCloseEvents:C,imperativeModeOnly:N,style:R,position:P,isOpen:L,defaultIsOpen:I,border:M,opacity:F,arrowColor:j,setIsOpen:H,afterShow:z,afterHide:B,activeAnchor:ye,setActiveAnchor:e=>ge(e),role:V};return o.createElement(Pe,{...Ae})}));"undefined"!=typeof window&&window.addEventListener("react-tooltip-inject-styles",(e=>{e.detail.disableCore||ge({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||ge({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 De=(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)}},Me=(e,t="")=>{for(const[n,r]of Object.entries(e)){let e=n;t&&(e+="_"+String(t)),addEventListener(e,(e=>{r(e.detail)}),!1)}},Fe=({onlineEventLinkDefault:e=""})=>{const t=(0,i.__)("Online event","gatherpress"),[n,r]=(0,c.useState)(e);return Me({setOnlineEventLink:r},d("eventDetails.postId")),(0,o.createElement)(a.Flex,{justify:"normal",gap:"3"},(0,o.createElement)(a.FlexItem,{display:"flex"},(0,o.createElement)(a.Icon,{icon:"video-alt2"})),(0,o.createElement)(a.FlexItem,null,!n&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)("span",{tabIndex:"0",className:"gp-tooltip","data-tooltip-id":"gp-online-event-tooltip","data-tooltip-content":(0,i.__)("Link active for attendees during event.","gatherpress")},t),(0,o.createElement)(Ie,{id:"gp-online-event-tooltip"})),n&&(0,o.createElement)("a",{href:n,rel:"noreferrer",target:"_blank"},t)))};var je=n(442);const He=je.default||je,ze=({name:e,fullAddress:t,phoneNumber:n,website:r})=>(0,o.createElement)(o.Fragment,null,(e||t)&&(0,o.createElement)(a.Flex,{justify:"normal",align:"flex-start",gap:"4"},(0,o.createElement)(a.FlexItem,{display:"flex",className:"gp-venue__icon"},(0,o.createElement)(a.Icon,{icon:"location"})),(0,o.createElement)(a.FlexItem,null,e&&(0,o.createElement)("div",{className:"gp-venue__name"},(0,o.createElement)("strong",null,He(e))),t&&(0,o.createElement)("div",{className:"gp-venue__full-address"},He(t)))),(n||r)&&(0,o.createElement)(a.Flex,{justify:"normal",gap:"8"},n&&(0,o.createElement)(a.FlexItem,null,(0,o.createElement)(a.Flex,{justify:"normal",gap:"4"},(0,o.createElement)(a.FlexItem,{display:"flex",className:"gp-venue__icon"},(0,o.createElement)(a.Icon,{icon:"phone"})),(0,o.createElement)(a.FlexItem,null,(0,o.createElement)("div",{className:"gp-venue__phone-number"},n)))),r&&(0,o.createElement)(a.FlexItem,null,(0,o.createElement)(a.Flex,{justify:"normal",gap:"4"},(0,o.createElement)(a.FlexItem,{display:"flex",className:"gp-venue__icon"},(0,o.createElement)(a.Icon,{icon:"admin-site-alt3"})),(0,o.createElement)(a.FlexItem,null,(0,o.createElement)("div",{className:"gp-venue__website"},(0,o.createElement)("a",{href:r,target:"_blank",rel:"noreferrer noopener"},r))))))),Be=({name:e="",fullAddress:t,phoneNumber:n,website:r,isOnlineEventTerm:i=!1,onlineEventLink:l=""})=>(0,o.createElement)(o.Fragment,null,!i&&(0,o.createElement)(ze,{name:e,fullAddress:t,phoneNumber:n,website:r}),i&&(0,o.createElement)(Fe,{onlineEventLinkDefault:l})),Ve=e=>{const{isSelected:t}=e,n=t?"none":"block";return(0,o.createElement)("div",{style:{position:"relative"}},e.children,(0,o.createElement)("div",{style:{position:"absolute",top:"0",right:"0",bottom:"0",left:"0",display:n}}))};function We(){return"gp_venue"===(0,s.select)("core/editor")?.getCurrentPostType()}const qe=()=>{const[e,t]=(0,c.useState)(""),[n,r]=(0,c.useState)(""),[l,u]=(0,c.useState)(""),[d,p]=(0,c.useState)(""),[f,m]=(0,c.useState)(!1),[h,v]=(0,c.useState)(""),y=(0,s.useDispatch)("core/editor").editPost,{unlockPostSaving:g}=(0,s.useDispatch)("core/editor"),b=(0,s.useSelect)((e=>e("core/editor").getEditedPostAttribute("_gp_venue"))),w=(0,s.useSelect)((e=>e("core").getEntityRecord("taxonomy","_gp_venue",b))),E=w?.slug.replace(/^_/,""),[x,_]=(0,c.useState)(""),S=b+":"+x,T=(0,s.useSelect)((e=>e("core").getEntityRecords("postType","gp_venue",{per_page:1,slug:x})));(0,c.useEffect)((()=>{var e,n,o,l;let a={};if(x&&Array.isArray(T)){var s;const e=null!==(s=T[0]?.meta?.venue_information)&&void 0!==s?s:"{}";var c;e&&(a=JSON.parse(e),a.name=null!==(c=T[0]?.title.rendered)&&void 0!==c?c:"")}const d=null!==(e=a?.name)&&void 0!==e?e:(0,i.__)("No venue selected.","gatherpress"),f=null!==(n=a?.fullAddress)&&void 0!==n?n:"",m=null!==(o=a?.phoneNumber)&&void 0!==o?o:"",h=null!==(l=a?.website)&&void 0!==l?l:"";E&&_(E),v(S?String(S):""),t(d),r(f),u(m),p(h),De({setName:d,setFullAddress:f,setPhoneNumber:m,setWebsite:h,setIsOnlineEventTerm:"online-event"===x})}),[x,T,E,S]);let k=(0,s.useSelect)((e=>e("core").getEntityRecords("taxonomy","_gp_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,i.__)("Choose a venue","gatherpress")})):k=[],(0,o.createElement)(a.PanelRow,null,(0,o.createElement)(a.SelectControl,{label:(0,i.__)("Venue Selector","gatherpress"),value:h,onChange:e=>{(e=>{v(e);const t=""!==(e=e.split(":"))[0]?[e[0]]:[];y({_gp_venue:t}),_(e[1]),g()})(e)},options:k}))},$e=()=>{var e,t,n;const r=(0,s.useDispatch)("core/editor").editPost,l=(e,t)=>{const n=JSON.stringify({...u,[e]:t});r({meta:{venue_information:n}})};let u=(0,s.useSelect)((e=>e("core/editor").getEditedPostAttribute("meta").venue_information));u=u?JSON.parse(u):{};const[d,p]=(0,c.useState)(null!==(e=u.fullAddress)&&void 0!==e?e:""),[f,m]=(0,c.useState)(null!==(t=u.phoneNumber)&&void 0!==t?t:""),[h,v]=(0,c.useState)(null!==(n=u.website)&&void 0!==n?n:"");return Me({setFullAddress:p,setPhoneNumber:m,setWebsite:v}),(0,o.createElement)(o.Fragment,null,(0,o.createElement)(a.TextControl,{label:(0,i.__)("Full Address","gatherpress"),value:d,onChange:e=>{De({setFullAddress:e}),l("fullAddress",e)}}),(0,o.createElement)(a.TextControl,{label:(0,i.__)("Phone Number","gatherpress"),value:f,onChange:e=>{De({setPhoneNumber:e}),l("phoneNumber",e)}}),(0,o.createElement)(a.TextControl,{label:(0,i.__)("Website","gatherpress"),value:h,type:"url",onChange:e=>{De({setWebsite:e}),l("website",e)}}))},Ue=()=>(0,o.createElement)("section",null,(0,o.createElement)($e,null)),Xe=()=>{const{editPost:e,unlockPostSaving:t}=(0,s.useDispatch)("core/editor"),n=(0,s.useSelect)((e=>e("core/editor").getEditedPostAttribute("meta").online_event_link)),[r,l]=(0,c.useState)(n);return Me({setOnlineEventLink:l},d("eventDetails.postId")),(0,o.createElement)(a.TextControl,{label:(0,i.__)("Online event link","gatherpress"),value:r,placeholder:(0,i.__)("Add link to online event","gatherpress"),onChange:n=>{(n=>{e({meta:{online_event_link:n}}),l(n),De({setOnlineEventLink:n},d("eventDetails.postId")),t()})(n)}})},Ge=window.moment;var Ye=n.n(Ge);window.wp.apiFetch;const Ze="YYYY-MM-DDTHH:mm:ss",Ke=Ye().tz(Je()).add(1,"day").set("hour",18).set("minute",0).set("second",0).format(Ze);function Je(e=d("eventDetails.dateTime.timezone")){return Ye().tz.zone(e)?e:(0,i.__)("GMT","gatherpress")}Ye().tz(Ke,Je()).add(2,"hours").format(Ze);const Qe=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"gatherpress/venue","version":"1.0.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","render":"file:./render.php"}');(0,r.registerBlockType)(Qe,{edit:({attributes:e,setAttributes:t,isSelected:n})=>{const{mapZoomLevel:r,mapType:d,mapHeight:f}=e,[m,h]=(0,c.useState)(""),[v,y]=(0,c.useState)(""),[g,b]=(0,c.useState)(""),[w,E]=(0,c.useState)(""),[x,_]=(0,c.useState)(!1),S=(0,l.useBlockProps)(),T=(0,s.useSelect)((e=>e("core/editor")?.getEditedPostAttribute("meta")?.online_event_link));let{mapShow:k}=e,A=(0,s.useSelect)((e=>e("core/editor")?.getEditedPostAttribute("meta")?.venue_information));return A=A?JSON.parse(A):{},k&&v&&(k=!0),k&&!u()&&(k=!0),Me({setName:h,setFullAddress:y,setPhoneNumber:b,setWebsite:E,setIsOnlineEventTerm:_}),(0,c.useEffect)((()=>{We()&&(y(A.fullAddress),b(A.phoneNumber),E(A.website),h(v||g||w?"":(0,i.__)("Add venue information.","gatherpress"))),"gp_event"!==(0,s.select)("core/editor").getCurrentPostType()&&u()||h(v||g||w?"":(0,i.__)("No venue selected.","gatherpress"))}),[A.fullAddress,A.phoneNumber,A.website,v,g,w]),(0,o.createElement)(o.Fragment,null,(0,o.createElement)(l.InspectorControls,null,u()&&(0,o.createElement)(a.PanelBody,{title:(0,i.__)("Venue settings","gatherpress"),initialOpen:!0},(0,o.createElement)(a.PanelRow,null,!We()&&(0,o.createElement)(qe,null),We()&&(0,o.createElement)(Ue,null)),x&&(0,o.createElement)(a.PanelRow,null,(0,o.createElement)(Xe,null))),!x&&(0,o.createElement)(a.PanelBody,{title:(0,i.__)("Map settings","gatherpress"),initialOpen:!0},(0,o.createElement)(a.PanelRow,null,(0,i.__)("Show map on venue","gatherpress")),(0,o.createElement)(a.PanelRow,null,(0,o.createElement)(a.ToggleControl,{label:k?(0,i.__)("Display the map","gatherpress"):(0,i.__)("Hide the map","gatherpress"),checked:k,onChange:e=>{t({mapShow:e})}})),(0,o.createElement)(a.RangeControl,{label:(0,i.__)("Zoom level","gatherpress"),beforeIcon:"search",value:r,onChange:e=>t({mapZoomLevel:e}),min:1,max:22}),(0,o.createElement)(a.RadioControl,{label:(0,i.__)("Map type","gatherpress"),selected:d,options:[{label:(0,i.__)("Roadmap","gatherpress"),value:"m"},{label:(0,i.__)("Satellite","gatherpress"),value:"k"}],onChange:e=>{t({mapType:e})}}),(0,o.createElement)(a.RangeControl,{label:(0,i.__)("Map height","gatherpress"),beforeIcon:"location",value:f,onChange:e=>t({mapHeight:e}),min:100,max:1e3}))),(0,o.createElement)("div",{...S},(0,o.createElement)(Ve,{isSelected:n},(0,o.createElement)("div",{className:"gp-venue"},(0,o.createElement)(Be,{name:m,fullAddress:v,phoneNumber:g,website:w,isOnlineEventTerm:x,onlineEventLink:T}),k&&(0,o.createElement)(p,{location:v,zoom:r,type:d,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 a={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},s=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=a),"object"==typeof e&&(t=e,e=void 0),this.callback=null!=e?e:null,this.options=null!=t?t:a,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=s,t.default=s},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}(a);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 m=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=m;var h=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 v(e){return(0,l.isTag)(e)}function y(e){return e.type===l.ElementType.CDATA}function g(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 E(e){return e.type===l.ElementType.Root}function x(e,t){var n;if(void 0===t&&(t=!1),g(e))n=new c(e.data);else if(b(e))n=new u(e.data);else if(v(e)){var r=t?_(e.children):[],o=new h(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(y(e)){r=t?_(e.children):[];var l=new f(r);r.forEach((function(e){return e.parent=l})),n=l}else if(E(e)){r=t?_(e.children):[];var a=new m(r);r.forEach((function(e){return e.parent=a})),e["x-mode"]&&(a["x-mode"]=e["x-mode"]),n=a}else{if(!w(e))throw new Error("Not implemented yet: ".concat(e.type));var s=new d(e.name,e.data);null!=e["x-name"]&&(s["x-name"]=e["x-name"],s["x-publicId"]=e["x-publicId"],s["x-systemId"]=e["x-systemId"]),n=s}return n.startIndex=e.startIndex,n.endIndex=e.endIndex,null!=e.sourceCodeLocation&&(n.sourceCodeLocation=e.sourceCodeLocation),n}function _(e){for(var t=e.map((function(e){return x(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});var n="html",r="head",o="body",i=/<([a-zA-Z]+[0-9]?)/,l=//i,a=//i,s=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;s=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();s=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,m="object"==typeof document&&document.createElement("template");m&&m.content&&(f=function(e){return m.innerHTML=e,m.content.childNodes}),t.default=function(e){var t,u,d=e.match(i),p=d&&d[1]?d[1].toLowerCase():"";switch(p){case n:var m=c(e);return l.test(e)||null===(t=null==(v=m.querySelector(r))?void 0:v.parentNode)||void 0===t||t.removeChild(v),a.test(e)||null===(u=null==(v=m.querySelector(o))?void 0:v.parentNode)||void 0===u||u.removeChild(v),m.querySelectorAll(n);case r:case o:var h=s(e).querySelectorAll(p);return a.test(e)&&l.test(e)?h[0].parentNode.childNodes:h;default:return f?f(e):(v=s(e,o).querySelector(o)).childNodes;var v}}},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});var o=r(n(5496)),i=n(7731),l=/<(![a-zA-Z\s]+)>/;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)}},7731:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatDOM=t.formatAttributes=void 0;var r=n(1141),o=n(5270);function i(e){for(var t={},n=0,r=e.length;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4210),o=n(4958),i=["checked","value"],l=["input","select","textarea"],a={reset:!0,submit:!0};function s(e){return r.possibleStandardNames[e]}t.default=function(e,t){void 0===e&&(e={});var n={},c=Boolean(e.type&&a[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=s(p);if(f){var m=(0,r.getPropertyInfo)(f);switch(i.includes(f)&&l.includes(t)&&!c&&(f=s("default"+p)),n[f]=d,m&&m.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}},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});var o=n(1609),i=r(n(840)),l=n(4958),a={cloneElement:o.cloneElement,createElement:o.createElement,isValidElement:o.isValidElement};function s(e){return l.PRESERVE_CUSTOM_ATTRIBUTES&&"tag"===e.type&&(0,l.isCustomComponent)(e.name,e.attribs)}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||a,d=u.cloneElement,p=u.createElement,f=u.isValidElement,m=t.length,h=0;h1&&(y=d(y,{key:y.key||h})),r.push(c(y,v,h));continue}}if("text"!==v.type){var g=v,b={};s(g)?((0,l.setStyleProp)(g.attribs.style,g.attribs),b=g.attribs):g.attribs&&(b=(0,i.default)(g.attribs,g.name));var w=void 0;switch(v.type){case"script":case"style":v.children[0]&&(b.dangerouslySetInnerHTML={__html:v.children[0].data});break;case"tag":"textarea"===v.name&&v.children[0]?b.defaultValue=v.children[0].data:v.children&&v.children.length&&(w=e(v.children,n));break;default:continue}m>1&&(b.key=h),r.push(c(p(v.name,b,w),v,h))}else{var E=!v.data.trim().length;if(E&&v.parent&&!(0,l.canTextBeChildOfNode)(v.parent))continue;if(n.trim&&E)continue;r.push(c(v.data,v,h))}}return 1===r.length?r[0]:r}},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;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 a=n(1141);Object.defineProperty(t,"Comment",{enumerable:!0,get:function(){return a.Comment}}),Object.defineProperty(t,"Element",{enumerable:!0,get:function(){return a.Element}}),Object.defineProperty(t,"ProcessingInstruction",{enumerable:!0,get:function(){return a.ProcessingInstruction}}),Object.defineProperty(t,"Text",{enumerable:!0,get:function(){return a.Text}});var s={lowerCaseAttributeNames:!1};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)||s),t):[]}},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=t.setStyleProp=t.isCustomComponent=void 0;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"]);t.isCustomComponent=function(e,t){return e.includes("-")?!l.has(e):Boolean(t&&"string"==typeof t.is)};var a={reactCompat:!0};t.setStyleProp=function(e,t){if("string"==typeof e)if(e.trim())try{t.style=(0,i.default)(e,a)}catch(e){t.style={}}else t.style={}},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=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,s=/^\s+|\s+$/g,c="";function u(e){return e?e.replace(s,c):c}e.exports=function(e,s){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];s=s||{};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 m(){var e={line:d,column:p};return function(t){return t.position=new h(e),b(),t}}function h(e){this.start=e,this.end={line:d,column:p},this.source=s.source}h.prototype.content=e;var v=[];function y(t){var n=new Error(s.source+":"+d+":"+p+": "+t);if(n.reason=t,n.filename=s.source,n.line=d,n.column=p,n.source=e,!s.silent)throw n;v.push(n)}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function b(){g(r)}function w(e){var t;for(e=e||[];t=E();)!1!==t&&e.push(t);return e}function E(){var t=m();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 y("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 x(){var e=m(),n=g(o);if(n){if(E(),!g(i))return y("property missing ':'");var r=g(l),s=e({type:"declaration",property:u(n[0].replace(t,c)),value:r?u(r[0].replace(t,c)):c});return g(a),s}}return b(),function(){var e,t=[];for(w(t);e=x();)!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:a,SAME:s,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===s?e[t]=t:n===a?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}};Object.defineProperty(t,"__esModule",{value:!0});var o=r(n(1133)),i=n(8917);t.default=function(e,t){var n={};return e&&"string"==typeof e?((0,o.default)(e,(function(e,r){e&&r&&(n[(0,i.camelCase)(e,t)]=r)})),n):n}},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)-/,a=function(e,t){return t.toUpperCase()},s=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,s):e.replace(i,s)).replace(r,a))}},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 l=1/0;for(u=0;u=i)&&Object.keys(r.O).every((e=>r.O[e](n[s])))?n.splice(s--,1):(a=!1,i0&&e[u-1][2]>i;u--)e[u]=e[u-1];e[u]=[n,o,i]},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={908:0,812:0};r.O.j=t=>0===e[t];var t=(t,n)=>{var o,i,[l,a,s]=n,c=0;if(l.some((t=>0!==e[t]))){for(o in a)r.o(a,o)&&(r.m[o]=a[o]);if(s)var u=s(r)}for(t&&t(n);cr(9778)));o=r.O(o)})(); \ No newline at end of file +(()=>{var e,t={2041:(e,t,n)=>{"use strict";const r=window.wp.blocks;var o=n(1609);const i=window.wp.i18n,l=window.wp.blockEditor,a=window.wp.components,s=window.wp.data,c=window.wp.element;function u(){return"string"==typeof(0,s.select)("core/editor")?.getCurrentPostType()}function d(e){if("object"==typeof GatherPress)return e.split(".").reduce(((e,t)=>e&&e[t]),GatherPress)}const p=e=>{const{zoom:t,type:n,className:r}=e;let{location:i,height:l}=e;if(l||(l=300),u()||i||(i="60 29th Street #343, San Francisco, CA 94110, USA"),!i)return(0,o.createElement)(o.Fragment,null);const a={border:0,height:l,width:"100%"},s="https://maps.google.com/maps?"+new URLSearchParams({q:i,z:t||10,t:n||"m",output:"embed"}).toString();return(0,o.createElement)("iframe",{src:s,style:a,className:r,title:i})},f=Math.min,m=Math.max,h=Math.round,v=Math.floor,y=e=>({x:e,y:e}),g={left:"right",right:"left",bottom:"top",top:"bottom"},b={start:"end",end:"start"};function w(e,t,n){return m(e,f(t,n))}function E(e,t){return"function"==typeof e?e(t):e}function x(e){return e.split("-")[0]}function _(e){return e.split("-")[1]}function S(e){return"x"===e?"y":"x"}function T(e){return"y"===e?"height":"width"}function k(e){return["top","bottom"].includes(x(e))?"y":"x"}function A(e){return S(k(e))}function O(e){return e.replace(/start|end/g,(e=>b[e]))}function C(e){return e.replace(/left|right|bottom|top/g,(e=>g[e]))}function N(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 R(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function P(e,t,n){let{reference:r,floating:o}=e;const i=k(t),l=A(t),a=T(l),s=x(t),c="y"===i,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[a]/2-o[a]/2;let f;switch(s){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)){case"start":f[l]-=p*(n&&c?-1:1);break;case"end":f[l]+=p*(n&&c?-1:1)}return f}async function L(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:l,elements:a,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:f=0}=E(t,e),m=N(f),h=a[p?"floating"===d?"reference":"floating":d],v=R(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(h)))||n?h:h.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:s})),y="floating"===d?{...l.floating,x:r,y:o}:l.reference,g=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),b=await(null==i.isElement?void 0:i.isElement(g))&&await(null==i.getScale?void 0:i.getScale(g))||{x:1,y:1},w=R(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:g,strategy:s}):y);return{top:(v.top-w.top+m.top)/b.y,bottom:(w.bottom-v.bottom+m.bottom)/b.y,left:(v.left-w.left+m.left)/b.x,right:(w.right-v.right+m.right)/b.x}}const I=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:a}=t,s=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=x(n),a=_(n),s="y"===k(n),c=["left","top"].includes(l)?-1:1,u=i&&s?-1:1,d=E(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:m}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&"number"==typeof m&&(f="end"===a?-1*m:m),s?{x:f*u,y:p*c}:{x:p*c,y:f*u}}(t,e);return l===(null==(n=a.offset)?void 0:n.placement)&&null!=(r=a.arrow)&&r.alignmentOffset?{}:{x:o+s.x,y:i+s.y,data:{...s,placement:l}}}}};function D(e){return j(e)?(e.nodeName||"").toLowerCase():"#document"}function M(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function F(e){var t;return null==(t=(j(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function j(e){return e instanceof Node||e instanceof M(e).Node}function H(e){return e instanceof Element||e instanceof M(e).Element}function z(e){return e instanceof HTMLElement||e instanceof M(e).HTMLElement}function B(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof M(e).ShadowRoot)}function V(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=X(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function W(e){return["table","td","th"].includes(D(e))}function q(e){const t=$(),n=X(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 $(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function U(e){return["html","body","#document"].includes(D(e))}function X(e){return M(e).getComputedStyle(e)}function G(e){return H(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Y(e){if("html"===D(e))return e;const t=e.assignedSlot||e.parentNode||B(e)&&e.host||F(e);return B(t)?t.host:t}function Z(e){const t=Y(e);return U(t)?e.ownerDocument?e.ownerDocument.body:e.body:z(t)&&V(t)?t:Z(t)}function K(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=Z(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),l=M(o);return i?t.concat(l,l.visualViewport||[],V(o)?o:[],l.frameElement&&n?K(l.frameElement):[]):t.concat(o,K(o,[],n))}function J(e){const t=X(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=z(e),i=o?e.offsetWidth:n,l=o?e.offsetHeight:r,a=h(n)!==i||h(r)!==l;return a&&(n=i,r=l),{width:n,height:r,$:a}}function Q(e){return H(e)?e:e.contextElement}function ee(e){const t=Q(e);if(!z(t))return y(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=J(t);let l=(i?h(n.width):n.width)/r,a=(i?h(n.height):n.height)/o;return l&&Number.isFinite(l)||(l=1),a&&Number.isFinite(a)||(a=1),{x:l,y:a}}const te=y(0);function ne(e){const t=M(e);return $()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:te}function re(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Q(e);let l=y(1);t&&(r?H(r)&&(l=ee(r)):l=ee(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==M(e))&&t}(i,n,r)?ne(i):y(0);let s=(o.left+a.x)/l.x,c=(o.top+a.y)/l.y,u=o.width/l.x,d=o.height/l.y;if(i){const e=M(i),t=r&&H(r)?M(r):r;let n=e,o=n.frameElement;for(;o&&r&&t!==n;){const e=ee(o),t=o.getBoundingClientRect(),r=X(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,l=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;s*=e.x,c*=e.y,u*=e.x,d*=e.y,s+=i,c+=l,n=M(o),o=n.frameElement}}return R({width:u,height:d,x:s,y:c})}const oe=[":popover-open",":modal"];function ie(e){return oe.some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function le(e){return re(F(e)).left+G(e).scrollLeft}function ae(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=M(e),r=F(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,a=0,s=0;if(o){i=o.width,l=o.height;const e=$();(!e||e&&"fixed"===t)&&(a=o.offsetLeft,s=o.offsetTop)}return{width:i,height:l,x:a,y:s}}(e,n);else if("document"===t)r=function(e){const t=F(e),n=G(e),r=e.ownerDocument.body,o=m(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=m(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+le(e);const a=-n.scrollTop;return"rtl"===X(r).direction&&(l+=m(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:a}}(F(e));else if(H(t))r=function(e,t){const n=re(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=z(e)?ee(e):y(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=ne(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return R(r)}function se(e,t){const n=Y(e);return!(n===t||!H(n)||U(n))&&("fixed"===X(n).position||se(n,t))}function ce(e,t,n){const r=z(t),o=F(t),i="fixed"===n,l=re(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const s=y(0);if(r||!r&&!i)if(("body"!==D(t)||V(o))&&(a=G(t)),r){const e=re(t,!0,i,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else o&&(s.x=le(o));return{x:l.left+a.scrollLeft-s.x,y:l.top+a.scrollTop-s.y,width:l.width,height:l.height}}function ue(e,t){return z(e)&&"fixed"!==X(e).position?t?t(e):e.offsetParent:null}function de(e,t){const n=M(e);if(!z(e)||ie(e))return n;let r=ue(e,t);for(;r&&W(r)&&"static"===X(r).position;)r=ue(r,t);return r&&("html"===D(r)||"body"===D(r)&&"static"===X(r).position&&!q(r))?n:r||function(e){let t=Y(e);for(;z(t)&&!U(t);){if(q(t))return t;t=Y(t)}return null}(e)||n}const pe={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,l=F(r),a=!!t&&ie(t.floating);if(r===l||a&&i)return n;let s={scrollLeft:0,scrollTop:0},c=y(1);const u=y(0),d=z(r);if((d||!d&&!i)&&(("body"!==D(r)||V(l))&&(s=G(r)),z(r))){const e=re(r);c=ee(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-s.scrollLeft*c.x+u.x,y:n.y*c.y-s.scrollTop*c.y+u.y}},getDocumentElement:F,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?function(e,t){const n=t.get(e);if(n)return n;let r=K(e,[],!1).filter((e=>H(e)&&"body"!==D(e))),o=null;const i="fixed"===X(e).position;let l=i?Y(e):e;for(;H(l)&&!U(l);){const t=X(l),n=q(l);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||V(l)&&!n&&se(e,l))?r=r.filter((e=>e!==l)):o=t,l=Y(l)}return t.set(e,r),r}(t,this._c):[].concat(n),r],l=i[0],a=i.reduce(((e,n)=>{const r=ae(t,n,o);return e.top=m(r.top,e.top),e.right=f(r.right,e.right),e.bottom=f(r.bottom,e.bottom),e.left=m(r.left,e.left),e}),ae(t,l,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:de,getElementRects:async function(e){const t=this.getOffsetParent||de,n=this.getDimensions;return{reference:ce(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,...await n(e.floating)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=J(e);return{width:t,height:n}},getScale:ee,isElement:H,isRTL:function(e){return"rtl"===X(e).direction}};const fe=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:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...s}=E(e,t),c={x:n,y:r},u=await L(t,s),d=k(x(o)),p=S(d);let f=c[p],m=c[d];if(i){const e="y"===p?"bottom":"right";f=w(f+u["y"===p?"top":"left"],f,f-u[e])}if(l){const e="y"===d?"bottom":"right";m=w(m+u["y"===d?"top":"left"],m,m-u[e])}const h=a.fn({...t,[p]:f,[d]:m});return{...h,data:{x:h.x-n,y:h.y-r}}}}},me=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:a,platform:s,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:h=!0,...v}=E(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const y=x(o),g=x(a)===a,b=await(null==s.isRTL?void 0:s.isRTL(c.floating)),w=p||(g||!h?[C(a)]:function(e){const t=C(e);return[O(e),t,O(t)]}(a));p||"none"===m||w.push(...function(e,t,n,r){const o=_(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[]}}(x(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(O)))),i}(a,h,m,b));const S=[a,...w],k=await L(t,v),N=[];let R=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&N.push(k[y]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=_(e),o=A(e),i=T(o);let l="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=C(l)),[l,C(l)]}(o,l,b);N.push(k[e[0]],k[e[1]])}if(R=[...R,{placement:o,overflows:N}],!N.every((e=>e<=0))){var P,I;const e=((null==(P=i.flip)?void 0:P.index)||0)+1,t=S[e];if(t)return{data:{index:e,overflows:R},reset:{placement:t}};let n=null==(I=R.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:I.placement;if(!n)switch(f){case"bestFit":{var D;const e=null==(D=R.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:D[0];e&&(n=e);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},he=(e,t,n)=>{const r=new Map,o={platform:pe,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,a=i.filter(Boolean),s=await(null==l.isRTL?void 0:l.isRTL(t));let c=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=P(c,r,s),p=r,f={},m=0;for(let n=0;n{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{},place:r};if(null===t)return{tooltipStyles:{},tooltipArrowStyles:{},place:r};const s=l;return n?(s.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:a}=e,{element:s,padding:u=0}=E(c,e)||{};if(null==s)return{};const d=N(u),p={x:t,y:n},m=A(r),h=T(m),v=await i.getDimensions(s),y="y"===m,g=y?"top":"left",b=y?"bottom":"right",x=y?"clientHeight":"clientWidth",S=o.reference[h]+o.reference[m]-p[m]-o.floating[h],k=p[m]-o.reference[m],O=await(null==i.getOffsetParent?void 0:i.getOffsetParent(s));let C=O?O[x]:0;C&&await(null==i.isElement?void 0:i.isElement(O))||(C=l.floating[x]||o.floating[h]);const R=S/2-k/2,P=C/2-v[h]/2-1,L=f(d[g],P),I=f(d[b],P),D=L,M=C-v[h]-I,F=C/2-v[h]/2+R,j=w(D,F,M),H=!a.arrow&&null!=_(r)&&F!==j&&o.reference[h]/2-(F{var o,i;const l={left:`${e}px`,top:`${t}px`,border:a},{x:s,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=a&&{borderBottom:a,borderRight:a};let p=0;if(a){const e=`${a}`.match(/(\d+)px/);p=(null==e?void 0:e[1])?Number(e[1]):1}return{tooltipStyles:l,tooltipArrowStyles:{left:null!=s?`${s}px`:"",top:null!=c?`${c}px`:"",right:"",bottom:"",...d,[u]:`-${4+p}px`},place:n}}))):he(e,t,{placement:"bottom",strategy:i,middleware:s}).then((({x:e,y:t,placement:n})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{},place:n})));var c},we=(e,t)=>!("CSS"in window&&"supports"in window.CSS)||window.CSS.supports(e,t),Ee=(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},xe=e=>null!==e&&!Array.isArray(e)&&"object"==typeof e,_e=(e,t)=>{if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every(((e,n)=>_e(e,t[n])));if(Array.isArray(e)!==Array.isArray(t))return!1;if(!xe(e)||!xe(t))return e===t;const n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every((n=>_e(e[n],t[n])))},Se=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}))},Te=e=>{if(!e)return null;let t=e.parentElement;for(;t;){if(Se(t))return t;t=t.parentElement}return document.scrollingElement||document.documentElement},ke="undefined"!=typeof window?o.useLayoutEffect:o.useEffect,Ae={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},Oe=(0,o.createContext)({getTooltipData:()=>Ae});function Ce(e="DEFAULT_TOOLTIP_ID"){return(0,o.useContext)(Oe).getTooltipData(e)}var Ne={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"},Re={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 Pe=({forwardRef:e,id:t,className:n,classNameArrow:r,variant:i="dark",anchorId:l,anchorSelect:a,place:s="top",offset:c=10,events:u=["hover"],openOnClick:d=!1,positionStrategy:p="absolute",middlewares:h,wrapper:y,delayShow:g=0,delayHide:b=0,float:w=!1,hidden:E=!1,noArrow:x=!1,clickable:_=!1,closeOnEsc:S=!1,closeOnScroll:T=!1,closeOnResize:k=!1,openEvents:A,closeEvents:O,globalCloseEvents:C,imperativeModeOnly:N,style:R,position:P,afterShow:L,afterHide:I,content:D,contentWrapperRef:M,isOpen:j,defaultIsOpen:H=!1,setIsOpen:z,activeAnchor:B,setActiveAnchor:V,border:W,opacity:q,arrowColor:$,role:U="tooltip"})=>{var X;const G=(0,o.useRef)(null),Y=(0,o.useRef)(null),Z=(0,o.useRef)(null),J=(0,o.useRef)(null),ee=(0,o.useRef)(null),[te,ne]=(0,o.useState)({tooltipStyles:{},tooltipArrowStyles:{},place:s}),[oe,ie]=(0,o.useState)(!1),[le,ae]=(0,o.useState)(!1),[se,ce]=(0,o.useState)(null),ue=(0,o.useRef)(!1),de=(0,o.useRef)(null),{anchorRefs:pe,setActiveAnchor:fe}=Ce(t),me=(0,o.useRef)(!1),[he,ye]=(0,o.useState)([]),ge=(0,o.useRef)(!1),we=d||u.includes("click"),xe=we||(null==A?void 0:A.click)||(null==A?void 0:A.dblclick)||(null==A?void 0:A.mousedown),Se=A?{...A}:{mouseenter:!0,focus:!0,click:!1,dblclick:!1,mousedown:!1};!A&&we&&Object.assign(Se,{mouseenter:!1,focus:!1,click:!0});const Ae=O?{...O}:{mouseleave:!0,blur:!0,click:!1,dblclick:!1,mouseup:!1};!O&&we&&Object.assign(Ae,{mouseleave:!1,blur:!1});const Oe=C?{...C}:{escape:S||!1,scroll:T||!1,resize:k||!1,clickOutsideAnchor:xe||!1};N&&(Object.assign(Se,{mouseenter:!1,focus:!1,click:!1,dblclick:!1,mousedown:!1}),Object.assign(Ae,{mouseleave:!1,blur:!1,click:!1,dblclick:!1,mouseup:!1}),Object.assign(Oe,{escape:!1,scroll:!1,resize:!1,clickOutsideAnchor:!1})),ke((()=>(ge.current=!0,()=>{ge.current=!1})),[]);const Pe=e=>{ge.current&&(e&&ae(!0),setTimeout((()=>{ge.current&&(null==z||z(e),void 0===j&&ie(e))}),10))};(0,o.useEffect)((()=>{if(void 0===j)return()=>null;j&&ae(!0);const e=setTimeout((()=>{ie(j)}),10);return()=>{clearTimeout(e)}}),[j]),(0,o.useEffect)((()=>{if(oe!==ue.current)if(ee.current&&clearTimeout(ee.current),ue.current=oe,oe)null==L||L();else{const e=(e=>{const t=getComputedStyle(document.body).getPropertyValue("--rt-transition-show-delay").match(/^([\d.]+)(ms|s)$/);if(!t)return 0;const[,n,r]=t;return Number(n)*("ms"===r?1:1e3)})();ee.current=setTimeout((()=>{ae(!1),ce(null),null==I||I()}),e+25)}}),[oe]);const Le=e=>{ne((t=>_e(t,e)?t:e))},Ie=(e=g)=>{Z.current&&clearTimeout(Z.current),le?Pe(!0):Z.current=setTimeout((()=>{Pe(!0)}),e)},De=(e=b)=>{J.current&&clearTimeout(J.current),J.current=setTimeout((()=>{me.current||Pe(!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});g?Ie():Pe(!0),V(n),fe({current:n}),J.current&&clearTimeout(J.current)},Fe=()=>{_?De(b||100):b?De():Pe(!1),Z.current&&clearTimeout(Z.current)},je=({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})};be({place:null!==(n=null==se?void 0:se.place)&&void 0!==n?n:s,offset:c,elementReference:r,tooltipReference:G.current,tooltipArrowReference:Y.current,strategy:p,middlewares:h,border:W}).then((e=>{Le(e)}))},He=e=>{if(!e)return;const t=e,n={x:t.clientX,y:t.clientY};je(n),de.current=n},ze=e=>{var t;if(!oe)return;const n=e.target;n.isConnected&&((null===(t=G.current)||void 0===t?void 0:t.contains(n))||[document.querySelector(`[id='${l}']`),...he].some((e=>null==e?void 0:e.contains(n)))||(Pe(!1),Z.current&&clearTimeout(Z.current)))},Be=Ee(Me,50,!0),Ve=Ee(Fe,50,!0),We=e=>{Ve.cancel(),Be(e)},qe=()=>{Be.cancel(),Ve()},$e=(0,o.useCallback)((()=>{var e,t;const n=null!==(e=null==se?void 0:se.position)&&void 0!==e?e:P;n?je(n):w?de.current&&je(de.current):(null==B?void 0:B.isConnected)&&be({place:null!==(t=null==se?void 0:se.place)&&void 0!==t?t:s,offset:c,elementReference:B,tooltipReference:G.current,tooltipArrowReference:Y.current,strategy:p,middlewares:h,border:W}).then((e=>{ge.current&&Le(e)}))}),[oe,B,D,R,s,null==se?void 0:se.place,c,p,P,null==se?void 0:se.position,w]);(0,o.useEffect)((()=>{var e,t;const n=new Set(pe);he.forEach((e=>{n.add({current:e})}));const r=document.querySelector(`[id='${l}']`);r&&n.add({current:r});const o=()=>{Pe(!1)},i=Te(B),a=Te(G.current);Oe.scroll&&(window.addEventListener("scroll",o),null==i||i.addEventListener("scroll",o),null==a||a.addEventListener("scroll",o));let s=null;Oe.resize?window.addEventListener("resize",o):B&&G.current&&(s=function(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:s=!1}=r,c=Q(e),u=o||i?[...c?K(c):[],...K(t)]:[];u.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=c&&a?function(e,t){let n,r=null;const o=F(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function l(a,s){void 0===a&&(a=!1),void 0===s&&(s=1),i();const{left:c,top:u,width:d,height:p}=e.getBoundingClientRect();if(a||t(),!d||!p)return;const h={rootMargin:-v(u)+"px "+-v(o.clientWidth-(c+d))+"px "+-v(o.clientHeight-(u+p))+"px "+-v(c)+"px",threshold:m(0,f(1,s))||1};let y=!0;function g(e){const t=e[0].intersectionRatio;if(t!==s){if(!y)return l();t?l(!1,t):n=setTimeout((()=>{l(!1,1e-7)}),100)}y=!1}try{r=new IntersectionObserver(g,{...h,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(g,h)}r.observe(e)}(!0),i}(c,n):null;let p,h=-1,y=null;l&&(y=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&y&&(y.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame((()=>{var e;null==(e=y)||e.observe(t)}))),n()})),c&&!s&&y.observe(c),y.observe(t));let g=s?re(e):null;return s&&function t(){const r=re(e);!g||r.x===g.x&&r.y===g.y&&r.width===g.width&&r.height===g.height||n(),g=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=y)||e.disconnect(),y=null,s&&cancelAnimationFrame(p)}}(B,G.current,$e,{ancestorResize:!0,elementResize:!0,layoutShift:!0}));const c=e=>{"Escape"===e.key&&Pe(!1)};Oe.escape&&window.addEventListener("keydown",c),Oe.clickOutsideAnchor&&window.addEventListener("click",ze);const u=[],d=e=>{oe&&(null==e?void 0:e.target)===B||Me(e)},p=e=>{oe&&(null==e?void 0:e.target)===B&&Fe()},h=["mouseenter","mouseleave","focus","blur"],y=["click","dblclick","mousedown","mouseup"];Object.entries(Se).forEach((([e,t])=>{t&&(h.includes(e)?u.push({event:e,listener:We}):y.includes(e)&&u.push({event:e,listener:d}))})),Object.entries(Ae).forEach((([e,t])=>{t&&(h.includes(e)?u.push({event:e,listener:qe}):y.includes(e)&&u.push({event:e,listener:p}))})),w&&u.push({event:"pointermove",listener:He});const g=()=>{me.current=!0},b=()=>{me.current=!1,Fe()};return _&&!xe&&(null===(e=G.current)||void 0===e||e.addEventListener("mouseenter",g),null===(t=G.current)||void 0===t||t.addEventListener("mouseleave",b)),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;Oe.scroll&&(window.removeEventListener("scroll",o),null==i||i.removeEventListener("scroll",o),null==a||a.removeEventListener("scroll",o)),Oe.resize?window.removeEventListener("resize",o):null==s||s(),Oe.clickOutsideAnchor&&window.removeEventListener("click",ze),Oe.escape&&window.removeEventListener("keydown",c),_&&!xe&&(null===(e=G.current)||void 0===e||e.removeEventListener("mouseenter",g),null===(t=G.current)||void 0===t||t.removeEventListener("mouseleave",b)),u.forEach((({event:e,listener:t})=>{n.forEach((n=>{var r;null===(r=n.current)||void 0===r||r.removeEventListener(e,t)}))}))}}),[B,$e,le,pe,he,A,O,C,we,g,b]),(0,o.useEffect)((()=>{var e,n;let r=null!==(n=null!==(e=null==se?void 0:se.anchorSelect)&&void 0!==e?e:a)&&void 0!==n?n:"";!r&&t&&(r=`[data-tooltip-id='${t}']`);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(B){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,B))&&(ae(!1),Pe(!1),V(null),Z.current&&clearTimeout(Z.current),J.current&&clearTimeout(J.current),!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)&&ye((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,a,null==se?void 0:se.anchorSelect,B]),(0,o.useEffect)((()=>{$e()}),[$e]),(0,o.useEffect)((()=>{if(!(null==M?void 0:M.current))return()=>null;const e=new ResizeObserver((()=>{setTimeout((()=>$e()))}));return e.observe(M.current),()=>{e.disconnect()}}),[D,null==M?void 0:M.current]),(0,o.useEffect)((()=>{var e;const t=document.querySelector(`[id='${l}']`),n=[...he,t];B&&n.includes(B)||V(null!==(e=he[0])&&void 0!==e?e:t)}),[l,he,B]),(0,o.useEffect)((()=>(H&&Pe(!0),()=>{Z.current&&clearTimeout(Z.current),J.current&&clearTimeout(J.current)})),[]),(0,o.useEffect)((()=>{var e;let n=null!==(e=null==se?void 0:se.anchorSelect)&&void 0!==e?e:a;if(!n&&t&&(n=`[data-tooltip-id='${t}']`),n)try{const e=Array.from(document.querySelectorAll(n));ye(e)}catch(e){ye([])}}),[t,a,null==se?void 0:se.anchorSelect]),(0,o.useEffect)((()=>{Z.current&&(clearTimeout(Z.current),Ie(g))}),[g]);const Ue=null!==(X=null==se?void 0:se.content)&&void 0!==X?X:D,Xe=oe&&Object.keys(te.tooltipStyles).length>0;return(0,o.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)?Ie(e.delay):Pe(!0)},close:e=>{(null==e?void 0:e.delay)?De(e.delay):Pe(!1)},activeAnchor:B,place:te.place,isOpen:Boolean(le&&!E&&Ue&&Xe)}))),le&&!E&&Ue?o.createElement(y,{id:t,role:U,className:ve("react-tooltip",Ne.tooltip,Re.tooltip,Re[i],n,`react-tooltip__place-${te.place}`,Ne[Xe?"show":"closing"],Xe?"react-tooltip__show":"react-tooltip__closing","fixed"===p&&Ne.fixed,_&&Ne.clickable),onTransitionEnd:e=>{ee.current&&clearTimeout(ee.current),oe||"opacity"!==e.propertyName||(ae(!1),ce(null),null==I||I())},style:{...R,...te.tooltipStyles,opacity:void 0!==q&&Xe?q:void 0},ref:G},Ue,o.createElement(y,{className:ve("react-tooltip-arrow",Ne.arrow,Re.arrow,r,x&&Ne.noArrow),style:{...te.tooltipArrowStyles,background:$?`linear-gradient(to right bottom, transparent 50%, ${$} 50%)`:void 0},ref:Y})):null},Le=({content:e})=>o.createElement("span",{dangerouslySetInnerHTML:{__html:e}}),Ie=o.forwardRef((({id:e,anchorId:t,anchorSelect:n,content:r,html:i,render:l,className:a,classNameArrow:s,variant:c="dark",place:u="top",offset:d=10,wrapper:p="div",children:f=null,events:m=["hover"],openOnClick:h=!1,positionStrategy:v="absolute",middlewares:y,delayShow:g=0,delayHide:b=0,float:w=!1,hidden:E=!1,noArrow:x=!1,clickable:_=!1,closeOnEsc:S=!1,closeOnScroll:T=!1,closeOnResize:k=!1,openEvents:A,closeEvents:O,globalCloseEvents:C,imperativeModeOnly:N=!1,style:R,position:P,isOpen:L,defaultIsOpen:I=!1,disableStyleInjection:D=!1,border:M,opacity:F,arrowColor:j,setIsOpen:H,afterShow:z,afterHide:B,role:V="tooltip"},W)=>{const[q,$]=(0,o.useState)(r),[U,X]=(0,o.useState)(i),[G,Y]=(0,o.useState)(u),[Z,K]=(0,o.useState)(c),[J,Q]=(0,o.useState)(d),[ee,te]=(0,o.useState)(g),[ne,re]=(0,o.useState)(b),[oe,ie]=(0,o.useState)(w),[le,ae]=(0,o.useState)(E),[se,ce]=(0,o.useState)(p),[ue,de]=(0,o.useState)(m),[pe,fe]=(0,o.useState)(v),[me,he]=(0,o.useState)(null),[ye,ge]=(0,o.useState)(null),be=(0,o.useRef)(D),{anchorRefs:Ee,activeAnchor:xe}=Ce(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:u)},content:e=>{$(null!=e?e:r)},html:e=>{X(null!=e?e:i)},variant:e=>{var t;K(null!==(t=e)&&void 0!==t?t:c)},offset:e=>{Q(null===e?d:Number(e))},wrapper:e=>{var t;ce(null!==(t=e)&&void 0!==t?t:p)},events:e=>{const t=null==e?void 0:e.split(" ");de(null!=t?t:m)},"position-strategy":e=>{var t;fe(null!==(t=e)&&void 0!==t?t:v)},"delay-show":e=>{te(null===e?g:Number(e))},"delay-hide":e=>{re(null===e?b:Number(e))},float:e=>{ie(null===e?w:"true"===e)},hidden:e=>{ae(null===e?E:"true"===e)},"class-name":e=>{he(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,o.useEffect)((()=>{$(r)}),[r]),(0,o.useEffect)((()=>{X(i)}),[i]),(0,o.useEffect)((()=>{Y(u)}),[u]),(0,o.useEffect)((()=>{K(c)}),[c]),(0,o.useEffect)((()=>{Q(d)}),[d]),(0,o.useEffect)((()=>{te(g)}),[g]),(0,o.useEffect)((()=>{re(b)}),[b]),(0,o.useEffect)((()=>{ie(w)}),[w]),(0,o.useEffect)((()=>{ae(E)}),[E]),(0,o.useEffect)((()=>{fe(v)}),[v]),(0,o.useEffect)((()=>{be.current!==D&&console.warn("[react-tooltip] Do not change `disableStyleInjection` dynamically.")}),[D]),(0,o.useEffect)((()=>{"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent("react-tooltip-inject-styles",{detail:{disableCore:"core"===D,disableBase:D}}))}),[]),(0,o.useEffect)((()=>{var r;const o=new Set(Ee);let i=n;if(!i&&e&&(i=`[data-tooltip-id='${e}']`),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 a=null!==(r=null!=ye?ye:l)&&void 0!==r?r:xe.current,s=new MutationObserver((e=>{e.forEach((e=>{var t;if(!a||"attributes"!==e.type||!(null===(t=e.attributeName)||void 0===t?void 0:t.startsWith("data-tooltip-")))return;const n=_e(a);Se(n)}))})),c={attributes:!0,childList:!1,subtree:!1};if(a){const e=_e(a);Se(e),s.observe(a,c)}return()=>{s.disconnect()}}),[Ee,xe,ye,t,n]),(0,o.useEffect)((()=>{(null==R?void 0:R.border)&&console.warn("[react-tooltip] Do not set `style.border`. Use `border` prop instead."),M&&!we("border",`${M}`)&&console.warn(`[react-tooltip] "${M}" is not a valid \`border\`.`),(null==R?void 0:R.opacity)&&console.warn("[react-tooltip] Do not set `style.opacity`. Use `opacity` prop instead."),F&&!we("opacity",`${F}`)&&console.warn(`[react-tooltip] "${F}" is not a valid \`opacity\`.`)}),[]);let Te=f;const ke=(0,o.useRef)(null);if(l){const e=l({content:(null==ye?void 0:ye.getAttribute("data-tooltip-content"))||q||null,activeAnchor:ye});Te=e?o.createElement("div",{ref:ke,className:"react-tooltip-content-wrapper"},e):null}else q&&(Te=q);U&&(Te=o.createElement(Le,{content:U}));const Ae={forwardRef:W,id:e,anchorId:t,anchorSelect:n,className:ve(a,me),classNameArrow:s,content:Te,contentWrapperRef:ke,place:G,variant:Z,offset:J,wrapper:se,events:ue,openOnClick:h,positionStrategy:pe,middlewares:y,delayShow:ee,delayHide:ne,float:oe,hidden:le,noArrow:x,clickable:_,closeOnEsc:S,closeOnScroll:T,closeOnResize:k,openEvents:A,closeEvents:O,globalCloseEvents:C,imperativeModeOnly:N,style:R,position:P,isOpen:L,defaultIsOpen:I,border:M,opacity:F,arrowColor:j,setIsOpen:H,afterShow:z,afterHide:B,activeAnchor:ye,setActiveAnchor:e=>ge(e),role:V};return o.createElement(Pe,{...Ae})}));"undefined"!=typeof window&&window.addEventListener("react-tooltip-inject-styles",(e=>{e.detail.disableCore||ge({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||ge({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 De=(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)}},Me=(e,t="")=>{for(const[n,r]of Object.entries(e)){let e=n;t&&(e+="_"+String(t)),addEventListener(e,(e=>{r(e.detail)}),!1)}},Fe=({onlineEventLinkDefault:e=""})=>{const t=(0,i.__)("Online event","gatherpress"),[n,r]=(0,c.useState)(e);return Me({setOnlineEventLink:r},d("eventDetails.postId")),(0,o.createElement)(a.Flex,{justify:"normal",gap:"3"},(0,o.createElement)(a.FlexItem,{display:"flex"},(0,o.createElement)(a.Icon,{icon:"video-alt2"})),(0,o.createElement)(a.FlexItem,null,!n&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)("span",{tabIndex:"0",className:"gp-tooltip","data-tooltip-id":"gp-online-event-tooltip","data-tooltip-content":(0,i.__)("Link active for attendees during event.","gatherpress")},t),(0,o.createElement)(Ie,{id:"gp-online-event-tooltip"})),n&&(0,o.createElement)("a",{href:n,rel:"noreferrer",target:"_blank"},t)))};var je=n(442);const He=je.default||je,ze=({name:e,fullAddress:t,phoneNumber:n,website:r})=>(0,o.createElement)(o.Fragment,null,(e||t)&&(0,o.createElement)(a.Flex,{justify:"normal",align:"flex-start",gap:"4"},(0,o.createElement)(a.FlexItem,{display:"flex",className:"gp-venue__icon"},(0,o.createElement)(a.Icon,{icon:"location"})),(0,o.createElement)(a.FlexItem,null,e&&(0,o.createElement)("div",{className:"gp-venue__name"},(0,o.createElement)("strong",null,He(e))),t&&(0,o.createElement)("div",{className:"gp-venue__full-address"},He(t)))),(n||r)&&(0,o.createElement)(a.Flex,{justify:"normal",gap:"8"},n&&(0,o.createElement)(a.FlexItem,null,(0,o.createElement)(a.Flex,{justify:"normal",gap:"4"},(0,o.createElement)(a.FlexItem,{display:"flex",className:"gp-venue__icon"},(0,o.createElement)(a.Icon,{icon:"phone"})),(0,o.createElement)(a.FlexItem,null,(0,o.createElement)("div",{className:"gp-venue__phone-number"},n)))),r&&(0,o.createElement)(a.FlexItem,null,(0,o.createElement)(a.Flex,{justify:"normal",gap:"4"},(0,o.createElement)(a.FlexItem,{display:"flex",className:"gp-venue__icon"},(0,o.createElement)(a.Icon,{icon:"admin-site-alt3"})),(0,o.createElement)(a.FlexItem,null,(0,o.createElement)("div",{className:"gp-venue__website"},(0,o.createElement)("a",{href:r,target:"_blank",rel:"noreferrer noopener"},r))))))),Be=({name:e="",fullAddress:t,phoneNumber:n,website:r,isOnlineEventTerm:i=!1,onlineEventLink:l=""})=>(0,o.createElement)(o.Fragment,null,!i&&(0,o.createElement)(ze,{name:e,fullAddress:t,phoneNumber:n,website:r}),i&&(0,o.createElement)(Fe,{onlineEventLinkDefault:l})),Ve=e=>{const{isSelected:t}=e,n=t?"none":"block";return(0,o.createElement)("div",{style:{position:"relative"}},e.children,(0,o.createElement)("div",{style:{position:"absolute",top:"0",right:"0",bottom:"0",left:"0",display:n}}))};function We(){return"gp_venue"===(0,s.select)("core/editor")?.getCurrentPostType()}const qe=()=>{const[e,t]=(0,c.useState)(""),[n,r]=(0,c.useState)(""),[l,u]=(0,c.useState)(""),[d,p]=(0,c.useState)(""),[f,m]=(0,c.useState)(!1),[h,v]=(0,c.useState)(""),y=(0,s.useDispatch)("core/editor").editPost,{unlockPostSaving:g}=(0,s.useDispatch)("core/editor"),b=(0,s.useSelect)((e=>e("core/editor").getEditedPostAttribute("_gp_venue"))),w=(0,s.useSelect)((e=>e("core").getEntityRecord("taxonomy","_gp_venue",b))),E=w?.slug.replace(/^_/,""),[x,_]=(0,c.useState)(""),S=b+":"+x,T=(0,s.useSelect)((e=>e("core").getEntityRecords("postType","gp_venue",{per_page:1,slug:x})));(0,c.useEffect)((()=>{var e,n,o,l;let a={};if(x&&Array.isArray(T)){var s;const e=null!==(s=T[0]?.meta?.venue_information)&&void 0!==s?s:"{}";var c;e&&(a=JSON.parse(e),a.name=null!==(c=T[0]?.title.rendered)&&void 0!==c?c:"")}const d=null!==(e=a?.name)&&void 0!==e?e:(0,i.__)("No venue selected.","gatherpress"),f=null!==(n=a?.fullAddress)&&void 0!==n?n:"",m=null!==(o=a?.phoneNumber)&&void 0!==o?o:"",h=null!==(l=a?.website)&&void 0!==l?l:"";E&&_(E),v(S?String(S):""),t(d),r(f),u(m),p(h),De({setName:d,setFullAddress:f,setPhoneNumber:m,setWebsite:h,setIsOnlineEventTerm:"online-event"===x})}),[x,T,E,S]);let k=(0,s.useSelect)((e=>e("core").getEntityRecords("taxonomy","_gp_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,i.__)("Choose a venue","gatherpress")})):k=[],(0,o.createElement)(a.PanelRow,null,(0,o.createElement)(a.SelectControl,{label:(0,i.__)("Venue Selector","gatherpress"),value:h,onChange:e=>{(e=>{v(e);const t=""!==(e=e.split(":"))[0]?[e[0]]:[];y({_gp_venue:t}),_(e[1]),g()})(e)},options:k}))},$e=()=>{var e,t,n;const r=(0,s.useDispatch)("core/editor").editPost,l=(e,t)=>{const n=JSON.stringify({...u,[e]:t});r({meta:{venue_information:n}})};let u=(0,s.useSelect)((e=>e("core/editor").getEditedPostAttribute("meta").venue_information));u=u?JSON.parse(u):{};const[d,p]=(0,c.useState)(null!==(e=u.fullAddress)&&void 0!==e?e:""),[f,m]=(0,c.useState)(null!==(t=u.phoneNumber)&&void 0!==t?t:""),[h,v]=(0,c.useState)(null!==(n=u.website)&&void 0!==n?n:"");return Me({setFullAddress:p,setPhoneNumber:m,setWebsite:v}),(0,o.createElement)(o.Fragment,null,(0,o.createElement)(a.TextControl,{label:(0,i.__)("Full Address","gatherpress"),value:d,onChange:e=>{De({setFullAddress:e}),l("fullAddress",e)}}),(0,o.createElement)(a.TextControl,{label:(0,i.__)("Phone Number","gatherpress"),value:f,onChange:e=>{De({setPhoneNumber:e}),l("phoneNumber",e)}}),(0,o.createElement)(a.TextControl,{label:(0,i.__)("Website","gatherpress"),value:h,type:"url",onChange:e=>{De({setWebsite:e}),l("website",e)}}))},Ue=()=>(0,o.createElement)("section",null,(0,o.createElement)($e,null)),Xe=()=>{const{editPost:e,unlockPostSaving:t}=(0,s.useDispatch)("core/editor"),n=(0,s.useSelect)((e=>e("core/editor").getEditedPostAttribute("meta").online_event_link)),[r,l]=(0,c.useState)(n);return Me({setOnlineEventLink:l},d("eventDetails.postId")),(0,o.createElement)(a.TextControl,{label:(0,i.__)("Online event link","gatherpress"),value:r,placeholder:(0,i.__)("Add link to online event","gatherpress"),onChange:n=>{(n=>{e({meta:{online_event_link:n}}),l(n),De({setOnlineEventLink:n},d("eventDetails.postId")),t()})(n)}})},Ge=window.moment;var Ye=n.n(Ge);window.wp.apiFetch,window.wp.date;const Ze="YYYY-MM-DDTHH:mm:ss",Ke=Ye().tz(Je()).add(1,"day").set("hour",18).set("minute",0).set("second",0).format(Ze);function Je(e=d("eventDetails.dateTime.timezone")){return Ye().tz.zone(e)?e:(0,i.__)("GMT","gatherpress")}Ye().tz(Ke,Je()).add(2,"hours").format(Ze);const Qe=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"gatherpress/venue","version":"1.0.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","render":"file:./render.php"}');(0,r.registerBlockType)(Qe,{edit:({attributes:e,setAttributes:t,isSelected:n})=>{const{mapZoomLevel:r,mapType:d,mapHeight:f}=e,[m,h]=(0,c.useState)(""),[v,y]=(0,c.useState)(""),[g,b]=(0,c.useState)(""),[w,E]=(0,c.useState)(""),[x,_]=(0,c.useState)(!1),S=(0,l.useBlockProps)(),T=(0,s.useSelect)((e=>e("core/editor")?.getEditedPostAttribute("meta")?.online_event_link));let{mapShow:k}=e,A=(0,s.useSelect)((e=>e("core/editor")?.getEditedPostAttribute("meta")?.venue_information));return A=A?JSON.parse(A):{},k&&v&&(k=!0),k&&!u()&&(k=!0),Me({setName:h,setFullAddress:y,setPhoneNumber:b,setWebsite:E,setIsOnlineEventTerm:_}),(0,c.useEffect)((()=>{We()&&(y(A.fullAddress),b(A.phoneNumber),E(A.website),h(v||g||w?"":(0,i.__)("Add venue information.","gatherpress"))),"gp_event"!==(0,s.select)("core/editor").getCurrentPostType()&&u()||h(v||g||w?"":(0,i.__)("No venue selected.","gatherpress"))}),[A.fullAddress,A.phoneNumber,A.website,v,g,w]),(0,o.createElement)(o.Fragment,null,(0,o.createElement)(l.InspectorControls,null,u()&&(0,o.createElement)(a.PanelBody,{title:(0,i.__)("Venue settings","gatherpress"),initialOpen:!0},(0,o.createElement)(a.PanelRow,null,!We()&&(0,o.createElement)(qe,null),We()&&(0,o.createElement)(Ue,null)),x&&(0,o.createElement)(a.PanelRow,null,(0,o.createElement)(Xe,null))),!x&&(0,o.createElement)(a.PanelBody,{title:(0,i.__)("Map settings","gatherpress"),initialOpen:!0},(0,o.createElement)(a.PanelRow,null,(0,i.__)("Show map on venue","gatherpress")),(0,o.createElement)(a.PanelRow,null,(0,o.createElement)(a.ToggleControl,{label:k?(0,i.__)("Display the map","gatherpress"):(0,i.__)("Hide the map","gatherpress"),checked:k,onChange:e=>{t({mapShow:e})}})),(0,o.createElement)(a.RangeControl,{label:(0,i.__)("Zoom level","gatherpress"),beforeIcon:"search",value:r,onChange:e=>t({mapZoomLevel:e}),min:1,max:22}),(0,o.createElement)(a.RadioControl,{label:(0,i.__)("Map type","gatherpress"),selected:d,options:[{label:(0,i.__)("Roadmap","gatherpress"),value:"m"},{label:(0,i.__)("Satellite","gatherpress"),value:"k"}],onChange:e=>{t({mapType:e})}}),(0,o.createElement)(a.RangeControl,{label:(0,i.__)("Map height","gatherpress"),beforeIcon:"location",value:f,onChange:e=>t({mapHeight:e}),min:100,max:1e3}))),(0,o.createElement)("div",{...S},(0,o.createElement)(Ve,{isSelected:n},(0,o.createElement)("div",{className:"gp-venue"},(0,o.createElement)(Be,{name:m,fullAddress:v,phoneNumber:g,website:w,isOnlineEventTerm:x,onlineEventLink:T}),k&&(0,o.createElement)(p,{location:v,zoom:r,type:d,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 a={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},s=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=a),"object"==typeof e&&(t=e,e=void 0),this.callback=null!=e?e:null,this.options=null!=t?t:a,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=s,t.default=s},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}(a);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 m=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=m;var h=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 v(e){return(0,l.isTag)(e)}function y(e){return e.type===l.ElementType.CDATA}function g(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 E(e){return e.type===l.ElementType.Root}function x(e,t){var n;if(void 0===t&&(t=!1),g(e))n=new c(e.data);else if(b(e))n=new u(e.data);else if(v(e)){var r=t?_(e.children):[],o=new h(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(y(e)){r=t?_(e.children):[];var l=new f(r);r.forEach((function(e){return e.parent=l})),n=l}else if(E(e)){r=t?_(e.children):[];var a=new m(r);r.forEach((function(e){return e.parent=a})),e["x-mode"]&&(a["x-mode"]=e["x-mode"]),n=a}else{if(!w(e))throw new Error("Not implemented yet: ".concat(e.type));var s=new d(e.name,e.data);null!=e["x-name"]&&(s["x-name"]=e["x-name"],s["x-publicId"]=e["x-publicId"],s["x-systemId"]=e["x-systemId"]),n=s}return n.startIndex=e.startIndex,n.endIndex=e.endIndex,null!=e.sourceCodeLocation&&(n.sourceCodeLocation=e.sourceCodeLocation),n}function _(e){for(var t=e.map((function(e){return x(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});var n="html",r="head",o="body",i=/<([a-zA-Z]+[0-9]?)/,l=//i,a=//i,s=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;s=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();s=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,m="object"==typeof document&&document.createElement("template");m&&m.content&&(f=function(e){return m.innerHTML=e,m.content.childNodes}),t.default=function(e){var t,u,d=e.match(i),p=d&&d[1]?d[1].toLowerCase():"";switch(p){case n:var m=c(e);return l.test(e)||null===(t=null==(v=m.querySelector(r))?void 0:v.parentNode)||void 0===t||t.removeChild(v),a.test(e)||null===(u=null==(v=m.querySelector(o))?void 0:v.parentNode)||void 0===u||u.removeChild(v),m.querySelectorAll(n);case r:case o:var h=s(e).querySelectorAll(p);return a.test(e)&&l.test(e)?h[0].parentNode.childNodes:h;default:return f?f(e):(v=s(e,o).querySelector(o)).childNodes;var v}}},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});var o=r(n(5496)),i=n(7731),l=/<(![a-zA-Z\s]+)>/;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)}},7731:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatDOM=t.formatAttributes=void 0;var r=n(1141),o=n(5270);function i(e){for(var t={},n=0,r=e.length;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4210),o=n(4958),i=["checked","value"],l=["input","select","textarea"],a={reset:!0,submit:!0};function s(e){return r.possibleStandardNames[e]}t.default=function(e,t){void 0===e&&(e={});var n={},c=Boolean(e.type&&a[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=s(p);if(f){var m=(0,r.getPropertyInfo)(f);switch(i.includes(f)&&l.includes(t)&&!c&&(f=s("default"+p)),n[f]=d,m&&m.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}},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});var o=n(1609),i=r(n(840)),l=n(4958),a={cloneElement:o.cloneElement,createElement:o.createElement,isValidElement:o.isValidElement};function s(e){return l.PRESERVE_CUSTOM_ATTRIBUTES&&"tag"===e.type&&(0,l.isCustomComponent)(e.name,e.attribs)}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||a,d=u.cloneElement,p=u.createElement,f=u.isValidElement,m=t.length,h=0;h1&&(y=d(y,{key:y.key||h})),r.push(c(y,v,h));continue}}if("text"!==v.type){var g=v,b={};s(g)?((0,l.setStyleProp)(g.attribs.style,g.attribs),b=g.attribs):g.attribs&&(b=(0,i.default)(g.attribs,g.name));var w=void 0;switch(v.type){case"script":case"style":v.children[0]&&(b.dangerouslySetInnerHTML={__html:v.children[0].data});break;case"tag":"textarea"===v.name&&v.children[0]?b.defaultValue=v.children[0].data:v.children&&v.children.length&&(w=e(v.children,n));break;default:continue}m>1&&(b.key=h),r.push(c(p(v.name,b,w),v,h))}else{var E=!v.data.trim().length;if(E&&v.parent&&!(0,l.canTextBeChildOfNode)(v.parent))continue;if(n.trim&&E)continue;r.push(c(v.data,v,h))}}return 1===r.length?r[0]:r}},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;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 a=n(1141);Object.defineProperty(t,"Comment",{enumerable:!0,get:function(){return a.Comment}}),Object.defineProperty(t,"Element",{enumerable:!0,get:function(){return a.Element}}),Object.defineProperty(t,"ProcessingInstruction",{enumerable:!0,get:function(){return a.ProcessingInstruction}}),Object.defineProperty(t,"Text",{enumerable:!0,get:function(){return a.Text}});var s={lowerCaseAttributeNames:!1};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)||s),t):[]}},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=t.setStyleProp=t.isCustomComponent=void 0;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"]);t.isCustomComponent=function(e,t){return e.includes("-")?!l.has(e):Boolean(t&&"string"==typeof t.is)};var a={reactCompat:!0};t.setStyleProp=function(e,t){if("string"==typeof e)if(e.trim())try{t.style=(0,i.default)(e,a)}catch(e){t.style={}}else t.style={}},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=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,s=/^\s+|\s+$/g,c="";function u(e){return e?e.replace(s,c):c}e.exports=function(e,s){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];s=s||{};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 m(){var e={line:d,column:p};return function(t){return t.position=new h(e),b(),t}}function h(e){this.start=e,this.end={line:d,column:p},this.source=s.source}h.prototype.content=e;var v=[];function y(t){var n=new Error(s.source+":"+d+":"+p+": "+t);if(n.reason=t,n.filename=s.source,n.line=d,n.column=p,n.source=e,!s.silent)throw n;v.push(n)}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function b(){g(r)}function w(e){var t;for(e=e||[];t=E();)!1!==t&&e.push(t);return e}function E(){var t=m();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 y("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 x(){var e=m(),n=g(o);if(n){if(E(),!g(i))return y("property missing ':'");var r=g(l),s=e({type:"declaration",property:u(n[0].replace(t,c)),value:r?u(r[0].replace(t,c)):c});return g(a),s}}return b(),function(){var e,t=[];for(w(t);e=x();)!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:a,SAME:s,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===s?e[t]=t:n===a?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}};Object.defineProperty(t,"__esModule",{value:!0});var o=r(n(1133)),i=n(8917);t.default=function(e,t){var n={};return e&&"string"==typeof e?((0,o.default)(e,(function(e,r){e&&r&&(n[(0,i.camelCase)(e,t)]=r)})),n):n}},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)-/,a=function(e,t){return t.toUpperCase()},s=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,s):e.replace(i,s)).replace(r,a))}},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 l=1/0;for(u=0;u=i)&&Object.keys(r.O).every((e=>r.O[e](n[s])))?n.splice(s--,1):(a=!1,i0&&e[u-1][2]>i;u--)e[u]=e[u-1];e[u]=[n,o,i]},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={908:0,812:0};r.O.j=t=>0===e[t];var t=(t,n)=>{var o,i,[l,a,s]=n,c=0;if(l.some((t=>0!==e[t]))){for(o in a)r.o(a,o)&&(r.m[o]=a[o]);if(s)var u=s(r)}for(t&&t(n);cr(2041)));o=r.O(o)})(); \ No newline at end of file diff --git a/build/editor.asset.php b/build/editor.asset.php index cb85ed410..6a6945da2 100644 --- a/build/editor.asset.php +++ b/build/editor.asset.php @@ -1 +1 @@ - array('moment', 'wp-api-fetch', 'wp-data', 'wp-dom-ready', 'wp-i18n'), 'version' => 'c6fce8fab64b6d9302cf'); + array('moment', 'react', 'wp-api-fetch', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-element', 'wp-i18n'), 'version' => '7e8c2e7c749537bad7ef'); diff --git a/build/editor.js b/build/editor.js index 1b2ed0d15..26828c010 100644 --- a/build/editor.js +++ b/build/editor.js @@ -1 +1 @@ -(()=>{"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 o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.domReady;var n=e.n(t);const o=window.wp.data,s=window.moment;var r=e.n(s);const i=window.wp.i18n;function a(e){if("object"==typeof GatherPress)return e.split(".").reduce(((e,t)=>e&&e[t]),GatherPress)}window.wp.apiFetch;const d="YYYY-MM-DDTHH:mm:ss",c=r().tz(p()).add(1,"day").set("hour",18).set("minute",0).set("second",0).format(d);function p(e=a("eventDetails.dateTime.timezone")){return r().tz.zone(e)?e:(0,i.__)("GMT","gatherpress")}r().tz(c,p()).add(2,"hours").format(d),n()((()=>{const e=(0,o.select)("core/edit-post");if(!e)return;const t=(0,o.dispatch)("core/edit-post");e.isEditorSidebarOpened()?(t.openGeneralSidebar("edit-post/document"),t.toggleEditorPanelOpened("gp-event-settings/gp-event-settings")):(t.openGeneralSidebar(),t.toggleEditorPanelOpened("gp-event-settings/gp-event-settings")),function(){const e="gp_event_past",t=(0,o.dispatch)("core/notices");t.removeNotice(e),function(){const e=r().tz(a("eventDetails.dateTime.datetime_end"),p());return"gp_event"===(0,o.select)("core/editor")?.getCurrentPostType()&&r().tz(p()).valueOf()>e.valueOf()}()&&t.createNotice("warning",(0,i.__)("This event has already past.","gatherpress"),{id:e,isDismissible:!1})}()}))})(); \ No newline at end of file +(()=>{"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 o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.domReady;var n=e.n(t);const o=window.wp.data,s=window.moment;var r=e.n(s);const i=window.wp.i18n;function a(e){if("object"==typeof GatherPress)return e.split(".").reduce(((e,t)=>e&&e[t]),GatherPress)}window.React,window.wp.apiFetch,window.wp.element,window.wp.date;const d="YYYY-MM-DDTHH:mm:ss",c=r().tz(p()).add(1,"day").set("hour",18).set("minute",0).set("second",0).format(d);function p(e=a("eventDetails.dateTime.timezone")){return r().tz.zone(e)?e:(0,i.__)("GMT","gatherpress")}r().tz(c,p()).add(2,"hours").format(d),n()((()=>{const e=(0,o.select)("core/edit-post");if(!e)return;const t=(0,o.dispatch)("core/edit-post");e.isEditorSidebarOpened()?(t.openGeneralSidebar("edit-post/document"),t.toggleEditorPanelOpened("gp-event-settings/gp-event-settings")):(t.openGeneralSidebar(),t.toggleEditorPanelOpened("gp-event-settings/gp-event-settings")),function(){const e="gp_event_past",t=(0,o.dispatch)("core/notices");t.removeNotice(e),function(){const e=r().tz(a("eventDetails.dateTime.datetime_end"),p());return"gp_event"===(0,o.select)("core/editor")?.getCurrentPostType()&&r().tz(p()).valueOf()>e.valueOf()}()&&t.createNotice("warning",(0,i.__)("This event has already past.","gatherpress"),{id:e,isDismissible:!1})}()}))})(); \ No newline at end of file diff --git a/build/panels.asset.php b/build/panels.asset.php index 78348fe8d..2e2d1dba9 100644 --- a/build/panels.asset.php +++ b/build/panels.asset.php @@ -1 +1 @@ - array('moment', 'react', 'wp-api-fetch', 'wp-components', 'wp-data', 'wp-date', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-plugins'), 'version' => '6d392ba00e9ef6095b1e'); + array('moment', 'react', 'wp-api-fetch', 'wp-components', 'wp-data', 'wp-date', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-plugins'), 'version' => 'd229da52d79c1c04a937'); diff --git a/build/panels.js b/build/panels.js index 832413dec..3cefea893 100644 --- a/build/panels.js +++ b/build/panels.js @@ -1 +1 @@ -(()=>{"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 a in n)e.o(n,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:n[a]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.React,n=window.wp.i18n,a=window.wp.data,r=window.wp.components,s=window.wp.plugins,o=window.wp.editPost,i=window.moment;var l=e.n(i);const c=window.wp.apiFetch;var m=e.n(c);function u(){(0,a.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 p(e,t){if("object"!=typeof GatherPress)return;const n=e.split("."),a=n.pop();n.reduce(((e,t)=>{var n;return null!==(n=e[t])&&void 0!==n?n:e[t]={}}),GatherPress)[a]=t}const g="YYYY-MM-DDTHH:mm:ss",v="YYYY-MM-DD HH:mm:ss",_=l().tz(f()).add(1,"day").set("hour",18).set("minute",0).set("second",0).format(g),E=l().tz(_,f()).add(2,"hours").format(g);function h(){return P(d("settings.dateFormat"))+" "+P(d("settings.timeFormat"))}function f(e=d("eventDetails.dateTime.timezone")){return l().tz.zone(e)?e:(0,n.__)("GMT","gatherpress")}function S(e=""){const t=/^([+-])(\d{2}):(00|15|30|45)$/,n=e.replace(t,"$1");return n!==e?"UTC"+n+parseInt(e.replace(t,"$2")).toString()+e.replace(t,"$3").replace("00","").replace("15",".25").replace("30",".5").replace("45",".75"):e}function T(e,t=null){!function(e){const t=l().tz(d("eventDetails.dateTime.datetime_end"),f()).valueOf(),n=l().tz(e,f()).valueOf();n>=t&&b(l().tz(n,f()).add(2,"hours").format(g))}(e),p("eventDetails.dateTime.datetime_start",e),"function"==typeof t&&t(e),u()}function b(e,t=null){!function(e){const t=l().tz(d("eventDetails.dateTime.datetime_start"),f()).valueOf(),n=l().tz(e,f()).valueOf();n<=t&&T(l().tz(n,f()).subtract(2,"hours").format(g))}(e),p("eventDetails.dateTime.datetime_end",e),null!==t&&t(e),u()}function D(){const e=(0,a.select)("core/editor").isSavingPost(),t=(0,a.select)("core/editor").isAutosavingPost();z()&&e&&!t&&m()({path:d("urls.eventRestApi")+"/datetime",method:"POST",data:{post_id:d("eventDetails.postId"),datetime_start:l().tz(d("eventDetails.dateTime.datetime_start"),f()).format(v),datetime_end:l().tz(d("eventDetails.dateTime.datetime_end"),f()).format(v),timezone:d("eventDetails.dateTime.timezone"),_wpnonce:d("misc.nonce")}}).then((()=>{!function(){const e="gp_event_communcation",t=(0,a.dispatch)("core/notices");t.removeNotice(e),"publish"!==(0,a.select)("core/editor").getEditedPostAttribute("status")||y()||t.createNotice("success",(0,n.__)("Send an event update to members via email?","gatherpress"),{id:e,isDismissible:!0,actions:[{onClick:()=>{w({setOpen:!0})},label:(0,n.__)("Compose Message","gatherpress")}]})}()}))}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=>e in t?t[e]:e)).join("")}const w=(e,t="")=>{for(const[n,a]of Object.entries(e)){let e=n;t&&(e+="_"+String(t));const r=new CustomEvent(e,{detail:a});dispatchEvent(r)}},C=(e,t="")=>{for(const[n,a]of Object.entries(e)){let e=n;t&&(e+="_"+String(t)),addEventListener(e,(e=>{a(e.detail)}),!1)}};function z(){return"gp_event"===(0,a.select)("core/editor").getCurrentPostType()}function y(){const e=l().tz(d("eventDetails.dateTime.datetime_end"),f());return"gp_event"===(0,a.select)("core/editor")?.getCurrentPostType()&&l().tz(f()).valueOf()>e.valueOf()}function O(){const e="gp_event_past",t=(0,a.dispatch)("core/notices");t.removeNotice(e),y()&&t.createNotice("warning",(0,n.__)("This event has already past.","gatherpress"),{id:e,isDismissible:!1})}const k=window.wp.element,A=()=>{const{editPost:e,unlockPostSaving:s}=(0,a.useDispatch)("core/editor"),o=(0,a.useSelect)((e=>e("core/editor").isCleanNewPost()),[]);let i=(0,a.useSelect)((e=>e("core/editor").getEditedPostAttribute("meta").enable_anonymous_rsvp),[]);o&&(i=d("settings.enableAnonymousRsvp"));const[l,c]=(0,k.useState)(i);return(0,t.createElement)(r.CheckboxControl,{label:(0,n.__)("Enable Anonymous RSVP","gatherpress"),checked:l,onChange:t=>{(t=>{const n={enable_anonymous_rsvp:Number(t)};c(t),e({meta:n}),s()})(t)}})},N=()=>(0,t.createElement)("section",null,(0,t.createElement)(A,null)),x=window.wp.date,M=e=>{const{dateTimeStart:t}=e;return l().tz(t,f()).format(h())},Y=e=>{const{dateTimeEnd:t}=e;return l().tz(t,f()).format(h())},F=e=>{const{dateTimeStart:n,setDateTimeStart:a}=e,s=(0,x.getSettings)(),o=/a(?!\\)/i.test(s.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return(0,t.createElement)(r.DateTimePicker,{currentDate:n,onChange:e=>T(e,a),is12Hour:o})},j=e=>{const{dateTimeEnd:n,setDateTimeEnd:a}=e,s=(0,x.getSettings)(),o=/a(?!\\)/i.test(s.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return(0,t.createElement)(r.DateTimePicker,{currentDate:n,onChange:e=>b(e,a),is12Hour:o})},R=e=>{const{dateTimeStart:a,setDateTimeStart:s}=e;return(0,k.useEffect)((()=>{s(l().tz(function(){let e=d("eventDetails.dateTime.datetime_start");return e=""!==e?l().tz(e,f()).format(g):_,p("eventDetails.dateTime.datetime_start",e),e}(),f()).format(g)),w({setDateTimeStart:a}),O()})),(0,t.createElement)(r.PanelRow,null,(0,t.createElement)(r.Flex,{direction:"column",gap:"0"},(0,t.createElement)(r.FlexItem,null,(0,t.createElement)("label",{htmlFor:"gp-datetime-start"},(0,n.__)("Start","gatherpress"))),(0,t.createElement)(r.FlexItem,null,(0,t.createElement)(r.Dropdown,{popoverProps:{placement:"bottom-end"},renderToggle:({isOpen:e,onToggle:n})=>(0,t.createElement)(r.Button,{id:"gp-datetime-start",onClick:n,"aria-expanded":e,isLink:!0},(0,t.createElement)(M,{dateTimeStart:a})),renderContent:()=>(0,t.createElement)(F,{dateTimeStart:a,setDateTimeStart:s})}))))},H=e=>{const{dateTimeEnd:a,setDateTimeEnd:s}=e;return(0,k.useEffect)((()=>{s(l().tz(function(){let e=d("eventDetails.dateTime.datetime_end");return e=""!==e?l().tz(e,f()).format(g):E,p("eventDetails.dateTime.datetime_end",e),e}(),f()).format(g)),w({setDateTimeEnd:a}),O()})),(0,t.createElement)(r.PanelRow,null,(0,t.createElement)(r.Flex,{direction:"column",gap:"0"},(0,t.createElement)(r.FlexItem,null,(0,t.createElement)("label",{htmlFor:"gp-datetime-end"},(0,n.__)("End","gatherpress"))),(0,t.createElement)(r.FlexItem,null,(0,t.createElement)(r.Dropdown,{popoverProps:{placement:"bottom-end"},renderToggle:({isOpen:e,onToggle:n})=>(0,t.createElement)(r.Button,{id:"gp-datetime-end",onClick:n,"aria-expanded":e,isLink:!0},(0,t.createElement)(Y,{dateTimeEnd:a})),renderContent:()=>(0,t.createElement)(j,{dateTimeEnd:a,setDateTimeEnd:s})}))))},I=e=>{const{timezone:a,setTimezone:s}=e,o=d("misc.timezoneChoices");return(0,k.useEffect)((()=>{s(d("eventDetails.dateTime.timezone"))}),[s]),(0,k.useEffect)((()=>{w({setTimezone:d("eventDetails.dateTime.timezone")})})),(0,t.createElement)(r.PanelRow,null,(0,t.createElement)(r.SelectControl,{label:(0,n.__)("Time Zone","gatherpress"),value:S(a),onChange:e=>{e=function(e=""){const t=/^UTC([+-])(\d+)(.\d+)?$/,n=e.replace(t,"$1");if(n!==e){const a=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"),n+a+r}return e}(e),s(e),p("eventDetails.dateTime.timezone",e),u()}},Object.keys(o).map((e=>(0,t.createElement)("optgroup",{key:e,label:e},Object.keys(o[e]).map((n=>(0,t.createElement)("option",{key:n,value:n},o[e][n]))))))))},L=()=>{const[e,r]=(0,k.useState)(),[s,o]=(0,k.useState)(),[i,l]=(0,k.useState)();return(0,a.subscribe)(D),(0,t.createElement)(t.Fragment,null,(0,t.createElement)("h3",null,(0,n.__)("Date & time","gatherpress")),(0,t.createElement)(R,{dateTimeStart:e,setDateTimeStart:r}),(0,t.createElement)(H,{dateTimeEnd:s,setDateTimeEnd:o}),(0,t.createElement)(I,{timezone:i,setTimezone:l}))},$=()=>(0,t.createElement)("section",null,(0,t.createElement)(L,null)),G=()=>"publish"===(0,a.select)("core/editor").getEditedPostAttribute("status")&&!y()&&(0,t.createElement)("section",null,(0,t.createElement)("h3",{style:{marginBottom:"0.5rem"}},(0,n.__)("Send an event update","gatherpress")),(0,t.createElement)(r.Button,{variant:"secondary",onClick:()=>w({setOpen:!0})},(0,n.__)("Compose Message","gatherpress"))),W=()=>{const{editPost:e,unlockPostSaving:s}=(0,a.useDispatch)("core/editor"),o=(0,a.useSelect)((e=>e("core/editor").getEditedPostAttribute("meta").online_event_link)),[i,l]=(0,k.useState)(o);return C({setOnlineEventLink:l},d("eventDetails.postId")),(0,t.createElement)(r.TextControl,{label:(0,n.__)("Online event link","gatherpress"),value:i,placeholder:(0,n.__)("Add link to online event","gatherpress"),onChange:t=>{(t=>{e({meta:{online_event_link:t}}),l(t),w({setOnlineEventLink:t},d("eventDetails.postId")),s()})(t)}})},B=()=>(0,t.createElement)("section",null,(0,t.createElement)(W,null)),V=()=>{const[e,s]=(0,k.useState)(""),[o,i]=(0,k.useState)(""),[l,c]=(0,k.useState)(""),[m,u]=(0,k.useState)(""),[d,p]=(0,k.useState)(!1),[g,v]=(0,k.useState)(""),_=(0,a.useDispatch)("core/editor").editPost,{unlockPostSaving:E}=(0,a.useDispatch)("core/editor"),h=(0,a.useSelect)((e=>e("core/editor").getEditedPostAttribute("_gp_venue"))),f=(0,a.useSelect)((e=>e("core").getEntityRecord("taxonomy","_gp_venue",h))),S=f?.slug.replace(/^_/,""),[T,b]=(0,k.useState)(""),D=h+":"+T,P=(0,a.useSelect)((e=>e("core").getEntityRecords("postType","gp_venue",{per_page:1,slug:T})));(0,k.useEffect)((()=>{var e,t,a,r;let o={};if(T&&Array.isArray(P)){var l;const e=null!==(l=P[0]?.meta?.venue_information)&&void 0!==l?l:"{}";var m;e&&(o=JSON.parse(e),o.name=null!==(m=P[0]?.title.rendered)&&void 0!==m?m:"")}const d=null!==(e=o?.name)&&void 0!==e?e:(0,n.__)("No venue selected.","gatherpress"),p=null!==(t=o?.fullAddress)&&void 0!==t?t:"",g=null!==(a=o?.phoneNumber)&&void 0!==a?a:"",_=null!==(r=o?.website)&&void 0!==r?r:"";S&&b(S),v(D?String(D):""),s(d),i(p),c(g),u(_),w({setName:d,setFullAddress:p,setPhoneNumber:g,setWebsite:_,setIsOnlineEventTerm:"online-event"===T})}),[T,P,S,D]);let C=(0,a.useSelect)((e=>e("core").getEntityRecords("taxonomy","_gp_venue",{per_page:-1,context:"view"})),[]);return C?(C=C.map((e=>({label:e.name,value:e.id+":"+e.slug.replace(/^_/,"")}))),C.unshift({value:":",label:(0,n.__)("Choose a venue","gatherpress")})):C=[],(0,t.createElement)(r.PanelRow,null,(0,t.createElement)(r.SelectControl,{label:(0,n.__)("Venue Selector","gatherpress"),value:g,onChange:e=>{(e=>{v(e);const t=""!==(e=e.split(":"))[0]?[e[0]]:[];_({_gp_venue:t}),b(e[1]),E()})(e)},options:C}))},J=()=>(0,t.createElement)("section",null,(0,t.createElement)(V,null));(0,s.registerPlugin)("gp-event-settings",{render:()=>z()&&(0,t.createElement)(o.PluginDocumentSettingPanel,{name:"gp-event-settings",title:(0,n.__)("Event settings","gatherpress"),initialOpen:!0,className:"gp-event-settings"},(0,t.createElement)(r.__experimentalVStack,{spacing:6},(0,t.createElement)($,null),(0,t.createElement)(J,null),(0,t.createElement)(B,null),(0,t.createElement)(N,null),(0,t.createElement)(G,null)))}),(0,a.dispatch)("core/edit-post").toggleEditorPanelOpened("gp-event-settings/gp-event-settings");const U=()=>{var e,s,o;const i=(0,a.useDispatch)("core/editor").editPost,l=(e,t)=>{const n=JSON.stringify({...c,[e]:t});i({meta:{venue_information:n}})};let c=(0,a.useSelect)((e=>e("core/editor").getEditedPostAttribute("meta").venue_information));c=c?JSON.parse(c):{};const[m,u]=(0,k.useState)(null!==(e=c.fullAddress)&&void 0!==e?e:""),[d,p]=(0,k.useState)(null!==(s=c.phoneNumber)&&void 0!==s?s:""),[g,v]=(0,k.useState)(null!==(o=c.website)&&void 0!==o?o:"");return C({setFullAddress:u,setPhoneNumber:p,setWebsite:v}),(0,t.createElement)(t.Fragment,null,(0,t.createElement)(r.TextControl,{label:(0,n.__)("Full Address","gatherpress"),value:m,onChange:e=>{w({setFullAddress:e}),l("fullAddress",e)}}),(0,t.createElement)(r.TextControl,{label:(0,n.__)("Phone Number","gatherpress"),value:d,onChange:e=>{w({setPhoneNumber:e}),l("phoneNumber",e)}}),(0,t.createElement)(r.TextControl,{label:(0,n.__)("Website","gatherpress"),value:g,type:"url",onChange:e=>{w({setWebsite:e}),l("website",e)}}))},Z=()=>(0,t.createElement)("section",null,(0,t.createElement)(U,null));(0,s.registerPlugin)("gp-venue-settings",{render:()=>"gp_venue"===(0,a.select)("core/editor")?.getCurrentPostType()&&(0,t.createElement)(o.PluginDocumentSettingPanel,{name:"gp-venue-settings",title:(0,n.__)("Venue settings","gatherpress"),initialOpen:!0,className:"gp-venue-settings"},(0,t.createElement)(r.__experimentalVStack,{spacing:6},(0,t.createElement)(Z,null)))}),(0,a.dispatch)("core/edit-post").toggleEditorPanelOpened("gp-venue-settings/gp-venue-settings")})(); \ No newline at end of file +(()=>{"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 a in n)e.o(n,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:n[a]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.React,n=window.wp.i18n,a=window.wp.data,r=window.wp.components,s=window.wp.plugins,o=window.wp.editPost,i=window.moment;var l=e.n(i);const c=window.wp.apiFetch;var m=e.n(c);const u=window.wp.element;function d(){(0,a.dispatch)("core/editor")?.editPost({meta:{_non_existing_meta:!0}})}function p(e){if("object"==typeof GatherPress)return e.split(".").reduce(((e,t)=>e&&e[t]),GatherPress)}function g(e,t){if("object"!=typeof GatherPress)return;const n=e.split("."),a=n.pop();n.reduce(((e,t)=>{var n;return null!==(n=e[t])&&void 0!==n?n:e[t]={}}),GatherPress)[a]=t}const v=window.wp.date,_="YYYY-MM-DDTHH:mm:ss",E="YYYY-MM-DD HH:mm:ss",h=l().tz(T()).add(1,"day").set("hour",18).set("minute",0).set("second",0).format(_),f=l().tz(h,T()).add(2,"hours").format(_);function S(){return C(p("settings.dateFormat"))+" "+C(p("settings.timeFormat"))}function T(e=p("eventDetails.dateTime.timezone")){return l().tz.zone(e)?e:(0,n.__)("GMT","gatherpress")}function b(e=""){const t=/^([+-])(\d{2}):(00|15|30|45)$/,n=e.replace(t,"$1");return n!==e?"UTC"+n+parseInt(e.replace(t,"$2")).toString()+e.replace(t,"$3").replace("00","").replace("15",".25").replace("30",".5").replace("45",".75"):e}function D(e,t=null){!function(e){const t=l().tz(p("eventDetails.dateTime.datetime_end"),T()).valueOf(),n=l().tz(e,T()).valueOf();n>=t&&P(l().tz(n,T()).add(2,"hours").format(_))}(e),g("eventDetails.dateTime.datetime_start",e),"function"==typeof t&&t(e),d()}function P(e,t=null){!function(e){const t=l().tz(p("eventDetails.dateTime.datetime_start"),T()).valueOf(),n=l().tz(e,T()).valueOf();n<=t&&D(l().tz(n,T()).subtract(2,"hours").format(_))}(e),g("eventDetails.dateTime.datetime_end",e),null!==t&&t(e),d()}function w(){const e=(0,a.select)("core/editor").isSavingPost(),t=(0,a.select)("core/editor").isAutosavingPost();O()&&e&&!t&&m()({path:p("urls.eventRestApi")+"/datetime",method:"POST",data:{post_id:p("eventDetails.postId"),datetime_start:l().tz(p("eventDetails.dateTime.datetime_start"),T()).format(E),datetime_end:l().tz(p("eventDetails.dateTime.datetime_end"),T()).format(E),timezone:p("eventDetails.dateTime.timezone"),_wpnonce:p("misc.nonce")}}).then((()=>{!function(){const e="gp_event_communcation",t=(0,a.dispatch)("core/notices");t.removeNotice(e),"publish"!==(0,a.select)("core/editor").getEditedPostAttribute("status")||k()||t.createNotice("success",(0,n.__)("Send an event update to members via email?","gatherpress"),{id:e,isDismissible:!0,actions:[{onClick:()=>{z({setOpen:!0})},label:(0,n.__)("Compose Message","gatherpress")}]})}()}))}function C(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=>e in t?t[e]:e)).join("")}const z=(e,t="")=>{for(const[n,a]of Object.entries(e)){let e=n;t&&(e+="_"+String(t));const r=new CustomEvent(e,{detail:a});dispatchEvent(r)}},y=(e,t="")=>{for(const[n,a]of Object.entries(e)){let e=n;t&&(e+="_"+String(t)),addEventListener(e,(e=>{a(e.detail)}),!1)}};function O(){return"gp_event"===(0,a.select)("core/editor").getCurrentPostType()}function k(){const e=l().tz(p("eventDetails.dateTime.datetime_end"),T());return"gp_event"===(0,a.select)("core/editor")?.getCurrentPostType()&&l().tz(T()).valueOf()>e.valueOf()}function A(){const e="gp_event_past",t=(0,a.dispatch)("core/notices");t.removeNotice(e),k()&&t.createNotice("warning",(0,n.__)("This event has already past.","gatherpress"),{id:e,isDismissible:!1})}const N=()=>{const{editPost:e,unlockPostSaving:s}=(0,a.useDispatch)("core/editor"),o=(0,a.useSelect)((e=>e("core/editor").isCleanNewPost()),[]);let i=(0,a.useSelect)((e=>e("core/editor").getEditedPostAttribute("meta").enable_anonymous_rsvp),[]);o&&(i=p("settings.enableAnonymousRsvp"));const[l,c]=(0,u.useState)(i);return(0,t.createElement)(r.CheckboxControl,{label:(0,n.__)("Enable Anonymous RSVP","gatherpress"),checked:l,onChange:t=>{(t=>{const n={enable_anonymous_rsvp:Number(t)};c(t),e({meta:n}),s()})(t)}})},x=()=>(0,t.createElement)("section",null,(0,t.createElement)(N,null)),M=e=>{const{dateTimeStart:t}=e;return l().tz(t,T()).format(S())},Y=e=>{const{dateTimeEnd:t}=e;return l().tz(t,T()).format(S())},F=e=>{const{dateTimeStart:n,setDateTimeStart:a}=e,s=(0,v.getSettings)(),o=/a(?!\\)/i.test(s.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return(0,t.createElement)(r.DateTimePicker,{currentDate:n,onChange:e=>D(e,a),is12Hour:o})},j=e=>{const{dateTimeEnd:n,setDateTimeEnd:a}=e,s=(0,v.getSettings)(),o=/a(?!\\)/i.test(s.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return(0,t.createElement)(r.DateTimePicker,{currentDate:n,onChange:e=>P(e,a),is12Hour:o})},R=e=>{const{dateTimeStart:a,setDateTimeStart:s}=e;return(0,u.useEffect)((()=>{s(l().tz(function(){let e=p("eventDetails.dateTime.datetime_start");return e=""!==e?l().tz(e,T()).format(_):h,g("eventDetails.dateTime.datetime_start",e),e}(),T()).format(_)),z({setDateTimeStart:a}),A()})),(0,t.createElement)(r.PanelRow,null,(0,t.createElement)(r.Flex,{direction:"column",gap:"0"},(0,t.createElement)(r.FlexItem,null,(0,t.createElement)("label",{htmlFor:"gp-datetime-start"},(0,n.__)("Start","gatherpress"))),(0,t.createElement)(r.FlexItem,null,(0,t.createElement)(r.Dropdown,{popoverProps:{placement:"bottom-end"},renderToggle:({isOpen:e,onToggle:n})=>(0,t.createElement)(r.Button,{id:"gp-datetime-start",onClick:n,"aria-expanded":e,isLink:!0},(0,t.createElement)(M,{dateTimeStart:a})),renderContent:()=>(0,t.createElement)(F,{dateTimeStart:a,setDateTimeStart:s})}))))},H=e=>{const{dateTimeEnd:a,setDateTimeEnd:s}=e;return(0,u.useEffect)((()=>{s(l().tz(function(){let e=p("eventDetails.dateTime.datetime_end");return e=""!==e?l().tz(e,T()).format(_):f,g("eventDetails.dateTime.datetime_end",e),e}(),T()).format(_)),z({setDateTimeEnd:a}),A()})),(0,t.createElement)(r.PanelRow,null,(0,t.createElement)(r.Flex,{direction:"column",gap:"0"},(0,t.createElement)(r.FlexItem,null,(0,t.createElement)("label",{htmlFor:"gp-datetime-end"},(0,n.__)("End","gatherpress"))),(0,t.createElement)(r.FlexItem,null,(0,t.createElement)(r.Dropdown,{popoverProps:{placement:"bottom-end"},renderToggle:({isOpen:e,onToggle:n})=>(0,t.createElement)(r.Button,{id:"gp-datetime-end",onClick:n,"aria-expanded":e,isLink:!0},(0,t.createElement)(Y,{dateTimeEnd:a})),renderContent:()=>(0,t.createElement)(j,{dateTimeEnd:a,setDateTimeEnd:s})}))))},I=e=>{const{timezone:a,setTimezone:s}=e,o=p("misc.timezoneChoices");return(0,u.useEffect)((()=>{s(p("eventDetails.dateTime.timezone"))}),[s]),(0,u.useEffect)((()=>{z({setTimezone:p("eventDetails.dateTime.timezone")})})),(0,t.createElement)(r.PanelRow,null,(0,t.createElement)(r.SelectControl,{label:(0,n.__)("Time Zone","gatherpress"),value:b(a),onChange:e=>{e=function(e=""){const t=/^UTC([+-])(\d+)(.\d+)?$/,n=e.replace(t,"$1");if(n!==e){const a=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"),n+a+r}return e}(e),s(e),g("eventDetails.dateTime.timezone",e),d()}},Object.keys(o).map((e=>(0,t.createElement)("optgroup",{key:e,label:e},Object.keys(o[e]).map((n=>(0,t.createElement)("option",{key:n,value:n},o[e][n]))))))))},L=()=>{const[e,r]=(0,u.useState)(),[s,o]=(0,u.useState)(),[i,l]=(0,u.useState)();return(0,a.subscribe)(w),(0,t.createElement)(t.Fragment,null,(0,t.createElement)("h3",null,(0,n.__)("Date & time","gatherpress")),(0,t.createElement)(R,{dateTimeStart:e,setDateTimeStart:r}),(0,t.createElement)(H,{dateTimeEnd:s,setDateTimeEnd:o}),(0,t.createElement)(I,{timezone:i,setTimezone:l}))},$=()=>(0,t.createElement)("section",null,(0,t.createElement)(L,null)),G=()=>"publish"===(0,a.select)("core/editor").getEditedPostAttribute("status")&&!k()&&(0,t.createElement)("section",null,(0,t.createElement)("h3",{style:{marginBottom:"0.5rem"}},(0,n.__)("Send an event update","gatherpress")),(0,t.createElement)(r.Button,{variant:"secondary",onClick:()=>z({setOpen:!0})},(0,n.__)("Compose Message","gatherpress"))),W=()=>{const{editPost:e,unlockPostSaving:s}=(0,a.useDispatch)("core/editor"),o=(0,a.useSelect)((e=>e("core/editor").getEditedPostAttribute("meta").online_event_link)),[i,l]=(0,u.useState)(o);return y({setOnlineEventLink:l},p("eventDetails.postId")),(0,t.createElement)(r.TextControl,{label:(0,n.__)("Online event link","gatherpress"),value:i,placeholder:(0,n.__)("Add link to online event","gatherpress"),onChange:t=>{(t=>{e({meta:{online_event_link:t}}),l(t),z({setOnlineEventLink:t},p("eventDetails.postId")),s()})(t)}})},B=()=>(0,t.createElement)("section",null,(0,t.createElement)(W,null)),V=()=>{const[e,s]=(0,u.useState)(""),[o,i]=(0,u.useState)(""),[l,c]=(0,u.useState)(""),[m,d]=(0,u.useState)(""),[p,g]=(0,u.useState)(!1),[v,_]=(0,u.useState)(""),E=(0,a.useDispatch)("core/editor").editPost,{unlockPostSaving:h}=(0,a.useDispatch)("core/editor"),f=(0,a.useSelect)((e=>e("core/editor").getEditedPostAttribute("_gp_venue"))),S=(0,a.useSelect)((e=>e("core").getEntityRecord("taxonomy","_gp_venue",f))),T=S?.slug.replace(/^_/,""),[b,D]=(0,u.useState)(""),P=f+":"+b,w=(0,a.useSelect)((e=>e("core").getEntityRecords("postType","gp_venue",{per_page:1,slug:b})));(0,u.useEffect)((()=>{var e,t,a,r;let o={};if(b&&Array.isArray(w)){var l;const e=null!==(l=w[0]?.meta?.venue_information)&&void 0!==l?l:"{}";var m;e&&(o=JSON.parse(e),o.name=null!==(m=w[0]?.title.rendered)&&void 0!==m?m:"")}const u=null!==(e=o?.name)&&void 0!==e?e:(0,n.__)("No venue selected.","gatherpress"),p=null!==(t=o?.fullAddress)&&void 0!==t?t:"",g=null!==(a=o?.phoneNumber)&&void 0!==a?a:"",v=null!==(r=o?.website)&&void 0!==r?r:"";T&&D(T),_(P?String(P):""),s(u),i(p),c(g),d(v),z({setName:u,setFullAddress:p,setPhoneNumber:g,setWebsite:v,setIsOnlineEventTerm:"online-event"===b})}),[b,w,T,P]);let C=(0,a.useSelect)((e=>e("core").getEntityRecords("taxonomy","_gp_venue",{per_page:-1,context:"view"})),[]);return C?(C=C.map((e=>({label:e.name,value:e.id+":"+e.slug.replace(/^_/,"")}))),C.unshift({value:":",label:(0,n.__)("Choose a venue","gatherpress")})):C=[],(0,t.createElement)(r.PanelRow,null,(0,t.createElement)(r.SelectControl,{label:(0,n.__)("Venue Selector","gatherpress"),value:v,onChange:e=>{(e=>{_(e);const t=""!==(e=e.split(":"))[0]?[e[0]]:[];E({_gp_venue:t}),D(e[1]),h()})(e)},options:C}))},J=()=>(0,t.createElement)("section",null,(0,t.createElement)(V,null));(0,s.registerPlugin)("gp-event-settings",{render:()=>O()&&(0,t.createElement)(o.PluginDocumentSettingPanel,{name:"gp-event-settings",title:(0,n.__)("Event settings","gatherpress"),initialOpen:!0,className:"gp-event-settings"},(0,t.createElement)(r.__experimentalVStack,{spacing:6},(0,t.createElement)($,null),(0,t.createElement)(J,null),(0,t.createElement)(B,null),(0,t.createElement)(x,null),(0,t.createElement)(G,null)))}),(0,a.dispatch)("core/edit-post").toggleEditorPanelOpened("gp-event-settings/gp-event-settings");const U=()=>{var e,s,o;const i=(0,a.useDispatch)("core/editor").editPost,l=(e,t)=>{const n=JSON.stringify({...c,[e]:t});i({meta:{venue_information:n}})};let c=(0,a.useSelect)((e=>e("core/editor").getEditedPostAttribute("meta").venue_information));c=c?JSON.parse(c):{};const[m,d]=(0,u.useState)(null!==(e=c.fullAddress)&&void 0!==e?e:""),[p,g]=(0,u.useState)(null!==(s=c.phoneNumber)&&void 0!==s?s:""),[v,_]=(0,u.useState)(null!==(o=c.website)&&void 0!==o?o:"");return y({setFullAddress:d,setPhoneNumber:g,setWebsite:_}),(0,t.createElement)(t.Fragment,null,(0,t.createElement)(r.TextControl,{label:(0,n.__)("Full Address","gatherpress"),value:m,onChange:e=>{z({setFullAddress:e}),l("fullAddress",e)}}),(0,t.createElement)(r.TextControl,{label:(0,n.__)("Phone Number","gatherpress"),value:p,onChange:e=>{z({setPhoneNumber:e}),l("phoneNumber",e)}}),(0,t.createElement)(r.TextControl,{label:(0,n.__)("Website","gatherpress"),value:v,type:"url",onChange:e=>{z({setWebsite:e}),l("website",e)}}))},Z=()=>(0,t.createElement)("section",null,(0,t.createElement)(U,null));(0,s.registerPlugin)("gp-venue-settings",{render:()=>"gp_venue"===(0,a.select)("core/editor")?.getCurrentPostType()&&(0,t.createElement)(o.PluginDocumentSettingPanel,{name:"gp-venue-settings",title:(0,n.__)("Venue settings","gatherpress"),initialOpen:!0,className:"gp-venue-settings"},(0,t.createElement)(r.__experimentalVStack,{spacing:6},(0,t.createElement)(Z,null)))}),(0,a.dispatch)("core/edit-post").toggleEditorPanelOpened("gp-venue-settings/gp-venue-settings")})(); \ No newline at end of file diff --git a/build/profile.asset.php b/build/profile.asset.php new file mode 100644 index 000000000..28ef1ce9d --- /dev/null +++ b/build/profile.asset.php @@ -0,0 +1 @@ + array('moment', 'react', 'wp-api-fetch', 'wp-data', 'wp-date', 'wp-element', 'wp-i18n'), 'version' => 'b9af77c74dcfb212b31a'); diff --git a/build/profile.js b/build/profile.js new file mode 100644 index 000000000..dde5e7838 --- /dev/null +++ b/build/profile.js @@ -0,0 +1 @@ +(()=>{"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.React,n=window.moment;var r=e.n(n);window.wp.data,window.wp.apiFetch;const o=window.wp.i18n,a=window.wp.element,s=window.wp.date,d=e=>{const{name:n,value:r}=e.attrs,[o,d]=(0,a.useState)(r);return document.querySelector(`[name="${n}"]`).addEventListener("input",(e=>{d(e.target.value)}),{once:!0}),(0,t.createElement)(t.Fragment,null,o&&(0,s.format)(o))},c="YYYY-MM-DDTHH:mm:ss",i=r().tz(u()).add(1,"day").set("hour",18).set("minute",0).set("second",0).format(c);function u(e=function(e){if("object"==typeof GatherPress)return"eventDetails.dateTime.timezone".split(".").reduce(((e,t)=>e&&e[t]),GatherPress)}()){return r().tz.zone(e)?e:(0,o.__)("GMT","gatherpress")}r().tz(i,u()).add(2,"hours").format(c),function(){const e=document.querySelectorAll('[data-gp_component_name="datetime-preview"]');for(let n=0;n array(), 'version' => '69fc5d4edab39ad5f7b0'); diff --git a/build/profile_style.js b/build/profile_style.js new file mode 100644 index 000000000..076bc2cfc --- /dev/null +++ b/build/profile_style.js @@ -0,0 +1 @@ +(()=>{"use strict";var r,e={9488:()=>{}},o={};function t(r){var a=o[r];if(void 0!==a)return a.exports;var n=o[r]={exports:{}};return e[r](n,n.exports,t),n.exports}t.m=e,r=[],t.O=(e,o,a,n)=>{if(!o){var s=1/0;for(p=0;p=n)&&Object.keys(t.O).every((r=>t.O[r](o[l])))?o.splice(l--,1):(i=!1,n0&&r[p-1][2]>n;p--)r[p]=r[p-1];r[p]=[o,a,n]},t.o=(r,e)=>Object.prototype.hasOwnProperty.call(r,e),(()=>{var r={604:0,739:0};t.O.j=e=>0===r[e];var e=(e,o)=>{var a,n,[s,i,l]=o,v=0;if(s.some((e=>0!==r[e]))){for(a in i)t.o(i,a)&&(t.m[a]=i[a]);if(l)var p=l(t)}for(e&&e(o);vt(9488)));a=t.O(a)})(); \ No newline at end of file diff --git a/build/settings.asset.php b/build/settings.asset.php index bfce402df..efc98bef8 100644 --- a/build/settings.asset.php +++ b/build/settings.asset.php @@ -1 +1 @@ - array('lodash', 'react', 'wp-components', 'wp-core-data', 'wp-data', 'wp-date', 'wp-element', 'wp-i18n'), 'version' => 'cfea6826b345be8ff710'); + array('lodash', 'moment', 'react', 'wp-api-fetch', 'wp-components', 'wp-core-data', 'wp-data', 'wp-date', 'wp-element', 'wp-i18n'), 'version' => '85b7ddf6074855040b96'); diff --git a/build/settings.js b/build/settings.js index 51038110f..ed9768af3 100644 --- a/build/settings.js +++ b/build/settings.js @@ -1 +1 @@ -(()=>{"use strict";const e=window.React,t=window.wp.element,n=window.lodash,a=window.wp.components,o=window.wp.i18n,r=window.wp.coreData,s=window.wp.data,l=l=>{var i,c;const{name:d,option:m,value:p,fieldOptions:u}=l.attrs,g=1!==u.limit,[w,_]=(0,t.useState)(null!==(i=JSON.parse(p))&&void 0!==i?i:"[]"),{contentList:v}=(0,s.useSelect)((e=>{const{getEntityRecords:t}=e(r.store);return{contentList:t("user"!==u.type?"postType":"root",u.type||"post",{per_page:-1,context:"view"})}}),[u.type]),y=null!==(c=v?.reduce(((e,t)=>({...e,[t.title?.rendered||t.name]:t})),{}))&&void 0!==c?c:{};return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(a.FormTokenField,{key:m,label:u.label||(0,o.__)("Select Posts","gatherpress"),name:d,value:w&&w.map((e=>({id:e.id,slug:e.slug,value:e.title?.rendered||e.name||e.value}))),suggestions:Object.keys(y),onChange:e=>{if(e.some((e=>"string"==typeof e&&!y[e])))return;const t=e.map((e=>"string"==typeof e?y[e]:e));if((0,n.includes)(t,null))return!1;_(t)},maxSuggestions:u.max_suggestions||20,maxLength:u.limit||0,__experimentalShowHowTo:g}),!1===g&&(0,e.createElement)("p",{className:"description"},(0,o.__)("Choose only one item.","gatherpress")),(0,e.createElement)("input",{type:"hidden",id:m,name:d,value:w&&JSON.stringify(w.map((e=>({id:e.id,slug:e.slug,value:e.title?.rendered||e.name||e.value}))))}))},i=window.wp.date,c=n=>{const{name:a,value:o}=n.attrs,[r,s]=(0,t.useState)(o);return document.querySelector(`[name="${a}"]`).addEventListener("input",(e=>{s(e.target.value)}),{once:!0}),(0,e.createElement)(e.Fragment,null,r&&(0,i.format)(r))},d=document.querySelectorAll('[data-gp_component_name="autocomplete"]');for(let n=0;n{"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 o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.React,n=window.wp.element,o=window.lodash,r=window.wp.components,a=window.wp.i18n,s=window.wp.coreData,l=window.wp.data,i=e=>{var i,d;const{name:c,option:u,value:m,fieldOptions:p}=e.attrs,w=1!==p.limit,[g,v]=(0,n.useState)(null!==(i=JSON.parse(m))&&void 0!==i?i:"[]"),{contentList:y}=(0,l.useSelect)((e=>{const{getEntityRecords:t}=e(s.store);return{contentList:t("user"!==p.type?"postType":"root",p.type||"post",{per_page:-1,context:"view"})}}),[p.type]),_=null!==(d=y?.reduce(((e,t)=>({...e,[t.title?.rendered||t.name]:t})),{}))&&void 0!==d?d:{};return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(r.FormTokenField,{key:u,label:p.label||(0,a.__)("Select Posts","gatherpress"),name:c,value:g&&g.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,o.includes)(t,null))return!1;v(t)},maxSuggestions:p.max_suggestions||20,maxLength:p.limit||0,__experimentalShowHowTo:w}),!1===w&&(0,t.createElement)("p",{className:"description"},(0,a.__)("Choose only one item.","gatherpress")),(0,t.createElement)("input",{type:"hidden",id:u,name:c,value:g&&JSON.stringify(g.map((e=>({id:e.id,slug:e.slug,value:e.title?.rendered||e.name||e.value}))))}))},d=window.moment;var c=e.n(d);window.wp.apiFetch;const u=window.wp.date,m=e=>{const{name:o,value:r}=e.attrs,[a,s]=(0,n.useState)(r);return document.querySelector(`[name="${o}"]`).addEventListener("input",(e=>{s(e.target.value)}),{once:!0}),(0,t.createElement)(t.Fragment,null,a&&(0,u.format)(a))},p="YYYY-MM-DDTHH:mm:ss",w=c().tz(g()).add(1,"day").set("hour",18).set("minute",0).set("second",0).format(p);function g(e=function(e){if("object"==typeof GatherPress)return"eventDetails.dateTime.timezone".split(".").reduce(((e,t)=>e&&e[t]),GatherPress)}()){return c().tz.zone(e)?e:(0,a.__)("GMT","gatherpress")}c().tz(w,g()).add(2,"hours").format(p);const v=document.querySelectorAll('[data-gp_component_name="autocomplete"]');for(let e=0;eget_asset_data( 'profile' ); + + wp_enqueue_script( + 'gatherpress-profile', + $this->build . 'profile.js', + $asset['dependencies'], + $asset['version'], + true + ); + + wp_set_script_translations( 'gatherpress-profile', 'gatherpress', GATHERPRESS_CORE_PATH . '/languages' ); + } } /** diff --git a/includes/core/classes/class-user.php b/includes/core/classes/class-user.php index abca0c06e..782423b36 100644 --- a/includes/core/classes/class-user.php +++ b/includes/core/classes/class-user.php @@ -71,9 +71,6 @@ protected function setup_hooks(): void { */ public function profile_fields( WP_User $user ): void { $event_updates_opt_in = get_user_meta( $user->ID, 'gp-event-updates-opt-in', true ); - $gp_date_format = get_user_meta( $user->ID, 'gp_date_format', true ); - $gp_time_format = get_user_meta( $user->ID, 'gp_time_format', true ); - $gp_timezone = get_user_meta( $user->ID, 'gp_timezone', true ); // Checkbox is selected by default. '1' is on, '0' is off. if ( '0' !== $event_updates_opt_in ) { @@ -88,12 +85,29 @@ public function profile_fields( WP_User $user ): void { true ); + // Render the user selected date/time format and timezone fields. + $gp_date_format = get_user_meta( $user->ID, 'gp_date_format', true ); + $gp_time_format = get_user_meta( $user->ID, 'gp_time_format', true ); + $gp_timezone = get_user_meta( $user->ID, 'gp_timezone', true ); + $tz_choices = Utility::timezone_choices(); + $date_attrs = array( + 'name' => 'gp_date_format', + 'value' => ! empty( $gp_date_format ) ? $gp_date_format : '', + ); + $time_attrs = array( + 'name' => 'gp_time_format', + 'value' => ! empty( $gp_time_format ) ? $gp_time_format : '', + ); + Utility::render_template( sprintf( '%s/includes/templates/admin/user/date-time.php', GATHERPRESS_CORE_PATH ), array( 'date_format' => $gp_date_format, 'time_format' => $gp_time_format, 'timezone' => $gp_timezone, + 'date_attrs' => $date_attrs, + 'time_attrs' => $time_attrs, + 'tz_choices' => $tz_choices, ), true ); diff --git a/includes/templates/admin/user/date-time.php b/includes/templates/admin/user/date-time.php index 0a11dd9df..56365b697 100644 --- a/includes/templates/admin/user/date-time.php +++ b/includes/templates/admin/user/date-time.php @@ -11,18 +11,6 @@ if ( ! isset( $timezone ) && ! isset( $date_format ) && ! isset( $time_format ) ) { return; } - -$gatherpress_tz_choices = Utility::timezone_choices(); - -$gatherpress_date_attrs = array( - 'name' => 'gp_date_format', - 'value' => ! empty( $date_format ) ? $date_format : '', -); - -$gatherpress_time_attrs = array( - 'name' => 'gp_time_format', - 'value' => ! empty( $time_format ) ? $time_format : '', -); ?>

@@ -40,7 +28,7 @@

: - +

@@ -54,7 +42,7 @@

: - +

@@ -65,16 +53,16 @@ diff --git a/src/helpers/datetime.js b/src/helpers/datetime.js index 661af7a7d..31ef1df4c 100644 --- a/src/helpers/datetime.js +++ b/src/helpers/datetime.js @@ -9,12 +9,14 @@ import moment from 'moment'; import { select } from '@wordpress/data'; import apiFetch from '@wordpress/api-fetch'; import { __ } from '@wordpress/i18n'; +import { createRoot } from '@wordpress/element'; /** * Internal dependencies. */ import { enableSave, getFromGlobal, setToGlobal } from './globals'; import { isEventPostType, triggerEventCommuncation } from './event'; +import DateTimePreview from '../components/DateTimePreview'; /** * Date and time format string for use with Moment.js. @@ -465,3 +467,33 @@ export function convertPHPToMomentFormat(format) { .map((chr) => (chr in replacements ? replacements[chr] : chr)) .join(''); } + +/** + * DateTime Preview Initialization + * + * This script initializes the DateTime Preview functionality for all elements + * with the attribute 'data-gp_component_name' set to 'datetime-preview'. + * It iterates through all matching elements and initializes a DateTimePreview component + * with the attributes provided in the 'data-gp_component_attrs' attribute. + * + * @since 1.0.0 + */ +export function dateTimePreview() { + // Select all elements with the attribute 'data-gp_component_name' set to 'datetime-preview'. + const dateTimePreviewContainers = document.querySelectorAll( + `[data-gp_component_name="datetime-preview"]` + ); + + // Iterate through each matched element and initialize DateTimePreview component. + for (let i = 0; i < dateTimePreviewContainers.length; i++) { + // Parse attributes from the 'data-gp_component_attrs' attribute. + const attrs = JSON.parse( + dateTimePreviewContainers[i].dataset.gp_component_attrs + ); + + // Create a root element and render the DateTimePreview component with the parsed attributes. + createRoot(dateTimePreviewContainers[i]).render( + + ); + } +} diff --git a/src/profile/index.js b/src/profile/index.js new file mode 100644 index 000000000..043e74e9b --- /dev/null +++ b/src/profile/index.js @@ -0,0 +1,16 @@ +/** + * Internal dependencies. + */ +import { dateTimePreview } from '../helpers/datetime'; + +/** + * DateTime Preview Initialization + * + * This script initializes the DateTime Preview functionality for all elements + * with the attribute 'data-gp_component_name' set to 'datetime-preview'. + * It iterates through all matching elements and initializes a DateTimePreview component + * with the attributes provided in the 'data-gp_component_attrs' attribute. + * + * @since 1.0.0 + */ +dateTimePreview(); diff --git a/src/profile/style.scss b/src/profile/style.scss new file mode 100644 index 000000000..4e70850f2 --- /dev/null +++ b/src/profile/style.scss @@ -0,0 +1,39 @@ +.gp-settings { + &__credits { + a { + text-decoration: none; + + &:hover { + text-decoration: underline; + } + } + } + + &__credits-featured { + display: flex; + flex-wrap: wrap; + gap: 1rem; + margin-bottom: 2rem; + + a { + display: block; + font-size: 1.2rem; + font-weight: 600; + padding: 1rem; + } + + img { + border-radius: 999rem; + margin-bottom: 0.5rem; + } + + li { + text-align: center; + width: 10rem; + } + } + + .components-form-token-field__input-container { + background: #fff; + } +} diff --git a/src/settings/index.js b/src/settings/index.js index b8b744d5f..37b90a835 100644 --- a/src/settings/index.js +++ b/src/settings/index.js @@ -7,7 +7,7 @@ import { createRoot } from '@wordpress/element'; * Internal dependencies. */ import Autocomplete from '../components/Autocomplete'; -import DateTimePreview from '../components/DateTimePreview'; +import { dateTimePreview } from '../helpers/datetime'; /** * Autocomplete Initialization @@ -48,21 +48,4 @@ for (let i = 0; i < autocompleteContainers.length; i++) { * * @since 1.0.0 */ - -// Select all elements with the attribute 'data-gp_component_name' set to 'datetime-preview'. -const dateTimePreviewContainers = document.querySelectorAll( - `[data-gp_component_name="datetime-preview"]` -); - -// Iterate through each matched element and initialize DateTimePreview component. -for (let i = 0; i < dateTimePreviewContainers.length; i++) { - // Parse attributes from the 'data-gp_component_attrs' attribute. - const attrs = JSON.parse( - dateTimePreviewContainers[i].dataset.gp_component_attrs - ); - - // Create a root element and render the DateTimePreview component with the parsed attributes. - createRoot(dateTimePreviewContainers[i]).render( - - ); -} +dateTimePreview(); diff --git a/webpack.config.js b/webpack.config.js index b799ecebd..937f5a88f 100755 --- a/webpack.config.js +++ b/webpack.config.js @@ -23,5 +23,11 @@ module.exports = { 'src/settings', 'style.scss' ), + profile: path.resolve(process.cwd(), 'src/profile', 'index.js'), + profile_style: path.resolve( + process.cwd(), + 'src/profile', + 'style.scss' + ), }, };