"use strict";
exports.id = 686;
exports.ids = [686];
exports.modules = {

/***/ 982072:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (/* binding */ Badge)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(920997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(545725);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(antd__WEBPACK_IMPORTED_MODULE_1__);


function Badge({ count , style  }) {
    return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(antd__WEBPACK_IMPORTED_MODULE_1__.Badge, {
        overflowCount: 1e8,
        count: count ?? 0,
        style: {
            backgroundColor: "#e6f7ff",
            color: "black",
            minWidth: "30px",
            ...style
        }
    });
};


/***/ }),

/***/ 543128:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (/* binding */ SanitizedMarkdown)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(920997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _cocalc_frontend_lib_file_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(732586);
/* harmony import */ var _cocalc_frontend_editors_slate_static_markdown__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(695379);
/* harmony import */ var _cocalc_frontend_editors_slate_static_markdown__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_cocalc_frontend_editors_slate_static_markdown__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var components_misc_A__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(940981);
/*
 *  This file is part of CoCalc: Copyright © 2021 Sagemath, Inc.
 *  License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details
 */ 



function SanitizedMarkdown({ style , value  }) {
    const ctx = {
        AnchorTagComponent: components_misc_A__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z,
        noSanitize: false
    };
    return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_cocalc_frontend_lib_file_context__WEBPACK_IMPORTED_MODULE_1__.FileContext.Provider, {
        value: ctx,
        children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((_cocalc_frontend_editors_slate_static_markdown__WEBPACK_IMPORTED_MODULE_2___default()), {
            value: value,
            style: style
        })
    });
};


/***/ }),

/***/ 216284:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {


// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "c": () => (/* binding */ Embed),
  "A": () => (/* binding */ Layout)
});

// EXTERNAL MODULE: external "react/jsx-runtime"
var jsx_runtime_ = __webpack_require__(920997);
// EXTERNAL MODULE: external "path"
var external_path_ = __webpack_require__(371017);
// EXTERNAL MODULE: external "antd"
var external_antd_ = __webpack_require__(545725);
// EXTERNAL MODULE: ./lib/config.ts
var config = __webpack_require__(774872);
// EXTERNAL MODULE: external "next/head"
var head_ = __webpack_require__(40968);
var head_default = /*#__PURE__*/__webpack_require__.n(head_);
// EXTERNAL MODULE: ./components/analytics.tsx
var analytics = __webpack_require__(499652);
// EXTERNAL MODULE: ./components/landing/footer.tsx + 1 modules
var footer = __webpack_require__(831910);
// EXTERNAL MODULE: ./components/landing/header.tsx + 2 modules
var header = __webpack_require__(131498);
;// CONCATENATED MODULE: ./components/share/header.tsx


function Header() {
    return /*#__PURE__*/ jsx_runtime_.jsx(header/* default */.Z, {
        page: "share"
    });
};

// EXTERNAL MODULE: ./lib/base-path.ts
var base_path = __webpack_require__(348397);
// EXTERNAL MODULE: ./lib/use-customize.ts
var use_customize = __webpack_require__(117682);
;// CONCATENATED MODULE: ./components/share/layout.tsx
/*
 *  This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
 *  License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details
 */ 









const favicon = (0,external_path_.join)(base_path/* default */.Z, "webapp/favicon-32x32.png");
function Layout({ title , children  }) {
    const { siteName , noindex  } = (0,use_customize/* default */.Z)();
    return /*#__PURE__*/ (0,jsx_runtime_.jsxs)(jsx_runtime_.Fragment, {
        children: [
            /*#__PURE__*/ (0,jsx_runtime_.jsxs)((head_default()), {
                children: [
                    /*#__PURE__*/ (0,jsx_runtime_.jsxs)("title", {
                        children: [
                            siteName,
                            " -- ",
                            title
                        ]
                    }),
                    /*#__PURE__*/ jsx_runtime_.jsx("meta", {
                        name: "description",
                        content: "CoCalc Share Server"
                    }),
                    noindex && /*#__PURE__*/ jsx_runtime_.jsx("meta", {
                        name: "robots",
                        content: "noindex,nofollow"
                    }),
                    /*#__PURE__*/ jsx_runtime_.jsx("link", {
                        rel: "icon",
                        href: favicon
                    })
                ]
            }),
            /*#__PURE__*/ (0,jsx_runtime_.jsxs)(external_antd_.Layout, {
                children: [
                    /*#__PURE__*/ jsx_runtime_.jsx(Header, {}),
                    /*#__PURE__*/ jsx_runtime_.jsx(external_antd_.Layout.Content, {
                        style: {
                            background: "white"
                        },
                        children: /*#__PURE__*/ jsx_runtime_.jsx("div", {
                            style: {
                                color: "#555",
                                margin: "0 auto",
                                maxWidth: config/* SHARE_MAX_WIDTH */.r,
                                fontSize: "11pt",
                                padding: "15px"
                            },
                            children: children
                        })
                    }),
                    /*#__PURE__*/ jsx_runtime_.jsx(footer/* default */.Z, {})
                ]
            })
        ]
    });
}
function Embed({ title , children  }) {
    const { siteName  } = (0,use_customize/* default */.Z)();
    return /*#__PURE__*/ (0,jsx_runtime_.jsxs)(jsx_runtime_.Fragment, {
        children: [
            /*#__PURE__*/ (0,jsx_runtime_.jsxs)((head_default()), {
                children: [
                    /*#__PURE__*/ (0,jsx_runtime_.jsxs)("title", {
                        children: [
                            siteName,
                            " -- ",
                            title
                        ]
                    }),
                    /*#__PURE__*/ jsx_runtime_.jsx("link", {
                        rel: "icon",
                        href: favicon
                    })
                ]
            }),
            /*#__PURE__*/ jsx_runtime_.jsx(analytics/* default */.Z, {}),
            /*#__PURE__*/ jsx_runtime_.jsx("main", {
                children: children
            })
        ]
    });
}


