hz-zhhq-app/node_modules/svelte-fa/dist/svelte-fa.js

808 lines
21 KiB
JavaScript
Raw Normal View History

2025-01-22 10:53:47 +08:00
var SvelteFa = (function () {
'use strict';
function _inheritsLoose(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
subClass.__proto__ = superClass;
}
function _assertThisInitialized(self) {
if (self === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return self;
}
function noop() {}
function run(fn) {
return fn();
}
function blank_object() {
return Object.create(null);
}
function run_all(fns) {
fns.forEach(run);
}
function is_function(thing) {
return typeof thing === 'function';
}
function safe_not_equal(a, b) {
return a != a ? b == b : a !== b || a && typeof a === 'object' || typeof a === 'function';
}
function is_empty(obj) {
return Object.keys(obj).length === 0;
}
function append(target, node) {
target.appendChild(node);
}
function insert(target, node, anchor) {
target.insertBefore(node, anchor || null);
}
function detach(node) {
node.parentNode.removeChild(node);
}
function svg_element(name) {
return document.createElementNS('http://www.w3.org/2000/svg', name);
}
function text(data) {
return document.createTextNode(data);
}
function empty() {
return text('');
}
function attr(node, attribute, value) {
if (value == null) node.removeAttribute(attribute);else if (node.getAttribute(attribute) !== value) node.setAttribute(attribute, value);
}
function children(element) {
return Array.from(element.childNodes);
}
var current_component;
function set_current_component(component) {
current_component = component;
}
var dirty_components = [];
var binding_callbacks = [];
var render_callbacks = [];
var flush_callbacks = [];
var resolved_promise = Promise.resolve();
var update_scheduled = false;
function schedule_update() {
if (!update_scheduled) {
update_scheduled = true;
resolved_promise.then(flush);
}
}
function add_render_callback(fn) {
render_callbacks.push(fn);
}
var flushing = false;
var seen_callbacks = new Set();
function flush() {
if (flushing) return;
flushing = true;
do {
// first, call beforeUpdate functions
// and update components
for (var i = 0; i < dirty_components.length; i += 1) {
var component = dirty_components[i];
set_current_component(component);
update(component.$$);
}
set_current_component(null);
dirty_components.length = 0;
while (binding_callbacks.length) {
binding_callbacks.pop()();
} // then, once components are updated, call
// afterUpdate functions. This may cause
// subsequent updates...
for (var _i = 0; _i < render_callbacks.length; _i += 1) {
var callback = render_callbacks[_i];
if (!seen_callbacks.has(callback)) {
// ...so guard against infinite loops
seen_callbacks.add(callback);
callback();
}
}
render_callbacks.length = 0;
} while (dirty_components.length);
while (flush_callbacks.length) {
flush_callbacks.pop()();
}
update_scheduled = false;
flushing = false;
seen_callbacks.clear();
}
function update($$) {
if ($$.fragment !== null) {
$$.update();
run_all($$.before_update);
var dirty = $$.dirty;
$$.dirty = [-1];
$$.fragment && $$.fragment.p($$.ctx, dirty);
$$.after_update.forEach(add_render_callback);
}
}
var outroing = new Set();
function transition_in(block, local) {
if (block && block.i) {
outroing.delete(block);
block.i(local);
}
}
function mount_component(component, target, anchor) {
var _component$$$ = component.$$,
fragment = _component$$$.fragment,
on_mount = _component$$$.on_mount,
on_destroy = _component$$$.on_destroy,
after_update = _component$$$.after_update;
fragment && fragment.m(target, anchor); // onMount happens before the initial afterUpdate
add_render_callback(function () {
var new_on_destroy = on_mount.map(run).filter(is_function);
if (on_destroy) {
on_destroy.push.apply(on_destroy, new_on_destroy);
} else {
// Edge case - component was destroyed immediately,
// most likely as a result of a binding initialising
run_all(new_on_destroy);
}
component.$$.on_mount = [];
});
after_update.forEach(add_render_callback);
}
function destroy_component(component, detaching) {
var $$ = component.$$;
if ($$.fragment !== null) {
run_all($$.on_destroy);
$$.fragment && $$.fragment.d(detaching); // TODO null out other refs, including component.$$ (but need to
// preserve final state?)
$$.on_destroy = $$.fragment = null;
$$.ctx = [];
}
}
function make_dirty(component, i) {
if (component.$$.dirty[0] === -1) {
dirty_components.push(component);
schedule_update();
component.$$.dirty.fill(0);
}
component.$$.dirty[i / 31 | 0] |= 1 << i % 31;
}
function init(component, options, instance, create_fragment, not_equal, props, dirty) {
if (dirty === void 0) {
dirty = [-1];
}
var parent_component = current_component;
set_current_component(component);
var prop_values = options.props || {};
var $$ = component.$$ = {
fragment: null,
ctx: null,
// state
props: props,
update: noop,
not_equal: not_equal,
bound: blank_object(),
// lifecycle
on_mount: [],
on_destroy: [],
before_update: [],
after_update: [],
context: new Map(parent_component ? parent_component.$$.context : []),
// everything else
callbacks: blank_object(),
dirty: dirty,
skip_bound: false
};
var ready = false;
$$.ctx = instance ? instance(component, prop_values, function (i, ret) {
var value = (arguments.length <= 2 ? 0 : arguments.length - 2) ? arguments.length <= 2 ? undefined : arguments[2] : ret;
if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) {
if (!$$.skip_bound && $$.bound[i]) $$.bound[i](value);
if (ready) make_dirty(component, i);
}
return ret;
}) : [];
$$.update();
ready = true;
run_all($$.before_update); // `false` as a special case of no DOM component
$$.fragment = create_fragment ? create_fragment($$.ctx) : false;
if (options.target) {
if (options.hydrate) {
var nodes = children(options.target); // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
$$.fragment && $$.fragment.l(nodes);
nodes.forEach(detach);
} else {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
$$.fragment && $$.fragment.c();
}
if (options.intro) transition_in(component.$$.fragment);
mount_component(component, options.target, options.anchor);
flush();
}
set_current_component(parent_component);
}
var SvelteComponent = /*#__PURE__*/function () {
function SvelteComponent() {}
var _proto3 = SvelteComponent.prototype;
_proto3.$destroy = function $destroy() {
destroy_component(this, 1);
this.$destroy = noop;
};
_proto3.$on = function $on(type, callback) {
var callbacks = this.$$.callbacks[type] || (this.$$.callbacks[type] = []);
callbacks.push(callback);
return function () {
var index = callbacks.indexOf(callback);
if (index !== -1) callbacks.splice(index, 1);
};
};
_proto3.$set = function $set($$props) {
if (this.$$set && !is_empty($$props)) {
this.$$.skip_bound = true;
this.$$set($$props);
this.$$.skip_bound = false;
}
};
return SvelteComponent;
}();
function create_if_block(ctx) {
var svg;
var g1;
var g0;
var svg_viewBox_value;
function select_block_type(ctx, dirty) {
if (typeof
/*i*/
ctx[8][4] == "string") return create_if_block_1;
return create_else_block;
}
var current_block_type = select_block_type(ctx);
var if_block = current_block_type(ctx);
return {
c: function c() {
svg = svg_element("svg");
g1 = svg_element("g");
g0 = svg_element("g");
if_block.c();
attr(g0, "transform",
/*transform*/
ctx[10]);
attr(g1, "transform", "translate(256 256)");
attr(svg, "id",
/*id*/
ctx[1]);
attr(svg, "class",
/*clazz*/
ctx[0]);
attr(svg, "style",
/*s*/
ctx[9]);
attr(svg, "viewBox", svg_viewBox_value = "0 0 " +
/*i*/
ctx[8][0] + " " +
/*i*/
ctx[8][1]);
attr(svg, "aria-hidden", "true");
attr(svg, "role", "img");
attr(svg, "xmlns", "http://www.w3.org/2000/svg");
},
m: function m(target, anchor) {
insert(target, svg, anchor);
append(svg, g1);
append(g1, g0);
if_block.m(g0, null);
},
p: function p(ctx, dirty) {
if (current_block_type === (current_block_type = select_block_type(ctx)) && if_block) {
if_block.p(ctx, dirty);
} else {
if_block.d(1);
if_block = current_block_type(ctx);
if (if_block) {
if_block.c();
if_block.m(g0, null);
}
}
if (dirty &
/*transform*/
1024) {
attr(g0, "transform",
/*transform*/
ctx[10]);
}
if (dirty &
/*id*/
2) {
attr(svg, "id",
/*id*/
ctx[1]);
}
if (dirty &
/*clazz*/
1) {
attr(svg, "class",
/*clazz*/
ctx[0]);
}
if (dirty &
/*s*/
512) {
attr(svg, "style",
/*s*/
ctx[9]);
}
if (dirty &
/*i*/
256 && svg_viewBox_value !== (svg_viewBox_value = "0 0 " +
/*i*/
ctx[8][0] + " " +
/*i*/
ctx[8][1])) {
attr(svg, "viewBox", svg_viewBox_value);
}
},
d: function d(detaching) {
if (detaching) detach(svg);
if_block.d();
}
};
} // (124:8) {:else}
function create_else_block(ctx) {
var path0;
var path0_d_value;
var path0_fill_value;
var path0_fill_opacity_value;
var path1;
var path1_d_value;
var path1_fill_value;
var path1_fill_opacity_value;
return {
c: function c() {
path0 = svg_element("path");
path1 = svg_element("path");
attr(path0, "d", path0_d_value =
/*i*/
ctx[8][4][0]);
attr(path0, "fill", path0_fill_value =
/*secondaryColor*/
ctx[4] ||
/*color*/
ctx[2] || "currentColor");
attr(path0, "fill-opacity", path0_fill_opacity_value =
/*swapOpacity*/
ctx[7] != false ?
/*primaryOpacity*/
ctx[5] :
/*secondaryOpacity*/
ctx[6]);
attr(path0, "transform", "translate(-256 -256)");
attr(path1, "d", path1_d_value =
/*i*/
ctx[8][4][1]);
attr(path1, "fill", path1_fill_value =
/*primaryColor*/
ctx[3] ||
/*color*/
ctx[2] || "currentColor");
attr(path1, "fill-opacity", path1_fill_opacity_value =
/*swapOpacity*/
ctx[7] != false ?
/*secondaryOpacity*/
ctx[6] :
/*primaryOpacity*/
ctx[5]);
attr(path1, "transform", "translate(-256 -256)");
},
m: function m(target, anchor) {
insert(target, path0, anchor);
insert(target, path1, anchor);
},
p: function p(ctx, dirty) {
if (dirty &
/*i*/
256 && path0_d_value !== (path0_d_value =
/*i*/
ctx[8][4][0])) {
attr(path0, "d", path0_d_value);
}
if (dirty &
/*secondaryColor, color*/
20 && path0_fill_value !== (path0_fill_value =
/*secondaryColor*/
ctx[4] ||
/*color*/
ctx[2] || "currentColor")) {
attr(path0, "fill", path0_fill_value);
}
if (dirty &
/*swapOpacity, primaryOpacity, secondaryOpacity*/
224 && path0_fill_opacity_value !== (path0_fill_opacity_value =
/*swapOpacity*/
ctx[7] != false ?
/*primaryOpacity*/
ctx[5] :
/*secondaryOpacity*/
ctx[6])) {
attr(path0, "fill-opacity", path0_fill_opacity_value);
}
if (dirty &
/*i*/
256 && path1_d_value !== (path1_d_value =
/*i*/
ctx[8][4][1])) {
attr(path1, "d", path1_d_value);
}
if (dirty &
/*primaryColor, color*/
12 && path1_fill_value !== (path1_fill_value =
/*primaryColor*/
ctx[3] ||
/*color*/
ctx[2] || "currentColor")) {
attr(path1, "fill", path1_fill_value);
}
if (dirty &
/*swapOpacity, secondaryOpacity, primaryOpacity*/
224 && path1_fill_opacity_value !== (path1_fill_opacity_value =
/*swapOpacity*/
ctx[7] != false ?
/*secondaryOpacity*/
ctx[6] :
/*primaryOpacity*/
ctx[5])) {
attr(path1, "fill-opacity", path1_fill_opacity_value);
}
},
d: function d(detaching) {
if (detaching) detach(path0);
if (detaching) detach(path1);
}
};
} // (118:8) {#if typeof i[4] == 'string'}
function create_if_block_1(ctx) {
var path;
var path_d_value;
var path_fill_value;
return {
c: function c() {
path = svg_element("path");
attr(path, "d", path_d_value =
/*i*/
ctx[8][4]);
attr(path, "fill", path_fill_value =
/*color*/
ctx[2] ||
/*primaryColor*/
ctx[3] || "currentColor");
attr(path, "transform", "translate(-256 -256)");
},
m: function m(target, anchor) {
insert(target, path, anchor);
},
p: function p(ctx, dirty) {
if (dirty &
/*i*/
256 && path_d_value !== (path_d_value =
/*i*/
ctx[8][4])) {
attr(path, "d", path_d_value);
}
if (dirty &
/*color, primaryColor*/
12 && path_fill_value !== (path_fill_value =
/*color*/
ctx[2] ||
/*primaryColor*/
ctx[3] || "currentColor")) {
attr(path, "fill", path_fill_value);
}
},
d: function d(detaching) {
if (detaching) detach(path);
}
};
}
function create_fragment(ctx) {
var if_block_anchor;
var if_block =
/*i*/
ctx[8][4] && create_if_block(ctx);
return {
c: function c() {
if (if_block) if_block.c();
if_block_anchor = empty();
},
m: function m(target, anchor) {
if (if_block) if_block.m(target, anchor);
insert(target, if_block_anchor, anchor);
},
p: function p(ctx, _ref) {
var dirty = _ref[0];
if (
/*i*/
ctx[8][4]) {
if (if_block) {
if_block.p(ctx, dirty);
} else {
if_block = create_if_block(ctx);
if_block.c();
if_block.m(if_block_anchor.parentNode, if_block_anchor);
}
} else if (if_block) {
if_block.d(1);
if_block = null;
}
},
i: noop,
o: noop,
d: function d(detaching) {
if (if_block) if_block.d(detaching);
if (detaching) detach(if_block_anchor);
}
};
}
function instance($$self, $$props, $$invalidate) {
var _$$props$class = $$props.class,
clazz = _$$props$class === void 0 ? "" : _$$props$class;
var _$$props$id = $$props.id,
id = _$$props$id === void 0 ? "" : _$$props$id;
var _$$props$style = $$props.style,
style = _$$props$style === void 0 ? "" : _$$props$style;
var icon = $$props.icon;
var _$$props$fw = $$props.fw,
fw = _$$props$fw === void 0 ? false : _$$props$fw;
var _$$props$flip = $$props.flip,
flip = _$$props$flip === void 0 ? false : _$$props$flip;
var _$$props$pull = $$props.pull,
pull = _$$props$pull === void 0 ? "" : _$$props$pull;
var _$$props$rotate = $$props.rotate,
rotate = _$$props$rotate === void 0 ? "" : _$$props$rotate;
var _$$props$size = $$props.size,
size = _$$props$size === void 0 ? "" : _$$props$size;
var _$$props$color = $$props.color,
color = _$$props$color === void 0 ? "" : _$$props$color;
var _$$props$primaryColor = $$props.primaryColor,
primaryColor = _$$props$primaryColor === void 0 ? "" : _$$props$primaryColor;
var _$$props$secondaryCol = $$props.secondaryColor,
secondaryColor = _$$props$secondaryCol === void 0 ? "" : _$$props$secondaryCol;
var _$$props$primaryOpaci = $$props.primaryOpacity,
primaryOpacity = _$$props$primaryOpaci === void 0 ? 1 : _$$props$primaryOpaci;
var _$$props$secondaryOpa = $$props.secondaryOpacity,
secondaryOpacity = _$$props$secondaryOpa === void 0 ? 0.4 : _$$props$secondaryOpa;
var _$$props$swapOpacity = $$props.swapOpacity,
swapOpacity = _$$props$swapOpacity === void 0 ? false : _$$props$swapOpacity;
var i;
var s;
var transform;
$$self.$$set = function ($$props) {
if ("class" in $$props) $$invalidate(0, clazz = $$props.class);
if ("id" in $$props) $$invalidate(1, id = $$props.id);
if ("style" in $$props) $$invalidate(11, style = $$props.style);
if ("icon" in $$props) $$invalidate(12, icon = $$props.icon);
if ("fw" in $$props) $$invalidate(13, fw = $$props.fw);
if ("flip" in $$props) $$invalidate(14, flip = $$props.flip);
if ("pull" in $$props) $$invalidate(15, pull = $$props.pull);
if ("rotate" in $$props) $$invalidate(16, rotate = $$props.rotate);
if ("size" in $$props) $$invalidate(17, size = $$props.size);
if ("color" in $$props) $$invalidate(2, color = $$props.color);
if ("primaryColor" in $$props) $$invalidate(3, primaryColor = $$props.primaryColor);
if ("secondaryColor" in $$props) $$invalidate(4, secondaryColor = $$props.secondaryColor);
if ("primaryOpacity" in $$props) $$invalidate(5, primaryOpacity = $$props.primaryOpacity);
if ("secondaryOpacity" in $$props) $$invalidate(6, secondaryOpacity = $$props.secondaryOpacity);
if ("swapOpacity" in $$props) $$invalidate(7, swapOpacity = $$props.swapOpacity);
};
$$self.$$.update = function () {
if ($$self.$$.dirty &
/*icon*/
4096) {
$$invalidate(8, i = icon && icon.icon || [0, 0, "", [], ""]);
}
if ($$self.$$.dirty &
/*fw, pull, size, style*/
174080) {
{
var float;
var width;
var height = "1em";
var lineHeight;
var fontSize;
var textAlign;
var verticalAlign = "-.125em";
var overflow = "visible";
if (fw) {
textAlign = "center";
width = "1.25em";
}
if (pull) {
float = pull;
}
if (size) {
if (size == "lg") {
fontSize = "1.33333em";
lineHeight = ".75em";
verticalAlign = "-.225em";
} else if (size == "xs") {
fontSize = ".75em";
} else if (size == "sm") {
fontSize = ".875em";
} else {
fontSize = size.replace("x", "em");
}
}
var styleObj = {
float: float,
width: width,
height: height,
"line-height": lineHeight,
"font-size": fontSize,
"text-align": textAlign,
"vertical-align": verticalAlign,
overflow: overflow
};
var styleStr = "";
for (var prop in styleObj) {
if (styleObj[prop]) {
styleStr += prop + ":" + styleObj[prop] + ";";
}
}
$$invalidate(9, s = styleStr + style);
}
}
if ($$self.$$.dirty &
/*flip, rotate*/
81920) {
{
var t = "";
if (flip) {
var flipX = 1;
var flipY = 1;
if (flip == "horizontal") {
flipX = -1;
} else if (flip == "vertical") {
flipY = -1;
} else {
flipX = flipY = -1;
}
t += " scale(" + flipX + " " + flipY + ")";
}
if (rotate) {
t += " rotate(" + rotate + " 0 0)";
}
$$invalidate(10, transform = t);
}
}
};
return [clazz, id, color, primaryColor, secondaryColor, primaryOpacity, secondaryOpacity, swapOpacity, i, s, transform, style, icon, fw, flip, pull, rotate, size];
}
var Fa = /*#__PURE__*/function (_SvelteComponent) {
_inheritsLoose(Fa, _SvelteComponent);
function Fa(options) {
var _this;
_this = _SvelteComponent.call(this) || this;
init(_assertThisInitialized(_this), options, instance, create_fragment, safe_not_equal, {
class: 0,
id: 1,
style: 11,
icon: 12,
fw: 13,
flip: 14,
pull: 15,
rotate: 16,
size: 17,
color: 2,
primaryColor: 3,
secondaryColor: 4,
primaryOpacity: 5,
secondaryOpacity: 6,
swapOpacity: 7
});
return _this;
}
return Fa;
}(SvelteComponent);
return Fa;
}());