
      import { Temporal } from "@js-temporal/polyfill";
      import { URLPattern } from "urlpattern-polyfill";
      globalThis.addEventListener = () => {};
    
import { Follow, Person } from "../type-BSR-vRXo.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-DxS7Csvz.js";
import "../client-KUXReLjS.js";
import "../lookup-q8DeFAjR.js";
import "../types-BSuWJsOm.js";
import "../actor-By5NMImS.js";
import "../key-B057bXm0.js";
import "../http-CCydyMoV.js";
import "../authdocloader-lhbaj4KA.js";
import "../ld-CxJe2x7_.js";
import "../owner-jwXilm3L.js";
import "../proof-CHi36V0T.js";
import "../inbox-DH8TXk1f.js";
import "../builder-B6AupxqD.js";
import "../collection-CcnIw1qY.js";
import "../keycache-CB_VjDe0.js";
import "../negotiation-5NPJL6zp.js";
import "../retry-D4GJ670a.js";
import "../send-CwVrwo7j.js";
import { test } from "../testing-Cqwzq9nj.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