
      import { Temporal } from "@js-temporal/polyfill";
      import { URLPattern } from "urlpattern-polyfill";
      globalThis.addEventListener = () => {};
    
import { Follow, Person } from "../lookup-Csp1y88W.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-BuMF-mtE.js";
import "../client-pY7-3icS.js";
import "../types-C2XVl6gj.js";
import "../actor-BV5H5O8U.js";
import "../key-DpaoFQ82.js";
import "../http-CqzO68Am.js";
import "../ld-gP0eHSrh.js";
import "../owner-CuAVQ6t7.js";
import "../proof-BM2DN2Sn.js";
import "../docloader-C2NUa918.js";
import "../kv-cache-DN9pfMBe.js";
import "../inbox-us8YQR88.js";
import "../builder-rmwKTih6.js";
import "../collection-BzWsN9pB.js";
import "../keycache-DbuBfl7N.js";
import "../negotiation-C4nFufNk.js";
import "../retry-CfF8Gn4d.js";
import "../send-BDf5TQos.js";
import { test } from "../testing-YUoSZp2V.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