/***/ }),

/***/ 113419:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (/* binding */ PublicPaths)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(920997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(545725);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(antd__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var components_misc_badge__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(982072);
/* harmony import */ var components_misc_A__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(940981);
/* harmony import */ var components_misc_sanitized_markdown__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(543128);
/* harmony import */ var _cocalc_frontend_components_icon__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(807772);
/* harmony import */ var _cocalc_frontend_components_icon__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_cocalc_frontend_components_icon__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _cocalc_util_misc__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(477389);
/* harmony import */ var _cocalc_util_misc__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_cocalc_util_misc__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _cocalc_util_consts_ui__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(883996);
/*
 *  This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
 *  License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details
 */ /*
A table of a list of public paths.
*/ 







function Description({ description , maxWidth  }) {
    if (!description?.trim()) return null;
    return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
        style: {
            maxWidth,
            maxHeight: "4em",
            overflow: "auto",
            border: "1px solid #eee",
            borderRadius: "3px",
            padding: "5px"
        },
        children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(components_misc_sanitized_markdown__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z, {
            value: description
        })
    });
}
function LastEdited({ last_edited  }) {
    return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
        children: `${new Date(parseFloat(last_edited)).toLocaleString()}`
    });
}
function Title({ id , title , url  }) {
    return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(components_misc_A__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, {
        href: url ? `/${url}` : `/share/public_paths/${id}`,
        children: (0,_cocalc_util_misc__WEBPACK_IMPORTED_MODULE_6__.trunc_middle)(title, 48)
    });
}
function Visibility({ disabled , unlisted , vhost , authenticated  }) {
    if (disabled) {
        return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
            children: [
                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_cocalc_frontend_components_icon__WEBPACK_IMPORTED_MODULE_5__.Icon, {
                    name: "lock"
                }),
                " Private"
            ]
        });
    }
    if (authenticated) {
        return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
            children: [
                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_cocalc_frontend_components_icon__WEBPACK_IMPORTED_MODULE_5__.Icon, {
                    name: _cocalc_util_consts_ui__WEBPACK_IMPORTED_MODULE_7__/* .SHARE_AUTHENTICATED_ICON */ .rD
                }),
                " Authenticated"
            ]
        });
    }
    if (unlisted) {
        return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
            children: [
                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_cocalc_frontend_components_icon__WEBPACK_IMPORTED_MODULE_5__.Icon, {
                    name: "eye-slash"
                }),
                " Unlisted"
            ]
        });
    }
    if (vhost) {
        return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
            children: [
                "Virtual Host: ",
                vhost
            ]
        });
    }
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
        children: [
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_cocalc_frontend_components_icon__WEBPACK_IMPORTED_MODULE_5__.Icon, {
                name: "eye"
            }),
            " Listed"
        ]
    });
}
function ViewsAndStars({ stars , views  }) {
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
        style: {
            display: "flex"
        },
        children: [
            views > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                style: {
                    marginRight: "30px"
                },
                children: [
                    "Views ",
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(components_misc_badge__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, {
                        count: views
                    })
                ]
            }),
            stars > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                children: [
                    "Stars ",
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(components_misc_badge__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, {
                        count: stars
                    })
                ]
            })
        ]
    });
}
// I'm using any[]'s below since it's too much of a pain dealing with TS for this.
const COLUMNS0 = [
    {
        title: "Path",
        dataIndex: "path",
        key: "path",
        render: (title, record)=>/*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(Title, {
                id: record.id,
                title: title,
                url: record.url
            }),
        responsive: [
            "sm"
        ],
        sorter: (0,_cocalc_util_misc__WEBPACK_IMPORTED_MODULE_6__.field_cmp)("path")
    },
    {
        title: "Description",
        dataIndex: "description",
        key: "description",
        render: (description)=>/*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(Description, {
                description: description,
                maxWidth: "250px"
            }),
        responsive: [
            "sm"
        ],
        sorter: (0,_cocalc_util_misc__WEBPACK_IMPORTED_MODULE_6__.field_cmp)("description")
    },
    {
        title: "Last Modified",
        dataIndex: "last_edited",
        key: "last_edited",
        render: (last_edited)=>/*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(LastEdited, {
                last_edited: last_edited
            }),
        responsive: [
            "sm"
        ],
        sorter: (0,_cocalc_util_misc__WEBPACK_IMPORTED_MODULE_6__.field_cmp)("last_edited")
    },
    {
        title: "Stars",
        dataIndex: "stars",
        key: "stars",
        render: (stars)=>/*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(components_misc_badge__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, {
                count: stars
            }),
        responsive: [
            "sm"
        ],
        sorter: (0,_cocalc_util_misc__WEBPACK_IMPORTED_MODULE_6__.field_cmp)("stars")
    },
    {
        title: "Views",
        dataIndex: "counter",
        key: "counter",
        render: (counter)=>/*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(components_misc_badge__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, {
                count: counter
            }),
        responsive: [
            "sm"
        ],
        sorter: (0,_cocalc_util_misc__WEBPACK_IMPORTED_MODULE_6__.field_cmp)("counter")
    }, 
];
const COLUMNS = COLUMNS0.concat([
    {
        title: "Documents",
        responsive: [
            "xs"
        ],
        key: "path",
        render: (_, record)=>{
            const { path , url , last_edited , id , description , stars , counter  } = record;
            return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_1__.Space, {
                direction: "vertical",
                style: {
                    width: "100%"
                },
                children: [
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(Title, {
                        title: path,
                        id: id,
                        url: url
                    }),
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(Description, {
                        description: description
                    }),
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(LastEdited, {
                        last_edited: last_edited
                    }),
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(ViewsAndStars, {
                        stars: stars,
                        views: counter
                    })
                ]
            });
        }
    }, 
]);
const COLUMNS_WITH_VISIBILITY = COLUMNS0.concat([
    {
        title: "Visibility",
        dataIndex: "disabled",
        key: "disabled",
        render: (_, record)=>/*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(Visibility, {
                disabled: record.disabled,
                unlisted: record.unlisted,
                authenticated: record.authenticated,
                vhost: record.vhost
            }),
        responsive: [
            "sm"
        ],
        sorter: (0,_cocalc_util_misc__WEBPACK_IMPORTED_MODULE_6__.field_cmp)([
            "disabled",
            "unlisted",
            "vhost",
            "authenticated"
        ])
    },
    {
        title: "Documents",
        responsive: [
            "xs"
        ],
        key: "path",
        render: (_, record)=>{
            const { path , last_edited , id , description , stars , counter , url  } = record;
            return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_1__.Space, {
                direction: "vertical",
                style: {
                    width: "100%"
                },
                children: [
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(Title, {
                        title: path,
                        id: id,
                        url: url
                    }),
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(Description, {
                        description: description
                    }),
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(LastEdited, {
                        last_edited: last_edited
                    }),
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(Visibility, {
                        disabled: record.disabled,
                        unlisted: record.unlisted,
                        authenticated: record.authenticated,
                        vhost: record.vhost
                    }),
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(ViewsAndStars, {
                        stars: stars,
                        views: counter
                    })
                ]
            });
        }
    }, 
]);
function PublicPaths({ publicPaths  }) {
    let showVisibility = false;
    if (publicPaths) {
        for (const path of publicPaths){
            const { disabled , unlisted , authenticated  } = path;
            if (disabled || unlisted || authenticated) {
                showVisibility = true;
                break;
            }
        }
    }
    return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(antd__WEBPACK_IMPORTED_MODULE_1__.Table, {
        pagination: false,
        rowKey: "id",
        loading: publicPaths == null,
        dataSource: publicPaths,
        columns: showVisibility ? COLUMNS_WITH_VISIBILITY : COLUMNS,
        style: {
            overflowX: "auto"
        }
    });
};


/***/ }),

/***/ 774872:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "d": () => (/* binding */ MAX_WIDTH),
/* harmony export */   "r": () => (/* binding */ SHARE_MAX_WIDTH)
/* harmony export */ });
/*
Constants and other configuration that impact the overall
look of all of the pages.
*/ const MAX_WIDTH = "900px";
const SHARE_MAX_WIDTH = "1100px";


/***/ }),

/***/ 883996:
/***/ ((__unused_webpack_module, exports) => {

var __webpack_unused_export__;

/*
 *  This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
 *  License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details
 */
__webpack_unused_export__ = ({ value: true });
exports.Le = exports.h1 = exports.rD = void 0;
/**
 * User Interface specific constants
 */
// icon name used for shared files, only accessible for authenticated users
exports.rD = "user";
exports.h1 = "only visible to those who are signed in";
// boolean flags for various shared files visibility modes
exports.Le = {
    LISTED: { unlisted: false, disabled: false, authenticated: false },
    UNLISTED: { unlisted: true, disabled: false, authenticated: false },
    DISABLED: { unlisted: false, disabled: true, authenticated: false },
    AUTHENTICATED: { unlisted: false, disabled: false, authenticated: true },
};
//# sourceMappingURL=ui.js.map

/***/ })

};
;