@mun-ui/vue 0.0.0-stage → 0.2.1
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/LICENSE +21 -0
- package/dist/continuous-corners.d.ts +2 -0
- package/dist/continuous-corners.d.ts.map +1 -0
- package/dist/continuous-corners.js +46 -0
- package/dist/continuous-corners.js.map +1 -0
- package/dist/geometry.d.ts +4 -0
- package/dist/geometry.d.ts.map +1 -0
- package/dist/geometry.js +53 -0
- package/dist/geometry.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/renderer.d.ts +87 -0
- package/dist/renderer.d.ts.map +1 -0
- package/dist/renderer.js +1554 -0
- package/dist/renderer.js.map +1 -0
- package/package.json +37 -3
- package/README.md +0 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"continuous-corners.d.ts","sourceRoot":"","sources":["../src/continuous-corners.ts"],"names":[],"mappings":"AA+BA,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAY9D"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { APPLE_CONTINUOUS_CORNER_SMOOTHING, continuousCornerPath, expandCornerRadiusShorthand } from "@mun-ui/core/corners";
|
|
2
|
+
const observers = new WeakMap();
|
|
3
|
+
function radius(value, size) {
|
|
4
|
+
const parsed = Number.parseFloat(value);
|
|
5
|
+
return Number.isFinite(parsed) ? (value.trim().endsWith("%") ? parsed * size / 100 : parsed) : 0;
|
|
6
|
+
}
|
|
7
|
+
function update(element) {
|
|
8
|
+
const view = element.ownerDocument?.defaultView;
|
|
9
|
+
if (!view || !(element instanceof view.HTMLElement))
|
|
10
|
+
return;
|
|
11
|
+
const width = element.offsetWidth;
|
|
12
|
+
const height = element.offsetHeight;
|
|
13
|
+
if (width <= 0 || height <= 0)
|
|
14
|
+
return;
|
|
15
|
+
const size = Math.min(width, height);
|
|
16
|
+
const css = view.getComputedStyle(element);
|
|
17
|
+
const shorthand = expandCornerRadiusShorthand(css.borderRadius);
|
|
18
|
+
const smoothing = Number.parseFloat(css.getPropertyValue("--mun-corner-smoothing"));
|
|
19
|
+
const preserveSmoothing = css.getPropertyValue("--mun-corner-preserve-smoothing").trim() !== "0";
|
|
20
|
+
const path = continuousCornerPath(width, height, {
|
|
21
|
+
topLeft: radius(css.borderTopLeftRadius || shorthand.topLeft, size),
|
|
22
|
+
topRight: radius(css.borderTopRightRadius || shorthand.topRight, size),
|
|
23
|
+
bottomRight: radius(css.borderBottomRightRadius || shorthand.bottomRight, size),
|
|
24
|
+
bottomLeft: radius(css.borderBottomLeftRadius || shorthand.bottomLeft, size),
|
|
25
|
+
}, Number.isFinite(smoothing) ? smoothing : APPLE_CONTINUOUS_CORNER_SMOOTHING, preserveSmoothing);
|
|
26
|
+
const clip = `path("${path}")`;
|
|
27
|
+
element.style.clipPath = clip;
|
|
28
|
+
element.style.webkitClipPath = clip;
|
|
29
|
+
}
|
|
30
|
+
export function attachContinuousCornerRef(value) {
|
|
31
|
+
if (!value || typeof value !== "object" || !("ownerDocument" in value))
|
|
32
|
+
return;
|
|
33
|
+
const view = value.ownerDocument?.defaultView;
|
|
34
|
+
if (!view || !(value instanceof view.Element))
|
|
35
|
+
return;
|
|
36
|
+
update(value);
|
|
37
|
+
const ResizeObserverConstructor = view.ResizeObserver
|
|
38
|
+
?? (typeof ResizeObserver === "undefined" ? undefined : ResizeObserver);
|
|
39
|
+
if (!ResizeObserverConstructor)
|
|
40
|
+
return;
|
|
41
|
+
observers.get(value)?.disconnect();
|
|
42
|
+
const observer = new ResizeObserverConstructor(() => update(value));
|
|
43
|
+
observer.observe(value);
|
|
44
|
+
observers.set(value, observer);
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=continuous-corners.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"continuous-corners.js","sourceRoot":"","sources":["../src/continuous-corners.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iCAAiC,EAAE,oBAAoB,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAA;AAE3H,MAAM,SAAS,GAAG,IAAI,OAAO,EAA2B,CAAA;AAExD,SAAS,MAAM,CAAC,KAAa,EAAE,IAAY;IACzC,MAAM,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAA;IACvC,OAAO,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,C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AE,QAAQ,CAAC,CAAA;AAChC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geometry.d.ts","sourceRoot":"","sources":["../src/geometry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmC,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEzF,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,aAAa,CA6BnE;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,GAAG,OAAO,CAS/E"}
|
package/dist/geometry.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { edgeInsetsFromCss, zeroGeometry } from "@mun-ui/core/compat";
|
|
2
|
+
export function geometryFromElement(element) {
|
|
3
|
+
let rect;
|
|
4
|
+
try {
|
|
5
|
+
rect = element.getBoundingClientRect();
|
|
6
|
+
}
|
|
7
|
+
catch {
|
|
8
|
+
return zeroGeometry;
|
|
9
|
+
}
|
|
10
|
+
const frame = {
|
|
11
|
+
x: rect.x,
|
|
12
|
+
y: rect.y,
|
|
13
|
+
width: rect.width,
|
|
14
|
+
height: rect.height,
|
|
15
|
+
top: rect.top,
|
|
16
|
+
right: rect.right,
|
|
17
|
+
bottom: rect.bottom,
|
|
18
|
+
left: rect.left,
|
|
19
|
+
};
|
|
20
|
+
const size = { width: rect.width, height: rect.height };
|
|
21
|
+
const document = element.ownerDocument;
|
|
22
|
+
const view = document.defaultView;
|
|
23
|
+
const fallback = { frame, size, safeAreaInsets: zeroGeometry.safeAreaInsets };
|
|
24
|
+
if (!view?.getComputedStyle || !document.body)
|
|
25
|
+
return fallback;
|
|
26
|
+
const probe = document.createElement("div");
|
|
27
|
+
probe.style.cssText = "position:fixed;inset:0;visibility:hidden;pointer-events:none;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)";
|
|
28
|
+
try {
|
|
29
|
+
document.body.appendChild(probe);
|
|
30
|
+
const style = view.getComputedStyle(probe);
|
|
31
|
+
return { frame, size, safeAreaInsets: edgeInsetsFromCss({ top: style.paddingTop, right: style.paddingRight, bottom: style.paddingBottom, left: style.paddingLeft }) };
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
return fallback;
|
|
35
|
+
}
|
|
36
|
+
finally {
|
|
37
|
+
try {
|
|
38
|
+
probe.remove();
|
|
39
|
+
}
|
|
40
|
+
catch { }
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
export function sameGeometry(left, right) {
|
|
44
|
+
return left.frame.x === right.frame.x
|
|
45
|
+
&& left.frame.y === right.frame.y
|
|
46
|
+
&& left.frame.width === right.frame.width
|
|
47
|
+
&& left.frame.height === right.frame.height
|
|
48
|
+
&& left.safeAreaInsets.top === right.safeAreaInsets.top
|
|
49
|
+
&& left.safeAreaInsets.right === right.safeAreaInsets.right
|
|
50
|
+
&& left.safeAreaInsets.bottom === right.safeAreaInsets.bottom
|
|
51
|
+
&& left.safeAreaInsets.left === right.safeAreaInsets.left;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=geometry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geometry.js","sourceRoot":"","sources":["../src/geometry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAsB,MAAM,qBAAqB,CAAA;AAEzF,MAAM,UAAU,mBAAmB,CAAC,OAAgB;IAClD,IAAI,IAAa,CAAA;IACjB,IAAI,CAAC;QAAC,IAAI,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAA;IAAC,CAAC;IAAC,MAAM,CAAC;QAAC,OAAO,YAAY,CAAA;IAAC,CAAC;IAC5E,MAAM,KAAK,GAAG;QACZ,CAAC,EAAE,IAAI,CAAC,CAAC;QACT,CAAC,EAAE,IAAI,CAAC,CAAC;QACT,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,MAAM,EAAE,IAAI,CAAC,MAAM;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,CAAC;IACjC,CAAC;AACH,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,IAAmB,EAAE,KAAoB;IACpE,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,KAAK,CAAC,KAAK,CAAC,CAAC;WAChC,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,KAAK,CAAC,KAAK,CAAC,CAAC;WAC9B,IAAI,CAAC,KAAK,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK,CAAC,KAAK;WACtC,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,KAAK,CAAC,MAAM;WACxC,IAAI,CAAC,cAAc,CAAC,GAAG,KAAK,KAAK,CAAC,cAAc,CAAC,GAAG;WACpD,IAAI,CAAC,cAAc,CAAC,KAAK,KAAK,KAAK,CAAC,cAAc,CAAC,KAAK;WACxD,IAAI,CAAC,cAAc,CAAC,MAAM,KAAK,KAAK,CAAC,cAAc,CAAC,MAAM;WAC1D,IAAI,CAAC,cAAc,CAAC,IAAI,KAAK,KAAK,CAAC,cAAc,CAAC,IAAI,CAAA;AAC7D,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Public Vue adapter. Renderer implementation stays behind a focused module. */
|
|
2
|
+
export { Component, MunView, createVueView, foreignComponent, fromVueRef, mount, render, toVueRef, vueComponent, } from "./renderer.js";
|
|
3
|
+
export type { MunViewProps, MunVueSlot, VueComponentProps, VueComponentView, VueMountOptions, VueView, } from "./renderer.js";
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,OAAO,EACL,SAAS,EACT,OAAO,EACP,aAAa,EACb,gBAAgB,EAChB,UAAU,EACV,KAAK,EACL,MAAM,EACN,QAAQ,EACR,YAAY,GACb,MAAM,eAAe,CAAA;AACtB,YAAY,EACV,YAAY,EACZ,UAAU,EACV,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,OAAO,GACR,MAAM,eAAe,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,OAAO,EACL,SAAS,EACT,OAAO,EACP,aAAa,EACb,gBAAgB,EAChB,UAAU,EACV,KAAK,EACL,MAAM,EACN,QAAQ,EACR,YAAY,GACb,MAAM,eAAe,CAAA"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { type Component as VueComponentType, type ComponentPublicInstance, type PropType, type Ref, type VNode, type VNodeChild } from "vue";
|
|
2
|
+
import { type BindingRef, type ModifiableViewNode, type StateRef, type ViewGraphValue, type ViewValue } from "@mun-ui/core/compat";
|
|
3
|
+
export type MunVueSlot = ViewValue | ((props: any, ...args: any[]) => ViewValue);
|
|
4
|
+
export type VueComponentProps<C> = C extends abstract new (...args: any[]) => {
|
|
5
|
+
$props: infer Props;
|
|
6
|
+
} ? Props : C extends (props: infer Props, ...args: any[]) => any ? Props : Record<string, unknown>;
|
|
7
|
+
type VueComponentEmitProps<C> = C extends {
|
|
8
|
+
emits?: infer Emits;
|
|
9
|
+
} ? Emits extends Record<string, unknown> ? {
|
|
10
|
+
[Key in keyof Emits as Key extends string ? `on${Capitalize<Key>}` : never]?: Emits[Key] extends (...args: infer Args) => any ? (...args: Args) => any : (...args: any[]) => any;
|
|
11
|
+
} : {} : {};
|
|
12
|
+
type RequiredVuePropKeys<Props> = {
|
|
13
|
+
[Key in keyof Props]-?: object extends Pick<Props, Key> ? never : Key;
|
|
14
|
+
}[keyof Props];
|
|
15
|
+
type MunVueComponentProps<C> = Omit<VueComponentProps<C>, "slots"> & VueComponentEmitProps<C> & {
|
|
16
|
+
readonly slots?: Record<string, MunVueSlot>;
|
|
17
|
+
};
|
|
18
|
+
type VueComponentArguments<C> = [RequiredVuePropKeys<VueComponentProps<C>>] extends [never] ? [props?: MunVueComponentProps<C> | null, ...children: ViewValue[]] : [props: MunVueComponentProps<C>, ...children: ViewValue[]];
|
|
19
|
+
export type VueComponentView<C extends object> = ((...args: VueComponentArguments<C>) => ModifiableViewNode) & {
|
|
20
|
+
readonly component: C;
|
|
21
|
+
};
|
|
22
|
+
/** Render any renderer-independent Mün ViewGraph value as Vue VNodes. */
|
|
23
|
+
export declare function render(value: ViewGraphValue): VNodeChild;
|
|
24
|
+
export interface MunViewProps {
|
|
25
|
+
readonly value?: ViewGraphValue;
|
|
26
|
+
readonly render?: () => ViewGraphValue;
|
|
27
|
+
readonly disablesAnimations?: boolean;
|
|
28
|
+
}
|
|
29
|
+
/** Component for direct use from a Vue SFC template. */
|
|
30
|
+
export declare const MunView: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
31
|
+
value: {
|
|
32
|
+
type: PropType<ViewGraphValue>;
|
|
33
|
+
required: false;
|
|
34
|
+
};
|
|
35
|
+
render: {
|
|
36
|
+
type: PropType<() => ViewGraphValue>;
|
|
37
|
+
required: false;
|
|
38
|
+
};
|
|
39
|
+
disablesAnimations: {
|
|
40
|
+
type: BooleanConstructor;
|
|
41
|
+
required: false;
|
|
42
|
+
default: boolean;
|
|
43
|
+
};
|
|
44
|
+
}>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
45
|
+
[key: string]: any;
|
|
46
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
47
|
+
value: {
|
|
48
|
+
type: PropType<ViewGraphValue>;
|
|
49
|
+
required: false;
|
|
50
|
+
};
|
|
51
|
+
render: {
|
|
52
|
+
type: PropType<() => ViewGraphValue>;
|
|
53
|
+
required: false;
|
|
54
|
+
};
|
|
55
|
+
disablesAnimations: {
|
|
56
|
+
type: BooleanConstructor;
|
|
57
|
+
required: false;
|
|
58
|
+
default: boolean;
|
|
59
|
+
};
|
|
60
|
+
}>> & Readonly<{}>, {
|
|
61
|
+
disablesAnimations: boolean;
|
|
62
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
63
|
+
/** Wrap a graph factory as a Vue component, retaining Vue props at the bridge. */
|
|
64
|
+
export declare function createVueView<Props extends Record<string, unknown> = Record<string, unknown>>(body: (props: Props) => ViewGraphValue): VueComponentType<Props>;
|
|
65
|
+
/** Place a Vue component or native HTML element in the same Mün graph. */
|
|
66
|
+
export declare function Component<C extends object>(type: C, props: Omit<MunVueComponentProps<NoInfer<C>>, "slots"> & {
|
|
67
|
+
readonly slots?: Record<string, any>;
|
|
68
|
+
}, ...children: ViewValue[]): ModifiableViewNode;
|
|
69
|
+
export declare function Component<C extends object>(type: C, ...args: VueComponentArguments<NoInfer<C>>): ModifiableViewNode;
|
|
70
|
+
export declare function Component(type: string, props?: Record<string, unknown> | null, ...children: ViewValue[]): ModifiableViewNode;
|
|
71
|
+
/** Adapt a Vue component definition into a Mun-callable, preserving its Vue prop surface. */
|
|
72
|
+
export declare function vueComponent<C extends object>(type: C): VueComponentView<C>;
|
|
73
|
+
/** Generic foreign-component callable layer; Vue is the first host implementation. */
|
|
74
|
+
export declare function foreignComponent<C extends object>(type: C): VueComponentView<C>;
|
|
75
|
+
/** Bridge Mun State to a Vue Ref without making State a Vue primitive. */
|
|
76
|
+
export declare function toVueRef<T>(state: StateRef<T>): Ref<T>;
|
|
77
|
+
/** Bridge any Vue Ref to a writable Mun Binding lens. */
|
|
78
|
+
export declare function fromVueRef<T>(ref: Ref<T>): BindingRef<T>;
|
|
79
|
+
/** Mount a graph into a Vue-managed DOM root. */
|
|
80
|
+
export interface VueMountOptions {
|
|
81
|
+
readonly hydrate?: boolean;
|
|
82
|
+
}
|
|
83
|
+
/** Mount a graph into Vue, optionally hydrating markup produced by SSR. */
|
|
84
|
+
export declare function mount(value: ViewGraphValue, target: Element, options?: VueMountOptions): () => void;
|
|
85
|
+
export type VueView = VueComponentType<ComponentPublicInstance>;
|
|
86
|
+
export {};
|
|
87
|
+
//# sourceMappingURL=renderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../src/renderer.ts"],"names":[],"mappings":"AAAA,OAAO,EAeL,KAAK,SAAS,IAAI,gBAAgB,EAClC,KAAK,uBAAuB,EAC5B,KAAK,QAAQ,EACb,KAAK,GAAG,EACR,KAAK,KAAK,EACV,KAAK,UAAU,EAChB,MAAM,KAAK,CAAA;AACZ,OAAO,EAuBL,KAAK,UAAU,EACf,KAAK,kBAAkB,EAEvB,KAAK,QAAQ,EACb,KAAK,cAAc,EAGnB,KAAK,SAAS,EAEf,MAAM,qBAAqB,CAAA;AAuO5B,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,SAAS,CAAC,CAAA;AAChF,MAAM,MAAM,iBAAiB,CAAC,CAAC,IAAI,CAAC,SAAS,QAAQ,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK;IAAE,MAAM,EAAE,MAAM,KAAK,CAAA;CAAE,GACjG,KAAK,GACL,CAAC,SAAS,CAAC,KAAK,EAAE,MAAM,KAAK,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,GAAG,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAC3F,KAAK,qBAAqB,CAAC,CAAC,IAAI,CAAC,SAAS;IAAE,KAAK,CAAC,EAAE,MAAM,KAAK,CAAA;CAAE,GAC7D,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACnC;KAAG,GAAG,IAAI,MAAM,KAAK,IAAI,GAAG,SAAS,MAAM,GAAG,KAAK,UAAU,CAAC,GAAG,CAAC,EAAE,GAAG,KAAK,CAAC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