83 lines
2.2 KiB
JavaScript
83 lines
2.2 KiB
JavaScript
/*
|
|
* Extracted from browser-delivered Turbopack chunk: 1da3af88666fe4c8.e799ee1631.js
|
|
* Module id: 24917
|
|
* For reading/searching only; this factory depends on the original Turbopack runtime.
|
|
*/
|
|
|
|
const moduleFactory = (e) => {
|
|
"use strict";
|
|
let t = (0, e.i(396805).createWithEqualityFn)((e, t) => ({
|
|
cache: {},
|
|
updateCache: (t, r) => e((e) => ({ cache: { ...e.cache, [t]: r } })),
|
|
getCache: (e) => t().cache[e],
|
|
}));
|
|
e.s(["generatorCacheStore", 0, t], 24917);
|
|
let r = { image: ["ratio"], video: ["ratio"] };
|
|
function o(e, t) {
|
|
return e?.settings
|
|
? Array.isArray(e.settings)
|
|
? e.settings
|
|
: (e.settings[t] ?? e.settings.text2video ?? [])
|
|
: [];
|
|
}
|
|
function n(e, t) {
|
|
return t?.originalField ?? e;
|
|
}
|
|
function i(e, t) {
|
|
return e.find((e) => e.startsWith(t));
|
|
}
|
|
function a(e, t, a) {
|
|
let l = {};
|
|
t.model && (l.model = t.model);
|
|
let s = r[e];
|
|
if (!s.length || !a) return l;
|
|
let c = a.properties ?? {},
|
|
u = o(a.config ?? {}, t.modeType ?? ""),
|
|
d = t.settings ?? {};
|
|
for (let e of s) {
|
|
let t = i(u, e);
|
|
if (!t) continue;
|
|
let r = c[t],
|
|
o = d[n(t, r)];
|
|
void 0 !== o && (l[e] = o);
|
|
}
|
|
return l;
|
|
}
|
|
function l(e, a, l) {
|
|
let s = t.getState().getCache(e);
|
|
if (!s) return null;
|
|
let c = r[e];
|
|
if (!c.length || !a) return null;
|
|
let u = a.properties ?? {},
|
|
d = o(a.config ?? {}, l ?? ""),
|
|
m = {},
|
|
f = !1;
|
|
for (let e of c) {
|
|
let t = s[e];
|
|
if (void 0 === t) continue;
|
|
let r = i(d, e);
|
|
if (!r) continue;
|
|
let o = u[r],
|
|
a = n(r, o);
|
|
(function (e, t) {
|
|
return (
|
|
!!e?.enum &&
|
|
!!Array.isArray(e.enum) &&
|
|
e.enum.some((e) =>
|
|
"object" == typeof e && null !== e && "value" in e
|
|
? e.value === t
|
|
: e === t,
|
|
)
|
|
);
|
|
})(o, t) && ((m[a] = t), (f = !0));
|
|
}
|
|
return f ? m : null;
|
|
}
|
|
e.s(
|
|
["buildCachedSettingsPatch", () => l, "extractCacheableFields", () => a],
|
|
706900,
|
|
);
|
|
};
|
|
|
|
export default moduleFactory;
|