(()=>{"use strict";var e,a={173:()=>{const e=window.wp.blocks,a=window.React,r=window.wp.i18n,l=window.wp.blockEditor,t=window.wp.components,s=window.wp.element,o=JSON.parse('{"UU":"ucla-wordpress-plugin/progress-bar"}');(0,e.registerBlockType)(o.UU,{edit:({attributes:e,setAttributes:o,clientId:n})=>{const{barVariant:c,colorVariant:u,progressNumber:i,blockId:p}=e,g=(0,l.useBlockProps)();return(0,s.useEffect)((()=>{""===p&&o({blockId:n})}),[]),(0,a.createElement)(a.Fragment,null,(0,a.createElement)(l.InspectorControls,null,(0,a.createElement)(t.PanelBody,{title:(0,r.__)("Settings","ucla-wordpress-plugin"),initialOpen:!0},(0,a.createElement)(t.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,r.__)("Select variant","ucla-wordpress-plugin"),value:c,onChange:e=>{o({barVariant:e})},help:(0,r.__)("Change the variant of the progress bar.","ucla-wordpress-plugin"),options:[{value:"default",label:(0,r.__)("Default","ucla-wordpess-plugin")},{value:"thin",label:(0,r.__)("Thin","ucla-wordpess-plugin")},{value:"thick",label:(0,r.__)("Thick","ucla-wordpess-plugin")},{value:"thicker",label:(0,r.__)("Thicker","ucla-wordpess-plugin")}]}),(0,a.createElement)(t.__experimentalHeading,{as:"span",size:11,upperCase:!0,weight:500},"Select Color"),(0,a.createElement)(t.ColorPalette,{colors:[{name:"Default",color:"#00598c"},{name:"Gold",color:"#ffd100"},{name:"Light Blue",color:"#8bb8e8"},{name:"UCLA Blue",color:"#2774ae"}],value:u,onChange:e=>{o({colorVariant:e})},disableCustomColors:!0}),(0,a.createElement)(t.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:"Please select how much progress has been made.",initialPosition:50,label:"Percentage",max:100,min:0,value:i,onChange:e=>{o({progressNumber:e})}}))),(0,a.createElement)("div",{...g},(0,a.createElement)("div",{className:"ucla-progress"},(0,a.createElement)("div",{className:"ucla-progress__info"},(0,a.createElement)("label",{htmlFor:`ucla-progress-${p}`,className:"ucla-progress__label"},(0,a.createElement)(l.RichText,{value:e.label,onChange:e=>{o({label:e})},placeholder:"Label"})),(0,a.createElement)("div",{className:"ucla-progress__percent"},(0,a.createElement)(l.RichText,{value:e.progressValue,onChange:e=>{o({progressValue:e})},placeholder:"100%"}))),(0,a.createElement)("progress",{className:`ucla-progress__bar ucla-progress__bar--${c} ucla-progress__bar--${(e=>{switch(e){case"#00598c":return"default";case"#ffd100":return"gold";case"#8bb8e8":return"light-blue";case"#2774ae":return"ucla-blue";default:return}})(u)}`,id:`ucla-progress-${p}`,max:"100",value:i}),(0,a.createElement)("div",{className:"ucla-progress__assistive"},(0,a.createElement)(l.RichText,{value:e.message,onChange:e=>{o({message:e})},placeholder:"Assistive text goes here"})))))},save:({attributes:e})=>{const{barVariant:r,colorVariant:t,progressNumber:s,blockId:o}=e,n=l.useBlockProps.save();return(0,a.createElement)("div",{...n},(0,a.createElement)("div",{className:"ucla-progress"},(0,a.createElement)("div",{className:"ucla-progress__info"},(0,a.createElement)("label",{htmlFor:`ucla-progress-${o}`,className:"ucla-progress__label"},(0,a.createElement)(l.RichText.Content,{value:e.label})),(0,a.createElement)("div",{className:"ucla-progress__percent"},(0,a.createElement)(l.RichText.Content,{value:e.progressValue}))),(0,a.createElement)("progress",{className:`ucla-progress__bar ucla-progress__bar--${r} ucla-progress__bar--${(e=>{switch(e){case"#00598c":return"default";case"#ffd100":return"gold";case"#8bb8e8":return"light-blue";case"#2774ae":return"ucla-blue";default:return}})(t)}`,id:`ucla-progress-${o}`,max:"100",value:s}),(0,a.createElement)("div",{className:"ucla-progress__assistive"},(0,a.createElement)(l.RichText.Content,{value:e.message}))))}})}},r={};function l(e){var t=r[e];if(void 0!==t)return t.exports;var s=r[e]={exports:{}};return a[e](s,s.exports,l),s.exports}l.m=a,e=[],l.O=(a,r,t,s)=>{if(!r){var o=1/0;for(i=0;i<e.length;i++){for(var[r,t,s]=e[i],n=!0,c=0;c<r.length;c++)(!1&s||o>=s)&&Object.keys(l.O).every((e=>l.O[e](r[c])))?r.splice(c--,1):(n=!1,s<o&&(o=s));if(n){e.splice(i--,1);var u=t();void 0!==u&&(a=u)}}return a}s=s||0;for(var i=e.length;i>0&&e[i-1][2]>s;i--)e[i]=e[i-1];e[i]=[r,t,s]},l.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),(()=>{var e={548:0,788:0};l.O.j=a=>0===e[a];var a=(a,r)=>{var t,s,[o,n,c]=r,u=0;if(o.some((a=>0!==e[a]))){for(t in n)l.o(n,t)&&(l.m[t]=n[t]);if(c)var i=c(l)}for(a&&a(r);u<o.length;u++)s=o[u],l.o(e,s)&&e[s]&&e[s][0](),e[s]=0;return l.O(i)},r=globalThis.webpackChunkucla_wordpress_plugin=globalThis.webpackChunkucla_wordpress_plugin||[];r.forEach(a.bind(null,0)),r.push=a.bind(null,r.push.bind(r))})();var t=l.O(void 0,[788],(()=>l(173)));t=l.O(t)})();