
      import { Temporal } from "@js-temporal/polyfill";
      import { URLPattern } from "urlpattern-polyfill";
      globalThis.addEventListener = () => {};
    
import { Follow, Person } from "../lookup-Dvhilldd.js";
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
import { assert } from "../assert-MZs1qjMx.js";
import { assertInstanceOf } from "../assert_instance_of-DHz7EHNU.js";
import { MemoryKvStore } from "../kv-CRZrzyXm.js";
import { FederationImpl, actorDehydrator, autoIdAssigner } from "../middleware-C7m5m72k.js";
import "../client-pY7-3icS.js";
import "../types-C2XVl6gj.js";
import "../actor-B5o1xrFI.js";
import "../key-jo5CucF6.js";
import "../http-pgzDkXD0.js";
import "../ld-CWuhgMM4.js";
import "../owner-_G6LyiEi.js";
import "../proof-BkMSGqJy.js";
import "../docloader-DUfba_vD.js";
import "../kv-cache-DN9pfMBe.js";
import "../inbox-BDF2VbZ8.js";
import "../builder-CiifhBKW.js";
import "../collection-BzWsN9pB.js";
import "../keycache-C5k5PTyM.js";
import "../negotiation-C4nFufNk.js";
import "../retry-CfF8Gn4d.js";
import "../send-BCzFH66x.js";
import { test } from "../testing-cwlO8Sns.js";

//#region src/compat/transformers.test.ts
const federation = new FederationImpl({ kv: new MemoryKvStore() });
const context = federation.createContext(new URL("http://example.com/"));
test("autoIdAssigner", async () => {
	const activity = new Follow({
		actor: new URL("http://example.com/actors/1"),
		object: new Person({
			id: new URL("http://example.com/actors/2"),
			name: "Bob",
			preferredUsername: "bob"
		})
	});
	const result = autoIdAssigner(activity, context);
	const { id } = result;
	assertInstanceOf(id, URL);
	assertEquals(id.origin, "http://example.com");
	assertEquals(id.pathname, "/");
	assertEquals(id.search, "");
	assert(id.hash.match(/^#Follow\/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/));
	assertEquals(await result.toJsonLd(), await new Follow({
		id,
		actor: new URL("http://example.com/actors/1"),
		object: new Person({
			id: new URL("http://example.com/actors/2"),
			name: "Bob",
			preferredUsername: "bob"
		})
	}).toJsonLd());
});
test("actorDehydrator()", async () => {
	const activity = new Follow({
		id: new URL("http://example.com/activities/1"),
		actor: new Person({
			id: new URL("http://example.com/actors/1"),
			name: "Alice",
			preferredUsername: "alice"
		}),
		object: new Person({
			id: new URL("http://example.com/actors/2"),
			name: "Bob",
			preferredUsername: "bob"
		})
	});
	const result = actorDehydrator(activity, context);
	assertEquals(await result.toJsonLd(), await new Follow({
		id: new URL("http://example.com/activities/1"),
		actor: new URL("http://example.com/actors/1"),
		object: new Person({
			id: new URL("http://example.com/actors/2"),
			name: "Bob",
			preferredUsername: "bob"
		})
	}).toJsonLd());
});

//#endregion