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AAS,WACnC,IAAI,EAAS,MAAM,QAEnB,OADA,EAAO,WAAa,KAAK,MAAM,WACxB,MAAM,cAAc,MAAO,CAAC,MAAO,OAAO,CAAC,EAAG,IAAU,KAAK,MACxE,EACO,CACX,CAlC0B,CAkCxB,MAAM,WACR,QAAQ,oBAAsB,oBAC9B,OAAO,eAAe,QAAS,aAAc,CAAE,OAAO,IACtD,QAAQ,QAAU,SAAU,GAAe,OAAO,SAAU,GAAS,OAAQ,MAAM,cAAc,oBAAqB,CAAC,MAAO,EAAO,YAAa,GAAgB,CAAG","file":"/npm/react-storybook-addon-backgrounds@0.0.7/dist/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.19.2.\n * Original file: /npm/react-storybook-addon-backgrounds@0.0.7/dist/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n    function __() { this.constructor = d; }\n    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar React = require(\"react\");\nvar storybook_addons_1 = require(\"@kadira/storybook-addons\");\nvar assign = require(\"object-assign\");\nvar style = {\n    wrapper: {\n        overflow: \"scroll\",\n        position: \"fixed\",\n        top: 0,\n        bottom: 0,\n        right: 0,\n        left: 0,\n        transition: \"background 0.25s ease-in-out\",\n        backgroundPosition: \"center\",\n        backgroundSize: \"cover\",\n        background: \"transparent\",\n    },\n};\nvar BackgroundDecorator = (function (_super) {\n    __extends(BackgroundDecorator, _super);\n    function BackgroundDecorator(props) {\n        var _this = this;\n        _super.call(this, props);\n        this.state = { background: \"transparent\" };\n        this.setBackground = function (background) { return _this.setState({ background: background }); };\n        if (this.props.channel) {\n            this.channel = this.props.channel;\n        }\n        else {\n            this.channel = storybook_addons_1.default.getChannel();\n        }\n        this.story = this.props.story();\n    }\n    BackgroundDecorator.prototype.componentWillMount = function () {\n        this.channel.on(\"background\", this.setBackground);\n        this.channel.emit(\"background-set\", this.props.backgrounds);\n    };\n    BackgroundDecorator.prototype.componentWillReceiveProps = function (nextProps) {\n        if (nextProps.story !== this.props.story) {\n            this.story = nextProps.story();\n        }\n    };\n    BackgroundDecorator.prototype.componentWillUnmount = function () {\n        this.channel.removeListener(\"background\", this.setBackground);\n        this.channel.emit(\"background-unset\");\n    };\n    BackgroundDecorator.prototype.render = function () {\n        var styles = style.wrapper;\n        styles.background = this.state.background;\n        return React.createElement(\"div\", {style: assign({}, styles)}, this.story);\n    };\n    return BackgroundDecorator;\n}(React.Component));\nexports.BackgroundDecorator = BackgroundDecorator;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = function (backgrounds) { return function (story) { return (React.createElement(BackgroundDecorator, {story: story, backgrounds: backgrounds})); }; };\n"]}