@kanaksan/tamil-calendar-widget
Version:
A reusable React widget for displaying Tamil daily calendar sheets
853 lines (849 loc) • 27.9 kB
JavaScript
var pr = Object.defineProperty;
var gr = (u, i, s) => i in u ? pr(u, i, { enumerable: !0, configurable: !0, writable: !0, value: s }) : u[i] = s;
var de = (u, i, s) => (gr(u, typeof i != "symbol" ? i + "" : i, s), s);
import Me, { useState as ve, useCallback as mr, useEffect as Ue } from "react";
var he = { exports: {} }, B = {};
/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var We;
function yr() {
if (We)
return B;
We = 1;
var u = Me, i = Symbol.for("react.element"), s = Symbol.for("react.fragment"), g = Object.prototype.hasOwnProperty, m = u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, j = { key: !0, ref: !0, __self: !0, __source: !0 };
function A(p, f, P) {
var y, C = {}, b = null, x = null;
P !== void 0 && (b = "" + P), f.key !== void 0 && (b = "" + f.key), f.ref !== void 0 && (x = f.ref);
for (y in f)
g.call(f, y) && !j.hasOwnProperty(y) && (C[y] = f[y]);
if (p && p.defaultProps)
for (y in f = p.defaultProps, f)
C[y] === void 0 && (C[y] = f[y]);
return { $$typeof: i, type: p, key: b, ref: x, props: C, _owner: m.current };
}
return B.Fragment = s, B.jsx = A, B.jsxs = A, B;
}
var J = {};
/**
* @license React
* react-jsx-runtime.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var Ye;
function br() {
return Ye || (Ye = 1, process.env.NODE_ENV !== "production" && function() {
var u = Me, i = Symbol.for("react.element"), s = Symbol.for("react.portal"), g = Symbol.for("react.fragment"), m = Symbol.for("react.strict_mode"), j = Symbol.for("react.profiler"), A = Symbol.for("react.provider"), p = Symbol.for("react.context"), f = Symbol.for("react.forward_ref"), P = Symbol.for("react.suspense"), y = Symbol.for("react.suspense_list"), C = Symbol.for("react.memo"), b = Symbol.for("react.lazy"), x = Symbol.for("react.offscreen"), G = Symbol.iterator, Y = "@@iterator";
function H(e) {
if (e === null || typeof e != "object")
return null;
var r = G && e[G] || e[Y];
return typeof r == "function" ? r : null;
}
var E = u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
function h(e) {
{
for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), a = 1; a < r; a++)
t[a - 1] = arguments[a];
N("error", e, t);
}
}
function N(e, r, t) {
{
var a = E.ReactDebugCurrentFrame, l = a.getStackAddendum();
l !== "" && (r += "%s", t = t.concat([l]));
var c = t.map(function(o) {
return String(o);
});
c.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, c);
}
}
var te = !1, S = !1, M = !1, $ = !1, F = !1, k;
k = Symbol.for("react.module.reference");
function z(e) {
return !!(typeof e == "string" || typeof e == "function" || e === g || e === j || F || e === m || e === P || e === y || $ || e === x || te || S || M || typeof e == "object" && e !== null && (e.$$typeof === b || e.$$typeof === C || e.$$typeof === A || e.$$typeof === p || e.$$typeof === f || // This needs to include all possible module reference object
// types supported by any Flight configuration anywhere since
// we don't know which Flight build this will end up being used
// with.
e.$$typeof === k || e.getModuleId !== void 0));
}
function X(e, r, t) {
var a = e.displayName;
if (a)
return a;
var l = r.displayName || r.name || "";
return l !== "" ? t + "(" + l + ")" : t;
}
function L(e) {
return e.displayName || "Context";
}
function w(e) {
if (e == null)
return null;
if (typeof e.tag == "number" && h("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
return e.displayName || e.name || null;
if (typeof e == "string")
return e;
switch (e) {
case g:
return "Fragment";
case s:
return "Portal";
case j:
return "Profiler";
case m:
return "StrictMode";
case P:
return "Suspense";
case y:
return "SuspenseList";
}
if (typeof e == "object")
switch (e.$$typeof) {
case p:
var r = e;
return L(r) + ".Consumer";
case A:
var t = e;
return L(t._context) + ".Provider";
case f:
return X(e, e.render, "ForwardRef");
case C:
var a = e.displayName || null;
return a !== null ? a : w(e.type) || "Memo";
case b: {
var l = e, c = l._payload, o = l._init;
try {
return w(o(c));
} catch {
return null;
}
}
}
return null;
}
var D = Object.assign, V = 0, pe, ge, me, ye, be, Re, Ee;
function _e() {
}
_e.__reactDisabledLog = !0;
function Le() {
{
if (V === 0) {
pe = console.log, ge = console.info, me = console.warn, ye = console.error, be = console.group, Re = console.groupCollapsed, Ee = console.groupEnd;
var e = {
configurable: !0,
enumerable: !0,
value: _e,
writable: !0
};
Object.defineProperties(console, {
info: e,
log: e,
warn: e,
error: e,
group: e,
groupCollapsed: e,
groupEnd: e
});
}
V++;
}
}
function Ve() {
{
if (V--, V === 0) {
var e = {
configurable: !0,
enumerable: !0,
writable: !0
};
Object.defineProperties(console, {
log: D({}, e, {
value: pe
}),
info: D({}, e, {
value: ge
}),
warn: D({}, e, {
value: me
}),
error: D({}, e, {
value: ye
}),
group: D({}, e, {
value: be
}),
groupCollapsed: D({}, e, {
value: Re
}),
groupEnd: D({}, e, {
value: Ee
})
});
}
V < 0 && h("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
}
}
var ae = E.ReactCurrentDispatcher, ne;
function Z(e, r, t) {
{
if (ne === void 0)
try {
throw Error();
} catch (l) {
var a = l.stack.trim().match(/\n( *(at )?)/);
ne = a && a[1] || "";
}
return `
` + ne + e;
}
}
var ie = !1, Q;
{
var Ke = typeof WeakMap == "function" ? WeakMap : Map;
Q = new Ke();
}
function Te(e, r) {
if (!e || ie)
return "";
{
var t = Q.get(e);
if (t !== void 0)
return t;
}
var a;
ie = !0;
var l = Error.prepareStackTrace;
Error.prepareStackTrace = void 0;
var c;
c = ae.current, ae.current = null, Le();
try {
if (r) {
var o = function() {
throw Error();
};
if (Object.defineProperty(o.prototype, "props", {
set: function() {
throw Error();
}
}), typeof Reflect == "object" && Reflect.construct) {
try {
Reflect.construct(o, []);
} catch (_) {
a = _;
}
Reflect.construct(e, [], o);
} else {
try {
o.call();
} catch (_) {
a = _;
}
e.call(o.prototype);
}
} else {
try {
throw Error();
} catch (_) {
a = _;
}
e();
}
} catch (_) {
if (_ && a && typeof _.stack == "string") {
for (var n = _.stack.split(`
`), R = a.stack.split(`
`), d = n.length - 1, v = R.length - 1; d >= 1 && v >= 0 && n[d] !== R[v]; )
v--;
for (; d >= 1 && v >= 0; d--, v--)
if (n[d] !== R[v]) {
if (d !== 1 || v !== 1)
do
if (d--, v--, v < 0 || n[d] !== R[v]) {
var T = `
` + n[d].replace(" at new ", " at ");
return e.displayName && T.includes("<anonymous>") && (T = T.replace("<anonymous>", e.displayName)), typeof e == "function" && Q.set(e, T), T;
}
while (d >= 1 && v >= 0);
break;
}
}
} finally {
ie = !1, ae.current = c, Ve(), Error.prepareStackTrace = l;
}
var W = e ? e.displayName || e.name : "", I = W ? Z(W) : "";
return typeof e == "function" && Q.set(e, I), I;
}
function qe(e, r, t) {
return Te(e, !1);
}
function Be(e) {
var r = e.prototype;
return !!(r && r.isReactComponent);
}
function ee(e, r, t) {
if (e == null)
return "";
if (typeof e == "function")
return Te(e, Be(e));
if (typeof e == "string")
return Z(e);
switch (e) {
case P:
return Z("Suspense");
case y:
return Z("SuspenseList");
}
if (typeof e == "object")
switch (e.$$typeof) {
case f:
return qe(e.render);
case C:
return ee(e.type, r, t);
case b: {
var a = e, l = a._payload, c = a._init;
try {
return ee(c(l), r, t);
} catch {
}
}
}
return "";
}
var K = Object.prototype.hasOwnProperty, Ce = {}, we = E.ReactDebugCurrentFrame;
function re(e) {
if (e) {
var r = e._owner, t = ee(e.type, e._source, r ? r.type : null);
we.setExtraStackFrame(t);
} else
we.setExtraStackFrame(null);
}
function Je(e, r, t, a, l) {
{
var c = Function.call.bind(K);
for (var o in e)
if (c(e, o)) {
var n = void 0;
try {
if (typeof e[o] != "function") {
var R = Error((a || "React class") + ": " + t + " type `" + o + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[o] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
throw R.name = "Invariant Violation", R;
}
n = e[o](r, o, a, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
} catch (d) {
n = d;
}
n && !(n instanceof Error) && (re(l), h("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", a || "React class", t, o, typeof n), re(null)), n instanceof Error && !(n.message in Ce) && (Ce[n.message] = !0, re(l), h("Failed %s type: %s", t, n.message), re(null));
}
}
}
var Ge = Array.isArray;
function oe(e) {
return Ge(e);
}
function He(e) {
{
var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
return t;
}
}
function ze(e) {
try {
return Oe(e), !1;
} catch {
return !0;
}
}
function Oe(e) {
return "" + e;
}
function je(e) {
if (ze(e))
return h("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", He(e)), Oe(e);
}
var q = E.ReactCurrentOwner, Xe = {
key: !0,
ref: !0,
__self: !0,
__source: !0
}, Pe, xe, se;
se = {};
function Ze(e) {
if (K.call(e, "ref")) {
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
if (r && r.isReactWarning)
return !1;
}
return e.ref !== void 0;
}
function Qe(e) {
if (K.call(e, "key")) {
var r = Object.getOwnPropertyDescriptor(e, "key").get;
if (r && r.isReactWarning)
return !1;
}
return e.key !== void 0;
}
function er(e, r) {
if (typeof e.ref == "string" && q.current && r && q.current.stateNode !== r) {
var t = w(q.current.type);
se[t] || (h('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', w(q.current.type), e.ref), se[t] = !0);
}
}
function rr(e, r) {
{
var t = function() {
Pe || (Pe = !0, h("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
};
t.isReactWarning = !0, Object.defineProperty(e, "key", {
get: t,
configurable: !0
});
}
}
function tr(e, r) {
{
var t = function() {
xe || (xe = !0, h("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
};
t.isReactWarning = !0, Object.defineProperty(e, "ref", {
get: t,
configurable: !0
});
}
}
var ar = function(e, r, t, a, l, c, o) {
var n = {
// This tag allows us to uniquely identify this as a React Element
$$typeof: i,
// Built-in properties that belong on the element
type: e,
key: r,
ref: t,
props: o,
// Record the component responsible for creating this element.
_owner: c
};
return n._store = {}, Object.defineProperty(n._store, "validated", {
configurable: !1,
enumerable: !1,
writable: !0,
value: !1
}), Object.defineProperty(n, "_self", {
configurable: !1,
enumerable: !1,
writable: !1,
value: a
}), Object.defineProperty(n, "_source", {
configurable: !1,
enumerable: !1,
writable: !1,
value: l
}), Object.freeze && (Object.freeze(n.props), Object.freeze(n)), n;
};
function nr(e, r, t, a, l) {
{
var c, o = {}, n = null, R = null;
t !== void 0 && (je(t), n = "" + t), Qe(r) && (je(r.key), n = "" + r.key), Ze(r) && (R = r.ref, er(r, l));
for (c in r)
K.call(r, c) && !Xe.hasOwnProperty(c) && (o[c] = r[c]);
if (e && e.defaultProps) {
var d = e.defaultProps;
for (c in d)
o[c] === void 0 && (o[c] = d[c]);
}
if (n || R) {
var v = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
n && rr(o, v), R && tr(o, v);
}
return ar(e, n, R, l, a, q.current, o);
}
}
var le = E.ReactCurrentOwner, Se = E.ReactDebugCurrentFrame;
function U(e) {
if (e) {
var r = e._owner, t = ee(e.type, e._source, r ? r.type : null);
Se.setExtraStackFrame(t);
} else
Se.setExtraStackFrame(null);
}
var ce;
ce = !1;
function ue(e) {
return typeof e == "object" && e !== null && e.$$typeof === i;
}
function ke() {
{
if (le.current) {
var e = w(le.current.type);
if (e)
return `
Check the render method of \`` + e + "`.";
}
return "";
}
}
function ir(e) {
{
if (e !== void 0) {
var r = e.fileName.replace(/^.*[\\\/]/, ""), t = e.lineNumber;
return `
Check your code at ` + r + ":" + t + ".";
}
return "";
}
}
var Ae = {};
function or(e) {
{
var r = ke();
if (!r) {
var t = typeof e == "string" ? e : e.displayName || e.name;
t && (r = `
Check the top-level render call using <` + t + ">.");
}
return r;
}
}
function De(e, r) {
{
if (!e._store || e._store.validated || e.key != null)
return;
e._store.validated = !0;
var t = or(r);
if (Ae[t])
return;
Ae[t] = !0;
var a = "";
e && e._owner && e._owner !== le.current && (a = " It was passed a child from " + w(e._owner.type) + "."), U(e), h('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, a), U(null);
}
}
function Ie(e, r) {
{
if (typeof e != "object")
return;
if (oe(e))
for (var t = 0; t < e.length; t++) {
var a = e[t];
ue(a) && De(a, r);
}
else if (ue(e))
e._store && (e._store.validated = !0);
else if (e) {
var l = H(e);
if (typeof l == "function" && l !== e.entries)
for (var c = l.call(e), o; !(o = c.next()).done; )
ue(o.value) && De(o.value, r);
}
}
}
function sr(e) {
{
var r = e.type;
if (r == null || typeof r == "string")
return;
var t;
if (typeof r == "function")
t = r.propTypes;
else if (typeof r == "object" && (r.$$typeof === f || // Note: Memo only checks outer props here.
// Inner props are checked in the reconciler.
r.$$typeof === C))
t = r.propTypes;
else
return;
if (t) {
var a = w(r);
Je(t, e.props, "prop", a, e);
} else if (r.PropTypes !== void 0 && !ce) {
ce = !0;
var l = w(r);
h("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", l || "Unknown");
}
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && h("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
}
}
function lr(e) {
{
for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
var a = r[t];
if (a !== "children" && a !== "key") {
U(e), h("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", a), U(null);
break;
}
}
e.ref !== null && (U(e), h("Invalid attribute `ref` supplied to `React.Fragment`."), U(null));
}
}
var $e = {};
function Fe(e, r, t, a, l, c) {
{
var o = z(e);
if (!o) {
var n = "";
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (n += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
var R = ir(l);
R ? n += R : n += ke();
var d;
e === null ? d = "null" : oe(e) ? d = "array" : e !== void 0 && e.$$typeof === i ? (d = "<" + (w(e.type) || "Unknown") + " />", n = " Did you accidentally export a JSX literal instead of a component?") : d = typeof e, h("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", d, n);
}
var v = nr(e, r, t, l, c);
if (v == null)
return v;
if (o) {
var T = r.children;
if (T !== void 0)
if (a)
if (oe(T)) {
for (var W = 0; W < T.length; W++)
Ie(T[W], e);
Object.freeze && Object.freeze(T);
} else
h("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
else
Ie(T, e);
}
if (K.call(r, "key")) {
var I = w(e), _ = Object.keys(r).filter(function(hr) {
return hr !== "key";
}), fe = _.length > 0 ? "{key: someKey, " + _.join(": ..., ") + ": ...}" : "{key: someKey}";
if (!$e[I + fe]) {
var vr = _.length > 0 ? "{" + _.join(": ..., ") + ": ...}" : "{}";
h(`A props object containing a "key" prop is being spread into JSX:
let props = %s;
<%s {...props} />
React keys must be passed directly to JSX without using spread:
let props = %s;
<%s key={someKey} {...props} />`, fe, I, vr, I), $e[I + fe] = !0;
}
}
return e === g ? lr(v) : sr(v), v;
}
}
function cr(e, r, t) {
return Fe(e, r, t, !0);
}
function ur(e, r, t) {
return Fe(e, r, t, !1);
}
var fr = ur, dr = cr;
J.Fragment = g, J.jsx = fr, J.jsxs = dr;
}()), J;
}
process.env.NODE_ENV === "production" ? he.exports = yr() : he.exports = br();
var O = he.exports;
class Rr {
constructor() {
de(this, "cache", {});
de(this, "CACHE_DURATION", 24 * 60 * 60 * 1e3);
}
// 24 hours in milliseconds
/**
* Generate cache key from API URL and date
*/
getCacheKey(i, s) {
return `${i}_${s}`;
}
/**
* Get cached image URL if available and not expired
*/
getCachedImage(i, s) {
const g = this.getCacheKey(i, s), m = this.cache[g];
return m ? Date.now() > m.expiresAt ? (this.removeCachedImage(i, s), null) : m.url : null;
}
/**
* Cache image URL with expiration
*/
setCachedImage(i, s, g) {
const m = this.getCacheKey(i, s);
this.cache[m] = {
url: g,
timestamp: Date.now(),
expiresAt: Date.now() + this.CACHE_DURATION
};
}
/**
* Remove specific cached image and revoke blob URL
*/
removeCachedImage(i, s) {
const g = this.getCacheKey(i, s), m = this.cache[g];
m && (URL.revokeObjectURL(m.url), delete this.cache[g]);
}
/**
* Clear all cached images and revoke blob URLs
*/
clearCache() {
Object.values(this.cache).forEach((i) => {
URL.revokeObjectURL(i.url);
}), this.cache = {};
}
/**
* Clean up expired entries
*/
cleanupExpired() {
const i = Date.now();
Object.keys(this.cache).forEach((s) => {
this.cache[s].expiresAt < i && (URL.revokeObjectURL(this.cache[s].url), delete this.cache[s]);
});
}
}
const Ne = new Rr(), Er = (u) => {
if (!/^\d{4}-\d{2}-\d{2}$/.test(u))
return !1;
const s = new Date(u);
return s instanceof Date && !isNaN(s.getTime());
}, _r = (u, i) => {
const s = u.replace(/\/$/, "");
return s.includes("/daily-sheet") ? `${s}/${i}` : `${s}/api/calendar/daily-sheet/${i}`;
}, Tr = (u) => {
if (u.name === "TypeError" && u.message.includes("fetch"))
return "Network error: Unable to connect to the calendar service. Please check your internet connection.";
if (u.status)
switch (u.status) {
case 401:
return "Authentication failed: Invalid API key or token. Please contact support for a valid API URL.";
case 403:
return "Access denied: Your API key does not have permission to access this resource.";
case 404:
return "Calendar not found: No calendar available for the selected date.";
case 429:
return "Rate limit exceeded: Too many requests. Please try again later.";
case 500:
return "Server error: The calendar service is temporarily unavailable. Please try again later.";
default:
return `Error ${u.status}: Unable to load calendar. Please try again.`;
}
return "Unable to load Tamil calendar. Please check your API URL and try again.";
};
const Or = ({
apiUrl: u,
date: i,
width: s = 400,
height: g,
alt: m = "Tamil Daily Calendar",
className: j = "",
style: A = {},
onLoad: p,
onError: f,
showLoader: P = !0,
loaderComponent: y,
errorComponent: C
}) => {
const [b, x] = ve(null), [G, Y] = ve(!1), [H, E] = ve(null), h = mr(
async (S, M) => {
try {
Y(!0), E(null);
const $ = Ne.getCachedImage(S, M);
if ($) {
x($), Y(!1), p == null || p();
return;
}
const F = _r(S, M), k = await fetch(F, {
method: "GET",
headers: {
Accept: "image/jpeg, image/png, image/*"
}
});
if (!k.ok) {
const L = new Error(
`HTTP ${k.status}: ${k.statusText}`
);
throw L.status = k.status, L;
}
const z = await k.blob();
if (!z.type.startsWith("image/"))
throw new Error("Invalid response: Expected image data");
const X = URL.createObjectURL(z);
Ne.setCachedImage(S, M, X), x(X), p == null || p();
} catch ($) {
const F = Tr($);
E(F), f == null || f(new Error(F));
} finally {
Y(!1);
}
},
[p, f]
);
Ue(() => {
if (!u) {
E("API URL is required");
return;
}
if (!i) {
E("Date is required");
return;
}
if (!Er(i)) {
E("Invalid date format. Please use YYYY-MM-DD format");
return;
}
return x(null), E(null), h(u, i), () => {
b && URL.revokeObjectURL(b);
};
}, [u, i, h]), Ue(() => () => {
b && URL.revokeObjectURL(b);
}, [b]);
const N = {
width: s,
height: g || "auto",
...A
}, te = {
width: "100%",
height: g ? "100%" : "auto",
objectFit: g ? "contain" : "initial",
display: "block"
};
return G && P ? /* @__PURE__ */ O.jsx(
"div",
{
className: `tamil-calendar-widget tamil-calendar-loading ${j}`,
style: N,
children: y || /* @__PURE__ */ O.jsxs("div", { className: "tamil-calendar-loader", children: [
/* @__PURE__ */ O.jsx("div", { className: "tamil-calendar-spinner" }),
/* @__PURE__ */ O.jsx("p", { children: "Loading Tamil Calendar..." })
] })
}
) : H ? /* @__PURE__ */ O.jsx(
"div",
{
className: `tamil-calendar-widget tamil-calendar-error ${j}`,
style: N,
children: C || /* @__PURE__ */ O.jsxs("div", { className: "tamil-calendar-error-content", children: [
/* @__PURE__ */ O.jsx("div", { className: "tamil-calendar-error-icon", children: "⚠️" }),
/* @__PURE__ */ O.jsx("p", { className: "tamil-calendar-error-message", children: H })
] })
}
) : b ? /* @__PURE__ */ O.jsx(
"div",
{
className: `tamil-calendar-widget ${j}`,
style: N,
children: /* @__PURE__ */ O.jsx(
"img",
{
src: b,
alt: m,
style: te,
onLoad: () => p == null ? void 0 : p(),
onError: () => {
const S = "Failed to display calendar image";
E(S), f == null || f(new Error(S));
}
}
)
}
) : null;
};
export {
Or as TamilCalendarWidget,
Ne as imageCache
};