1(()=>{"use strict";const e=window.wp.i18n,t=window.wp.components,i=window.wp.hooks,n=window.wp.element,a=window.wp.apiFetch,o=window.jQuery,r=window.ReactJSXRuntime,l=({searchBoxText:t,searchBoxButton:i})=>{const n="wfea_SearchBox";let a=sessionStorage.getItem(n)||"0";a=(parseInt(a,10)+1).toString(),sessionStorage.setItem(n,a);const o=(0,e.__)("Search Events","widget-for-eventbrite-api"),l=(0,e.__)("Search","widget-for-eventbrite-api"),s=`wfea_s_${a}`;return(0,r.jsx)("div",{className:"__search wfea-search__wrap",children:(0,r.jsxs)("form",{className:"wfea-search__form",children:[(0,r.jsx)("label",{className:"screen-reader-text",htmlFor:s,children:t||o}),(0,r.jsx)("input",{name:s,type:"search",id:s,className:"wfea-search__input",placeholder:t||o,"aria-label":t||o}),(0,r.jsx)("input",{type:"submit",className:"wfea-search__submit wfea-search_cal__submit wp-element-button",value:i||l})]})})},s={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let c;const d=new Uint8Array(16);function _(){if(!c&&(c="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!c))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return c(d)}const p=[];for(let e=0;e<256;++e)p.push((e+256).toString(16).slice(1));const u=function(e,t,i){if(s.randomUUID&&!t&&!e)return s.randomUUID();const n=(e=e||{}).random||(e.rng||_)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){i=i||0;for(let e=0;e<16;++e)t[i+e]=n[e];return t}return function(e,t=0){return p[e[t+0]]+p[e[t+1]]+p[e[t+2]]+p[e[t+3]]+"-"+p[e[t+4]]+p[e[t+5]]+"-"+p[e[t+6]]+p[e[t+7]]+"-"+p[e[t+8]]+p[e[t+9]]+"-"+p[e[t+10]]+p[e[t+11]]+p[e[t+12]]+p[e[t+13]]+p[e[t+14]]+p[e[t+15]]}(n)},f=e=>{let t={nonce:wfea_controls_meta.nonce};t=Object.assign({},t,e);let{setAttributes:i,optionToUpdate:n,...a}=t;jQuery.ajax({url:wfea_controls_meta.ajaxurl,type:"POST",data:a,success:function(e){i({[n]:e})}})},{can_use_premium_code:g,is_plan_silver:w,is_plan_gold:m,is_plan_platinum:h}=wfea_freemius,b=e=>(0,r.jsx)(t.Dashicon,{className:e,icon:"list-view"});(0,i.addFilter)("wfea-handle-search","widget-for-eventbrite-api",function(e,t){const i=e=>{const t=e.target;1!=e.target.dataset.clicked&&(e.preventDefault(),t.setAttribute("data-clicked",1),alert("Search is not supported in editor."),setTimeout(()=>{t.setAttribute("data-clicked",0)},500))};if(void 0!==e&&e instanceof Element){const t=e.querySelector(".wfea-search__input"),n=e.querySelector(".wfea-search__submit");t&&(t.style.opacity="0.5",t.setAttribute("readonly",!0),t.addEventListener("click",i)),n&&(n.style.opacity="0.5",n.addEventListener("click",i))}return null}),(0,i.addFilter)("wfea-block-plans","widget-for-eventbrite-api",function(e){return g&&(w&&e.push("fledgling"),m&&e.push("high_powered"),h&&e.push("major_league")),e}),(0,i.addFilter)("wfea-api-key-select","widget-for-eventbrite-api",function(i,n,a){return(0,r.jsx)("div",{id:"wfea_api_key",children:(0,r.jsx)(t.SelectControl,{label:(0,e.__)("API Key","widget-for-eventbrite-api"),value:n.api_key,options:Object.entries(n.apiKeyOptions).map(([e,t])=>({label:t,value:e})),onChange:e=>{a({api_key:e}),a({organization_id:""}),a({eb_id:""}),a({organizationOptions:{}}),a({eventOptions:{}}),a({organizerOptions:{}}),f({setAttributes:a,token:e,action:"fetch_organizations_for_key",optionToUpdate:"organizationOptions"}),f({setAttributes:a,token:e,organizationID:"",action:"fetch_events_for_key",optionToUpdate:"eventOptions"}),f({setAttributes:a,token:e,organizationID:"",action:"fetch_organizers_for_key",optionToUpdate:"organizerOptions"}),f({setAttributes:a,token:e,organizationID:"",action:"fetch_venues_options",optionToUpdate:"venueOptions"})},__nextHasNoMarginBottom:!0})})}),(0,i.addFilter)("wfea-cal-list-options","widget-for-eventbrite-api",function(i,n,a,o){if(!o)return i;const l=[{attName:"cal_list_days",label:(0,e.__)("Calendar list days","widget-for-eventbrite-api")},{attName:"cal_list_header_center",label:(0,e.__)("Calendar list header center","widget-for-eventbrite-api")},{attName:"cal_list_header_left",label:(0,e.__)("Calendar list header left","widget-for-eventbrite-api")},{attName:"cal_list_header_right",label:(0,e.__)("Calendar list header right","widget-for-eventbrite-api")}];return(0,r.jsx)(r.Fragment,{children:l.map(e=>(0,r.jsx)(t.__experimentalInputControl,{isPressEnterToChange:!0,className:"wfea_input",label:e.label,value:n[e.attName],onChange:t=>{a({[e.attName]:t})}},u()))})});const v=(e,t,i,n)=>{const a=e[i][n];return a?a.findIndex(function(e){return e.name===t}):-1},y=(e,t,i,n,a)=>{e[i][n][t].type="select",e[i][n][t].args={},e[i][n][t].args.multiple=!1,e[i][n][t].args.options={},e[i][n][t].args.onchange=a};(0,i.addFilter)("wfea-dynamic-options","widget-for-eventbrite-api",function(e){const t=v(e,"
1wfea_organization_id","selection","fledgling");-1!==t&&y(e,t,"selection","fledgling",f);const i=v(e,"wfea_organizer_id","selection","fledgling");-1!==i&&y(e,i,"selection","fledgling",f);const n=v(e,"wfea_venue_id","selection","fledgling");return-1!==n&&y(e,n,"selection","fledgling",f),e}),(0,i.addFilter)("wfea-block-theme-colors","widget-for-eventbrite-api/display-eventbrite-events",function(t,i,n){return g?[{title:(0,e.__)("Gray","widget-for-eventbrite-api"),icon:b("gray"),onClick:()=>{i({theme_color:"theme-gray"})}},{title:(0,e.__)("Red","widget-for-eventbrite-api"),icon:b("red"),onClick:()=>{i({theme_color:"theme-red"})}},{title:(0,e.__)("Orange","widget-for-eventbrite-api"),icon:b("orange"),onClick:()=>{i({theme_color:"theme-orange"})}},{title:(0,e.__)("Green","widget-for-eventbrite-api"),icon:b("green"),onClick:()=>{i({theme_color:"theme-green"})}},{title:(0,e.__)("Blue","widget-for-eventbrite-api"),icon:b("blue"),onClick:()=>{i({theme_color:"theme-blue"})}},{title:(0,e.__)("Indigo","widget-for-eventbrite-api"),icon:b("indigo"),onClick:()=>{i({theme_color:"theme-indigo"})}},{title:(0,e.__)("Purple","widget-for-eventbrite-api"),icon:b("purple"),onClick:()=>{i({theme_color:"theme-purple"})}},{title:(0,e.__)("Pink","widget-for-eventbrite-api"),icon:b("pink"),onClick:()=>{i({theme_color:"theme-pink"})}},{title:(0,e.__)("Theme Default","widget-for-eventbrite-api"),icon:b("default"),onClick:()=>{i({theme_color:""})}}]:[]},1);const k=()=>(0,r.jsx)(t.Dashicon,{icon:"calendar-alt"}),x=()=>(0,r.jsx)(t.Dashicon,{icon:"list-view"});(0,i.addFilter)("wfea-block-layouts-cal","widget-for-eventbrite-api/display-eventbrite-calendar",function(t,i){if(!wfea_freemius)return console.log("Error Freemius Data not found"),t;const{current_plan:n,can_use_premium_code:a,is_plan_silver:o,is_plan_gold:r,is_plan_platinum:l}=wfea_freemius;return a?(r&&(t.push({title:(0,e.__)("Calendar","widget-for-eventbrite-api"),icon:k,onClick:()=>{i({limit:-1}),i({layout:"cal"})}}),t.push({title:(0,e.__)("Calendar List","widget-for-eventbrite-api"),icon:x,onClick:()=>{i({limit:-1}),i({layout:"cal_list"})}})),t):(console.log("Error Freemius Premium Code not allowed"),t)}),(0,i.addFilter)("wfea-block-display-cal","widget-for-eventbrite-api/display-eventbrite-calendar",function(e,t){const i=(0,n.useRef)(),[s,c]=(0,n.useState)(null),[d,_]=(0,n.use
1State)(null),p=t&&t.layout,u=t&&JSON.stringify(t);if((0,n.useEffect)(()=>{p&&u&&a({path:"/widget-for-eventbrite-api/v1/wfea_cal_options",method:"POST",headers:{"Content-Type":"application/json"},body:u}).then(e=>{c(e),_(null)}).catch(_)},[p,u]),(0,n.useEffect)(()=>{const e=o(i.current);if(s){let t={...s,...window.wfea_extend_fullcalendar(s)};e.fullCalendar(t)}return()=>e.fullCalendar("destroy")},[s]),d)return(0,r.jsxs)("div",{children:["Error: ",d.message]});const f="cal"===t.layout?"wfea-calendar":"wfea-calendar-list",{popup:g,newtab:w}=t,m=g?"wfea-popup":w?"newtab":"sametab",h=g?"popup":"";return(0,r.jsxs)(r.Fragment,{children:[t.search_box&&(0,r.jsx)(l,{search_box_text:t.search_box_text,search_box_button:t.search_box_button}),(0,r.jsx)("section",{className:`wfea wfea-cal ${t.theme_color} ${h}`,children:(0,r.jsx)("div",{ref:i,className:`wfea-fullcalendar ${f} ${m}`})})]})},1)})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.