const require_rolldown_runtime = require('../../../../../../../../../_virtual/rolldown_runtime.js');
const require_Observable$1 = require('../Observable.js');
const require_empty$1 = require('./empty.js');
const require_innerFrom$1 = require('./innerFrom.js');

//#region ../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/using.js
var require_using = /* @__PURE__ */ require_rolldown_runtime.__commonJS({ "../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/using.js": ((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	var Observable_1 = require_Observable$1.require_Observable();
	var innerFrom_1 = require_innerFrom$1.require_innerFrom();
	var empty_1 = require_empty$1.require_empty();
	function using(resourceFactory, observableFactory) {
		return new Observable_1.Observable(function(subscriber) {
			var resource = resourceFactory();
			var result = observableFactory(resource);
			(result ? innerFrom_1.innerFrom(result) : empty_1.EMPTY).subscribe(subscriber);
			return function() {
				if (resource) resource.unsubscribe();
			};
		});
	}
	exports.using = using;
}) });

//#endregion
Object.defineProperty(exports, 'default', {
  enumerable: true,
  get: function () {
    return require_using();
  }
});