@integrativedesigndevelopment/dashboard-core 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +1 -13
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -13
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/dist/actions/pluginActions.d.ts +0 -48
- package/dist/actions/pluginActions.d.ts.map +0 -1
- package/dist/actions/types.d.ts +0 -17
- package/dist/actions/types.d.ts.map +0 -1
- package/dist/components/ActivityProvider/index.d.ts +0 -10
- package/dist/components/ActivityProvider/index.d.ts.map +0 -1
- package/dist/components/CancelActionButton/index.d.ts +0 -14
- package/dist/components/CancelActionButton/index.d.ts.map +0 -1
- package/dist/components/Card/index.d.ts +0 -18
- package/dist/components/Card/index.d.ts.map +0 -1
- package/dist/components/ConfirmActionButton/index.d.ts +0 -14
- package/dist/components/ConfirmActionButton/index.d.ts.map +0 -1
- package/dist/components/ErrorBoundary/index.d.ts +0 -18
- package/dist/components/ErrorBoundary/index.d.ts.map +0 -1
- package/dist/components/IDDLink/index.d.ts +0 -12
- package/dist/components/IDDLink/index.d.ts.map +0 -1
- package/dist/components/IDDLinkInputItem/index.d.ts +0 -18
- package/dist/components/IDDLinkInputItem/index.d.ts.map +0 -1
- package/dist/components/Layout/SimpleLayout.d.ts +0 -8
- package/dist/components/Layout/SimpleLayout.d.ts.map +0 -1
- package/dist/components/Layout/index.d.ts +0 -8
- package/dist/components/Layout/index.d.ts.map +0 -1
- package/dist/components/Loader/index.d.ts +0 -16
- package/dist/components/Loader/index.d.ts.map +0 -1
- package/dist/components/LoginBackground/index.d.ts +0 -29
- package/dist/components/LoginBackground/index.d.ts.map +0 -1
- package/dist/components/LoginBackground/index.improved.d.ts +0 -16
- package/dist/components/LoginBackground/index.improved.d.ts.map +0 -1
- package/dist/components/LoginBackground/types.d.ts +0 -27
- package/dist/components/LoginBackground/types.d.ts.map +0 -1
- package/dist/components/LoginBackground/utils.d.ts +0 -30
- package/dist/components/LoginBackground/utils.d.ts.map +0 -1
- package/dist/components/Modal/index.d.ts +0 -18
- package/dist/components/Modal/index.d.ts.map +0 -1
- package/dist/components/Password/index.d.ts +0 -15
- package/dist/components/Password/index.d.ts.map +0 -1
- package/dist/components/PasswordStrengthIndicator/index.d.ts +0 -47
- package/dist/components/PasswordStrengthIndicator/index.d.ts.map +0 -1
- package/dist/components/PasswordStrengthIndicator/index.improved.d.ts +0 -47
- package/dist/components/PasswordStrengthIndicator/index.improved.d.ts.map +0 -1
- package/dist/components/SimpleButton/index.d.ts +0 -16
- package/dist/components/SimpleButton/index.d.ts.map +0 -1
- package/dist/components/TextInput/index.d.ts +0 -16
- package/dist/components/TextInput/index.d.ts.map +0 -1
- package/dist/components/forms/FormField/index.d.ts +0 -19
- package/dist/components/forms/FormField/index.d.ts.map +0 -1
- package/dist/components/forms/FormField/index.improved.d.ts +0 -27
- package/dist/components/forms/FormField/index.improved.d.ts.map +0 -1
- package/dist/components/forms/SubmitButton/index.d.ts +0 -11
- package/dist/components/forms/SubmitButton/index.d.ts.map +0 -1
- package/dist/components/forms/SubmitButton/index.improved.d.ts +0 -17
- package/dist/components/forms/SubmitButton/index.improved.d.ts.map +0 -1
- package/dist/components/forms/TermsCheckbox/index.d.ts +0 -13
- package/dist/components/forms/TermsCheckbox/index.d.ts.map +0 -1
- package/dist/components/forms/TermsCheckbox/index.improved.d.ts +0 -23
- package/dist/components/forms/TermsCheckbox/index.improved.d.ts.map +0 -1
- package/dist/components/helpers.d.ts +0 -5
- package/dist/components/helpers.d.ts.map +0 -1
- package/dist/components/index.d.ts +0 -25
- package/dist/components/index.d.ts.map +0 -1
- package/dist/components/utils/componentTemplate.d.ts +0 -40
- package/dist/components/utils/componentTemplate.d.ts.map +0 -1
- package/dist/components/utils/componentWrapper.d.ts +0 -87
- package/dist/components/utils/componentWrapper.d.ts.map +0 -1
- package/dist/config/index.d.ts +0 -23
- package/dist/config/index.d.ts.map +0 -1
- package/dist/hooks/index.d.ts +0 -3
- package/dist/hooks/index.d.ts.map +0 -1
- package/dist/hooks/useAsyncOperation.d.ts +0 -12
- package/dist/hooks/useAsyncOperation.d.ts.map +0 -1
- package/dist/hooks/useUpdateUser.d.ts +0 -32
- package/dist/hooks/useUpdateUser.d.ts.map +0 -1
- package/dist/hooks/useUserManagement.d.ts +0 -51
- package/dist/hooks/useUserManagement.d.ts.map +0 -1
- package/dist/index.d.ts +0 -27
- package/dist/index.d.ts.map +0 -1
- package/dist/metrics/clsMetrics.d.ts +0 -3
- package/dist/metrics/clsMetrics.d.ts.map +0 -1
- package/dist/metrics/fcpMetrics.d.ts +0 -3
- package/dist/metrics/fcpMetrics.d.ts.map +0 -1
- package/dist/metrics/fidMetrics.d.ts +0 -3
- package/dist/metrics/fidMetrics.d.ts.map +0 -1
- package/dist/metrics/index.d.ts +0 -3
- package/dist/metrics/index.d.ts.map +0 -1
- package/dist/metrics/lcpMetrics.d.ts +0 -3
- package/dist/metrics/lcpMetrics.d.ts.map +0 -1
- package/dist/metrics/ttfbMetrics.d.ts +0 -3
- package/dist/metrics/ttfbMetrics.d.ts.map +0 -1
- package/dist/plugin-system/DashboardProvider.d.ts +0 -14
- package/dist/plugin-system/DashboardProvider.d.ts.map +0 -1
- package/dist/plugin-system/PluginManager.d.ts +0 -9
- package/dist/plugin-system/PluginManager.d.ts.map +0 -1
- package/dist/plugin-system/core/Dashboard/Icon.d.ts +0 -6
- package/dist/plugin-system/core/Dashboard/Icon.d.ts.map +0 -1
- package/dist/plugin-system/core/Dashboard/index.d.ts +0 -4
- package/dist/plugin-system/core/Dashboard/index.d.ts.map +0 -1
- package/dist/plugin-system/core/Dashboard/tab0.d.ts +0 -8
- package/dist/plugin-system/core/Dashboard/tab0.d.ts.map +0 -1
- package/dist/plugin-system/core/Dashboard/views/DashboardView/index.d.ts +0 -3
- package/dist/plugin-system/core/Dashboard/views/DashboardView/index.d.ts.map +0 -1
- package/dist/plugin-system/index.d.ts +0 -6
- package/dist/plugin-system/index.d.ts.map +0 -1
- package/dist/plugin-system/plugin_manifest.d.ts +0 -2
- package/dist/plugin-system/plugin_manifest.d.ts.map +0 -1
- package/dist/plugin-system/types.d.ts +0 -76
- package/dist/plugin-system/types.d.ts.map +0 -1
- package/dist/services/errorServices.d.ts +0 -37
- package/dist/services/errorServices.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -76
- package/dist/types/index.d.ts.map +0 -1
- package/dist/utils/array-safety.d.ts +0 -32
- package/dist/utils/array-safety.d.ts.map +0 -1
- package/dist/utils/assetValidation.d.ts +0 -54
- package/dist/utils/assetValidation.d.ts.map +0 -1
- package/dist/utils/fromReq.d.ts +0 -3
- package/dist/utils/fromReq.d.ts.map +0 -1
- package/dist/utils/helpers.d.ts +0 -27
- package/dist/utils/helpers.d.ts.map +0 -1
- package/dist/utils/validation.d.ts +0 -93
- package/dist/utils/validation.d.ts.map +0 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,14 +1,2 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t}from"react/jsx-runtime";import r,{Component as n,useState as i,useCallback as s,useEffect as o,Fragment as a,createContext as l,useContext as c,useRef as d}from"react";import{useTailwindConfig as u,IDDButton as p,IDDLoader as h,IDDInput as f,IDDCard as m}from"@integrativedesigndevelopment/idd-common";import{IDDXIcon as g,IDDShowPasswordIcon as y,IDDHidePasswordIcon as b,IDDOutlineWarningIcon as v,IDDInfoIcon as E,IDDOutlineCheckmarkIcon as N}from"@integrativedesigndevelopment/idd-icons";function T(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(r){if("default"!==r&&!(r in e)){var n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:function(){return t[r]}})}}))})),Object.freeze(e)}var _=function(e,t){return _=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},_(e,t)};function x(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}_(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var k=function(){return k=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},k.apply(this,arguments)};function I(e,t,r,n){return new(r||(r=Promise))((function(i,s){function o(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}l((n=n.apply(e,t||[])).next())}))}function w(e,t,r){if(r||2===arguments.length)for(var n,i=0,s=t.length;i<s;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;class O extends n{constructor(){super(...arguments),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error("ErrorBoundary caught an error:",e,t)}render(){return this.state.hasError?this.props.fallback||e("div",{className:"flex items-center justify-center h-full w-full p-4",children:t("div",{className:"text-center",children:[e("h2",{className:"text-xl font-semibold mb-2",children:"Something went wrong"}),e("p",{className:"text-gray-600 mb-4",children:"An error occurred while loading this component."}),e("button",{onClick:()=>this.setState({hasError:!1,error:void 0}),className:"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600",children:"Try again"})]})}):this.props.children}}const A={loginBackground:{type:"color",value:"#f3f4f6",fallback:"#ffffff",borderRadius:"0px",backgroundSize:"cover",backgroundPosition:"center",additionalStyles:{}}},C=e=>{const t={backgroundRepeat:"no-repeat"};switch(e.borderRadius&&(t.borderRadius=e.borderRadius),"image"===e.type&&(t.backgroundSize=e.backgroundSize||"cover",t.backgroundPosition=e.backgroundPosition||"center"),e.type){case"image":t.backgroundImage=`url('${e.value}')`,t.backgroundColor=e.fallback;break;case"color":t.backgroundColor=e.value;break;case"gradient":t.backgroundImage=e.value,t.backgroundColor=e.fallback;break;default:t.backgroundColor=e.fallback}return t},S=e=>{const t=(new Option).style;return t.color=e,""!==t.color},D=e=>{try{return new URL(e,window.location.origin),!0}catch(e){return!1}},R=e=>{const t=[];return e.type&&["image","color","gradient"].includes(e.type)||t.push('Invalid background type. Must be "image", "color", or "gradient".'),e.value||t.push("Background value is required."),e.fallback&&S(e.fallback)||t.push("Valid fallback color is required."),"image"!==e.type||D(e.value)||t.push("Invalid image URL provided."),"color"!==e.type||S(e.value)||t.push("Invalid color value provided."),t},L=()=>({type:A.loginBackground.type,value:A.loginBackground.value,fallback:A.loginBackground.fallback,borderRadius:A.loginBackground.borderRadius,backgroundSize:A.loginBackground.backgroundSize,backgroundPosition:A.loginBackground.backgroundPosition,additionalStyles:A.loginBackground.additionalStyles}),F=e=>new Promise(((t,r)=>{const n=new Image;n.onload=()=>t(n),n.onerror=r,n.src=e})),P=(e,t)=>{let r;return(...n)=>{clearTimeout(r),r=setTimeout((()=>e(...n)),t)}},M=({config:t,className:r="",children:n,onImageError:a,onImageLoad:l,"data-testid":c="login-background"})=>{const[d,u]=i(!1),[p,h]=i(!1),[f,m]=i(!1),g=t||L(),y=R(g);y.length>0&&console.warn("LoginBackground configuration errors:",y);const b=s((()=>I(void 0,void 0,void 0,(function*(){if("image"===g.type){m(!0),h(!1);try{yield F(g.value),u(!0),h(!1),null==l||l(new Event("load"))}catch(e){h(!0),u(!1),null==a||a(new Event("error")),console.warn("Failed to load background image:",g.value)}finally{m(!1)}}}))),[g.type,g.value,a,l]);o((()=>{b()}),[b]),o((()=>{const e=document.documentElement;"image"===g.type?e.style.setProperty("--login-bg-image",`url('${g.value}')`):"color"===g.type?(e.style.setProperty("--login-bg-image","none"),e.style.setProperty("--login-bg-color",g.value)):"gradient"===g.type&&e.style.setProperty("--login-bg-image",g.value),e.style.setProperty("--login-bg-fallback",g.fallback),g.backgroundSize&&e.style.setProperty("--login-bg-size",g.backgroundSize),g.backgroundPosition&&e.style.setProperty("--login-bg-position",g.backgroundPosition),"image"===g.type&&(p||f)&&(e.style.setProperty("--login-bg-image","none"),e.style.setProperty("--login-bg-color",g.fallback))}),[g,p,f]);const v=g.additionalStyles||{},E=["bg-login","transition-all duration-300 ease-in-out","min-h-full w-full",r].filter(Boolean).join(" ");return e(O,{fallback:e("div",{children:"Something went wrong with the background"}),children:e("div",{className:E,style:v,"data-testid":c,"data-background-type":g.type,"data-image-loaded":"image"===g.type?d:void 0,"aria-label":"image"===g.type?`Background image: ${g.value}`:"Background styling",children:n})})},U=()=>s((e=>{if("undefined"==typeof window||"undefined"==typeof document)return;const t=document.documentElement;try{if("image"===e.type&&e.value){const r=e.value.replace(/[<>"']/g,"");t.style.setProperty("--login-bg-image",`url('${r}')`)}else if("color"===e.type&&e.value){/^(#[0-9A-F]{6}|#[0-9A-F]{3}|rgb\(|rgba\(|hsl\(|hsla\()/i.test(e.value)&&(t.style.setProperty("--login-bg-image","none"),t.style.setProperty("--login-bg-color",e.value))}else"gradient"===e.type&&e.value&&e.value.includes("gradient(")&&t.style.setProperty("--login-bg-image",e.value);if(e.fallback){const r=e.fallback.replace(/[<>"']/g,"");t.style.setProperty("--login-bg-fallback",r)}if(e.backgroundSize){(["cover","contain","auto","100%"].includes(e.backgroundSize)||/^\d+(px|%|em|rem)$/.test(e.backgroundSize))&&t.style.setProperty("--login-bg-size",e.backgroundSize)}if(e.backgroundPosition){/^(center|left|right|top|bottom|\d+(px|%|em|rem)|\s)+$/.test(e.backgroundPosition)&&t.style.setProperty("--login-bg-position",e.backgroundPosition)}}catch(e){console.warn("Failed to set login background styles:",e)}}),[]);var j;!function(e){e[e.VERY_WEAK=0]="VERY_WEAK",e[e.WEAK=1]="WEAK",e[e.FAIR=2]="FAIR",e[e.GOOD=3]="GOOD",e[e.STRONG=4]="STRONG"}(j||(j={}));const B=e=>e/4*100,V=r.memo((({analysis:r,showDetails:n=!0,className:i=""})=>{const s=B(r.score);return t("div",{className:`password-strength-indicator ${i}`,role:"status","aria-live":"polite",children:[t("div",{className:"flex items-center gap-2 mb-2",children:[e("div",{className:"flex-1 bg-gray-200 rounded-full h-2",role:"progressbar","aria-valuenow":r.score,"aria-valuemin":0,"aria-valuemax":4,children:e("div",{className:"h-2 rounded-full transition-all duration-300",style:{width:`${s}%`}})}),e("span",{className:"text-sm font-medium",children:r.label})]}),n&&t("div",{className:"space-y-2",children:[t("div",{className:"flex justify-between text-xs text-gray-600",children:[t("span",{children:["Entropy: ",r.entropy," bits"]}),t("span",{children:["Crack time: ",r.crackTime]})]}),r.warnings.length>0&&e("div",{className:"space-y-1",children:r.warnings.map(((r,n)=>t("div",{className:"flex items-start gap-2 text-xs text-amber-600",children:[e("span",{className:"text-amber-500 mt-0.5",children:"⚠"}),e("span",{children:r})]},n)))}),r.suggestions.length>0&&e("div",{className:"space-y-1",children:r.suggestions.map(((r,n)=>t("div",{className:"flex items-start gap-2 text-xs text-blue-600",children:[e("span",{className:"text-blue-500 mt-0.5",children:"💡"}),e("span",{children:r})]},n)))}),e("div",{className:"text-xs font-medium "+(r.isAcceptable?"text-green-600":"text-red-600"),children:r.isAcceptable?"✓ Password meets security requirements":"✗ Password does not meet security requirements"})]})]})})),z=r.memo((({score:t,className:r=""})=>{const n=B(t);return e("div",{className:`w-full bg-gray-200 rounded-full h-1 ${r}`,children:e("div",{className:`h-1 rounded-full transition-all duration-300 ${(e=>{switch(e){case j.VERY_WEAK:return"bg-red-500";case j.WEAK:return"bg-orange-500";case j.FAIR:return"bg-yellow-500";case j.GOOD:return"bg-lime-500";case j.STRONG:return"bg-green-500";default:return"bg-gray-300"}})(t)}`,style:{width:`${n}%`}})})})),$=({requirements:r,password:n,className:i=""})=>t("div",{className:`password-requirements ${i}`,children:[e("div",{className:"text-sm font-medium text-gray-700 mb-2",children:"Password Requirements:"}),e("ul",{className:"space-y-1",children:r.map(((r,i)=>{const s=!!n&&(e=>{if(e.includes("lowercase"))return/[a-z]/.test(n);if(e.includes("uppercase"))return/[A-Z]/.test(n);if(e.includes("number"))return/[0-9]/.test(n);if(e.includes("special character"))return/[!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?]/.test(n);if(e.includes("characters long")){const t=e.match(/(\d+)-(\d+) characters/);if(t){const e=parseInt(t[1]),r=parseInt(t[2]);return n.length>=e&&n.length<=r}}return!1})(r);return t("li",{className:"flex items-start gap-2 text-xs",children:[e("span",{className:"mt-0.5 "+(s?"text-green-500":"text-gray-400"),children:s?"✓":"○"}),e("span",{className:s?"text-green-600":"text-gray-600",children:r})]},i)}))})]}),G={title:"IDD Dashboard",pages:[],plugins:["Dashboard"],categories:[],sub_categories:{},style:{colors:{"idd-red":"#DD3150","idd-red-20":"#F6CBD3","idd-orange":"#D1823B","idd-orange-20":"#F3DFCE","idd-yellow":"#D9C982","idd-yellow-20":"#F4EFDA","idd-green":"#98BD83","idd-green-20":"#E5EEE0","idd-blue":"#00A89D","idd-blue-20":"#6F6F5","idd-purple":"#4040D8","idd-purple-20":"#CFCFF5","idd-brown":"#7A6C53","idd-brown-20":"#F2F0EE","idd-black":"#19191c","idd-black-20":"#C5C5C6","idd-grey":"#6D6E81","idd-grey-20":"#DCDCE1","idd-white":"#fff","idd-transparent":"transparent","idd-primary-color":"#292929","idd-secondary-color":"#5f696d","idd-tertiary-color":"#d8dfe7","idd-tertiary-color-20":"#ECECEC","idd-active-color":"#ad0000","idd-inactive-color":"#DCDCE1","idd-primary-background":"#ad0000","idd-secondary-background":"#f2f0ee","idd-tertiary-background":"#F6F6F9","idd-active-background":"#7a6c53","idd-inactive-background":"#7a6c531a","idd-shadow-color":"rgba(50,69,71,0.17)"},fontFamily:{"idd-primary-font":"Gotham-Book","idd-primary-font-light":"Gotham-Light","idd-primary-font-regular":"Gotham-Book","idd-primary-font-medium":"Gotham-Medium","idd-primary-font-bold":"Gotham-Bold","idd-secondary-font":"Rubik-Regular","idd-secondary-font-light":"Rubik-Light","idd-secondary-font-regular":"Rubik-Regular","idd-secondary-font-medium":"Rubik-Medium","idd-secondary-font-bold":"Rubik-Bold"},fontStyle:{"idd-font-style":"normal"},fontWeight:{"idd-light-font-weight":"300","idd-regular-font-weight":"normal","idd-medium-font-weight":"medium","idd-bold-font-weight":"bold"},fontSize:{"idd-primary-font-size":"1rem","idd-xtrasmall-font-size":"0.25rem","idd-small-font-size":"0.5rem","idd-medium-font-size":"1.125rem","idd-large-font-size":"1.25rem","idd-xtralarge-font-size":"1.5rem"},letterSpacing:{"idd-character-spacing":"0","idd-body-character-spacing":"0.05"},lineHeight:{"idd-primary-line-spacing":"1.5"},backgroundImage:{"gradient-radial":"radial-gradient(var(--tw-gradient-stops))","gradient-conic":"conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))","signup-theme":"linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('/signup-theme.png')"},borderRadius:{"idd-border-radius":"0.3125rem"}}};let K=G;const Y=e=>{K=Object.assign(Object.assign({},G),e)},q=()=>K,W=()=>q(),J=()=>{const e=W(),t=u(e.style);return{config:e,tailwindConfig:t,colors:t.colors}},Q={primary:{base:"text-idd-white bg-idd-active-color hover:bg-idd-primary-color focus:bg-idd-primary-color",disabled:"opacity-50 cursor-not-allowed"},secondary:{base:"text-idd-active-color bg-idd-tertiary-background border border-idd-active-color hover:bg-idd-active-color hover:text-idd-white focus:bg-idd-active-color focus:text-idd-white",disabled:"opacity-50 cursor-not-allowed"},tertiary:{base:"text-idd-black bg-idd-tertiary-background hover:bg-idd-grey-20 focus:bg-idd-grey-20",disabled:"opacity-50 cursor-not-allowed"},outline:{base:"text-idd-active-color bg-transparent border border-idd-active-color hover:bg-idd-active-color hover:text-idd-white focus:bg-idd-active-color focus:text-idd-white",disabled:"opacity-50 cursor-not-allowed"},ghost:{base:"text-idd-grey bg-transparent hover:bg-idd-grey-20 hover:text-idd-black focus:bg-idd-grey-20 focus:text-idd-black",disabled:"opacity-50 cursor-not-allowed"},danger:{base:"text-idd-white bg-idd-red hover:opacity-90 focus:opacity-90",disabled:"opacity-50 cursor-not-allowed"},success:{base:"text-idd-white bg-idd-green hover:opacity-90 focus:opacity-90",disabled:"opacity-50 cursor-not-allowed"}},H={button:"font-idd-primary-font-medium text-idd-primary-font-size text-center py-2 px-4 rounded-sm focus:outline-none focus-visible:outline-none transition-colors duration-200",input:"w-full h-[3.125rem] rounded-sm",error:"font-idd-primary-font text-idd-primary-font-size !mb-0",label:"font-idd-primary-font-medium text-idd-primary-font-size"},X=(e="primary",t=!1,r="")=>{const n=Q[e];return`${H.button} ${t?n.disabled:n.base} ${r}`.trim()},Z=({children:t,onPress:r,onClick:n,disabled:i=!1,type:s="button",className:o="",variant:a="primary","data-testid":l})=>e(p,{type:s,onPress:r||n||(()=>{}),disabled:i,buttonClass:X(a,i,o),"data-testid":l,children:t}),ee=r.memo((({label:r,type:n,value:i,onChange:s,errors:o=[],required:a=!1,autoComplete:l,placeholder:c,disabled:d=!1,showErrors:u=!1,showPasswordToggle:p=!1,onTogglePassword:h,showPassword:f=!1})=>{const m=u&&o.length>0,g=`field-${r.toLowerCase().replace(/\s+/g,"-")}`;return t("div",{className:"form-field "+(m?"form-field--error":""),children:[t("label",{htmlFor:g,className:"form-field__label",children:[r,a&&e("span",{className:"form-field__required","aria-label":"required",children:"*"})]}),t("div",{className:"form-field__input-wrapper",children:[e("input",{id:g,type:n,value:i,onChange:e=>s(e.target.value),autoComplete:l,placeholder:c,disabled:d,required:a,className:"form-field__input "+(m?"form-field__input--error":""),"aria-invalid":m,"aria-required":a,"aria-describedby":m?`${g}-errors`:void 0}),p&&e(Z,{type:"button",onPress:h,variant:"ghost",className:"form-field__password-toggle",disabled:d,"data-testid":"password-toggle",children:f?"👁️":"👁️🗨️"})]}),m&&e("div",{id:`${g}-errors`,className:"form-field__errors",role:"alert",children:o.map(((t,r)=>e("div",{className:"form-field__error",children:t},r)))})]})})),te=({size:r="medium",message:n="Loading...",show:i=!0,color:s,className:o="","data-testid":a})=>{var l,c;const d=W();return i?(s||null===(c=null===(l=d.style)||void 0===l?void 0:l.colors)||void 0===c||c["idd-active-color"],t("div",{className:`flex flex-col items-center justify-center space-y-4 ${o}`,"data-testid":a,children:[e(h,{}),n&&e("p",{className:"text-sm text-gray-600 font-medium",children:n})]})):null},re=r.memo((({isLoading:r,disabled:n=!1,text:i,loadingText:s,className:o=""})=>t(Z,{type:"submit",disabled:n||r,variant:"primary",className:o,"aria-busy":r,"aria-disabled":n||r,children:[t("div",{className:"flex items-center space-x-2",children:[r&&e("div",{className:"inline-block",children:e(te,{show:!0,size:"small"})}),e("span",{className:"submit-button__text",children:r?s:i})]}),r&&e("span",{id:"submit-loading-text",className:"sr-only",children:"Please wait while we process your request"})]}))),ne=r.memo((({checked:r,onChange:n,errors:i=[],disabled:s=!1,showErrors:o=!1,termsUrl:a="/terms",privacyUrl:l="/privacy"})=>{const c=o&&i.length>0,d="terms-checkbox";return t("div",{className:"terms-checkbox "+(c?"terms-checkbox--error":""),children:[t("div",{className:"terms-checkbox__wrapper",children:[e("input",{id:d,type:"checkbox",checked:r,onChange:e=>n(e.target.checked),disabled:s,className:"terms-checkbox__input "+(c?"terms-checkbox__input--error":""),"aria-invalid":c,"aria-describedby":c?`${d}-errors`:void 0,required:!0}),t("label",{htmlFor:d,className:"terms-checkbox__label",children:[e("span",{className:"terms-checkbox__checkmark","aria-hidden":"true",children:r?"✓":""}),t("span",{className:"terms-checkbox__text",children:["I agree to the"," ",e("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"terms-checkbox__link",children:"Terms of Service"})," ","and"," ",e("a",{href:l,target:"_blank",rel:"noopener noreferrer",className:"terms-checkbox__link",children:"Privacy Policy"}),e("span",{className:"terms-checkbox__required","aria-label":"required",children:"*"})]})]})]}),c&&e("div",{id:`${d}-errors`,className:"terms-checkbox__errors",role:"alert",children:i.map(((t,r)=>e("div",{className:"terms-checkbox__error",children:t},r)))})]})})),ie={SET_PLUGINS:"set_plugins",SET_CURRENT_PLUGIN:"set_current_plugin",SET_CURRENT_TAB:"set_current_tab",SET_CURRENT_STATE:"set_current_state",SET_CURRENT_VIEW:"set_current_view",SET_CURRENT_ITEM:"set_current_item",COLLAPSED_TOGGLE:"toggle_collapsed",SET_COLOR_MODE:"set_color_mode",TOGGLE_NOTIFICATIONS:"toggle_notifications",SET_SETTING:"set_setting",SET_JWT:"SET_JWT",SET_USER:"SET_USER",RESET:"reset"},se=e=>({type:ie.SET_PLUGINS,payload:e}),oe=e=>({type:ie.SET_CURRENT_PLUGIN,payload:e}),ae=e=>({type:ie.SET_CURRENT_TAB,payload:e}),le=e=>({type:ie.SET_CURRENT_STATE,payload:e}),ce=e=>({type:ie.SET_CURRENT_VIEW,payload:e}),de=e=>({type:ie.SET_CURRENT_ITEM,payload:e}),ue=()=>({type:ie.RESET}),pe=(e,t)=>(r,n)=>{r(oe(e)),r(ae(0));const{session:i}=n(),s=[...i.currentState||[]],o=s.findIndex((t=>t.pluginID===e));-1!==o?s[o]={pluginID:e,tabID:t}:s.push({pluginID:e,tabID:t}),r(le(s))},he=(e,t)=>(r,n)=>{r(ae(e));const{session:i}=n(),s=i.current.id,o=[...i.currentState||[]],a=o.findIndex((e=>e.pluginID===s));-1!==a?o[a]={pluginID:s,tabID:t}:o.push({pluginID:s,tabID:t}),r(le(o))},fe=(e,t)=>({type:ie.SET_SETTING,payload:{key:e,value:t}}),me=()=>({type:ie.COLLAPSED_TOGGLE}),ge=()=>({type:ie.TOGGLE_NOTIFICATIONS}),ye=({children:t,onPress:r,disabled:n=!1,type:i="button",className:s="",variant:o="outline","data-testid":a})=>e(p,{type:i,onPress:r||(()=>{}),disabled:n,buttonClass:X(o,n,`px-5 ${s}`),"data-testid":a,children:t}),be=({children:t,onPress:r,disabled:n=!1,type:i="submit",className:s="",variant:o="primary","data-testid":a})=>e(p,{type:i,onPress:r||(()=>{}),disabled:n,buttonClass:X(o,n,`px-5 ${s}`),"data-testid":a,children:t});function ve(e){return/^(?:\w+:)?\/\/([^\s.]+\.\S{2}|localhost[:?\d]*)\S*$/.test(e)}const Ee=({id:r,idsArray:n,onDelete:s=()=>{},onBlur:l=()=>{},link:c,className:d=""})=>{const h=W(),m=u(h.style),[y,b]=i(m.colors["idd-black"]),[v,E]=i({id:"",text:"",url:""});return o((()=>{c&&(c.path&&c.path.length>0?E({id:c.id,text:c.text,url:c.path}):E(c))}),[c]),t("div",{className:`flex justify-between items-center ${d}`,onBlur:e=>{e.stopPropagation(),l(v)},children:[e(f,{id:`link-${r}`,componentClass:"w-[45%]",type:"text",label:"Link Text",labelClass:"text-capitalize",showLabel:!!(v&&v.text&&v.text.length>0),placeholder:"Link Text",value:v.text,inputClass:"ps-3 active-primary-black",onChange:e=>{E(Object.assign(Object.assign({},v),{text:e.target.value}))}}),e(f,{id:`url-${r}`,componentClass:"w-45",type:"url",label:"URL",showLabel:!!(v&&v.url&&v.url.length>0),placeholder:"URL",value:v.url,inputClass:"ps-3 active-primary-black",onChange:e=>{E(Object.assign(Object.assign({},v),{url:e.target.value}))}}),e(p,{id:`removeLink-${r}`,onPress:()=>{if(n){let e=[...n];e=e.filter((e=>e!==r)),E({id:"",text:"",url:""}),s(e)}},onMouseEnter:()=>b("var(--idd-red)"),onFocus:()=>b("var(--idd-red)"),onMouseLeave:()=>b("var(--idd-primary-black)"),onBlur:()=>b("var(--idd-primary-black)"),isSecondary:!0,buttonClass:"flex items-center justify-center border-0 rounded-sm w-[1.5625rem] h-[1.5625rem] p-0",children:t(a,{children:[e("span",{className:"sr-only",children:"remove link"}),e(g,{wrapperClass:"flex justify-center items-center",color:y})]})})]})},Ne=({children:t,className:r="flex items-center justify-center min-h-screen w-full p-5"})=>e(O,{children:e("div",{className:`bg-signup-theme bg-cover bg-center bg-no-repeat ${r}`,children:t})}),Te=({onChange:r=()=>{},label:n="Password",value:s,componentClass:o="",appendToInputClass:l="",error:c="",errorColor:d="",isErrorOnlyColor:h=!0})=>{const[m,g]=i(!1),[v,E]=i(!1),N=W(),T=u(N.style);return e(f,{label:n,value:s,type:m?"text":"password",componentClass:o,appendToInputClass:`me-4 ${l}`,activeTextColor:T.colors["idd-black"],inactiveTextColor:!s||"string"==typeof s&&0===s.length?T.colors["idd-grey"]:T.colors["idd-black"],activeColor:T.colors["idd-black"],inactiveColor:!s||"string"==typeof s&&0===s.length?T.colors["idd-grey"]:T.colors["idd-black"],activeLabelColor:T.colors["idd-black"],inactiveLabelColor:!s||"string"==typeof s&&0===s.length?T.colors["idd-grey"]:T.colors["idd-black"],errors:c,errorColor:h?!s||"string"==typeof s&&0===s.length?T.colors["idd-grey"]:T.colors["idd-black"]:d,errorClass:"font-idd-primary-font text-idd-primary-font-size !mb-0",errorStyle:h?{color:T.colors["idd-active-color"]}:{},onFocus:()=>E(!0),onBlur:()=>E(!1),appendToInput:e(p,{buttonClass:"p-1 rounded-sm focus:outline focus-visible:outline focus:outline-1 focus-visible:outline-1offset-1 focus:outline-idd-black focus-visible:outline-idd-black",onPress:()=>g(!m),children:t(a,{children:[e("span",{className:"sr-only",children:m?"password shown":"password hidden"}),e(m?y:b,{color:v?T.colors["idd-black"]:T.colors["idd-grey"]})]})}),onChange:e=>{r&&r(e)}})},_e=({label:t,onChange:r=()=>{},value:n,placeholder:i,type:s="text",readOnly:o=!1,error:a="",errorColor:l="",isErrorOnlyColor:c=!0})=>{const d=W(),p=u(d.style);return e(f,{label:t,value:n,onChange:r,placeholder:i,type:s,readOnly:o,activeColor:o?p.colors["idd-grey"]:p.colors["idd-black"],inactiveColor:!n||"string"==typeof n&&0===n.length?p.colors["idd-grey"]:p.colors["idd-black"],activeLabelColor:o?p.colors["idd-grey"]:p.colors["idd-black"],inactiveLabelColor:!n||"string"==typeof n&&0===n.length?p.colors["idd-grey"]:p.colors["idd-black"],activeTextColor:o?p.colors["idd-grey"]:p.colors["idd-black"],inactiveTextColor:!n||"string"==typeof n&&0===n.length?p.colors["idd-grey"]:p.colors["idd-black"],inputWrapperClass:"w-full h-[3.125rem] rounded-sm",inputClass:o?"pointer-events-none":"",errors:a,errorColor:c?!n||"string"==typeof n&&0===n.length?p.colors["idd-grey"]:p.colors["idd-black"]:l,errorClass:"font-idd-primary-font text-idd-primary-font-size !mb-0",errorStyle:c?{color:p.colors["idd-active-color"]}:{}})},xe=({children:r,isOpen:n,onClose:i,title:s,showCloseButton:o=!0,size:a="medium",className:l="","data-testid":c})=>{if(!n)return null;return e("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center min-h-screen p-4 z-50",onClick:e=>{e.target===e.currentTarget&&i()},onKeyDown:e=>{"Escape"===e.key&&i()},"data-testid":c,role:"dialog","aria-modal":"true",tabIndex:-1,children:t("div",{className:`bg-white rounded-lg shadow-xl ${{small:"max-w-md",medium:"max-w-lg",large:"max-w-2xl",full:"max-w-full mx-4"}[a]} w-full ${l}`,children:[s&&t("div",{className:"flex items-center justify-between p-6 border-b border-gray-200",children:[e("h2",{className:"text-xl font-semibold text-gray-900",children:s}),o&&e("button",{onClick:i,className:"text-gray-400 hover:text-gray-600 focus:outline-none focus:text-gray-600","aria-label":"Close modal",children:e("svg",{className:"w-6 h-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),e("div",{className:"p-6",children:r})]})})},ke=({children:r,title:n,subtitle:i,className:s="",padding:o="medium",shadow:a="medium",border:l=!0,"data-testid":c})=>{const d=["bg-white rounded-lg",{none:"",small:"shadow-sm",medium:"shadow-md",large:"shadow-lg"}[a],l?"border border-gray-200":"",s].filter(Boolean).join(" ");return e(m,{"data-testid":c,children:e("div",{className:d,children:t("div",{className:{none:"",small:"p-3",medium:"p-6",large:"p-8"}[o],children:[(n||i)&&t("div",{className:"mb-4",children:[n&&e("h3",{className:"text-lg font-semibold text-gray-900 mb-1",children:n}),i&&e("p",{className:"text-sm text-gray-600",children:i})]}),r]})})})};var Ie="Invariant Violation",we=Object.setPrototypeOf,Oe=void 0===we?function(e,t){return e.__proto__=t,e}:we,Ae=function(e){function t(r){void 0===r&&(r=Ie);var n=e.call(this,"number"==typeof r?Ie+": "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return n.framesToPop=1,n.name=Ie,Oe(n,t.prototype),n}return x(t,e),t}(Error);function Ce(e,t){if(!e)throw new Ae(t)}var Se=["debug","log","warn","error","silent"],De=Se.indexOf("log");function Re(e){return function(){if(Se.indexOf(e)>=De)return(console[e]||console.log).apply(console,arguments)}}!function(e){e.debug=Re("debug"),e.log=Re("log"),e.warn=Re("warn"),e.error=Re("error")}(Ce||(Ce={}));var Le="3.14.0";function Fe(e){try{return e()}catch(e){}}var Pe=Fe((function(){return globalThis}))||Fe((function(){return window}))||Fe((function(){return self}))||Fe((function(){return global}))||Fe((function(){return Fe.constructor("return this")()})),Me=new Map;function Ue(e,t){var r,n,i=(r="stringifyForDisplay",n=Me.get(r)||1,Me.set(r,n+1),"".concat(r,":").concat(n,":").concat(Math.random().toString(36).slice(2)));return JSON.stringify(e,(function(e,t){return void 0===t?i:t}),t).split(JSON.stringify(i)).join("<undefined>")}function je(e){return function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];if("number"==typeof t){var i=t;(t=$e(i))||(t=Ge(i,r),r=[])}e.apply(void 0,[t].concat(r))}}var Be=Object.assign((function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];e||Ce(e,$e(t,r)||Ge(t,r))}),{debug:je(Ce.debug),log:je(Ce.log),warn:je(Ce.warn),error:je(Ce.error)}),Ve=Symbol.for("ApolloErrorMessageHandler_"+Le);function ze(e){if("string"==typeof e)return e;try{return Ue(e,2).slice(0,1e3)}catch(e){return"<non-serializable>"}}function $e(e,t){if(void 0===t&&(t=[]),e)return Pe[Ve]&&Pe[Ve](e,t.map(ze))}function Ge(e,t){if(void 0===t&&(t=[]),e)return"An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({version:Le,message:e,args:t.map(ze)})))}function Ke(e,t){if(!Boolean(e))throw new Error(t)}function Ye(e,t){if(!Boolean(e))throw new Error("Unexpected invariant triggered.")}const qe=/\r\n|[\n\r]/g;function We(e,t){let r=0,n=1;for(const i of e.body.matchAll(qe)){if("number"==typeof i.index||Ye(!1),i.index>=t)break;r=i.index+i[0].length,n+=1}return{line:n,column:t+1-r}}function Je(e,t){const r=e.locationOffset.column-1,n="".padStart(r)+e.body,i=t.line-1,s=e.locationOffset.line-1,o=t.line+s,a=1===t.line?r:0,l=t.column+a,c=`${e.name}:${o}:${l}\n`,d=n.split(/\r\n|[\n\r]/g),u=d[i];if(u.length>120){const e=Math.floor(l/80),t=l%80,r=[];for(let e=0;e<u.length;e+=80)r.push(u.slice(e,e+80));return c+Qe([[`${o} |`,r[0]],...r.slice(1,e+1).map((e=>["|",e])),["|","^".padStart(t)],["|",r[e+1]]])}return c+Qe([[o-1+" |",d[i-1]],[`${o} |`,u],["|","^".padStart(l)],[`${o+1} |`,d[i+1]]])}function Qe(e){const t=e.filter((([e,t])=>void 0!==t)),r=Math.max(...t.map((([e])=>e.length)));return t.map((([e,t])=>e.padStart(r)+(t?" "+t:""))).join("\n")}class He extends Error{constructor(e,...t){var r,n,i;const{nodes:s,source:o,positions:a,path:l,originalError:c,extensions:d}=function(e){const t=e[0];return null==t||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}(t);super(e),this.name="GraphQLError",this.path=null!=l?l:void 0,this.originalError=null!=c?c:void 0,this.nodes=Xe(Array.isArray(s)?s:s?[s]:void 0);const u=Xe(null===(r=this.nodes)||void 0===r?void 0:r.map((e=>e.loc)).filter((e=>null!=e)));this.source=null!=o?o:null==u||null===(n=u[0])||void 0===n?void 0:n.source,this.positions=null!=a?a:null==u?void 0:u.map((e=>e.start)),this.locations=a&&o?a.map((e=>We(o,e))):null==u?void 0:u.map((e=>We(e.source,e.start)));const p="object"==typeof(h=null==c?void 0:c.extensions)&&null!==h?null==c?void 0:c.extensions:void 0;var h;this.extensions=null!==(i=null!=d?d:p)&&void 0!==i?i:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=c&&c.stack?Object.defineProperty(this,"stack",{value:c.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,He):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const r of this.nodes)r.loc&&(e+="\n\n"+Je((t=r.loc).source,We(t.source,t.start)));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+Je(this.source,t);var t;return e}toJSON(){const e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function Xe(e){return void 0===e||0===e.length?void 0:e}function Ze(e,t,r){return new He(`Syntax Error: ${r}`,{source:e,positions:[t]})}class et{constructor(e,t,r){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=r}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class tt{constructor(e,t,r,n,i,s){this.kind=e,this.start=t,this.end=r,this.line=n,this.column=i,this.value=s,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}var rt,nt,it,st;function ot(e){return e>=48&&e<=57}function at(e){return e>=97&&e<=122||e>=65&&e<=90}function lt(e){return at(e)||95===e}function ct(e){return at(e)||ot(e)||95===e}function dt(e){var t;let r=Number.MAX_SAFE_INTEGER,n=null,i=-1;for(let t=0;t<e.length;++t){var s;const o=e[t],a=ut(o);a!==o.length&&(n=null!==(s=n)&&void 0!==s?s:t,i=t,0!==t&&a<r&&(r=a))}return e.map(((e,t)=>0===t?e:e.slice(r))).slice(null!==(t=n)&&void 0!==t?t:0,i+1)}function ut(e){let t=0;for(;t<e.length&&(9===(r=e.charCodeAt(t))||32===r);)++t;var r;return t}new Set(Object.keys({Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]})),function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"}(rt||(rt={})),function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"}(nt||(nt={})),function(e){e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",e.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",e.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",e.UNION_TYPE_EXTENSION="UnionTypeExtension",e.ENUM_TYPE_EXTENSION="EnumTypeExtension",e.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"}(it||(it={})),function(e){e.SOF="<SOF>",e.EOF="<EOF>",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"}(st||(st={}));class pt{constructor(e){const t=new tt(st.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){this.lastToken=this.token;return this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==st.EOF)do{if(e.next)e=e.next;else{const t=vt(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===st.COMMENT);return e}}function ht(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function ft(e,t){return mt(e.charCodeAt(t))&>(e.charCodeAt(t+1))}function mt(e){return e>=55296&&e<=56319}function gt(e){return e>=56320&&e<=57343}function yt(e,t){const r=e.source.body.codePointAt(t);if(void 0===r)return st.EOF;if(r>=32&&r<=126){const e=String.fromCodePoint(r);return'"'===e?"'\"'":`"${e}"`}return"U+"+r.toString(16).toUpperCase().padStart(4,"0")}function bt(e,t,r,n,i){const s=e.line,o=1+r-e.lineStart;return new tt(t,r,n,s,o,i)}function vt(e,t){const r=e.source.body,n=r.length;let i=t;for(;i<n;){const t=r.charCodeAt(i);switch(t){case 65279:case 9:case 32:case 44:++i;continue;case 10:++i,++e.line,e.lineStart=i;continue;case 13:10===r.charCodeAt(i+1)?i+=2:++i,++e.line,e.lineStart=i;continue;case 35:return Et(e,i);case 33:return bt(e,st.BANG,i,i+1);case 36:return bt(e,st.DOLLAR,i,i+1);case 38:return bt(e,st.AMP,i,i+1);case 40:return bt(e,st.PAREN_L,i,i+1);case 41:return bt(e,st.PAREN_R,i,i+1);case 46:if(46===r.charCodeAt(i+1)&&46===r.charCodeAt(i+2))return bt(e,st.SPREAD,i,i+3);break;case 58:return bt(e,st.COLON,i,i+1);case 61:return bt(e,st.EQUALS,i,i+1);case 64:return bt(e,st.AT,i,i+1);case 91:return bt(e,st.BRACKET_L,i,i+1);case 93:return bt(e,st.BRACKET_R,i,i+1);case 123:return bt(e,st.BRACE_L,i,i+1);case 124:return bt(e,st.PIPE,i,i+1);case 125:return bt(e,st.BRACE_R,i,i+1);case 34:return 34===r.charCodeAt(i+1)&&34===r.charCodeAt(i+2)?At(e,i):_t(e,i)}if(ot(t)||45===t)return Nt(e,i,t);if(lt(t))return Ct(e,i);throw Ze(e.source,i,39===t?"Unexpected single quote character ('), did you mean to use a double quote (\")?":ht(t)||ft(r,i)?`Unexpected character: ${yt(e,i)}.`:`Invalid character: ${yt(e,i)}.`)}return bt(e,st.EOF,n,n)}function Et(e,t){const r=e.source.body,n=r.length;let i=t+1;for(;i<n;){const e=r.charCodeAt(i);if(10===e||13===e)break;if(ht(e))++i;else{if(!ft(r,i))break;i+=2}}return bt(e,st.COMMENT,t,i,r.slice(t+1,i))}function Nt(e,t,r){const n=e.source.body;let i=t,s=r,o=!1;if(45===s&&(s=n.charCodeAt(++i)),48===s){if(s=n.charCodeAt(++i),ot(s))throw Ze(e.source,i,`Invalid number, unexpected digit after 0: ${yt(e,i)}.`)}else i=Tt(e,i,s),s=n.charCodeAt(i);if(46===s&&(o=!0,s=n.charCodeAt(++i),i=Tt(e,i,s),s=n.charCodeAt(i)),69!==s&&101!==s||(o=!0,s=n.charCodeAt(++i),43!==s&&45!==s||(s=n.charCodeAt(++i)),i=Tt(e,i,s),s=n.charCodeAt(i)),46===s||lt(s))throw Ze(e.source,i,`Invalid number, expected digit but got: ${yt(e,i)}.`);return bt(e,o?st.FLOAT:st.INT,t,i,n.slice(t,i))}function Tt(e,t,r){if(!ot(r))throw Ze(e.source,t,`Invalid number, expected digit but got: ${yt(e,t)}.`);const n=e.source.body;let i=t+1;for(;ot(n.charCodeAt(i));)++i;return i}function _t(e,t){const r=e.source.body,n=r.length;let i=t+1,s=i,o="";for(;i<n;){const n=r.charCodeAt(i);if(34===n)return o+=r.slice(s,i),bt(e,st.STRING,t,i+1,o);if(92!==n){if(10===n||13===n)break;if(ht(n))++i;else{if(!ft(r,i))throw Ze(e.source,i,`Invalid character within String: ${yt(e,i)}.`);i+=2}}else{o+=r.slice(s,i);const t=117===r.charCodeAt(i+1)?123===r.charCodeAt(i+2)?xt(e,i):kt(e,i):Ot(e,i);o+=t.value,i+=t.size,s=i}}throw Ze(e.source,i,"Unterminated string.")}function xt(e,t){const r=e.source.body;let n=0,i=3;for(;i<12;){const e=r.charCodeAt(t+i++);if(125===e){if(i<5||!ht(n))break;return{value:String.fromCodePoint(n),size:i}}if(n=n<<4|wt(e),n<0)break}throw Ze(e.source,t,`Invalid Unicode escape sequence: "${r.slice(t,t+i)}".`)}function kt(e,t){const r=e.source.body,n=It(r,t+2);if(ht(n))return{value:String.fromCodePoint(n),size:6};if(mt(n)&&92===r.charCodeAt(t+6)&&117===r.charCodeAt(t+7)){const e=It(r,t+8);if(gt(e))return{value:String.fromCodePoint(n,e),size:12}}throw Ze(e.source,t,`Invalid Unicode escape sequence: "${r.slice(t,t+6)}".`)}function It(e,t){return wt(e.charCodeAt(t))<<12|wt(e.charCodeAt(t+1))<<8|wt(e.charCodeAt(t+2))<<4|wt(e.charCodeAt(t+3))}function wt(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function Ot(e,t){const r=e.source.body;switch(r.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:"\t",size:2}}throw Ze(e.source,t,`Invalid character escape sequence: "${r.slice(t,t+2)}".`)}function At(e,t){const r=e.source.body,n=r.length;let i=e.lineStart,s=t+3,o=s,a="";const l=[];for(;s<n;){const n=r.charCodeAt(s);if(34===n&&34===r.charCodeAt(s+1)&&34===r.charCodeAt(s+2)){a+=r.slice(o,s),l.push(a);const n=bt(e,st.BLOCK_STRING,t,s+3,dt(l).join("\n"));return e.line+=l.length-1,e.lineStart=i,n}if(92!==n||34!==r.charCodeAt(s+1)||34!==r.charCodeAt(s+2)||34!==r.charCodeAt(s+3))if(10!==n&&13!==n)if(ht(n))++s;else{if(!ft(r,s))throw Ze(e.source,s,`Invalid character within String: ${yt(e,s)}.`);s+=2}else a+=r.slice(o,s),l.push(a),13===n&&10===r.charCodeAt(s+1)?s+=2:++s,a="",o=s,i=s;else a+=r.slice(o,s),o=s+1,s+=4}throw Ze(e.source,s,"Unterminated string.")}function Ct(e,t){const r=e.source.body,n=r.length;let i=t+1;for(;i<n;){if(!ct(r.charCodeAt(i)))break;++i}return bt(e,st.NAME,t,i,r.slice(t,i))}function St(e){return Dt(e,[])}function Dt(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return function(e,t){if(null===e)return"null";if(t.includes(e))return"[Circular]";const r=[...t,e];if(function(e){return"function"==typeof e.toJSON}(e)){const t=e.toJSON();if(t!==e)return"string"==typeof t?t:Dt(t,r)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";const r=Math.min(10,e.length),n=e.length-r,i=[];for(let n=0;n<r;++n)i.push(Dt(e[n],t));1===n?i.push("... 1 more item"):n>1&&i.push(`... ${n} more items`);return"["+i.join(", ")+"]"}(e,r);return function(e,t){const r=Object.entries(e);if(0===r.length)return"{}";if(t.length>2)return"["+function(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){const t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}(e)+"]";const n=r.map((([e,r])=>e+": "+Dt(r,t)));return"{ "+n.join(", ")+" }"}(e,r)}(e,t);default:return String(e)}}const Rt=globalThis.process&&"production"===process.env.NODE_ENV?function(e,t){return e instanceof t}:function(e,t){if(e instanceof t)return!0;if("object"==typeof e&&null!==e){var r;const n=t.prototype[Symbol.toStringTag];if(n===(Symbol.toStringTag in e?e[Symbol.toStringTag]:null===(r=e.constructor)||void 0===r?void 0:r.name)){const t=St(e);throw new Error(`Cannot use ${n} "${t}" from another module or realm.\n\nEnsure that there is only one instance of "graphql" in the node_modules\ndirectory. If different versions of "graphql" are the dependencies of other\nrelied on modules, use "resolutions" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate "graphql" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.`)}}return!1};class Lt{constructor(e,t="GraphQL request",r={line:1,column:1}){"string"==typeof e||Ke(!1,`Body must be a string. Received: ${St(e)}.`),this.body=e,this.name=t,this.locationOffset=r,this.locationOffset.line>0||Ke(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Ke(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}class Ft{constructor(e,t={}){const r=function(e){return Rt(e,Lt)}(e)?e:new Lt(e);this._lexer=new pt(r),this._options=t,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){const e=this.expectToken(st.NAME);return this.node(e,{kind:it.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:it.DOCUMENT,definitions:this.many(st.SOF,this.parseDefinition,st.EOF)})}parseDefinition(){if(this.peek(st.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(t.kind===st.NAME){switch(t.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(e)throw Ze(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(t)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(st.BRACE_L))return this.node(e,{kind:it.OPERATION_DEFINITION,operation:rt.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const t=this.parseOperationType();let r;return this.peek(st.NAME)&&(r=this.parseName()),this.node(e,{kind:it.OPERATION_DEFINITION,operation:t,name:r,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(st.NAME);switch(e.value){case"query":return rt.QUERY;case"mutation":return rt.MUTATION;case"subscription":return rt.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(st.PAREN_L,this.parseVariableDefinition,st.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:it.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(st.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(st.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(st.DOLLAR),this.node(e,{kind:it.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:it.SELECTION_SET,selections:this.many(st.BRACE_L,this.parseSelection,st.BRACE_R)})}parseSelection(){return this.peek(st.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,t=this.parseName();let r,n;return this.expectOptionalToken(st.COLON)?(r=t,n=this.parseName()):n=t,this.node(e,{kind:it.FIELD,alias:r,name:n,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(st.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){const t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(st.PAREN_L,t,st.PAREN_R)}parseArgument(e=!1){const t=this._lexer.token,r=this.parseName();return this.expectToken(st.COLON),this.node(t,{kind:it.ARGUMENT,name:r,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(st.SPREAD);const t=this.expectOptionalKeyword("on");return!t&&this.peek(st.NAME)?this.node(e,{kind:it.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:it.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token;return this.expectKeyword("fragment"),!0===this._options.allowLegacyFragmentVariables?this.node(e,{kind:it.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:it.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()}parseValueLiteral(e){const t=this._lexer.token;switch(t.kind){case st.BRACKET_L:return this.parseList(e);case st.BRACE_L:return this.parseObject(e);case st.INT:return this.advanceLexer(),this.node(t,{kind:it.INT,value:t.value});case st.FLOAT:return this.advanceLexer(),this.node(t,{kind:it.FLOAT,value:t.value});case st.STRING:case st.BLOCK_STRING:return this.parseStringLiteral();case st.NAME:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:it.BOOLEAN,value:!0});case"false":return this.node(t,{kind:it.BOOLEAN,value:!1});case"null":return this.node(t,{kind:it.NULL});default:return this.node(t,{kind:it.ENUM,value:t.value})}case st.DOLLAR:if(e){if(this.expectToken(st.DOLLAR),this._lexer.token.kind===st.NAME){const e=this._lexer.token.value;throw Ze(this._lexer.source,t.start,`Unexpected variable "$${e}" in constant value.`)}throw this.unexpected(t)}return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:it.STRING,value:e.value,block:e.kind===st.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:it.LIST,values:this.any(st.BRACKET_L,(()=>this.parseValueLiteral(e)),st.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:it.OBJECT,fields:this.any(st.BRACE_L,(()=>this.parseObjectField(e)),st.BRACE_R)})}parseObjectField(e){const t=this._lexer.token,r=this.parseName();return this.expectToken(st.COLON),this.node(t,{kind:it.OBJECT_FIELD,name:r,value:this.parseValueLiteral(e)})}parseDirectives(e){const t=[];for(;this.peek(st.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const t=this._lexer.token;return this.expectToken(st.AT),this.node(t,{kind:it.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let t;if(this.expectOptionalToken(st.BRACKET_L)){const r=this.parseTypeReference();this.expectToken(st.BRACKET_R),t=this.node(e,{kind:it.LIST_TYPE,type:r})}else t=this.parseNamedType();return this.expectOptionalToken(st.BANG)?this.node(e,{kind:it.NON_NULL_TYPE,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:it.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(st.STRING)||this.peek(st.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");const r=this.parseConstDirectives(),n=this.many(st.BRACE_L,this.parseOperationTypeDefinition,st.BRACE_R);return this.node(e,{kind:it.SCHEMA_DEFINITION,description:t,directives:r,operationTypes:n})}parseOperationTypeDefinition(){const e=this._lexer.token,t=this.parseOperationType();this.expectToken(st.COLON);const r=this.parseNamedType();return this.node(e,{kind:it.OPERATION_TYPE_DEFINITION,operation:t,type:r})}parseScalarTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");const r=this.parseName(),n=this.parseConstDirectives();return this.node(e,{kind:it.SCALAR_TYPE_DEFINITION,description:t,name:r,directives:n})}parseObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");const r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(e,{kind:it.OBJECT_TYPE_DEFINITION,description:t,name:r,interfaces:n,directives:i,fields:s})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(st.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(st.BRACE_L,this.parseFieldDefinition,st.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,t=this.parseDescription(),r=this.parseName(),n=this.parseArgumentDefs();this.expectToken(st.COLON);const i=this.parseTypeReference(),s=this.parseConstDirectives();return this.node(e,{kind:it.FIELD_DEFINITION,description:t,name:r,arguments:n,type:i,directives:s})}parseArgumentDefs(){return this.optionalMany(st.PAREN_L,this.parseInputValueDef,st.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,t=this.parseDescription(),r=this.parseName();this.expectToken(st.COLON);const n=this.parseTypeReference();let i;this.expectOptionalToken(st.EQUALS)&&(i=this.parseConstValueLiteral());const s=this.parseConstDirectives();return this.node(e,{kind:it.INPUT_VALUE_DEFINITION,description:t,name:r,type:n,defaultValue:i,directives:s})}parseInterfaceTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");const r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(e,{kind:it.INTERFACE_TYPE_DEFINITION,description:t,name:r,interfaces:n,directives:i,fields:s})}parseUnionTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");const r=this.parseName(),n=this.parseConstDirectives(),i=this.parseUnionMemberTypes();return this.node(e,{kind:it.UNION_TYPE_DEFINITION,description:t,name:r,directives:n,types:i})}parseUnionMemberTypes(){return this.expectOptionalToken(st.EQUALS)?this.delimitedMany(st.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");const r=this.parseName(),n=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();return this.node(e,{kind:it.ENUM_TYPE_DEFINITION,description:t,name:r,directives:n,values:i})}parseEnumValuesDefinition(){return this.optionalMany(st.BRACE_L,this.parseEnumValueDefinition,st.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,t=this.parseDescription(),r=this.parseEnumValueName(),n=this.parseConstDirectives();return this.node(e,{kind:it.ENUM_VALUE_DEFINITION,description:t,name:r,directives:n})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw Ze(this._lexer.source,this._lexer.token.start,`${Pt(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");const r=this.parseName(),n=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();return this.node(e,{kind:it.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:r,directives:n,fields:i})}parseInputFieldsDefinition(){return this.optionalMany(st.BRACE_L,this.parseInputValueDef,st.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===st.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const t=this.parseConstDirectives(),r=this.optionalMany(st.BRACE_L,this.parseOperationTypeDefinition,st.BRACE_R);if(0===t.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:it.SCHEMA_EXTENSION,directives:t,operationTypes:r})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const t=this.parseName(),r=this.parseConstDirectives();if(0===r.length)throw this.unexpected();return this.node(e,{kind:it.SCALAR_TYPE_EXTENSION,name:t,directives:r})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const t=this.parseName(),r=this.parseImplementsInterfaces(),n=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===r.length&&0===n.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:it.OBJECT_TYPE_EXTENSION,name:t,interfaces:r,directives:n,fields:i})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const t=this.parseName(),r=this.parseImplementsInterfaces(),n=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===r.length&&0===n.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:it.INTERFACE_TYPE_EXTENSION,name:t,interfaces:r,directives:n,fields:i})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const t=this.parseName(),r=this.parseConstDirectives(),n=this.parseUnionMemberTypes();if(0===r.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:it.UNION_TYPE_EXTENSION,name:t,directives:r,types:n})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const t=this.parseName(),r=this.parseConstDirectives(),n=this.parseEnumValuesDefinition();if(0===r.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:it.ENUM_TYPE_EXTENSION,name:t,directives:r,values:n})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const t=this.parseName(),r=this.parseConstDirectives(),n=this.parseInputFieldsDefinition();if(0===r.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:it.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:r,fields:n})}parseDirectiveDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(st.AT);const r=this.parseName(),n=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const s=this.parseDirectiveLocations();return this.node(e,{kind:it.DIRECTIVE_DEFINITION,description:t,name:r,arguments:n,repeatable:i,locations:s})}parseDirectiveLocations(){return this.delimitedMany(st.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,t=this.parseName();if(Object.prototype.hasOwnProperty.call(nt,t.value))return t;throw this.unexpected(e)}node(e,t){return!0!==this._options.noLocation&&(t.loc=new et(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){const t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw Ze(this._lexer.source,t.start,`Expected ${Mt(e)}, found ${Pt(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){const t=this._lexer.token;if(t.kind!==st.NAME||t.value!==e)throw Ze(this._lexer.source,t.start,`Expected "${e}", found ${Pt(t)}.`);this.advanceLexer()}expectOptionalKeyword(e){const t=this._lexer.token;return t.kind===st.NAME&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){const t=null!=e?e:this._lexer.token;return Ze(this._lexer.source,t.start,`Unexpected ${Pt(t)}.`)}any(e,t,r){this.expectToken(e);const n=[];for(;!this.expectOptionalToken(r);)n.push(t.call(this));return n}optionalMany(e,t,r){if(this.expectOptionalToken(e)){const e=[];do{e.push(t.call(this))}while(!this.expectOptionalToken(r));return e}return[]}many(e,t,r){this.expectToken(e);const n=[];do{n.push(t.call(this))}while(!this.expectOptionalToken(r));return n}delimitedMany(e,t){this.expectOptionalToken(e);const r=[];do{r.push(t.call(this))}while(this.expectOptionalToken(e));return r}advanceLexer(){const{maxTokens:e}=this._options,t=this._lexer.advance();if(t.kind!==st.EOF&&(++this._tokenCounter,void 0!==e&&this._tokenCounter>e))throw Ze(this._lexer.source,t.start,`Document contains more that ${e} tokens. Parsing aborted.`)}}function Pt(e){const t=e.value;return Mt(e.kind)+(null!=t?` "${t}"`:"")}function Mt(e){return function(e){return e===st.BANG||e===st.DOLLAR||e===st.AMP||e===st.PAREN_L||e===st.PAREN_R||e===st.SPREAD||e===st.COLON||e===st.EQUALS||e===st.AT||e===st.BRACKET_L||e===st.BRACKET_R||e===st.BRACE_L||e===st.PIPE||e===st.BRACE_R}(e)?`"${e}"`:e}Fe((function(){return navigator.product}));var Ut="function"==typeof Symbol&&"function"==typeof Symbol.for,jt="function"==typeof Fe((function(){return window.document.createElement}));function Bt(){}Fe((function(){return navigator.userAgent.indexOf("jsdom")>=0}));const Vt=Bt,zt="undefined"!=typeof WeakRef?WeakRef:function(e){return{deref:()=>e}},$t="undefined"!=typeof WeakMap?WeakMap:Map,Gt="undefined"!=typeof FinalizationRegistry?FinalizationRegistry:function(){return{register:Bt,unregister:Bt}};class Kt{constructor(e=1/0,t=Vt){this.max=e,this.dispose=t,this.map=new $t,this.newest=null,this.oldest=null,this.unfinalizedNodes=new Set,this.finalizationScheduled=!1,this.size=0,this.finalize=()=>{const e=this.unfinalizedNodes.values();for(let t=0;t<10024;t++){const t=e.next().value;if(!t)break;this.unfinalizedNodes.delete(t);const r=t.key;delete t.key,t.keyRef=new zt(r),this.registry.register(r,t,t)}this.unfinalizedNodes.size>0?queueMicrotask(this.finalize):this.finalizationScheduled=!1},this.registry=new Gt(this.deleteNode.bind(this))}has(e){return this.map.has(e)}get(e){const t=this.getNode(e);return t&&t.value}getNode(e){const t=this.map.get(e);if(t&&t!==this.newest){const{older:e,newer:r}=t;r&&(r.older=e),e&&(e.newer=r),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=r)}return t}set(e,t){let r=this.getNode(e);return r?r.value=t:(r={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=r),this.newest=r,this.oldest=this.oldest||r,this.scheduleFinalization(r),this.map.set(e,r),this.size++,r.value)}clean(){for(;this.oldest&&this.size>this.max;)this.deleteNode(this.oldest)}deleteNode(e){e===this.newest&&(this.newest=e.older),e===this.oldest&&(this.oldest=e.newer),e.newer&&(e.newer.older=e.older),e.older&&(e.older.newer=e.newer),this.size--;const t=e.key||e.keyRef&&e.keyRef.deref();this.dispose(e.value,t),e.keyRef?this.registry.unregister(e):this.unfinalizedNodes.delete(e),t&&this.map.delete(t)}delete(e){const t=this.map.get(e);return!!t&&(this.deleteNode(t),!0)}scheduleFinalization(e){this.unfinalizedNodes.add(e),this.finalizationScheduled||(this.finalizationScheduled=!0,queueMicrotask(this.finalize))}}var Yt=new WeakSet;var qt=function(e,t){var r=new Kt(e,t);return r.set=function(e,t){var r=Kt.prototype.set.call(this,e,t);return function(e){e.size<=(e.max||-1)||Yt.has(e)||(Yt.add(e),setTimeout((function(){e.clean(),Yt.delete(e)}),100))}(this),r},r},Wt=Symbol.for("apollo.cacheSize"),Jt=k({},Pe[Wt]);let Qt=null;const Ht={};let Xt=1;function Zt(e){try{return e()}catch(e){}}const er="@wry/context:Slot",tr=Zt((()=>globalThis))||Zt((()=>global))||Object.create(null),rr=tr[er]||Array[er]||function(e){try{Object.defineProperty(tr,er,{value:e,enumerable:!1,writable:!1,configurable:!0})}finally{return e}}(class{constructor(){this.id=["slot",Xt++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=Qt;e;e=e.parent)if(this.id in e.slots){const t=e.slots[this.id];if(t===Ht)break;return e!==Qt&&(Qt.slots[this.id]=t),!0}return Qt&&(Qt.slots[this.id]=Ht),!1}getValue(){if(this.hasValue())return Qt.slots[this.id]}withValue(e,t,r,n){const i={__proto__:null,[this.id]:e},s=Qt;Qt={parent:s,slots:i};try{return t.apply(n,r)}finally{Qt=s}}static bind(e){const t=Qt;return function(){const r=Qt;try{return Qt=t,e.apply(this,arguments)}finally{Qt=r}}}static noContext(e,t,r){if(!Qt)return e.apply(r,t);{const n=Qt;try{return Qt=null,e.apply(r,t)}finally{Qt=n}}}}),{bind:nr,noContext:ir}=rr;function sr(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Object.create(null);return e.forEach((function(e){e&&Object.keys(e).forEach((function(t){var n=e[t];void 0!==n&&(r[t]=n)}))})),r}new rr;var or=Symbol.for("apollo.deprecations"),ar=Pe,lr=new rr;function cr(e,t){(function(e){return ar[or]||(lr.getValue()||[]).includes(e)})(e)||t()}var dr=function(e){function t(r){var n,i,s=r.graphQLErrors,o=r.protocolErrors,a=r.clientErrors,l=r.networkError,c=r.errorMessage,d=r.extraInfo,u=e.call(this,c)||this;return u.name="ApolloError",u.graphQLErrors=s||[],u.protocolErrors=o||[],u.clientErrors=a||[],u.networkError=l||null,u.message=c||(i=w(w(w([],(n=u).graphQLErrors,!0),n.clientErrors,!0),n.protocolErrors,!0),n.networkError&&i.push(n.networkError),i.map((function(e){return null!==(t=e)&&"object"==typeof t&&e.message||"Error message not found.";var t})).join("\n")),u.extraInfo=d,u.cause=w(w(w([l],s||[],!0),o||[],!0),a||[],!0).find((function(e){return!!e}))||null,u.__proto__=t.prototype,u}return x(t,e),t}(Error);const{toString:ur,hasOwnProperty:pr}=Object.prototype,hr=Function.prototype.toString,fr=new Map;function mr(e,t){try{return gr(e,t)}finally{fr.clear()}}function gr(e,t){if(e===t)return!0;const r=ur.call(e);if(r!==ur.call(t))return!1;switch(r){case"[object Array]":if(e.length!==t.length)return!1;case"[object Object]":{if(Er(e,t))return!0;const r=yr(e),n=yr(t),i=r.length;if(i!==n.length)return!1;for(let e=0;e<i;++e)if(!pr.call(t,r[e]))return!1;for(let n=0;n<i;++n){const i=r[n];if(!gr(e[i],t[i]))return!1}return!0}case"[object Error]":return e.name===t.name&&e.message===t.message;case"[object Number]":if(e!=e)return t!=t;case"[object Boolean]":case"[object Date]":return+e===+t;case"[object RegExp]":case"[object String]":return e==`${t}`;case"[object Map]":case"[object Set]":{if(e.size!==t.size)return!1;if(Er(e,t))return!0;const n=e.entries(),i="[object Map]"===r;for(;;){const e=n.next();if(e.done)break;const[r,s]=e.value;if(!t.has(r))return!1;if(i&&!gr(s,t.get(r)))return!1}return!0}case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":e=new Uint8Array(e),t=new Uint8Array(t);case"[object DataView]":{let r=e.byteLength;if(r===t.byteLength)for(;r--&&e[r]===t[r];);return-1===r}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{const r=hr.call(e);return r===hr.call(t)&&!function(e,t){const r=e.length-t.length;return r>=0&&e.indexOf(t,r)===r}(r,vr)}}return!1}function yr(e){return Object.keys(e).filter(br,e)}function br(e){return void 0!==this[e]}const vr="{ [native code] }";function Er(e,t){let r=fr.get(e);if(r){if(r.has(t))return!0}else fr.set(e,r=new Set);return r.add(t),!1}function Nr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Tr=new Map,_r=new Map,xr=!0,kr=!1;function Ir(e){return e.replace(/[\s,]+/g," ").trim()}function wr(e){var t=new Set,r=[];return e.definitions.forEach((function(e){if("FragmentDefinition"===e.kind){var n=e.name.value,i=Ir((o=e.loc).source.body.substring(o.start,o.end)),s=_r.get(n);s&&!s.has(i)?xr&&console.warn("Warning: fragment with name "+n+" already exists.\ngraphql-tag enforces all fragment names across your application to be unique; read more about\nthis in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"):s||_r.set(n,s=new Set),s.add(i),t.has(i)||(t.add(i),r.push(e))}else r.push(e);var o})),k(k({},e),{definitions:r})}function Or(e){var t=Ir(e);if(!Tr.has(t)){var r=function(e,t){const r=new Ft(e,t),n=r.parseDocument();return Object.defineProperty(n,"tokenCount",{enumerable:!1,value:r.tokenCount}),n}(e,{experimentalFragmentVariables:kr,allowLegacyFragmentVariables:kr});if(!r||"Document"!==r.kind)throw new Error("Not a valid GraphQL document.");Tr.set(t,function(e){var t=new Set(e.definitions);t.forEach((function(e){e.loc&&delete e.loc,Object.keys(e).forEach((function(r){var n=e[r];n&&"object"==typeof n&&t.add(n)}))}));var r=e.loc;return r&&(delete r.startToken,delete r.endToken),e}(wr(r)))}return Tr.get(t)}function Ar(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];"string"==typeof e&&(e=[e]);var n=e[0];return t.forEach((function(t,r){t&&"Document"===t.kind?n+=t.loc.source.body:n+=t,n+=e[r+1]})),Or(n)}var Cr,Sr=Ar,Dr=function(){Tr.clear(),_r.clear()},Rr=function(){xr=!1},Lr=function(){kr=!0},Fr=function(){kr=!1};(Cr=Ar||(Ar={})).gql=Sr,Cr.resetCaches=Dr,Cr.disableFragmentWarnings=Rr,Cr.enableExperimentalFragmentVariables=Lr,Cr.disableExperimentalFragmentVariables=Fr,Ar.default=Ar;var Pr,Mr={exports:{}};var Ur,jr,Br,Vr=(Pr||(Pr=1,(Ur=Mr).exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=void 0,Ur.exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=void 0,Ur.exports.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=void 0,Object.assign(Ur.exports,r)),Mr.exports),zr=T({__proto__:null,default:Nr(Vr)},[Vr]),$r=Ut?Symbol.for("__APOLLO_CONTEXT__"):"__APOLLO_CONTEXT__";function Gr(e){var t=Vr.useContext(function(){Be("createContext"in zr,69);var e=Vr.createContext[$r];return e||(Object.defineProperty(Vr.createContext,$r,{value:e=Vr.createContext({}),enumerable:!1,writable:!1,configurable:!0}),e.displayName="ApolloContext"),e}()).client;return Be(!!t,79),t}function Kr(e){var t;switch(e){case jr.Query:t="Query";break;case jr.Mutation:t="Mutation";break;case jr.Subscription:t="Subscription"}return t}function Yr(e){cr("parser",(function(){!1!==globalThis.__DEV__&&Be.warn(94)})),Br||(Br=new qt(Jt.parser||1e3));var t,r,n=Br.get(e);if(n)return n;Be(!!e&&!!e.kind,95,e);for(var i=[],s=[],o=[],a=[],l=0,c=e.definitions;l<c.length;l++){var d=c[l];if("FragmentDefinition"!==d.kind){if("OperationDefinition"===d.kind)switch(d.operation){case"query":s.push(d);break;case"mutation":o.push(d);break;case"subscription":a.push(d)}}else i.push(d)}Be(!i.length||s.length||o.length||a.length,96),Be(s.length+o.length+a.length<=1,97,e,s.length,a.length,o.length),r=s.length?jr.Query:jr.Mutation,s.length||o.length||(r=jr.Subscription);var u=s.length?s:o.length?o:a;Be(1===u.length,98,e,u.length);var p=u[0];t=p.variableDefinitions||[];var h={name:p.name&&"Name"===p.name.kind?p.name.value:"data",type:r,variables:t};return Br.set(e,h),h}function qr(e,t){var r=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return lr.withValue.apply(lr,w([Array.isArray(e)?e:[e]],t,!1))}("parser",Yr,[e]),n=Kr(t),i=Kr(r.type);Be(r.type===t,99,n,n,i)}!function(e){e[e.Query=0]="Query",e[e.Mutation=1]="Mutation",e[e.Subscription=2]="Subscription"}(jr||(jr={})),Yr.resetCache=function(){Br=void 0};var Wr=jt?Vr.useLayoutEffect:Vr.useEffect;function Jr(e,t){!1!==globalThis.__DEV__&&function(e,t,r,n){var i=Vr.useRef(!1);t in e&&!i.current&&(!1!==globalThis.__DEV__&&Be.warn(78,r,t,n),i.current=!0)}({},"ignoreResults","useMutation","If you don't want to synchronize component state with the mutation, please use the `useApolloClient` hook to get the client instance and call `client.mutate` directly.");var r=Gr();qr(e,jr.Mutation);var n=Vr.useState({called:!1,loading:!1,client:r}),i=n[0],s=n[1],o=Vr.useRef({result:i,mutationId:0,isMounted:!0,client:r,mutation:e,options:t});Wr((function(){Object.assign(o.current,{client:r,options:t,mutation:e})}));var a=Vr.useCallback((function(e){void 0===e&&(e={});var t=o.current,r=t.options,n=t.mutation,i=k(k({},r),{mutation:n}),a=e.client||o.current.client;o.current.result.loading||i.ignoreResults||!o.current.isMounted||s(o.current.result={loading:!0,error:void 0,data:void 0,called:!0,client:a});var l=++o.current.mutationId,c=function(e,t){return sr(e,t,t.variables&&{variables:sr(k(k({},e&&e.variables),t.variables))})}(i,e);return a.mutate(c).then((function(t){var r,n,i=t.data,d=t.errors,u=d&&d.length>0?new dr({graphQLErrors:d}):void 0,p=e.onError||(null===(r=o.current.options)||void 0===r?void 0:r.onError);if(u&&p&&p(u,c),l===o.current.mutationId&&!c.ignoreResults){var h={called:!0,loading:!1,data:i,error:u,client:a};o.current.isMounted&&!mr(o.current.result,h)&&s(o.current.result=h)}var f=e.onCompleted||(null===(n=o.current.options)||void 0===n?void 0:n.onCompleted);return u||null==f||f(t.data,c),t}),(function(t){var r;if(l===o.current.mutationId&&o.current.isMounted){var n={loading:!1,error:t,data:void 0,called:!0,client:a};mr(o.current.result,n)||s(o.current.result=n)}var i=e.onError||(null===(r=o.current.options)||void 0===r?void 0:r.onError);if(i)return i(t,c),{data:void 0,errors:t};throw t}))}),[]),l=Vr.useCallback((function(){if(o.current.isMounted){var e={called:!1,loading:!1,client:o.current.client};Object.assign(o.current,{mutationId:0,result:e}),s(e)}}),[]);return Vr.useEffect((function(){var e=o.current;return e.isMounted=!0,function(){e.isMounted=!1}}),[]),[a,k({reset:l},i)]}const Qr=Ar`
|
|
2
|
-
mutation UpdateUser($input: Update_Auth_Input!) {
|
|
3
|
-
update_auth(input: $input) {
|
|
4
|
-
_id
|
|
5
|
-
firstName
|
|
6
|
-
lastName
|
|
7
|
-
email
|
|
8
|
-
role
|
|
9
|
-
dateAdded
|
|
10
|
-
projects
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
`,Hr=()=>{const[e,{loading:t,error:r}]=Jr(Qr);return{updateUser:t=>I(void 0,void 0,void 0,(function*(){try{const{data:r}=yield e({variables:{input:t}});return(null==r?void 0:r.update_auth)||null}catch(e){throw console.log("Error updating user:",e),e}})),loading:t,error:r}},Xr=[],Zr=l(void 0),en=({config:t,children:n})=>{const[i,s]=r.useState(t),o={config:i,updateConfig:e=>{s((t=>Object.assign(Object.assign({},t),e)))}};return e(Zr.Provider,{value:o,children:n})},tn=()=>{const e=c(Zr);if(!e)throw new Error("useDashboard must be used within a DashboardProvider");return e},rn=({plugins:r,children:n})=>{const[s,o]=i(r.length>0?r[0].id:null),[a,l]=i(0);return t("div",{className:"plugin-manager",children:[n,0===r.length?null:t("div",{className:"plugin-list mb-4",children:[e("h3",{className:"text-lg font-semibold mb-2",children:"Available Plugins:"}),e("div",{className:"space-x-2",children:r.map((t=>e("button",{onClick:()=>{o(t.id),l(0)},className:"px-3 py-1 rounded "+(s===t.id?"bg-blue-500 text-white":"bg-gray-200 text-gray-700 hover:bg-gray-300"),children:t.name},t.id)))})]}),e("div",{className:"plugin-content",children:(()=>{if(!s||0===r.length)return null;const e=r.find((e=>e.id===s));if(!e||!e.tabs||0===e.tabs.length)return null;return(e.tabs[a]||e.tabs[0]).content})()})]})},nn=e=>Xr.flatMap((e=>Array.isArray(e)?e:[e]));function sn(e){return Array.isArray(e)?e:[]}function on(e,t){return sn(e).filter(t)}function an(e,t){return sn(e).map(t)}function ln(e,t){return sn(e).find(t)}function cn(e,t){return sn(e).some(t)}function dn(e){return sn(e).length}function un(e){return Array.isArray(e)&&e.length>0}const pn=(e,...t)=>I(void 0,[e,...t],void 0,(function*(e,t=5e3){return e.startsWith("data:")||e.startsWith("url(")?{exists:!0,fallbackUsed:!1}:new Promise((r=>{const n=new Image,i=setTimeout((()=>{r({exists:!1,error:"Asset loading timeout",fallbackUsed:!0})}),t);n.onload=()=>{clearTimeout(i),r({exists:!0,fallbackUsed:!1})},n.onerror=()=>{clearTimeout(i),r({exists:!1,error:"Asset failed to load",fallbackUsed:!0})},n.src=e}))})),hn=(e,t)=>I(void 0,void 0,void 0,(function*(){const r=e.map((e=>I(void 0,void 0,void 0,(function*(){return{path:e,result:yield pn(e,t)}}))));return(yield Promise.all(r)).reduce(((e,{path:t,result:r})=>(e[t]=r,e)),{})})),fn=(e,t)=>{if(((null==t?void 0:t.fallbackUsed)||!1===(null==t?void 0:t.exists))&&e.fallback)return{backgroundColor:e.fallback,backgroundImage:"none"};return{backgroundImage:e.path.startsWith("url(")||e.path.startsWith("data:")?e.path:`url('${e.path}')`}},mn=(e,t)=>{const[r,n]=i({exists:!0,fallbackUsed:!1}),[s,a]=i(!0);return o((()=>{let r=!0;return I(void 0,void 0,void 0,(function*(){a(!0);const i=yield pn(e,t);r&&(n(i),a(!1))})),()=>{r=!1}}),[e,t]),{result:r,isLoading:s}},gn={SIGNUP_THEME:"/signup-theme.png",LOGO_ENVIROME:"/logo-envirome.png",BVOC:"/bvoc.png",LOGO:"/logo.png"},yn={PRIMARY:"#ad0000",SECONDARY:"#0066cc",NEUTRAL:"#666666",SUCCESS:"#00A89D",WARNING:"#DD3150"},bn=()=>I(void 0,void 0,void 0,(function*(){return hn(Object.values(gn))})),vn=e=>{if("development"!==process.env.NODE_ENV)return;const t=Object.entries(e).filter((([,e])=>!e.exists)).map((([e])=>e));t.length>0&&console.warn("⚠️ IDD Dashboard: Missing optional assets detected:",t,"\nSee https://github.com/integrativedesigndevelopment/idd-dashboard/blob/main/docs/guides/required-assets.md for details.")};function En(e){if(!e)return e;if("undefined"!=typeof window){const t=document.createElement("div");t.textContent=e;return t.innerHTML.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"").replace(/javascript:/gi,"").replace(/on\w+\s*=/gi,"").replace(/style\s*=/gi,"").replace(/<iframe/gi,"<iframe").replace(/<object/gi,"<object").replace(/<embed/gi,"<embed").replace(/<form/gi,"<form")}return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Nn(e){return/<[a-z][\s\S]*>/i.test(e)}function Tn(e,t){for(let r=0;r<e.length;r++){let n=!1;if(n=Nn(e[r]),n){const n={text:e[r],hasLinks:!0};t.push(n)}else{const n={text:e[r],hasLinks:!1};t.push(n)}}}const _n=({type:t,style:r,text:n,items:i,orderedListStyle:s="",unorderedListStyle:o="",paragraphStyle:a=""})=>{if("list"===t){if("ordered"===r){const t=[];return i&&Tn(i,t),e("ol",{className:s,children:t.map(((t,r)=>t.hasLinks?e("li",{dangerouslySetInnerHTML:{__html:En(t.text)}},r):e("li",{children:t.text},r)))})}{const t=[];return i&&Tn(i,t),e("ul",{className:o,children:t.map(((t,r)=>t.hasLinks?e("li",{dangerouslySetInnerHTML:{__html:En(t.text)}},r):e("li",{children:t.text},r)))})}}{let t;return n?(t=Nn(n),e("p",t?{className:a,dangerouslySetInnerHTML:{__html:En(n)}}:{className:a,children:n})):e("p",{className:a,children:n})}},xn=(e,t)=>e&&e.length>t?e.slice(0,t)+"...":e,kn=()=>{const[e,t]=i({width:0,height:0});return o((()=>{function e(){t({width:window.innerWidth,height:window.innerHeight})}return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]),e};function In(e,t){const r=t||[];return(e||[]).filter((e=>!r.includes(e)))}function wn(e){return(e||[]).reduce(((e,t)=>e.concat(Array.isArray(t)?wn(t):t)),[])}const On=e=>{let t="";return e&&(t=e.address_1&&e.address_1.length>0?e.address_1+", ":"",e.address_2&&e.address_2.length>0?t+=e.address_2+", ":t+="",e.city&&e.city.length>0?t+=e.city+", ":t+="",e.state&&e.state.length>0?t+=e.state:t+="",e.zip&&e.zip.length>0&&(t+=" "+e.zip)),t},An=e=>"EVALUATOR"===e?"MODERATOR":e,Cn=e=>e&&"string"==typeof e?e.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"").replace(/<[^>]+>/g,"").replace(/javascript:/gi,"").replace(/on\w+\s*=/gi,"").trim():"",Sn=e=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e),Dn=e=>{try{return new URL(e),!0}catch(e){return!1}},Rn=e=>!e||0===e.trim().length,Ln=(e,t,r)=>{const n=e?e.length:0;return n>=t&&n<=r},Fn=e=>/^[a-zA-Z0-9]+$/.test(e),Pn=e=>/^[a-zA-Z]+$/.test(e),Mn=e=>/^\d+$/.test(e),Un=e=>/^[\d\s\-\(\)\+]+$/.test(e)&&e.replace(/\D/g,"").length>=10,jn=e=>e.replace(/\s+/g," ").trim(),Bn=(e,t)=>t.test(e),Vn=e=>{const t=new Date(e);return!isNaN(t.getTime())},zn=(e,t=[])=>({isValid:e,errors:t}),$n=l(null),Gn=({children:t})=>{const[r,n]=i([]),a=d(new Map),l=s((e=>{const t=a.current.get(e);t&&(clearTimeout(t),a.current.delete(e)),n((t=>t.filter((t=>t.id!==e))))}),[]),c=s(((e,t="error",r=!0,i=1e4)=>{const s=`error_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,o={id:s,type:t,message:e,timestamp:Date.now(),autoHide:r,duration:i};if(n((r=>r.some((r=>r.message===e&&r.type===t))?r:[...r,o])),r&&i){const e=setTimeout((()=>{l(s)}),i);a.current.set(s,e)}return s}),[l]),u=s((()=>{a.current.forEach((e=>{clearTimeout(e)})),a.current.clear(),n([])}),[]),p=s(((e,t=!0)=>c(e,"error",t)),[c]),h=s(((e,t=!0)=>c(e,"success",t)),[c]),f=s(((e,t=!0)=>c(e,"warning",t)),[c]),m=s(((e,t=!0)=>c(e,"info",t)),[c]);o((()=>()=>{a.current.forEach((e=>{clearTimeout(e)})),a.current.clear()}),[]);const g={errors:r,addError:c,removeError:l,clearErrors:u,showError:p,showSuccess:h,showWarning:f,showInfo:m};return e($n.Provider,{value:g,children:t})},Kn=()=>{const e=c($n);if(!e)throw new Error("useError must be used within an ErrorProvider");return e},Yn=()=>{const{showError:e}=Kn();return{handleError:s(((t,r)=>{console.error("Error caught by boundary:",t,r),e("An unexpected error occurred. Please try again.")}),[e])}},qn=({error:r,onClose:n})=>t("div",{className:`text-white p-4 rounded-lg shadow-lg ring-2 ${(()=>{switch(r.type){case"success":return"ring-idd-green";case"warning":return"ring-idd-yellow";case"info":return"ring-idd-purple";default:return"ring-idd-active-color"}})()} flex items-start gap-3 max-w-md`,children:[e("div",{className:"flex-shrink-0 mt-0.5",children:(()=>{switch(r.type){case"success":return e(N,{});case"warning":default:return e(v,{});case"info":return e(E,{})}})()}),e("div",{className:"flex-1 min-w-0",children:t("div",{className:"font-idd-primary-font-regular text-lg leading-relaxed",children:[e("span",{className:"font-idd-primary-font-bold text-lg",children:(()=>{switch(r.type){case"success":return"Success: ";case"warning":return"Warning: ";case"info":return"Info: ";default:return"Error: "}})()})," ",r.message]})}),e(p,{buttonClass:"border-0 bg-idd-transparent ms-auto",onPress:()=>n(r.id),"aria-label":"Close",children:e(g,{})})]}),Wn=()=>{const{errors:t,removeError:r}=Kn();return 0===t.length?null:e("div",{className:"fixed bottom-10 right-10 flex flex-col gap-3",style:{zIndex:1e3},children:t.map((t=>e("div",{className:"bg-idd-white mt-3",children:e(qn,{error:t,onClose:r})},t.id)))})};export{ie as ActionTypes,ye as CancelActionButton,ke as Card,be as ConfirmActionButton,_n as ContentItem,gn as DEFAULT_ASSET_PATHS,yn as DEFAULT_FALLBACK_COLORS,en as DashboardProvider,O as ErrorBoundary,Gn as ErrorProvider,qn as ErrorToast,Wn as ErrorToastContainer,ee as FormField,Ee as IDDLinkInputItem,Ne as Layout,te as Loader,M as LoginBackground,xe as Modal,Te as Password,$ as PasswordRequirements,j as PasswordStrength,z as PasswordStrengthBar,V as PasswordStrengthIndicator,rn as PluginManager,Z as SimpleButton,re as SubmitButton,ne as TermsCheckbox,_e as TextInput,Q as buttonVariants,H as commonStyles,L as createDefaultConfig,zn as createValidationResult,P as debounce,G as defaultConfig,sn as ensureArray,wn as flatten,C as generateBackgroundStyles,In as getArraysDiff,fn as getBackgroundStyle,X as getButtonStyles,q as getConfig,On as getLocationString,nn as get_all_plugins,Pn as isAlpha,Fn as isAlphanumeric,Rn as isEmpty,Ln as isLengthValid,un as isNonEmptyArray,Mn as isNumeric,ve as isURL,S as isValidColor,Vn as isValidDate,Sn as isValidEmail,D as isValidImageUrl,Un as isValidPhone,Dn as isValidUrl,An as mapUserRole,Bn as matchesPattern,jn as normalizeWhitespace,F as preloadImage,ue as resetReducer,on as safeFilter,ln as safeFind,dn as safeLength,an as safeMap,cn as safeSome,Cn as sanitizeInput,Y as setConfig,de as setCurrentItem,oe as setCurrentPlugin,pe as setCurrentPluginAndTab,le as setCurrentState,ae as setCurrentTab,he as setCurrentTabAndState,ce as setCurrentView,se as setPlugins,fe as setSetting,me as toggleCollapsed,ge as toggleNotifications,xn as truncate,mn as useAssetValidation,W as useConfig,tn as useDashboard,Kn as useError,Yn as useErrorBoundary,J as useIDDTheme,U as useLoginBackground,Hr as useUpdateUser,kn as useWindowDimensions,pn as validateAsset,hn as validateAssets,bn as validateCommonAssets,R as validateConfig,vn as warnMissingAssets};
|
|
1
|
+
import{jsx as e,jsxs as r}from"react/jsx-runtime";import t,{Component as a,useState as i,useCallback as o,useEffect as n,Fragment as s,createContext as l,useContext as d,useRef as c}from"react";import{useTailwindConfig as u,IDDButton as g,IDDLoader as m,IDDInput as p,IDDCard as h}from"@integrativedesigndevelopment/idd-common";import{IDDXIcon as b,IDDShowPasswordIcon as y,IDDHidePasswordIcon as f,IDDOutlineWarningIcon as v,IDDInfoIcon as x,IDDOutlineCheckmarkIcon as w}from"@integrativedesigndevelopment/idd-icons";function k(e,r,t,a){return new(t||(t=Promise))(function(i,o){function n(e){try{l(a.next(e))}catch(e){o(e)}}function s(e){try{l(a.throw(e))}catch(e){o(e)}}function l(e){var r;e.done?i(e.value):(r=e.value,r instanceof t?r:new t(function(e){e(r)})).then(n,s)}l((a=a.apply(e,r||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;class N extends a{constructor(){super(...arguments),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,r){console.error("ErrorBoundary caught an error:",e,r)}render(){return this.state.hasError?this.props.fallback||e("div",{className:"flex items-center justify-center h-full w-full p-4",children:r("div",{className:"text-center",children:[e("h2",{className:"text-xl font-semibold mb-2",children:"Something went wrong"}),e("p",{className:"text-gray-600 mb-4",children:"An error occurred while loading this component."}),e("button",{onClick:()=>this.setState({hasError:!1,error:void 0}),className:"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600",children:"Try again"})]})}):this.props.children}}const E={loginBackground:{type:"color",value:"#f3f4f6",fallback:"#ffffff",backgroundSize:"cover",backgroundPosition:"center",additionalStyles:{}}},_=e=>{const r={backgroundRepeat:"no-repeat"};switch("image"===e.type&&(r.backgroundSize=e.backgroundSize||"cover",r.backgroundPosition=e.backgroundPosition||"center"),e.type){case"image":r.backgroundImage=`url('${e.value}')`,r.backgroundColor=e.fallback;break;case"color":r.backgroundColor=e.value;break;case"gradient":r.backgroundImage=e.value,r.backgroundColor=e.fallback;break;default:r.backgroundColor=e.fallback}return r},C=e=>{const r=(new Option).style;return r.color=e,""!==r.color},T=e=>{try{return new URL(e,window.location.origin),!0}catch(e){return!1}},S=e=>{const r=[];return e.type&&["image","color","gradient"].includes(e.type)||r.push('Invalid background type. Must be "image", "color", or "gradient".'),e.value||r.push("Background value is required."),e.fallback&&C(e.fallback)||r.push("Valid fallback color is required."),"image"!==e.type||T(e.value)||r.push("Invalid image URL provided."),"color"!==e.type||C(e.value)||r.push("Invalid color value provided."),r},P=()=>({type:E.loginBackground.type,value:E.loginBackground.value,fallback:E.loginBackground.fallback,backgroundSize:E.loginBackground.backgroundSize,backgroundPosition:E.loginBackground.backgroundPosition,additionalStyles:E.loginBackground.additionalStyles}),I=e=>new Promise((r,t)=>{const a=new Image;a.onload=()=>r(a),a.onerror=t,a.src=e}),R=(e,r)=>{let t;return(...a)=>{clearTimeout(t),t=setTimeout(()=>e(...a),r)}},D=({config:r,className:t="",children:a,onImageError:s,onImageLoad:l,"data-testid":d="login-background"})=>{const[c,u]=i(!1),[g,m]=i(!1),[p,h]=i(!1),b=r||P(),y=S(b);y.length>0&&console.warn("LoginBackground configuration errors:",y);const f=o(()=>k(void 0,void 0,void 0,function*(){if("image"===b.type){h(!0),m(!1);try{yield I(b.value),u(!0),m(!1),null==l||l(new Event("load"))}catch(e){m(!0),u(!1),null==s||s(new Event("error")),console.warn("Failed to load background image:",b.value)}finally{h(!1)}}}),[b.type,b.value,s,l]);n(()=>{f()},[f]),n(()=>{const e=document.documentElement;"image"===b.type?e.style.setProperty("--login-bg-image",`url('${b.value}')`):"color"===b.type?(e.style.setProperty("--login-bg-image","none"),e.style.setProperty("--login-bg-color",b.value)):"gradient"===b.type&&e.style.setProperty("--login-bg-image",b.value),e.style.setProperty("--login-bg-fallback",b.fallback),b.backgroundSize&&e.style.setProperty("--login-bg-size",b.backgroundSize),b.backgroundPosition&&e.style.setProperty("--login-bg-position",b.backgroundPosition),"image"===b.type&&(g||p)&&(e.style.setProperty("--login-bg-image","none"),e.style.setProperty("--login-bg-color",b.fallback))},[b,g,p]);const v=b.additionalStyles||{},x=["bg-login","transition-all duration-300 ease-in-out","min-h-full w-full",t].filter(Boolean).join(" ");return e(N,{fallback:e("div",{children:"Something went wrong with the background"}),children:e("div",{className:x,style:v,"data-testid":d,"data-background-type":b.type,"data-image-loaded":"image"===b.type?c:void 0,"aria-label":"image"===b.type?`Background image: ${b.value}`:"Background styling",children:a})})},L=()=>o(e=>{if("undefined"==typeof window||"undefined"==typeof document)return;const r=document.documentElement;try{if("image"===e.type&&e.value){const t=e.value.replace(/[<>"']/g,"");r.style.setProperty("--login-bg-image",`url('${t}')`)}else if("color"===e.type&&e.value){/^(#[0-9A-F]{6}|#[0-9A-F]{3}|rgb\(|rgba\(|hsl\(|hsla\()/i.test(e.value)&&(r.style.setProperty("--login-bg-image","none"),r.style.setProperty("--login-bg-color",e.value))}else"gradient"===e.type&&e.value&&e.value.includes("gradient(")&&r.style.setProperty("--login-bg-image",e.value);if(e.fallback){const t=e.fallback.replace(/[<>"']/g,"");r.style.setProperty("--login-bg-fallback",t)}if(e.backgroundSize){(["cover","contain","auto","100%"].includes(e.backgroundSize)||/^\d+(px|%|em|rem)$/.test(e.backgroundSize))&&r.style.setProperty("--login-bg-size",e.backgroundSize)}if(e.backgroundPosition){/^(center|left|right|top|bottom|\d+(px|%|em|rem)|\s)+$/.test(e.backgroundPosition)&&r.style.setProperty("--login-bg-position",e.backgroundPosition)}}catch(e){console.warn("Failed to set login background styles:",e)}},[]);var A;!function(e){e[e.VERY_WEAK=0]="VERY_WEAK",e[e.WEAK=1]="WEAK",e[e.FAIR=2]="FAIR",e[e.GOOD=3]="GOOD",e[e.STRONG=4]="STRONG"}(A||(A={}));const O=e=>e/4*100,$=t.memo(({analysis:t,showDetails:a=!0,className:i=""})=>{const o=O(t.score);return r("div",{className:`password-strength-indicator ${i}`,role:"status","aria-live":"polite",children:[r("div",{className:"flex items-center gap-2 mb-2",children:[e("div",{className:"flex-1 bg-gray-200 rounded-full h-2",role:"progressbar","aria-valuenow":t.score,"aria-valuemin":0,"aria-valuemax":4,children:e("div",{className:"h-2 rounded-full transition-all duration-300",style:{width:`${o}%`}})}),e("span",{className:"text-sm font-medium",children:t.label})]}),a&&r("div",{className:"space-y-2",children:[r("div",{className:"flex justify-between text-xs text-gray-600",children:[r("span",{children:["Entropy: ",t.entropy," bits"]}),r("span",{children:["Crack time: ",t.crackTime]})]}),t.warnings.length>0&&e("div",{className:"space-y-1",children:t.warnings.map((t,a)=>r("div",{className:"flex items-start gap-2 text-xs text-amber-600",children:[e("span",{className:"text-amber-500 mt-0.5",children:"⚠"}),e("span",{children:t})]},a))}),t.suggestions.length>0&&e("div",{className:"space-y-1",children:t.suggestions.map((t,a)=>r("div",{className:"flex items-start gap-2 text-xs text-blue-600",children:[e("span",{className:"text-blue-500 mt-0.5",children:"💡"}),e("span",{children:t})]},a))}),e("div",{className:"text-xs font-medium "+(t.isAcceptable?"text-green-600":"text-red-600"),children:t.isAcceptable?"✓ Password meets security requirements":"✗ Password does not meet security requirements"})]})]})}),z=t.memo(({score:r,className:t=""})=>{const a=O(r);return e("div",{className:`w-full bg-gray-200 rounded-full h-1 ${t}`,children:e("div",{className:`h-1 rounded-full transition-all duration-300 ${(e=>{switch(e){case A.VERY_WEAK:return"bg-red-500";case A.WEAK:return"bg-orange-500";case A.FAIR:return"bg-yellow-500";case A.GOOD:return"bg-lime-500";case A.STRONG:return"bg-green-500";default:return"bg-gray-300"}})(r)}`,style:{width:`${a}%`}})})}),U=({requirements:t,password:a,className:i=""})=>r("div",{className:`password-requirements ${i}`,children:[e("div",{className:"text-sm font-medium text-gray-700 mb-2",children:"Password Requirements:"}),e("ul",{className:"space-y-1",children:t.map((t,i)=>{const o=!!a&&(e=>{if(e.includes("lowercase"))return/[a-z]/.test(a);if(e.includes("uppercase"))return/[A-Z]/.test(a);if(e.includes("number"))return/[0-9]/.test(a);if(e.includes("special character"))return/[!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?]/.test(a);if(e.includes("characters long")){const r=e.match(/(\d+)-(\d+) characters/);if(r){const e=parseInt(r[1]),t=parseInt(r[2]);return a.length>=e&&a.length<=t}}return!1})(t);return r("li",{className:"flex items-start gap-2 text-xs",children:[e("span",{className:"mt-0.5 "+(o?"text-green-500":"text-gray-400"),children:o?"✓":"○"}),e("span",{className:o?"text-green-600":"text-gray-600",children:t})]},i)})})]}),B={title:"IDD Dashboard",pages:[],plugins:["Dashboard"],categories:[],sub_categories:{},style:{colors:{"idd-red":"#DD3150","idd-red-20":"#F6CBD3","idd-orange":"#D1823B","idd-orange-20":"#F3DFCE","idd-yellow":"#D9C982","idd-yellow-20":"#F4EFDA","idd-green":"#98BD83","idd-green-20":"#E5EEE0","idd-blue":"#00A89D","idd-blue-20":"#6F6F5","idd-purple":"#4040D8","idd-purple-20":"#CFCFF5","idd-brown":"#7A6C53","idd-brown-20":"#F2F0EE","idd-black":"#19191c","idd-black-20":"#C5C5C6","idd-grey":"#6D6E81","idd-grey-20":"#DCDCE1","idd-white":"#fff","idd-transparent":"transparent","idd-primary-color":"#292929","idd-secondary-color":"#5f696d","idd-tertiary-color":"#d8dfe7","idd-tertiary-color-20":"#ECECEC","idd-active-color":"#ad0000","idd-inactive-color":"#DCDCE1","idd-primary-background":"#ad0000","idd-secondary-background":"#f2f0ee","idd-tertiary-background":"#F6F6F9","idd-active-background":"#7a6c53","idd-inactive-background":"#7a6c531a","idd-shadow-color":"rgba(50,69,71,0.17)"},fontFamily:{"idd-primary-font":"Gotham-Book","idd-primary-font-light":"Gotham-Light","idd-primary-font-regular":"Gotham-Book","idd-primary-font-medium":"Gotham-Medium","idd-primary-font-bold":"Gotham-Bold","idd-secondary-font":"Rubik-Regular","idd-secondary-font-light":"Rubik-Light","idd-secondary-font-regular":"Rubik-Regular","idd-secondary-font-medium":"Rubik-Medium","idd-secondary-font-bold":"Rubik-Bold"},fontStyle:{"idd-font-style":"normal"},fontWeight:{"idd-light-font-weight":"300","idd-regular-font-weight":"normal","idd-medium-font-weight":"medium","idd-bold-font-weight":"bold"},fontSize:{"idd-primary-font-size":"1rem","idd-xtrasmall-font-size":"0.25rem","idd-small-font-size":"0.5rem","idd-medium-font-size":"1.125rem","idd-large-font-size":"1.25rem","idd-xtralarge-font-size":"1.5rem"},letterSpacing:{"idd-character-spacing":"0","idd-body-character-spacing":"0.05"},lineHeight:{"idd-primary-line-spacing":"1.5"},backgroundImage:{"gradient-radial":"radial-gradient(var(--tw-gradient-stops))","gradient-conic":"conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))","signup-theme":"linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('/signup-theme.png')"},borderRadius:{"idd-border-radius":"0.3125rem"}}};let F=B;const G=e=>{F=Object.assign(Object.assign({},B),e)},j=()=>F,M=()=>j(),W=()=>{const e=M(),r=u(e.style);return{config:e,tailwindConfig:r,colors:r.colors}},q={primary:{base:"text-idd-white bg-idd-active-color hover:bg-idd-primary-color focus:bg-idd-primary-color",disabled:"opacity-50 cursor-not-allowed"},secondary:{base:"text-idd-active-color bg-idd-tertiary-background border border-idd-active-color hover:bg-idd-active-color hover:text-idd-white focus:bg-idd-active-color focus:text-idd-white",disabled:"opacity-50 cursor-not-allowed"},tertiary:{base:"text-idd-black bg-idd-tertiary-background hover:bg-idd-grey-20 focus:bg-idd-grey-20",disabled:"opacity-50 cursor-not-allowed"},outline:{base:"text-idd-active-color bg-transparent border border-idd-active-color hover:bg-idd-active-color hover:text-idd-white focus:bg-idd-active-color focus:text-idd-white",disabled:"opacity-50 cursor-not-allowed"},ghost:{base:"text-idd-grey bg-transparent hover:bg-idd-grey-20 hover:text-idd-black focus:bg-idd-grey-20 focus:text-idd-black",disabled:"opacity-50 cursor-not-allowed"},danger:{base:"text-idd-white bg-idd-red hover:opacity-90 focus:opacity-90",disabled:"opacity-50 cursor-not-allowed"},success:{base:"text-idd-white bg-idd-green hover:opacity-90 focus:opacity-90",disabled:"opacity-50 cursor-not-allowed"}},V={button:"font-idd-primary-font-medium text-idd-primary-font-size text-center py-2 px-4 rounded-sm focus:outline-none focus-visible:outline-none transition-colors duration-200",input:"w-full h-[3.125rem] rounded-sm",error:"font-idd-primary-font text-idd-primary-font-size !mb-0",label:"font-idd-primary-font-medium text-idd-primary-font-size"},H=(e="primary",r=!1,t="")=>{const a=q[e];return`${V.button} ${r?a.disabled:a.base} ${t}`.trim()},K=({children:r,onPress:t,onClick:a,disabled:i=!1,type:o="button",className:n="",variant:s="primary","data-testid":l})=>e(g,{type:o,onPress:t||a||(()=>{}),disabled:i,buttonClass:H(s,i,n),"data-testid":l,children:r}),Y=t.memo(({label:t,type:a,value:i,onChange:o,errors:n=[],required:s=!1,autoComplete:l,placeholder:d,disabled:c=!1,showErrors:u=!1,showPasswordToggle:g=!1,onTogglePassword:m,showPassword:p=!1})=>{const h=u&&n.length>0,b=`field-${t.toLowerCase().replace(/\s+/g,"-")}`;return r("div",{className:"form-field "+(h?"form-field--error":""),children:[r("label",{htmlFor:b,className:"form-field__label",children:[t,s&&e("span",{className:"form-field__required","aria-label":"required",children:"*"})]}),r("div",{className:"form-field__input-wrapper",children:[e("input",{id:b,type:a,value:i,onChange:e=>o(e.target.value),autoComplete:l,placeholder:d,disabled:c,required:s,className:"form-field__input "+(h?"form-field__input--error":""),"aria-invalid":h,"aria-required":s,"aria-describedby":h?`${b}-errors`:void 0}),g&&e(K,{type:"button",onPress:m,variant:"ghost",className:"form-field__password-toggle",disabled:c,"data-testid":"password-toggle",children:p?"👁️":"👁️🗨️"})]}),h&&e("div",{id:`${b}-errors`,className:"form-field__errors",role:"alert",children:n.map((r,t)=>e("div",{className:"form-field__error",children:r},t))})]})}),Z=({size:t="medium",message:a="Loading...",show:i=!0,color:o,className:n="","data-testid":s})=>{var l,d;const c=M();return i?(o||null===(d=null===(l=c.style)||void 0===l?void 0:l.colors)||void 0===d||d["idd-active-color"],r("div",{className:`flex flex-col items-center justify-center space-y-4 ${n}`,"data-testid":s,children:[e(m,{}),a&&e("p",{className:"text-sm text-gray-600 font-medium",children:a})]})):null},J=t.memo(({isLoading:t,disabled:a=!1,text:i,loadingText:o,className:n=""})=>r(K,{type:"submit",disabled:a||t,variant:"primary",className:n,"aria-busy":t,"aria-disabled":a||t,children:[r("div",{className:"flex items-center space-x-2",children:[t&&e("div",{className:"inline-block",children:e(Z,{show:!0,size:"small"})}),e("span",{className:"submit-button__text",children:t?o:i})]}),t&&e("span",{id:"submit-loading-text",className:"sr-only",children:"Please wait while we process your request"})]})),Q=t.memo(({checked:t,onChange:a,errors:i=[],disabled:o=!1,showErrors:n=!1,termsUrl:s="/terms",privacyUrl:l="/privacy"})=>{const d=n&&i.length>0,c="terms-checkbox";return r("div",{className:"terms-checkbox "+(d?"terms-checkbox--error":""),children:[r("div",{className:"terms-checkbox__wrapper",children:[e("input",{id:c,type:"checkbox",checked:t,onChange:e=>a(e.target.checked),disabled:o,className:"terms-checkbox__input "+(d?"terms-checkbox__input--error":""),"aria-invalid":d,"aria-describedby":d?`${c}-errors`:void 0,required:!0}),r("label",{htmlFor:c,className:"terms-checkbox__label",children:[e("span",{className:"terms-checkbox__checkmark","aria-hidden":"true",children:t?"✓":""}),r("span",{className:"terms-checkbox__text",children:["I agree to the"," ",e("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:"terms-checkbox__link",children:"Terms of Service"})," ","and"," ",e("a",{href:l,target:"_blank",rel:"noopener noreferrer",className:"terms-checkbox__link",children:"Privacy Policy"}),e("span",{className:"terms-checkbox__required","aria-label":"required",children:"*"})]})]})]}),d&&e("div",{id:`${c}-errors`,className:"terms-checkbox__errors",role:"alert",children:i.map((r,t)=>e("div",{className:"terms-checkbox__error",children:r},t))})]})}),X={SET_PLUGINS:"set_plugins",SET_CURRENT_PLUGIN:"set_current_plugin",SET_CURRENT_TAB:"set_current_tab",SET_CURRENT_STATE:"set_current_state",SET_CURRENT_VIEW:"set_current_view",SET_CURRENT_ITEM:"set_current_item",COLLAPSED_TOGGLE:"toggle_collapsed",SET_COLOR_MODE:"set_color_mode",TOGGLE_NOTIFICATIONS:"toggle_notifications",SET_SETTING:"set_setting",SET_JWT:"SET_JWT",SET_USER:"SET_USER",RESET:"reset"},ee=e=>({type:X.SET_PLUGINS,payload:e}),re=e=>({type:X.SET_CURRENT_PLUGIN,payload:e}),te=e=>({type:X.SET_CURRENT_TAB,payload:e}),ae=e=>({type:X.SET_CURRENT_STATE,payload:e}),ie=e=>({type:X.SET_CURRENT_VIEW,payload:e}),oe=e=>({type:X.SET_CURRENT_ITEM,payload:e}),ne=()=>({type:X.RESET}),se=(e,r)=>(t,a)=>{t(re(e)),t(te(0));const{session:i}=a(),o=[...i.currentState||[]],n=o.findIndex(r=>r.pluginID===e);-1!==n?o[n]={pluginID:e,tabID:r}:o.push({pluginID:e,tabID:r}),t(ae(o))},le=(e,r)=>(t,a)=>{t(te(e));const{session:i}=a(),o=i.current.id,n=[...i.currentState||[]],s=n.findIndex(e=>e.pluginID===o);-1!==s?n[s]={pluginID:o,tabID:r}:n.push({pluginID:o,tabID:r}),t(ae(n))},de=(e,r)=>({type:X.SET_SETTING,payload:{key:e,value:r}}),ce=()=>({type:X.COLLAPSED_TOGGLE}),ue=()=>({type:X.TOGGLE_NOTIFICATIONS}),ge=({children:r,onPress:t,disabled:a=!1,type:i="button",className:o="",variant:n="outline","data-testid":s})=>e(g,{type:i,onPress:t||(()=>{}),disabled:a,buttonClass:H(n,a,`px-5 ${o}`),"data-testid":s,children:r}),me=({children:r,onPress:t,disabled:a=!1,type:i="submit",className:o="",variant:n="primary","data-testid":s})=>e(g,{type:i,onPress:t||(()=>{}),disabled:a,buttonClass:H(n,a,`px-5 ${o}`),"data-testid":s,children:r});function pe(e){return/^(?:\w+:)?\/\/([^\s.]+\.\S{2}|localhost[:?\d]*)\S*$/.test(e)}const he=({id:t,idsArray:a,onDelete:o=()=>{},onBlur:l=()=>{},link:d,className:c=""})=>{const m=M(),h=u(m.style),[y,f]=i(h.colors["idd-black"]),[v,x]=i({id:"",text:"",url:""});return n(()=>{d&&(d.path&&d.path.length>0?x({id:d.id,text:d.text,url:d.path}):x(d))},[d]),r("div",{className:`flex justify-between items-center ${c}`,onBlur:e=>{e.stopPropagation(),l(v)},children:[e(p,{id:`link-${t}`,componentClass:"w-[45%]",type:"text",label:"Link Text",labelClass:"text-capitalize",showLabel:!!(v&&v.text&&v.text.length>0),placeholder:"Link Text",value:v.text,inputClass:"ps-3 active-primary-black",onChange:e=>{x(Object.assign(Object.assign({},v),{text:e.target.value}))}}),e(p,{id:`url-${t}`,componentClass:"w-45",type:"url",label:"URL",showLabel:!!(v&&v.url&&v.url.length>0),placeholder:"URL",value:v.url,inputClass:"ps-3 active-primary-black",onChange:e=>{x(Object.assign(Object.assign({},v),{url:e.target.value}))}}),e(g,{id:`removeLink-${t}`,onPress:()=>{if(a){let e=[...a];e=e.filter(e=>e!==t),x({id:"",text:"",url:""}),o(e)}},onMouseEnter:()=>f("var(--idd-red)"),onFocus:()=>f("var(--idd-red)"),onMouseLeave:()=>f("var(--idd-primary-black)"),onBlur:()=>f("var(--idd-primary-black)"),isSecondary:!0,buttonClass:"flex items-center justify-center border-0 rounded-sm w-[1.5625rem] h-[1.5625rem] p-0",children:r(s,{children:[e("span",{className:"sr-only",children:"remove link"}),e(b,{wrapperClass:"flex justify-center items-center",color:y})]})})]})},be=({children:r,className:t="flex items-center justify-center min-h-screen w-full p-5"})=>e(N,{children:e("div",{className:`bg-signup-theme bg-cover bg-center bg-no-repeat ${t}`,children:r})}),ye=({onChange:t=()=>{},label:a="Password",value:o,componentClass:n="",appendToInputClass:l="",error:d="",errorColor:c="",isErrorOnlyColor:m=!0})=>{const[h,b]=i(!1),[v,x]=i(!1),w=M(),k=u(w.style);return e(p,{label:a,value:o,type:h?"text":"password",componentClass:n,inputWrapperClass:"w-full h-14 rounded-sm border border-idd-grey",inputClass:"px-4 py-2",appendToInputClass:`me-4 ${l}`,activeTextColor:k.colors["idd-black"],inactiveTextColor:!o||"string"==typeof o&&0===o.length?k.colors["idd-grey"]:k.colors["idd-black"],activeColor:k.colors["idd-black"],inactiveColor:!o||"string"==typeof o&&0===o.length?k.colors["idd-grey"]:k.colors["idd-black"],activeLabelColor:k.colors["idd-black"],inactiveLabelColor:!o||"string"==typeof o&&0===o.length?k.colors["idd-grey"]:k.colors["idd-black"],errors:d,errorColor:m?!o||"string"==typeof o&&0===o.length?k.colors["idd-grey"]:k.colors["idd-black"]:c,errorClass:"font-idd-primary-font text-idd-primary-font-size !mb-0",errorStyle:m?{color:k.colors["idd-active-color"]}:{},onFocus:()=>x(!0),onBlur:()=>x(!1),appendToInput:e(g,{buttonClass:"p-1 rounded-sm focus:outline focus-visible:outline focus:outline-1 focus-visible:outline-1offset-1 focus:outline-idd-black focus-visible:outline-idd-black",onPress:()=>b(!h),children:r(s,{children:[e("span",{className:"sr-only",children:h?"password shown":"password hidden"}),e(h?y:f,{color:v?k.colors["idd-black"]:k.colors["idd-grey"]})]})}),onChange:e=>{if(t){const r="string"==typeof e?e:e.target.value;t(r)}}})},fe=({label:r,onChange:t=()=>{},value:a,placeholder:i,type:o="text",readOnly:n=!1,error:s="",errorColor:l="",isErrorOnlyColor:d=!0})=>{const c=M(),g=u(c.style);return e(p,{label:r,value:a,onChange:t,placeholder:i,type:o,readOnly:n,activeColor:n?g.colors["idd-grey"]:g.colors["idd-black"],inactiveColor:!a||"string"==typeof a&&0===a.length?g.colors["idd-grey"]:g.colors["idd-black"],activeLabelColor:n?g.colors["idd-grey"]:g.colors["idd-black"],inactiveLabelColor:!a||"string"==typeof a&&0===a.length?g.colors["idd-grey"]:g.colors["idd-black"],activeTextColor:n?g.colors["idd-grey"]:g.colors["idd-black"],inactiveTextColor:!a||"string"==typeof a&&0===a.length?g.colors["idd-grey"]:g.colors["idd-black"],inputWrapperClass:"w-full h-[3.125rem] rounded-sm border border-idd-grey",inputClass:n?"pointer-events-none px-4":"px-4",errors:s,errorColor:d?!a||"string"==typeof a&&0===a.length?g.colors["idd-grey"]:g.colors["idd-black"]:l,errorClass:"font-idd-primary-font text-idd-primary-font-size !mb-0",errorStyle:d?{color:g.colors["idd-active-color"]}:{}})},ve=({children:t,isOpen:a,onClose:i,title:o,showCloseButton:n=!0,size:s="medium",className:l="","data-testid":d})=>{if(!a)return null;return e("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center min-h-screen p-4 z-50",onClick:e=>{e.target===e.currentTarget&&i()},onKeyDown:e=>{"Escape"===e.key&&i()},"data-testid":d,role:"dialog","aria-modal":"true",tabIndex:-1,children:r("div",{className:`bg-white rounded-lg shadow-xl ${{small:"max-w-md",medium:"max-w-lg",large:"max-w-2xl",full:"max-w-full mx-4"}[s]} w-full ${l}`,children:[o&&r("div",{className:"flex items-center justify-between p-6 border-b border-gray-200",children:[e("h2",{className:"text-xl font-semibold text-gray-900",children:o}),n&&e("button",{onClick:i,className:"text-gray-400 hover:text-gray-600 focus:outline-none focus:text-gray-600","aria-label":"Close modal",children:e("svg",{className:"w-6 h-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),e("div",{className:"p-6",children:t})]})})},xe=({children:t,title:a,subtitle:i,className:o="",padding:n="medium",shadow:s="medium",border:l=!0,"data-testid":d})=>{const c=["bg-white rounded-lg",{none:"",small:"shadow-sm",medium:"shadow-md",large:"shadow-lg"}[s],l?"border border-gray-200":"",o].filter(Boolean).join(" ");return e(h,{"data-testid":d,children:e("div",{className:c,children:r("div",{className:{none:"",small:"p-3",medium:"p-6",large:"p-8"}[n],children:[(a||i)&&r("div",{className:"mb-4",children:[a&&e("h3",{className:"text-lg font-semibold text-gray-900 mb-1",children:a}),i&&e("p",{className:"text-sm text-gray-600",children:i})]}),t]})})})},we=[],ke=l(void 0),Ne=({config:r,children:a})=>{const[i,o]=t.useState(r),n={config:i,updateConfig:e=>{o(r=>Object.assign(Object.assign({},r),e))}};return e(ke.Provider,{value:n,children:a})},Ee=()=>{const e=d(ke);if(!e)throw new Error("useDashboard must be used within a DashboardProvider");return e},_e=({plugins:t,children:a})=>{const[o,n]=i(t.length>0?t[0].id:null),[s,l]=i(0);return r("div",{className:"plugin-manager",children:[a,0===t.length?null:r("div",{className:"plugin-list mb-4",children:[e("h3",{className:"text-lg font-semibold mb-2",children:"Available Plugins:"}),e("div",{className:"space-x-2",children:t.map(r=>e("button",{onClick:()=>{n(r.id),l(0)},className:"px-3 py-1 rounded "+(o===r.id?"bg-blue-500 text-white":"bg-gray-200 text-gray-700 hover:bg-gray-300"),children:r.name},r.id))})]}),e("div",{className:"plugin-content",children:(()=>{if(!o||0===t.length)return null;const e=t.find(e=>e.id===o);if(!e||!e.tabs||0===e.tabs.length)return null;return(e.tabs[s]||e.tabs[0]).content})()})]})},Ce=e=>we.flatMap(e=>Array.isArray(e)?e:[e]);function Te(e){return Array.isArray(e)?e:[]}function Se(e,r){return Te(e).filter(r)}function Pe(e,r){return Te(e).map(r)}function Ie(e,r){return Te(e).find(r)}function Re(e,r){return Te(e).some(r)}function De(e){return Te(e).length}function Le(e){return Array.isArray(e)&&e.length>0}const Ae=(e,...r)=>k(void 0,[e,...r],void 0,function*(e,r=5e3){return e.startsWith("data:")||e.startsWith("url(")?{exists:!0,fallbackUsed:!1}:new Promise(t=>{const a=new Image,i=setTimeout(()=>{t({exists:!1,error:"Asset loading timeout",fallbackUsed:!0})},r);a.onload=()=>{clearTimeout(i),t({exists:!0,fallbackUsed:!1})},a.onerror=()=>{clearTimeout(i),t({exists:!1,error:"Asset failed to load",fallbackUsed:!0})},a.src=e})}),Oe=(e,r)=>k(void 0,void 0,void 0,function*(){const t=e.map(e=>k(void 0,void 0,void 0,function*(){return{path:e,result:yield Ae(e,r)}}));return(yield Promise.all(t)).reduce((e,{path:r,result:t})=>(e[r]=t,e),{})}),$e=(e,r)=>{if(((null==r?void 0:r.fallbackUsed)||!1===(null==r?void 0:r.exists))&&e.fallback)return{backgroundColor:e.fallback,backgroundImage:"none"};return{backgroundImage:e.path.startsWith("url(")||e.path.startsWith("data:")?e.path:`url('${e.path}')`}},ze=(e,r)=>{const[t,a]=i({exists:!0,fallbackUsed:!1}),[o,s]=i(!0);return n(()=>{let t=!0;return k(void 0,void 0,void 0,function*(){s(!0);const i=yield Ae(e,r);t&&(a(i),s(!1))}),()=>{t=!1}},[e,r]),{result:t,isLoading:o}},Ue={SIGNUP_THEME:"/signup-theme.png",LOGO_ENVIROME:"/logo-envirome.png",BVOC:"/bvoc.png",LOGO:"/logo.png"},Be={PRIMARY:"#ad0000",SECONDARY:"#0066cc",NEUTRAL:"#666666",SUCCESS:"#00A89D",WARNING:"#DD3150"},Fe=()=>k(void 0,void 0,void 0,function*(){return Oe(Object.values(Ue))}),Ge=e=>{if("development"!==process.env.NODE_ENV)return;const r=Object.entries(e).filter(([,e])=>!e.exists).map(([e])=>e);r.length>0&&console.warn("⚠️ IDD Dashboard: Missing optional assets detected:",r,"\nSee https://github.com/integrativedesigndevelopment/idd-dashboard/blob/main/docs/guides/required-assets.md for details.")};function je(e){if(!e)return e;if("undefined"!=typeof window){const r=document.createElement("div");r.textContent=e;return r.innerHTML.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"").replace(/javascript:/gi,"").replace(/on\w+\s*=/gi,"").replace(/style\s*=/gi,"").replace(/<iframe/gi,"<iframe").replace(/<object/gi,"<object").replace(/<embed/gi,"<embed").replace(/<form/gi,"<form")}return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Me(e){return/<[a-z][\s\S]*>/i.test(e)}function We(e,r){for(let t=0;t<e.length;t++){let a=!1;if(a=Me(e[t]),a){const a={text:e[t],hasLinks:!0};r.push(a)}else{const a={text:e[t],hasLinks:!1};r.push(a)}}}const qe=({type:r,style:t,text:a,items:i,orderedListStyle:o="",unorderedListStyle:n="",paragraphStyle:s=""})=>{if("list"===r){if("ordered"===t){const r=[];return i&&We(i,r),e("ol",{className:o,children:r.map((r,t)=>r.hasLinks?e("li",{dangerouslySetInnerHTML:{__html:je(r.text)}},t):e("li",{children:r.text},t))})}{const r=[];return i&&We(i,r),e("ul",{className:n,children:r.map((r,t)=>r.hasLinks?e("li",{dangerouslySetInnerHTML:{__html:je(r.text)}},t):e("li",{children:r.text},t))})}}{let r;return a?(r=Me(a),e("p",r?{className:s,dangerouslySetInnerHTML:{__html:je(a)}}:{className:s,children:a})):e("p",{className:s,children:a})}},Ve=(e,r)=>e&&e.length>r?e.slice(0,r)+"...":e,He=()=>{const[e,r]=i({width:0,height:0});return n(()=>{function e(){r({width:window.innerWidth,height:window.innerHeight})}return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e};function Ke(e,r){const t=r||[];return(e||[]).filter(e=>!t.includes(e))}function Ye(e){return(e||[]).reduce((e,r)=>e.concat(Array.isArray(r)?Ye(r):r),[])}const Ze=e=>{let r="";return e&&(r=e.address_1&&e.address_1.length>0?e.address_1+", ":"",e.address_2&&e.address_2.length>0?r+=e.address_2+", ":r+="",e.city&&e.city.length>0?r+=e.city+", ":r+="",e.state&&e.state.length>0?r+=e.state:r+="",e.zip&&e.zip.length>0&&(r+=" "+e.zip)),r},Je=e=>"EVALUATOR"===e?"MODERATOR":e,Qe=e=>e&&"string"==typeof e?e.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"").replace(/<[^>]+>/g,"").replace(/javascript:/gi,"").replace(/on\w+\s*=/gi,"").trim():"",Xe=e=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e),er=e=>{try{return new URL(e),!0}catch(e){return!1}},rr=e=>!e||0===e.trim().length,tr=(e,r,t)=>{const a=e?e.length:0;return a>=r&&a<=t},ar=e=>/^[a-zA-Z0-9]+$/.test(e),ir=e=>/^[a-zA-Z]+$/.test(e),or=e=>/^\d+$/.test(e),nr=e=>/^[\d\s\-\(\)\+]+$/.test(e)&&e.replace(/\D/g,"").length>=10,sr=e=>e.replace(/\s+/g," ").trim(),lr=(e,r)=>r.test(e),dr=e=>{const r=new Date(e);return!isNaN(r.getTime())},cr=(e,r=[])=>({isValid:e,errors:r}),ur=l(null),gr=({children:r})=>{const[t,a]=i([]),s=c(new Map),l=o(e=>{const r=s.current.get(e);r&&(clearTimeout(r),s.current.delete(e)),a(r=>r.filter(r=>r.id!==e))},[]),d=o((e,r="error",t=!0,i=1e4)=>{const o=`error_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,n={id:o,type:r,message:e,timestamp:Date.now(),autoHide:t,duration:i};if(a(t=>t.some(t=>t.message===e&&t.type===r)?t:[...t,n]),t&&i){const e=setTimeout(()=>{l(o)},i);s.current.set(o,e)}return o},[l]),u=o(()=>{s.current.forEach(e=>{clearTimeout(e)}),s.current.clear(),a([])},[]),g=o((e,r=!0)=>d(e,"error",r),[d]),m=o((e,r=!0)=>d(e,"success",r),[d]),p=o((e,r=!0)=>d(e,"warning",r),[d]),h=o((e,r=!0)=>d(e,"info",r),[d]);n(()=>()=>{s.current.forEach(e=>{clearTimeout(e)}),s.current.clear()},[]);const b={errors:t,addError:d,removeError:l,clearErrors:u,showError:g,showSuccess:m,showWarning:p,showInfo:h};return e(ur.Provider,{value:b,children:r})},mr=()=>{const e=d(ur);if(!e)throw new Error("useError must be used within an ErrorProvider");return e},pr=()=>{const{showError:e}=mr();return{handleError:o((r,t)=>{console.error("Error caught by boundary:",r,t),e("An unexpected error occurred. Please try again.")},[e])}},hr=({error:t,onClose:a})=>r("div",{className:`text-white p-4 rounded-lg shadow-lg ring-2 ${(()=>{switch(t.type){case"success":return"ring-idd-green";case"warning":return"ring-idd-yellow";case"info":return"ring-idd-purple";default:return"ring-idd-active-color"}})()} flex items-start gap-3 max-w-md`,children:[e("div",{className:"flex-shrink-0 mt-0.5",children:(()=>{switch(t.type){case"success":return e(w,{});case"warning":default:return e(v,{});case"info":return e(x,{})}})()}),e("div",{className:"flex-1 min-w-0",children:r("div",{className:"font-idd-primary-font-regular text-lg leading-relaxed",children:[e("span",{className:"font-idd-primary-font-bold text-lg",children:(()=>{switch(t.type){case"success":return"Success: ";case"warning":return"Warning: ";case"info":return"Info: ";default:return"Error: "}})()})," ",t.message]})}),e(g,{buttonClass:"border-0 bg-idd-transparent ms-auto",onPress:()=>a(t.id),"aria-label":"Close",children:e(b,{})})]}),br=()=>{const{errors:r,removeError:t}=mr();return 0===r.length?null:e("div",{className:"fixed bottom-10 right-10 flex flex-col gap-3",style:{zIndex:1e3},children:r.map(r=>e("div",{className:"bg-idd-white mt-3",children:e(hr,{error:r,onClose:t})},r.id))})};export{X as ActionTypes,ge as CancelActionButton,xe as Card,me as ConfirmActionButton,qe as ContentItem,Ue as DEFAULT_ASSET_PATHS,Be as DEFAULT_FALLBACK_COLORS,Ne as DashboardProvider,N as ErrorBoundary,gr as ErrorProvider,hr as ErrorToast,br as ErrorToastContainer,Y as FormField,he as IDDLinkInputItem,be as Layout,Z as Loader,D as LoginBackground,ve as Modal,ye as Password,U as PasswordRequirements,A as PasswordStrength,z as PasswordStrengthBar,$ as PasswordStrengthIndicator,_e as PluginManager,K as SimpleButton,J as SubmitButton,Q as TermsCheckbox,fe as TextInput,q as buttonVariants,V as commonStyles,P as createDefaultConfig,cr as createValidationResult,R as debounce,B as defaultConfig,Te as ensureArray,Ye as flatten,_ as generateBackgroundStyles,Ke as getArraysDiff,$e as getBackgroundStyle,H as getButtonStyles,j as getConfig,Ze as getLocationString,Ce as get_all_plugins,ir as isAlpha,ar as isAlphanumeric,rr as isEmpty,tr as isLengthValid,Le as isNonEmptyArray,or as isNumeric,pe as isURL,C as isValidColor,dr as isValidDate,Xe as isValidEmail,T as isValidImageUrl,nr as isValidPhone,er as isValidUrl,Je as mapUserRole,lr as matchesPattern,sr as normalizeWhitespace,I as preloadImage,ne as resetReducer,Se as safeFilter,Ie as safeFind,De as safeLength,Pe as safeMap,Re as safeSome,Qe as sanitizeInput,G as setConfig,oe as setCurrentItem,re as setCurrentPlugin,se as setCurrentPluginAndTab,ae as setCurrentState,te as setCurrentTab,le as setCurrentTabAndState,ie as setCurrentView,ee as setPlugins,de as setSetting,ce as toggleCollapsed,ue as toggleNotifications,Ve as truncate,ze as useAssetValidation,M as useConfig,Ee as useDashboard,mr as useError,pr as useErrorBoundary,W as useIDDTheme,L as useLoginBackground,He as useWindowDimensions,Ae as validateAsset,Oe as validateAssets,Fe as validateCommonAssets,S as validateConfig,Ge as warnMissingAssets};
|
|
14
2
|
//# sourceMappingURL=index.esm.js.map
|