1var __create = Object.create;
2var __getProtoOf = Object.getPrototypeOf;
3var __defProp = Object.defineProperty;
4var __getOwnPropNames = Object.getOwnPropertyNames;
5var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6var __hasOwnProp = Object.prototype.hasOwnProperty;
7var __toESM = (mod, isNodeMode, target) => {
8 target = mod != null ? __create(__getProtoOf(mod)) : {};
9 const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
10 for (let key of __getOwnPropNames(mod))
11 if (!__hasOwnProp.call(to, key))
18var __moduleCache = /* @__PURE__ */ new WeakMap;
19var __toCommonJS = (from) => {
20 var entry = __moduleCache.get(from), desc;
23 entry = __defProp({}, "__esModule", { value: true });
24 if (from && typeof from === "object" || typeof from === "function")
25 __getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, {
27 enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
29 __moduleCache.set(from, entry);
32var __export = (target, all) => {
34 __defProp(target, name, {
38 set: (newValue) => all[name] = () => newValue
43var exports_loader_entry = {};
44__export(exports_loader_entry, {
45 default: () => loader_entry_default
47module.exports = __toCommonJS(exports_loader_entry);
49// output-loader/Loader.Plugin/foreign.js
50var import_fs = __toESM(require("fs"));
51var import_path = __toESM(require("path"));
52var import_unplugin = require("unplugin");
55var loadDirectivesImpl = () => {
56 const rootDir = process.cwd();
57 const manifestPath = import_path.default.join(rootDir, "output", "directives.json");
58 if (!import_fs.default.existsSync(manifestPath))
60 const stat = import_fs.default.statSync(manifestPath);
61 if (stat.mtimeMs === mtime)
64 cache = JSON.parse(import_fs.default.readFileSync(manifestPath, "utf-8"));
65 console.log("[purescript-rsc] Loaded directives:", cache);
67var lookupDirectiveImpl = (nothing) => (just) => (moduleName) => () => {
70 const entry = cache[moduleName];
73 const d = typeof entry === "string" ? entry : entry.directive;
74 return d ? just(d) : nothing;
76var lookupImportsImpl = (moduleName) => () => {
79 const entry = cache[moduleName];
80 if (!entry || typeof entry === "string")
82 return entry.imports || [];
84var extractModuleImpl = (nothing) => (just) => (id) => {
85 const match = id.match(/output[/\\]([^/\\]+)[/\\]index\.js$/);
86 return match ? just(match[1]) : nothing;
88var createPluginImpl = (transformFn) => {
89 const unplugin = import_unplugin.createUnplugin(() => ({
90 name: "purescript-rsc",
92 filter: { id: /output[/\\].*[/\\]index\.js$/ },
94 return transformFn(id)(code)();
98 function raw(source) {
99 return transformFn(this.resourcePath)(source)();
101 raw.webpack = unplugin.webpack;
102 raw.vite = unplugin.vite;
103 raw.rollup = unplugin.rollup;
104 raw.esbuild = unplugin.esbuild;
108// output-loader/Data.Array/foreign.js
109var replicateFill = function(count, value) {
113 var result = new Array(count);
114 return result.fill(value);
116var replicatePolyfill = function(count, value) {
119 for (var i = 0;i < count; i++) {
124var replicateImpl = typeof Array.prototype.fill === "function" ? replicateFill : replicatePolyfill;
125var fromFoldableImpl = function() {
126 function Cons(head, tail) {
131 function curryCons(head) {
132 return function(tail) {
133 return new Cons(head, tail);
136 function listToArray(list) {
140 while (xs !== emptyList) {
141 result[count++] = xs.head;
146 return function(foldr, xs) {
147 return listToArray(foldr(curryCons)(emptyList)(xs));
150var length = function(xs) {
153var sortByImpl = function() {
154 function mergeFromTo(compare, fromOrdering, xs1, xs2, from, to) {
162 mid = from + (to - from >> 1);
164 mergeFromTo(compare, fromOrdering, xs2, xs1, from, mid);
166 mergeFromTo(compare, fromOrdering, xs2, xs1, mid, to);
170 while (i < mid && j < to) {
173 c = fromOrdering(compare(x)(y));
189 return function(compare, fromOrdering, xs) {
194 mergeFromTo(compare, fromOrdering, out, xs.slice(0), 0, xs.length);
199// output-loader/Data.Functor/foreign.js
200var arrayMap = function(f) {
201 return function(arr) {
203 var result = new Array(l);
204 for (var i = 0;i < l; i++) {
205 result[i] = f(arr[i]);
210// output-loader/Data.Functor/index.js
211var map = function(dict) {
214var mapFlipped = function(dictFunctor) {
215 var map1 = map(dictFunctor);
216 return function(fa) {
225// output-loader/Control.Bind/foreign.js
226var arrayBind = typeof Array.prototype.flatMap === "function" ? function(arr) {
228 return arr.flatMap(f);
234 for (var i = 0;i < l; i++) {
237 for (var j = 0;j < k; j++) {
244// output-loader/Data.Bounded/foreign.js
245var topChar = String.fromCharCode(65535);
246var bottomChar = String.fromCharCode(0);
247var topNumber = Number.POSITIVE_INFINITY;
248var bottomNumber = Number.NEGATIVE_INFINITY;
249// output-loader/Data.Show/foreign.js
250var showIntImpl = function(n) {
253var showStringImpl = function(s) {
255 return '"' + s.replace(/[\0-\x1F\x7F"\\]/g, function(c, i) {
277 var empty = k < l && s[k] >= "0" && s[k] <= "9" ? "\\&" : "";
278 return "\\" + c.charCodeAt(0).toString(10) + empty;
282// output-loader/Data.Show/index.js
289var show = function(dict) {
293// output-loader/Data.Maybe/index.js
294var Nothing = /* @__PURE__ */ function() {
295 function Nothing2() {}
296 Nothing2.value = new Nothing2;
299var Just = /* @__PURE__ */ function() {
300 function Just2(value0) {
301 this.value0 = value0;
303 Just2.create = function(value0) {
304 return new Just2(value0);
308// output-loader/Data.Array.ST/foreign.js
309var sortByImpl2 = function() {
310 function mergeFromTo(compare2, fromOrdering, xs1, xs2, from, to) {
318 mid = from + (to - from >> 1);
320 mergeFromTo(compare2, fromOrdering, xs2, xs1, from, mid);
322 mergeFromTo(compare2, fromOrdering, xs2, xs1, mid, to);
326 while (i < mid && j < to) {
329 c = fromOrdering(compare2(x)(y));
345 return function(compare2, fromOrdering, xs) {
348 mergeFromTo(compare2, fromOrdering, xs, xs.slice(0), 0, xs.length);
352// output-loader/Data.Traversable/foreign.js
353var traverseArrayImpl = function() {
369 function concat2(xs) {
370 return function(ys) {
371 return xs.concat(ys);
374 return function(apply2) {
375 return function(map2) {
376 return function(pure2) {
378 return function(array) {
379 function go(bot, top2) {
380 switch (top2 - bot) {
384 return map2(array1)(f(array[bot]));
386 return apply2(map2(array2)(f(array[bot])))(f(array[bot + 1]));
388 return apply2(apply2(map2(array3)(f(array[bot])))(f(array[bot + 1])))(f(array[bot + 2]));
390 var pivot = bot + Math.floor((top2 - bot) / 4) * 2;
391 return apply2(map2(concat2)(go(bot, pivot)))(go(pivot, top2));
394 return go(0, array.length);
401// output-loader/Data.String.Common/foreign.js
402var joinWith = function(s) {
403 return function(xs) {
408// output-loader/Data.String.Common/index.js
409var $$null = function(s) {
413// output-loader/Effect.Console/foreign.js
414var log = function(s) {
419// output-loader/Loader.Plugin/index.js
420var show2 = /* @__PURE__ */ show(showString);
421var mapFlipped2 = /* @__PURE__ */ mapFlipped(functorArray);
422var show1 = /* @__PURE__ */ show(showInt);
423var lookupImports = lookupImportsImpl;
424var lookupDirective = /* @__PURE__ */ function() {
425 return lookupDirectiveImpl(Nothing.value)(Just.create);
427var extractModule = /* @__PURE__ */ function() {
428 return extractModuleImpl(Nothing.value)(Just.create);
430var transform = function(id) {
431 return function(source) {
432 return function __do() {
433 loadDirectivesImpl();
434 var v = extractModule(id);
435 if (v instanceof Nothing) {
438 if (v instanceof Just) {
439 var directive = lookupDirective(v.value0)();
440 var imports = lookupImports(v.value0)();
441 var directiveLine = function() {
442 if (directive instanceof Just) {
443 return show2(directive.value0) + `;
446 if (directive instanceof Nothing) {
449 throw new Error("Failed pattern match at Loader.Plugin (line 40, column 27 - line 42, column 26): " + [directive.constructor.name]);
451 var importLines = mapFlipped2(imports)(function(path2) {
452 return "import " + (show2(path2) + `;
455 var prefix = directiveLine + joinWith("")(importLines);
456 var $12 = $$null(prefix);
460 log("[purescript-rsc] " + (v.value0 + (" -> injecting " + (show1(length(imports)) + (" import(s)" + function() {
461 if (directive instanceof Just) {
462 return " + " + show2(directive.value0);
464 if (directive instanceof Nothing) {
467 throw new Error("Failed pattern match at Loader.Plugin (line 48, column 14 - line 50, column 29): " + [directive.constructor.name]);
469 return prefix + source;
471 throw new Error("Failed pattern match at Loader.Plugin (line 35, column 3 - line 51, column 32): " + [v.constructor.name]);
475var plugin = /* @__PURE__ */ createPluginImpl(transform);
478var loader_entry_default = plugin;
480module.exports=module.exports.default;
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list