"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "useUniqId", {
    enumerable: true,
    get: function() {
        return useUniqId;
    }
});
const _react = require("react");
const _SSRProvider = require("../components/SSRProvider");
let noSSRId = 0;
function useUniqId() {
    const context = (0, _react.useContext)(_SSRProvider.SSRContext);
    const [id] = (0, _react.useState)(()=>{
        if (context.uniqId !== null) {
            return `plasma-uniq-id-ssr-${++context.uniqId}`;
        }
        return `plasma-uniq-id-${++noSSRId}`;
    });
    return id;
}
