diff --git a/README.md b/README.md index 749c502124e786a7bb130b5b15b0e9ae5514e8b4..aadb6987eac35d1d0abe2ff1976d5795940dacdd 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ --- title: Style2Paints 4.5 Gradio -emoji: 📉 -colorFrom: red +emoji: 🐨 +colorFrom: indigo colorTo: yellow sdk: gradio sdk_version: 3.27.0 diff --git a/app.py b/app.py new file mode 100644 index 0000000000000000000000000000000000000000..03e5d0b5a899db40d9d2a9e6132b430a47c1c7cb --- /dev/null +++ b/app.py @@ -0,0 +1,663 @@ +import cv2 +import numpy as np +import datetime +import pickle +import base64 +import json +import gzip +import re +import gradio as gr + +from tqdm import tqdm +from cv2.ximgproc import l0Smooth, createGuidedFilter, guidedFilter + + +import tensorflow + +tensorflow.compat.v1.disable_v2_behavior() +tf = tensorflow.compat.v1 + + +import os +import glob +import shutil + +splash = glob.glob('ui/web-mobile/splash*')[0] +os.remove(splash) +shutil.copy('res/splash.png', splash) +with open('ui/web-mobile/index.html', 'r', encoding='utf-8') as f: + page = f.read() +with open('ui/web-mobile/index.html', 'w', encoding='utf-8') as f: + f.write(page.replace('Cocos Creator | ', '')) + + +def ToGray(x): + R = x[:, :, :, 0:1] + G = x[:, :, :, 1:2] + B = x[:, :, :, 2:3] + return 0.30 * R + 0.59 * G + 0.11 * B + + +def VGG2RGB(x): + return (x + [103.939, 116.779, 123.68])[:, :, :, ::-1] + + +def norm_feature(x, core): + cs0 = tf.shape(core)[1] + cs1 = tf.shape(core)[2] + small = tf.image.resize_area(x, (cs0, cs1)) + avged = tf.nn.avg_pool(tf.pad(small, [[0, 0], [2, 2], [2, 2], [0, 0]], 'REFLECT'), [1, 5, 5, 1], [1, 1, 1, 1], + 'VALID') + return tf.image.resize_bicubic(avged, tf.shape(x)[1:3]) + + +def blur(x): + def layer(op): + def layer_decorated(self, *args, **kwargs): + # Automatically set a name if not provided. + name = kwargs.setdefault('name', self.get_unique_name(op.__name__)) + # Figure out the layer inputs. + if len(self.terminals) == 0: + raise RuntimeError('No input variables found for layer %s.' % name) + elif len(self.terminals) == 1: + layer_input = self.terminals[0] + else: + layer_input = list(self.terminals) + # Perform the operation and get the output. + layer_output = op(self, layer_input, *args, **kwargs) + # Add to layer LUT. + self.layers[name] = layer_output + # This output is now the input for the next layer. + self.feed(layer_output) + # Return self for chained calls. + return self + + return layer_decorated + + class Smoother(object): + def __init__(self, inputs, filter_size, sigma): + self.inputs = inputs + self.terminals = [] + self.layers = dict(inputs) + self.filter_size = filter_size + self.sigma = sigma + self.setup() + + def setup(self): + (self.feed('data') + .conv(name='smoothing')) + + def get_unique_name(self, prefix): + ident = sum(t.startswith(prefix) for t, _ in self.layers.items()) + 1 + return '%s_%d' % (prefix, ident) + + def feed(self, *args): + assert len(args) != 0 + self.terminals = [] + for fed_layer in args: + if isinstance(fed_layer, str): + try: + fed_layer = self.layers[fed_layer] + except KeyError: + raise KeyError('Unknown layer name fed: %s' % fed_layer) + self.terminals.append(fed_layer) + return self + + def gauss_kernel(self, kernlen=21, nsig=3, channels=1): + out_filter = np.load('./nets/gau.npy') + return out_filter + + def make_gauss_var(self, name, size, sigma, c_i): + kernel = self.gauss_kernel(size, sigma, c_i) + var = tf.Variable(tf.convert_to_tensor(kernel), name=name) + return var + + def get_output(self): + '''Returns the smoother output.''' + return self.terminals[-1] + + @layer + def conv(self, + input, + name, + padding='SAME'): + # Get the number of channels in the input + c_i = input.get_shape().as_list()[3] + # Convolution for a given input and kernel + convolve = lambda i, k: tf.nn.depthwise_conv2d(i, k, [1, 1, 1, 1], + padding=padding) + with tf.variable_scope(name) as scope: + kernel = self.make_gauss_var('gauss_weight', self.filter_size, + self.sigma, c_i) + output = convolve(input, kernel) + return output + + return Smoother({'data': tf.pad(x, [[0, 0], [9, 9], [9, 9], [0, 0]], 'SYMMETRIC')}, 7, 2).get_output()[:, 9: -9, + 9: -9, :] + + +def downsample(x): + return tf.nn.avg_pool(x, ksize=[1, 2, 2, 1], strides=[1, 2, 2, 1], padding='SAME') + + +def nts(x): + return (x + [103.939, 116.779, 123.68])[:, :, :, ::-1] / 255.0 + + +def np_expand_image(x): + p = np.pad(x, ((1, 1), (1, 1), (0, 0)), 'symmetric') + r = [] + r.append(p[:-2, 1:-1, :]) + r.append(p[1:-1, :-2, :]) + r.append(p[1:-1, 1:-1, :]) + r.append(p[1:-1, 2:, :]) + r.append(p[2:, 1:-1, :]) + return np.stack(r, axis=2) + + +def build_sketch_sparse(x, abs): + x = x[:, :, None].astype(np.float32) + expanded = np_expand_image(x) + distance = x[:, :, None] - expanded + if abs: + distance = np.abs(distance) + weight = 8 - distance + weight[weight < 0] = 0.0 + weight /= np.sum(weight, axis=2, keepdims=True) + return weight + + +def build_repeat_mulsep(x, m, i): + a = m[:, :, 0] + b = m[:, :, 1] + c = m[:, :, 2] + d = m[:, :, 3] + e = m[:, :, 4] + y = x + for _ in range(i): + p = tf.pad(y, [[1, 1], [1, 1], [0, 0]], 'SYMMETRIC') + y = p[:-2, 1:-1, :] * a + p[1:-1, :-2, :] * b + y * c + p[1:-1, 2:, :] * d + p[2:, 1:-1, :] * e + return y + + +session = tf.Session() +tf.keras.backend.set_session(session) + +ip1 = tf.placeholder(dtype=tf.float32, shape=(None, None, None, 1)) +ip3 = tf.placeholder(dtype=tf.float32, shape=(None, None, None, 3)) +ip4 = tf.placeholder(dtype=tf.float32, shape=(None, None, None, 4)) +ipsp9 = tf.placeholder(dtype=tf.float32, shape=(None, None, 5, 1)) +ipsp3 = tf.placeholder(dtype=tf.float32, shape=(None, None, 3)) + +tf_sparse_op_H = build_repeat_mulsep(ipsp3, ipsp9, 64) +tf_sparse_op_L = build_repeat_mulsep(ipsp3, ipsp9, 16) + + +def make_graph(): + with gzip.open('./nets/refs.net', 'rb') as fp: + refs_img = pickle.load(fp) + + tail = tf.keras.models.load_model('./nets/tail.net') + reader = tf.keras.models.load_model('./nets/reader.net') + head = tf.keras.models.load_model('./nets/head.net') + neck = tf.keras.models.load_model('./nets/neck.net') + inception = tf.keras.models.load_model('./nets/inception.net') + render_head = tf.keras.models.load_model('./nets/render_head.net') + render_neck = tf.keras.models.load_model('./nets/render_neck.net') + + tail_op = tail(ip3) + features = reader(ip3 / 255.0) + print('Loaded some basic models.') + feed = [1 - ip1 / 255.0, (ip4[:, :, :, 0:3] / 127.5 - 1) * ip4[:, :, :, 3:4] / 255.0] + for _ in range(len(features)): + feed.append(tf.reduce_mean(features[_], axis=[1, 2])) + nil0, nil1, head_temp = head(feed) + feed[0] = tf.clip_by_value(1 - tf.image.resize_bilinear(ToGray(VGG2RGB(head_temp) / 255.0), tf.shape(ip1)[1:3]), + 0.0, 1.0) + nil4, nil5, head_temp = neck(feed) + head_op = VGG2RGB(head_temp) + features_render = inception((ip3 + (downsample(ip1) - blur(downsample(ip1))) * 2.0) / 255.0) + precessed_feed = [(ip4[:, :, :, 0:3] / 127.5 - 1) * ip4[:, :, :, 3:4] / 255.0] + [ + norm_feature(item, features_render[-1]) for item in features_render] + nil6, nil7, render_A = render_head([1 - ip1 / 255.0] + precessed_feed) + nil8, nil9, render_B = render_neck( + [1 - tf.image.resize_bilinear(ToGray(nts(render_A)), tf.shape(ip1)[1:3])] + precessed_feed) + render_op = nts(render_B) * 255.0 + print('Loaded - Style2Paints Deep Learning Engine V4.6 - GPU') + + session.run(tf.global_variables_initializer()) + + tail.load_weights('./nets/tail.net') + head.load_weights('./nets/head.net') + neck.load_weights('./nets/neck.net') + reader.load_weights('./nets/reader.net') + inception.load_weights('./nets/inception.net') + render_head.load_weights('./nets/render_head.net') + render_neck.load_weights('./nets/render_neck.net') + + print('Deep learning modules are ready.') + + return tail_op, head_op, render_op, refs_img + + +tail_op_g, head_op_g, render_op_g, refs_img_g = make_graph() + + +def go_tail(x): + def srange(l, s): + result = [] + iters = int(float(l) / float(s)) + for i in range(iters): + result.append([i * s, (i + 1) * s]) + result[len(result) - 1][1] = l + return result + + H, W, C = x.shape + padded_img = np.pad(x, ((20, 20), (20, 20), (0, 0)), 'symmetric').astype(np.float32) / 255.0 + lines = [] + for hs, he in srange(H, 64): + items = [] + for ws, we in srange(W, 64): + items.append(padded_img[hs:he + 40, ws:we + 40, :]) + lines.append(items) + iex = 0 + result_all_lines = [] + for line in lines: + result_one_line = [] + for item in line: + ots = session.run(tail_op_g, feed_dict={ip3: item[None, :, :, :]})[0] + result_one_line.append(ots[41:-41, 41:-41, :]) + print('Slicing ... ' + str(iex)) + iex += 1 + result_one_line = np.concatenate(result_one_line, axis=1) + result_all_lines.append(result_one_line) + result_all_lines = np.concatenate(result_all_lines, axis=0) + return (result_all_lines * 255.0).clip(0, 255).astype(np.uint8) + + +def go_head(sketch, global_hint, local_hint): + return session.run(head_op_g, feed_dict={ + ip1: sketch[None, :, :, None], ip3: global_hint[None, :, :, :], ip4: local_hint[None, :, :, :] + })[0].clip(0, 255).astype(np.uint8) + + +def go_render(sketch, segmentation, points): + return session.run(render_op_g, feed_dict={ + ip1: sketch[None, :, :, None], ip3: segmentation[None, :, :, :], ip4: points[None, :, :, :] + })[0].clip(0, 255).astype(np.uint8) + + +print('Deep learning functions are ready.') + + +def k_resize(x, k): + if x.shape[0] < x.shape[1]: + s0 = k + s1 = int(x.shape[1] * (k / x.shape[0])) + s1 = s1 - s1 % 64 + _s0 = 16 * s0 + _s1 = int(x.shape[1] * (_s0 / x.shape[0])) + _s1 = (_s1 + 32) - (_s1 + 32) % 64 + else: + s1 = k + s0 = int(x.shape[0] * (k / x.shape[1])) + s0 = s0 - s0 % 64 + _s1 = 16 * s1 + _s0 = int(x.shape[0] * (_s1 / x.shape[1])) + _s0 = (_s0 + 32) - (_s0 + 32) % 64 + new_min = min(_s1, _s0) + raw_min = min(x.shape[0], x.shape[1]) + if new_min < raw_min: + interpolation = cv2.INTER_AREA + else: + interpolation = cv2.INTER_LANCZOS4 + y = cv2.resize(x, (_s1, _s0), interpolation=interpolation) + return y + + +def d_resize(x, d, fac=1.0): + new_min = min(int(d[1] * fac), int(d[0] * fac)) + raw_min = min(x.shape[0], x.shape[1]) + if new_min < raw_min: + interpolation = cv2.INTER_AREA + else: + interpolation = cv2.INTER_LANCZOS4 + y = cv2.resize(x, (int(d[1] * fac), int(d[0] * fac)), interpolation=interpolation) + return y + + +def min_resize(x, m): + if x.shape[0] < x.shape[1]: + s0 = m + s1 = int(float(m) / float(x.shape[0]) * float(x.shape[1])) + else: + s0 = int(float(m) / float(x.shape[1]) * float(x.shape[0])) + s1 = m + new_max = min(s1, s0) + raw_max = min(x.shape[0], x.shape[1]) + if new_max < raw_max: + interpolation = cv2.INTER_AREA + else: + interpolation = cv2.INTER_LANCZOS4 + y = cv2.resize(x, (s1, s0), interpolation=interpolation) + return y + + +def cli_norm(sketch): + light = np.max(min_resize(sketch, 64), axis=(0, 1), keepdims=True) + intensity = (light - sketch.astype(np.float32)).clip(0, 255) + line_intensities = np.sort(intensity[intensity > 16])[::-1] + line_quantity = float(line_intensities.shape[0]) + intensity /= line_intensities[int(line_quantity * 0.1)] + intensity *= 0.9 + return (255.0 - intensity * 255.0).clip(0, 255).astype(np.uint8) + + +def cv2_imwrite(a, b): + print(a) + cv2.imwrite(a, b) + + +def from_png_to_jpg(map): + if map.shape[2] == 3: + return map + color = map[:, :, 0:3].astype(np.float) / 255.0 + alpha = map[:, :, 3:4].astype(np.float) / 255.0 + reversed_color = 1 - color + final_color = (255.0 - reversed_color * alpha * 255.0).clip(0, 255).astype(np.uint8) + return final_color + + +def s_enhance(x, k=2.0): + p = cv2.cvtColor(x, cv2.COLOR_RGB2HSV).astype(np.float) + p[:, :, 1] *= k + p = p.clip(0, 255).astype(np.uint8) + return cv2.cvtColor(p, cv2.COLOR_HSV2RGB).clip(0, 255) + + +def ini_hint(x): + r = np.zeros(shape=(x.shape[0], x.shape[1], 4), dtype=np.uint8) + return r + + +def opreate_normal_hint(gird, points, length): + h = gird.shape[0] + w = gird.shape[1] + for point in points: + x, y, r, g, b = point + x = int(x * w) + y = int(y * h) + l_ = max(0, x - length) + b_ = max(0, y - length) + r_ = min(w, x + length + 1) + t_ = min(h, y + length + 1) + gird[b_:t_, l_:r_, 2] = r + gird[b_:t_, l_:r_, 1] = g + gird[b_:t_, l_:r_, 0] = b + gird[b_:t_, l_:r_, 3] = 255.0 + return gird + + +def get_hdr(x): + def get_hdr_g(x): + img = x.astype(np.float32) + mean = np.mean(img) + h_mean = mean.copy() + l_mean = mean.copy() + for i in range(2): + h_mean = np.mean(img[img >= h_mean]) + l_mean = np.mean(img[img <= l_mean]) + for i in range(2): + l_mean = np.mean(img[img <= l_mean]) + return l_mean, mean, h_mean + + l_mean = np.zeros(shape=(1, 1, 3), dtype=np.float32) + mean = np.zeros(shape=(1, 1, 3), dtype=np.float32) + h_mean = np.zeros(shape=(1, 1, 3), dtype=np.float32) + for c in range(3): + l, m, h = get_hdr_g(x[:, :, c]) + l_mean[:, :, c] = l + mean[:, :, c] = m + h_mean[:, :, c] = h + return l_mean, mean, h_mean + + +def f2(x1, x2, x3, y1, y2, y3, x): + A = y1 * ((x - x2) * (x - x3)) / ((x1 - x2) * (x1 - x3)) + B = y2 * ((x - x1) * (x - x3)) / ((x2 - x1) * (x2 - x3)) + C = y3 * ((x - x1) * (x - x2)) / ((x3 - x1) * (x3 - x2)) + return A + B + C + + +print('Tricks loaded.') + + +def refine_image(image, sketch, origin): + verbose = False + + def cv_log(name, img): + if verbose: + print(name) + cv2.imshow('cv_log', img.clip(0, 255).astype(np.uint8)) + cv2.imwrite('cv_log.png', img.clip(0, 255).astype(np.uint8)) + cv2.waitKey(0) + + print('Building Sparse Matrix ...') + sketch = sketch.astype(np.float32) + sparse_matrix = build_sketch_sparse(sketch, True) + bright_matrix = build_sketch_sparse(sketch - cv2.GaussianBlur(sketch, (0, 0), 3.0), False) + guided_matrix = createGuidedFilter(sketch.clip(0, 255).astype(np.uint8), 1, 0.01) + HDRL, HDRM, HDRH = get_hdr(image) + + def go_guide(x): + y = x + (x - cv2.GaussianBlur(x, (0, 0), 1)) * 2.0 + for _ in tqdm(range(4)): + y = guided_matrix.filter(y) + return y + + def go_refine_sparse(x): + return session.run(tf_sparse_op_H, feed_dict={ipsp3: x, ipsp9: sparse_matrix}) + + def go_refine_bright(x): + return session.run(tf_sparse_op_L, feed_dict={ipsp3: x, ipsp9: bright_matrix}) + + def go_flat(x): + pia = 32 + y = x.clip(0, 255).astype(np.uint8) + y = cv2.resize(y, (x.shape[1] // 2, x.shape[0] // 2), interpolation=cv2.INTER_AREA) + y = np.pad(y, ((pia, pia), (pia, pia), (0, 0)), 'reflect') + y = l0Smooth(y, None, 0.01) + y = y[pia:-pia, pia:-pia, :] + y = cv2.resize(y, (x.shape[1], x.shape[0]), interpolation=cv2.INTER_CUBIC) + return y + + def go_hdr(x): + xl, xm, xh = get_hdr(x) + y = f2(xl, xm, xh, HDRL, HDRM, HDRH, x) + return y.clip(0, 255) + + def go_blend(BGR, X, m): + BGR = BGR.clip(0, 255).astype(np.uint8) + X = X.clip(0, 255).astype(np.uint8) + YUV = cv2.cvtColor(BGR, cv2.COLOR_BGR2YUV) + s_l = YUV[:, :, 0].astype(np.float32) + t_l = X.astype(np.float32) + r_l = (s_l * t_l / 255.0) if m else np.minimum(s_l, t_l) + YUV[:, :, 0] = r_l.clip(0, 255).astype(np.uint8) + return cv2.cvtColor(YUV, cv2.COLOR_YUV2BGR) + + print('Getting Target ...') + smoothed = d_resize(image, sketch.shape) + print('Global Optimization ...') + cv_log('smoothed', smoothed) + sparse_smoothed = go_refine_sparse(smoothed) + cv_log('smoothed', sparse_smoothed) + smoothed = go_guide(sparse_smoothed) + cv_log('smoothed', smoothed) + smoothed = go_hdr(smoothed) + cv_log('smoothed', smoothed) + print('Decomposition Optimization ...') + flat = sparse_smoothed.copy() + cv_log('flat', flat) + flat = go_refine_bright(flat) + cv_log('flat', flat) + flat = go_flat(flat) + cv_log('flat', flat) + flat = go_refine_sparse(flat) + cv_log('flat', flat) + flat = go_guide(flat) + cv_log('flat', flat) + flat = go_hdr(flat) + cv_log('flat', flat) + print('Blending Optimization ...') + cv_log('origin', origin) + blended_smoothed = go_blend(smoothed, origin, False) + cv_log('blended_smoothed', blended_smoothed) + blended_flat = go_blend(flat, origin, True) + cv_log('blended_flat', blended_flat) + print('Optimization finished.') + return smoothed, flat, blended_smoothed, blended_flat + + +print('Fundamental Methods loaded.') + + +def cv2_encode(image: np.ndarray): + if image is None: + return 'null' + _, data = cv2.imencode('.png', image) + return 'data:image/png;base64,' + base64.b64encode(data).decode('utf8') + + +def get_request_image(request, name): + img = request.get(name) + img = re.sub('^data:image/.+;base64,', '', img) + img = base64.b64decode(img) + img = np.fromstring(img, dtype=np.uint8) + img = cv2.imdecode(img, -1) + return img + + +def upload_sketch(json_str, history): + request = json.loads(json_str) + origin = from_png_to_jpg(get_request_image(request, 'sketch')) + ID = datetime.datetime.now().strftime('H%HM%MS%S') + print('New room ID: ' + ID) + sketch = min_resize(origin, 512) + sketch = np.min(sketch, axis=2) + sketch = cli_norm(sketch) + sketch = np.tile(sketch[:, :, None], [1, 1, 3]) + sketch = go_tail(sketch) + sketch = np.mean(sketch, axis=2) + if len(history) > 5: + history = history[-5:] + return ID + '_' + ID, [*history, {'ID': ID, 'origin': origin, 'sketch': sketch, 'results': {}}] + + +def request_result(json_str, history): + request = json.loads(json_str) + room = request.get("room") + ridx = next(i for i, his in enumerate(history) if his['ID'] == room) + room_path = './rooms/' + room + '/' + ID = datetime.datetime.now().strftime('H%HM%MS%S') + history[ridx]['results'][ID] = {} + points = request.get("points") + points = json.loads(points) + history[ridx]['results'][ID]['points'] = points + for _ in range(len(points)): + points[_][1] = 1 - points[_][1] + sketch = history[ridx]['sketch'] + origin = history[ridx]['origin'] + if origin.ndim == 3: + origin = cv2.cvtColor(origin, cv2.COLOR_BGR2GRAY) + origin = d_resize(origin, sketch.shape).astype(np.float32) + low_origin = cv2.GaussianBlur(origin, (0, 0), 3.0) + high_origin = origin - low_origin + low_origin = (low_origin / np.median(low_origin) * 255.0).clip(0, 255) + origin = (low_origin + high_origin).clip(0, 255).astype(np.uint8) + faceID = int(request.get("faceID")) - 65535 + print(faceID) + if faceID > -1: + print('Default reference.') + face = from_png_to_jpg(refs_img_g[faceID]) + else: + print('Load reference.') + face = from_png_to_jpg(get_request_image(request, 'face')) + face = s_enhance(face, 2.0) + print('request result room = ' + str(room) + ', ID = ' + str(ID)) + print('processing painting in ' + room_path) + sketch_1024 = k_resize(sketch, 64) + hints_1024 = opreate_normal_hint(ini_hint(sketch_1024), points, length=2) + careless = go_head(sketch_1024, k_resize(face, 14), hints_1024) + smoothed_careless, flat_careless, blended_smoothed_careless, blended_flat_careless = refine_image(careless, sketch, + origin) + history[ridx]['results'][ID]['smoothed_careless'] = smoothed_careless + history[ridx]['results'][ID]['flat_careless'] = flat_careless + history[ridx]['results'][ID]['blended_smoothed_careless'] = blended_smoothed_careless + history[ridx]['results'][ID]['blended_flat_careless'] = blended_flat_careless + print('Stage I finished.') + careful = go_render(sketch_1024, d_resize(flat_careless, sketch_1024.shape, 0.5), hints_1024) + smoothed_careful, flat_careful, blended_smoothed_careful, blended_flat_careful = refine_image(careful, sketch, + origin) + history[ridx]['results'][ID]['smoothed_careful'] = smoothed_careful + history[ridx]['results'][ID]['flat_careful'] = flat_careful + history[ridx]['results'][ID]['blended_smoothed_careful'] = blended_smoothed_careful + history[ridx]['results'][ID]['blended_flat_careful'] = blended_flat_careful + history[ridx]['results'][ID]['lighted'] = blended_flat_careful + print('Stage II finished.') + return room + '_' + ID, history + + +def download_result(json_str, history): + request = json.loads(json_str) + room = request.get("room") + step = request.get("step") + name = request.get("name") + ridx = next(i for i, his in enumerate(history) if his['ID'] == room) + if history[ridx].get(name, None) is None: + result = history[ridx]['results'][step][name] + else: + result = history[ridx][name] + + if name == 'points': + return json.dumps(result) + + return cv2_encode(result) + + +with gr.Blocks() as demo: + history = gr.State(value=[]) + with gr.Row(): + with gr.Column(): + btn_show = gr.Button("Open Style2Paints V4.6") + btn_show.click(None, _js="(_) => open('file/ui/web-mobile/index.html')") + + with gr.Row(): + with gr.Box(): + with gr.Row(): + upload_sketch_json = gr.Textbox(label="upload_sketch(json string)") + with gr.Row(): + upload_sketch_btn = gr.Button(label="Submit sketch json") + with gr.Row(): + upload_sketch_result = gr.Textbox(label="Result", interactive=False) + upload_sketch_btn.click(upload_sketch, [upload_sketch_json, history], [upload_sketch_result, history], api_name="upload_sketch") + + with gr.Box(): + with gr.Row(): + request_result_json = gr.Textbox(label="request_result(json string)") + with gr.Row(): + request_result_btn = gr.Button(label="Submit json of request for result") + with gr.Row(): + request_result_result = gr.Textbox(label="Result", interactive=False) + upload_sketch_btn.click(request_result, [request_result_json, history], [request_result_result, history], api_name="request_result") + + with gr.Box(): + with gr.Row(): + download_result_json = gr.Textbox(label="download_result(json string)") + with gr.Row(): + download_result_btn = gr.Button(label="Submit json of download for result") + with gr.Row(): + download_result_result = gr.Textbox(label="Result", interactive=False) + upload_sketch_btn.click(download_result, [download_result_json, history], [download_result_result], api_name="download_result") + +demo.launch() diff --git a/nets/gau.npy b/nets/gau.npy new file mode 100644 index 0000000000000000000000000000000000000000..c7012dc32ad689497b3b5573912d146f057eed67 --- /dev/null +++ b/nets/gau.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3297028c7d29078be7722bca9b68b119f852794741cfb4185b990e1c469ecbae +size 324 diff --git a/nets/head.net b/nets/head.net new file mode 100644 index 0000000000000000000000000000000000000000..34e936c902f621628ccedc5ebc24e0a05e57d6c9 --- /dev/null +++ b/nets/head.net @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fd5f608bf5511293cd582e6d87e55f483259b8d606feba7a5042382a19cde630 +size 411622416 diff --git a/nets/inception.net b/nets/inception.net new file mode 100644 index 0000000000000000000000000000000000000000..e9d44793639d142952e3bf72e8a00beb94917bc0 --- /dev/null +++ b/nets/inception.net @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9a503841e955ee56f2e0b71219952f0f554c9eaff9e887f82853f600f0ddee80 +size 41501888 diff --git a/nets/neck.net b/nets/neck.net new file mode 100644 index 0000000000000000000000000000000000000000..82dd524f956b4f6281b5ca167f0f0a4ca7337b9f --- /dev/null +++ b/nets/neck.net @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e91e4e688379dc95a14ea8f33fa1c2141584b0387e16be5efcc7acb5299ad5d7 +size 411623808 diff --git a/nets/reader.net b/nets/reader.net new file mode 100644 index 0000000000000000000000000000000000000000..07ace4f7b494ced0cd09848dd1bb29606bc28dd5 --- /dev/null +++ b/nets/reader.net @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5a65a53091acb96dbdcf325afb1b233ff374e220cb822fe8b1771dcd65f999df +size 41502832 diff --git a/nets/refs.net b/nets/refs.net new file mode 100644 index 0000000000000000000000000000000000000000..e2308575680953700b359f42a87539db0df0dfc7 --- /dev/null +++ b/nets/refs.net @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:92e95f226cb67abd309014b50eff810fef25e6cf3731aacea4efa3254c0a6adc +size 18324023 diff --git a/nets/render_head.net b/nets/render_head.net new file mode 100644 index 0000000000000000000000000000000000000000..3860840af4dd0e40b64bdbb7f751961cbfd3880e --- /dev/null +++ b/nets/render_head.net @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cacac78d2e19bd38b2efbdd8eb372594e333e5284e9f2c2b605652c8dd26ffad +size 411612752 diff --git a/nets/render_neck.net b/nets/render_neck.net new file mode 100644 index 0000000000000000000000000000000000000000..f12a758a6a1f3254cc0e8a32883d81e4fc94aa74 --- /dev/null +++ b/nets/render_neck.net @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:66050656839363d7977dd970cc2f6d7f81722a8cf5cd67a1793bae8214a07c0b +size 411613336 diff --git a/nets/tail.net b/nets/tail.net new file mode 100644 index 0000000000000000000000000000000000000000..8878ed2f6c920309946d80ceb532527d8109b968 --- /dev/null +++ b/nets/tail.net @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2255073ccdc311d8c61c074ffeb4ad7db200ca9116011e1cf213d6d4b1967e15 +size 4018208 diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..d5c669f07f50a6413c4a763f72f2ba03abd907a7 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,6 @@ +opencv-contrib-python>=4.1.0.25 +tensorflow>=2.12.0 +gradio>=3.20.1 +scikit-learn>=0.23.1 +scikit-image>=0.14.5 +tqdm \ No newline at end of file diff --git a/res/Texture/1.jpg b/res/Texture/1.jpg new file mode 100644 index 0000000000000000000000000000000000000000..ca35539fb5094718573497c3a6c0dff1e41f6d54 --- /dev/null +++ b/res/Texture/1.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0dce28125d936f3c5bbf8871b34aa6d038e01889bcc65cbbae49f9bb7a23f1a8 +size 4759 diff --git a/res/Texture/127.png b/res/Texture/127.png new file mode 100644 index 0000000000000000000000000000000000000000..d4954d5d16547dc8ad9d0a63d957a3218b54474d --- /dev/null +++ b/res/Texture/127.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2ee180cbe8710605abfb8a77dce2b77d9215263bfb77cb43fba9fe9c62e9c84e +size 362 diff --git a/res/Texture/ai.png b/res/Texture/ai.png new file mode 100644 index 0000000000000000000000000000000000000000..0492df44ed8f6cb1aad4054f940c3efa3b0aa728 --- /dev/null +++ b/res/Texture/ai.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6ff6df797e62b56fb1f5a21691d3b97708f09921455d446917997ac8d2be1ec5 +size 1840 diff --git a/res/Texture/b.png b/res/Texture/b.png new file mode 100644 index 0000000000000000000000000000000000000000..447e43c7a5bf235ec197a303f4f11943199a3027 --- /dev/null +++ b/res/Texture/b.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8c18e868a191f1a171643b8a4a5652072683f412d27d7880223876638918bd65 +size 144 diff --git a/res/Texture/big_logo.png b/res/Texture/big_logo.png new file mode 100644 index 0000000000000000000000000000000000000000..567519dc51568bb6bdda7f8a75ddd536aada3c76 --- /dev/null +++ b/res/Texture/big_logo.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:643664af8e1c0be0d6da4196e1a58c817fef726b5646e0755d5bda472fa98b17 +size 3184 diff --git a/res/Texture/board.png b/res/Texture/board.png new file mode 100644 index 0000000000000000000000000000000000000000..60c82119b838690020e6459eee639fb6df0ca14d --- /dev/null +++ b/res/Texture/board.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9483f602b24f67daf49b3007048554d9e9cbeff243c564c3f9cbfc9e43017a34 +size 257 diff --git a/res/Texture/brush.png b/res/Texture/brush.png new file mode 100644 index 0000000000000000000000000000000000000000..52e95b870c1f2555ae4445b7d6d24a9a9d069147 --- /dev/null +++ b/res/Texture/brush.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e1da02b8d48292760959714fabb6f59170c30aadadbe9d73356f55f02c8ee26d +size 1885 diff --git a/res/Texture/circle.png b/res/Texture/circle.png new file mode 100644 index 0000000000000000000000000000000000000000..c8006c4f2cdf996dfa7ee5fc0312310046900cbb --- /dev/null +++ b/res/Texture/circle.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d420b7999194572a9addd25831fdbf0f8eb86636e4d0e75c5526a073dbd9446a +size 16879 diff --git a/res/Texture/clear.png b/res/Texture/clear.png new file mode 100644 index 0000000000000000000000000000000000000000..0adbff0462c458c37e1dd5c698cd361db1fc7693 --- /dev/null +++ b/res/Texture/clear.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f61dfaa7179562f500c5a7bdfb70871f8048802669d03e82292426ca3859440c +size 15667 diff --git a/res/Texture/downloadh.png b/res/Texture/downloadh.png new file mode 100644 index 0000000000000000000000000000000000000000..51384d477f86e7c5f55ff53f561e6b58b3eb4339 --- /dev/null +++ b/res/Texture/downloadh.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c0bae1de2227f90604a757a740ca89a62de326e387b78448e1b24767ccecfcb2 +size 18076 diff --git a/res/Texture/drag.png b/res/Texture/drag.png new file mode 100644 index 0000000000000000000000000000000000000000..cb463e3e4428db9bac2d1e670d949565ce69c6f6 --- /dev/null +++ b/res/Texture/drag.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:62a5691a31c9b24b5ea7b53fb704a50f5927e9a8b5b087cf7688be34d37abd5c +size 18800 diff --git a/res/Texture/dropper.png b/res/Texture/dropper.png new file mode 100644 index 0000000000000000000000000000000000000000..117f61a67ffb43f70e799641c792e798f7321d96 --- /dev/null +++ b/res/Texture/dropper.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5c746fc669e3e33d74bafe6dbcf9c9e467717024362acf940138f7492020fdcd +size 18438 diff --git a/res/Texture/dustbin.png b/res/Texture/dustbin.png new file mode 100644 index 0000000000000000000000000000000000000000..fab7c6ec4ed1d355f653af04647b7f880f096dad --- /dev/null +++ b/res/Texture/dustbin.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:70e3291987314190480d0001f3d3dbeac5762f7714a3b71edfaac92046728aa5 +size 1517 diff --git a/res/Texture/eraser.png b/res/Texture/eraser.png new file mode 100644 index 0000000000000000000000000000000000000000..08797039a6d6418c8873673a2b41b7646c85d097 --- /dev/null +++ b/res/Texture/eraser.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2ae7b99f34e1e7514d8cb24031ab780d735fba9d64a591d4f67784c0e3f16e3e +size 16905 diff --git a/res/Texture/fil.png b/res/Texture/fil.png new file mode 100644 index 0000000000000000000000000000000000000000..11d035f687ad5e85d69087814b7e199d9c88d8e0 --- /dev/null +++ b/res/Texture/fil.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:70e2055e83026d941458a49dd5057dcf259beb633563f1f565365f2a8f985885 +size 461 diff --git a/res/Texture/filled-circle.png b/res/Texture/filled-circle.png new file mode 100644 index 0000000000000000000000000000000000000000..d6fc5d3e973f29f58156c4a1b25ace7fa28df8aa --- /dev/null +++ b/res/Texture/filled-circle.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eaa10af572bbd99b65362239b39e00ea1bb7106b9ddc8796fbf938af13a8c543 +size 1659 diff --git a/res/Texture/folder.png b/res/Texture/folder.png new file mode 100644 index 0000000000000000000000000000000000000000..4401de5fe4b98ebc256c3f3f13e899841b75a846 --- /dev/null +++ b/res/Texture/folder.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7902c8aa41f0f2d130cd01ad4bd439d507e401261e3eead2bc2fab5db27f6594 +size 1653 diff --git a/res/Texture/girl.png b/res/Texture/girl.png new file mode 100644 index 0000000000000000000000000000000000000000..af0e4aa8b7a76dd947e0c8c2f59fcd1459539301 --- /dev/null +++ b/res/Texture/girl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d7eeac2edbb5d9a07bccc422077df3cec2b81e50876a49adbc477685e51c89ec +size 519471 diff --git a/res/Texture/girl_raw.png b/res/Texture/girl_raw.png new file mode 100644 index 0000000000000000000000000000000000000000..7c78821e5844d144d83b2e66824cfabb7cd90d52 --- /dev/null +++ b/res/Texture/girl_raw.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:02fdc9b17b3648ec379c18c7f9824446fa16849740c0cd8cc93e65092a4d25ae +size 439288 diff --git a/res/Texture/github.png b/res/Texture/github.png new file mode 100644 index 0000000000000000000000000000000000000000..72037b75728aba0a7e536de34abfc902b4cb948c --- /dev/null +++ b/res/Texture/github.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:14fda50eaec92a4f2217e2480b4cf4dd0567c101b666fb4923b65479ea7a84c3 +size 2742 diff --git a/res/Texture/grids.png b/res/Texture/grids.png new file mode 100644 index 0000000000000000000000000000000000000000..c3f2851ef2bdec50876b2a0efb7e7da066b2013b --- /dev/null +++ b/res/Texture/grids.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:60a88e121f97a3c288ee40421909a9f433286a74979ecd5e2a17f188b8ffc1dd +size 15614 diff --git a/res/Texture/help.png b/res/Texture/help.png new file mode 100644 index 0000000000000000000000000000000000000000..5cb7cec8e735f9230d1f746d80820f8840de9d75 --- /dev/null +++ b/res/Texture/help.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e97d336706b1d6dbb3919414ad6cfb2927065793cd84ad3bf9903f097e722c09 +size 2734 diff --git a/res/Texture/hint.png b/res/Texture/hint.png new file mode 100644 index 0000000000000000000000000000000000000000..48f9c37bfc88406cad60113cbef2af3e2b649d05 --- /dev/null +++ b/res/Texture/hint.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6d09493aa0b1741dc99aef199d2b04118d5bd04493db85d18459ff348642921c +size 91 diff --git a/res/Texture/left-arrow.png b/res/Texture/left-arrow.png new file mode 100644 index 0000000000000000000000000000000000000000..562f1459c6c740bc5bd27238e7364008039cd7e5 --- /dev/null +++ b/res/Texture/left-arrow.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ae9d815a6608d7605de93a06a8edfdc0ef812da1c454e19d603f6f9316d26abe +size 15947 diff --git a/res/Texture/left.png b/res/Texture/left.png new file mode 100644 index 0000000000000000000000000000000000000000..0c8070f8a419d53af1451bc05d58e8733c292381 --- /dev/null +++ b/res/Texture/left.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6973ae3b9ec05be4cca2a06a70e8cd00671c3d04373b59b2aa3fdc2cfeb3c567 +size 16571 diff --git a/res/Texture/loading.png b/res/Texture/loading.png new file mode 100644 index 0000000000000000000000000000000000000000..f136ab7b32a09fad3eae1ebbf0837fb0f006bd32 --- /dev/null +++ b/res/Texture/loading.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bf9e87e667193562b8775578664ef49ace0256f9599d2cef948c24bc3d729fbe +size 2552 diff --git a/res/Texture/magic.png b/res/Texture/magic.png new file mode 100644 index 0000000000000000000000000000000000000000..2a09b6bfc6d7af2bcc5d073cad0447c15694787d --- /dev/null +++ b/res/Texture/magic.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cfa80908453f821a3fcec9bdd7cbb4badbcb9acb3df476d1965341eb7b696d39 +size 2766 diff --git a/res/Texture/pallete.png b/res/Texture/pallete.png new file mode 100644 index 0000000000000000000000000000000000000000..69f5912bc45e3b6f5e4135cb06c6b577582d24d5 --- /dev/null +++ b/res/Texture/pallete.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:84ccf449e5b5aef9260144b4131d0489cd51841c1f2c4a73236809ad25399d4d +size 20462 diff --git a/res/Texture/pencil.png b/res/Texture/pencil.png new file mode 100644 index 0000000000000000000000000000000000000000..8ac5f139bfd44a7f1bca97457afeb0ea21420c8c --- /dev/null +++ b/res/Texture/pencil.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:df09b6093d56b95ff0b8245192f142deccb2cd4717acc09af0d70a5939b6ff35 +size 2347 diff --git a/res/Texture/ref.png b/res/Texture/ref.png new file mode 100644 index 0000000000000000000000000000000000000000..a58dba7b5f6f86e42db37656dc47133591b856b4 --- /dev/null +++ b/res/Texture/ref.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:49bcc48c0b47f6f49430ed90afa57aecda6ff4515814869896b8b739ff74a32d +size 19153 diff --git a/res/Texture/refresh.png b/res/Texture/refresh.png new file mode 100644 index 0000000000000000000000000000000000000000..ba48d8c09631027964ec3758f7ef54f83e5f462a --- /dev/null +++ b/res/Texture/refresh.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2bcb26526357b1bf760d5be92fc570baa7b82bb8f9bc7633ce48c1f71a24e3ac +size 22276 diff --git a/res/Texture/result.png b/res/Texture/result.png new file mode 100644 index 0000000000000000000000000000000000000000..48f9c37bfc88406cad60113cbef2af3e2b649d05 --- /dev/null +++ b/res/Texture/result.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6d09493aa0b1741dc99aef199d2b04118d5bd04493db85d18459ff348642921c +size 91 diff --git a/res/Texture/right-arrow.png b/res/Texture/right-arrow.png new file mode 100644 index 0000000000000000000000000000000000000000..7373042f1fe95666b33b8836881d79320de52d5c --- /dev/null +++ b/res/Texture/right-arrow.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a3a552a0383739350721328aba81e314f12a6b6abfa148908063281171bfb8ef +size 2065 diff --git a/res/Texture/right.png b/res/Texture/right.png new file mode 100644 index 0000000000000000000000000000000000000000..6364f25be7048a1784bcda3011b3997e1278e053 --- /dev/null +++ b/res/Texture/right.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e682e50174428be69453ab5533cc04ad2b41e0fc3c166bab1de97964e40f7ada +size 16493 diff --git a/res/Texture/ring.png b/res/Texture/ring.png new file mode 100644 index 0000000000000000000000000000000000000000..d836b311def9d84a1322b957da0027c8a7069db2 --- /dev/null +++ b/res/Texture/ring.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:789a4a9f372e48f03631a45ceca726ea6046ffa80061fc960ede359dc9e31a11 +size 38022 diff --git a/res/Texture/s.png b/res/Texture/s.png new file mode 100644 index 0000000000000000000000000000000000000000..bc0d9984cb392aebbf32c194e26a0e48ff8eb27a --- /dev/null +++ b/res/Texture/s.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:00dc07a6cb2711bb24851068239c9d8cd01f51e90fc097660699a00e65b303da +size 544537 diff --git a/res/Texture/sketch.png b/res/Texture/sketch.png new file mode 100644 index 0000000000000000000000000000000000000000..48f9c37bfc88406cad60113cbef2af3e2b649d05 --- /dev/null +++ b/res/Texture/sketch.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6d09493aa0b1741dc99aef199d2b04118d5bd04493db85d18459ff348642921c +size 91 diff --git a/res/Texture/skilled.png b/res/Texture/skilled.png new file mode 100644 index 0000000000000000000000000000000000000000..ddae05a17583b3911980b34c751153af3f884ed1 --- /dev/null +++ b/res/Texture/skilled.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b33c9d493fd188c20864c96d8e88af3161e95620c1c5078aa9da32454173840d +size 17789 diff --git a/res/Texture/skills.png b/res/Texture/skills.png new file mode 100644 index 0000000000000000000000000000000000000000..76552f5f6c64cef7dd6fde96580a66788c2c8486 --- /dev/null +++ b/res/Texture/skills.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0c870d811be5e2d6e42398dc63b357f924a9065083f97cc6f5e112ae5623144e +size 21267 diff --git a/res/Texture/sun.png b/res/Texture/sun.png new file mode 100644 index 0000000000000000000000000000000000000000..0a8e88d3a4584b2c3b23e1e0c39881177be54635 --- /dev/null +++ b/res/Texture/sun.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:74ae870f63288c1ced1bc01b7caaee18ef7695b9d69f1835a091b9362de3543c +size 17492 diff --git a/res/Texture/twitte.png b/res/Texture/twitte.png new file mode 100644 index 0000000000000000000000000000000000000000..6297c7bc68a928b6824877f95b6d2136f98f6f91 --- /dev/null +++ b/res/Texture/twitte.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1305d75fd82ebcdbd2e4951be193be90e0e7a66e166a874ae1d9aa1bf23a8f1c +size 2780 diff --git a/res/Texture/upload_img.png b/res/Texture/upload_img.png new file mode 100644 index 0000000000000000000000000000000000000000..5bae1ef06db9d7d5418cfb603d8bebfef74060a4 --- /dev/null +++ b/res/Texture/upload_img.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7622665575aa1afc353fd7eb86a8d09cba4956a9cf1d3e63d951641972e853db +size 1595 diff --git a/res/Texture/uploadh.png b/res/Texture/uploadh.png new file mode 100644 index 0000000000000000000000000000000000000000..e89efa261201d7ae9eb3b51838733c149828bfea --- /dev/null +++ b/res/Texture/uploadh.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6e74aa0193a4ca9ca6df095d338d9a9c97766bd45810240ac800c3ffc007a327 +size 17997 diff --git a/res/Texture/w.png b/res/Texture/w.png new file mode 100644 index 0000000000000000000000000000000000000000..36ca6d84b7ac190302c8f542cea3765108cac4f2 --- /dev/null +++ b/res/Texture/w.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f0af41df383af16cbefa29139fcb5ca8ef51165dfb61a1d48ee3e18914c3aff4 +size 131 diff --git a/res/face_128/1.jpg b/res/face_128/1.jpg new file mode 100644 index 0000000000000000000000000000000000000000..516081ef2c1dec15faf43fdaf81c6e564553fba7 --- /dev/null +++ b/res/face_128/1.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bab493a97f980c3feeed72ae9fd422daa167989c232bf953eb9ca76a75fdac74 +size 2080 diff --git a/res/face_128/10.jpg b/res/face_128/10.jpg new file mode 100644 index 0000000000000000000000000000000000000000..1c7e3c6bdfa436f772ca324d610819d922c221f9 --- /dev/null +++ b/res/face_128/10.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cd0f49f749f8a6a4643716527cc471d6b82fdb003a2ce8d84c0358f4f8bf263f +size 2130 diff --git a/res/face_128/11.jpg b/res/face_128/11.jpg new file mode 100644 index 0000000000000000000000000000000000000000..06cb5ef4a8f1ac447644f2d1d4f4633a144f340a --- /dev/null +++ b/res/face_128/11.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:872bccaf5406271d39fa176ea9df7613af264616e64db5826d756b73a8ee32d7 +size 2114 diff --git a/res/face_128/12.jpg b/res/face_128/12.jpg new file mode 100644 index 0000000000000000000000000000000000000000..2176e92549564e0c5c1362e1a511862739d55b84 --- /dev/null +++ b/res/face_128/12.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:151c31043ea88922b344026229d59643035c333f90d9455698b38415b1c10c98 +size 2141 diff --git a/res/face_128/13.jpg b/res/face_128/13.jpg new file mode 100644 index 0000000000000000000000000000000000000000..41bacc5438931a2474db83e6f13d98bcaae3a251 --- /dev/null +++ b/res/face_128/13.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:23d94218b76f5b0dbea49340b5391650ad906a23adc4aca11403dd02ece8d22b +size 2118 diff --git a/res/face_128/14.jpg b/res/face_128/14.jpg new file mode 100644 index 0000000000000000000000000000000000000000..4db839809080225ef65c560cd5df8f14166c2c57 --- /dev/null +++ b/res/face_128/14.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2a53f19515ce17df4d78d4736b711517f39ea61998e6ba96348344603e1a29e8 +size 2045 diff --git a/res/face_128/15.jpg b/res/face_128/15.jpg new file mode 100644 index 0000000000000000000000000000000000000000..95b8080c4b22b23531d41dceb7b3570ffa648553 --- /dev/null +++ b/res/face_128/15.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:572a354aba186e053ab1acae38cee4a97b97afef6bc0ef312526daf5ef662e85 +size 2120 diff --git a/res/face_128/16.jpg b/res/face_128/16.jpg new file mode 100644 index 0000000000000000000000000000000000000000..cb6dceecbe51be2b3799164a40085c713c57c3db --- /dev/null +++ b/res/face_128/16.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ee2ad8627529bdecac5389e735e54370504cb27d12c985d60cbe692405f9cbf7 +size 2181 diff --git a/res/face_128/17.jpg b/res/face_128/17.jpg new file mode 100644 index 0000000000000000000000000000000000000000..f7cdd67f36e8f02c958b3d31ac4cf4c2dd4aba61 --- /dev/null +++ b/res/face_128/17.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f76c73f92db511d6fdce9f581d67a6b3852662f1b3ab27c816ff8b39fe11385f +size 1954 diff --git a/res/face_128/18.jpg b/res/face_128/18.jpg new file mode 100644 index 0000000000000000000000000000000000000000..ab2526ef62ec770ecce3bf1cd502733ff3c8fd77 --- /dev/null +++ b/res/face_128/18.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:da9cf87b3cee5655b08a91e05487b32b0287f18e5c2629c3895eb463c785a7a9 +size 2106 diff --git a/res/face_128/19.jpg b/res/face_128/19.jpg new file mode 100644 index 0000000000000000000000000000000000000000..4a16d1c99faba62deb71252d541d302bd1fdbdf5 --- /dev/null +++ b/res/face_128/19.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:079602fe293e81ad5f6b0cd27944e2a25c535fc25b5d516ff2e4fc76161c91e0 +size 2167 diff --git a/res/face_128/2.jpg b/res/face_128/2.jpg new file mode 100644 index 0000000000000000000000000000000000000000..fb1e01305ce87e744caab52fff42767a7653f3f2 --- /dev/null +++ b/res/face_128/2.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8c3d08555ffe92ec332768dc299e422bf5b3f1e9167e0eebf3b1ffbb938409a0 +size 2118 diff --git a/res/face_128/20.jpg b/res/face_128/20.jpg new file mode 100644 index 0000000000000000000000000000000000000000..3c40b6afefc351030a1d89a933eccb4216dd48e0 --- /dev/null +++ b/res/face_128/20.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:56e91e7f8fba803f345de5dd2186df1cbe45973de1ea9dffdbd616d8e51fb3c8 +size 2047 diff --git a/res/face_128/21.jpg b/res/face_128/21.jpg new file mode 100644 index 0000000000000000000000000000000000000000..ab805723b02330b40b0e389012f80c23d7d0abc6 --- /dev/null +++ b/res/face_128/21.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:679f624b8699e01d919b92196e2f7b403012fe76a584c3ef9e351f870ff91a1a +size 2142 diff --git a/res/face_128/22.jpg b/res/face_128/22.jpg new file mode 100644 index 0000000000000000000000000000000000000000..b4f2fe67185073c90a3cd4fa64f169c2f7d462c2 --- /dev/null +++ b/res/face_128/22.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8d1f943fc0356b05455106b26370fbea4c7edcdbc0c24b09d70326a52f3645a3 +size 2065 diff --git a/res/face_128/23.jpg b/res/face_128/23.jpg new file mode 100644 index 0000000000000000000000000000000000000000..299ae7f702775d1d35f3e48337a3c00354f40942 --- /dev/null +++ b/res/face_128/23.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3a0cfb5e6af85f33289029eef767f23848eca029dc4a07d23c2799812a93a344 +size 2153 diff --git a/res/face_128/24.jpg b/res/face_128/24.jpg new file mode 100644 index 0000000000000000000000000000000000000000..2b9b6b07a93fc2652a3bda4fa7d98f536b71b39b --- /dev/null +++ b/res/face_128/24.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4a413643d880b4d668ccc5a9944efc4fa999bf6830edcb59fdcc7d5162db519c +size 2181 diff --git a/res/face_128/25.jpg b/res/face_128/25.jpg new file mode 100644 index 0000000000000000000000000000000000000000..12da2599d529188b8dcd62aa2624cfc9fa865cfe --- /dev/null +++ b/res/face_128/25.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c85a85794aa3b820e627ca5b022f0b8242662861af78e03b4caee4f7a4b7e192 +size 2182 diff --git a/res/face_128/26.jpg b/res/face_128/26.jpg new file mode 100644 index 0000000000000000000000000000000000000000..cf03944fec101ea9d6747c7350eb60bad7c0dc2f --- /dev/null +++ b/res/face_128/26.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:87c65df4e95d6bea6d34944af735bd6e6efef4c10b75b008a588662422d7d3d2 +size 2059 diff --git a/res/face_128/27.jpg b/res/face_128/27.jpg new file mode 100644 index 0000000000000000000000000000000000000000..9402b8e259864be4d0fc28df5f2d6f7566ca1ab1 --- /dev/null +++ b/res/face_128/27.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6afaa56ccd2560ad5a346aa46ca968812df4a62fdc04c0d45c48151628300d69 +size 2140 diff --git a/res/face_128/28.jpg b/res/face_128/28.jpg new file mode 100644 index 0000000000000000000000000000000000000000..7b3ce4fb5a5dda972d8f87b11f20cc09c7915a62 --- /dev/null +++ b/res/face_128/28.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3c8ba91489e199cdccfd82e7a48ed892c07497c8441605ad0a0589954098eaa9 +size 2160 diff --git a/res/face_128/29.jpg b/res/face_128/29.jpg new file mode 100644 index 0000000000000000000000000000000000000000..08ed0b0e07d9fc6e912e362200ecba786771ae64 --- /dev/null +++ b/res/face_128/29.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1b6f8bdf9dd87c824177d5eee1bea1d76fdc1b8a8cc2ba051b32e7c6a385ed24 +size 2102 diff --git a/res/face_128/3.jpg b/res/face_128/3.jpg new file mode 100644 index 0000000000000000000000000000000000000000..6149b5236848589d55311521a93b5b717f6c7a2b --- /dev/null +++ b/res/face_128/3.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fa69eaec3dd3594eb21102cb6a5727c4165d2fe29ea8e92e9b2e76136a7bbc10 +size 2116 diff --git a/res/face_128/30.jpg b/res/face_128/30.jpg new file mode 100644 index 0000000000000000000000000000000000000000..ae36276f1173b9ab0a739b1c1a5e3a1bf5f6c4c0 --- /dev/null +++ b/res/face_128/30.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3e025642f416eef7cdacd45974a0888ad57e53d99321f73d3d03e3510ba094b2 +size 2199 diff --git a/res/face_128/31.jpg b/res/face_128/31.jpg new file mode 100644 index 0000000000000000000000000000000000000000..78fe05f0a95047ca112be0bf35a851522397ef88 --- /dev/null +++ b/res/face_128/31.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9727b79dc27967f9dd4d471b4066b6da777772daeab0859d5047a25d3ec941f5 +size 2111 diff --git a/res/face_128/32.jpg b/res/face_128/32.jpg new file mode 100644 index 0000000000000000000000000000000000000000..b7e363876ff7965565763b5da2b043282aa2489b --- /dev/null +++ b/res/face_128/32.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:db45e2bc91a2982fd7fb71852d3087d7cb2b826b548341324fc3b5b88b030d33 +size 2186 diff --git a/res/face_128/4.jpg b/res/face_128/4.jpg new file mode 100644 index 0000000000000000000000000000000000000000..9cae4343534b06542a6c922eec6479e3ee011488 --- /dev/null +++ b/res/face_128/4.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1f8fa82d8febfc0277b3501f69adb5b5e763fe89b1849727bf86662f49c6db7b +size 2138 diff --git a/res/face_128/5.jpg b/res/face_128/5.jpg new file mode 100644 index 0000000000000000000000000000000000000000..142f2991bb715fba9f4ca086c1823348875b93b5 --- /dev/null +++ b/res/face_128/5.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3f716fa03c757a76813d6a02b971c8b59408a0f5354a046900287e0ede8f54e6 +size 2146 diff --git a/res/face_128/6.jpg b/res/face_128/6.jpg new file mode 100644 index 0000000000000000000000000000000000000000..637a64015b1432a8f050a3acef76d1d9858bc681 --- /dev/null +++ b/res/face_128/6.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1322e5bc1c28d43d3db461e3328a872fe621ace88e0b6c5e2d03f87c1cd14547 +size 2104 diff --git a/res/face_128/7.jpg b/res/face_128/7.jpg new file mode 100644 index 0000000000000000000000000000000000000000..e0f1c84fc2ae1ad147e9232afe456a1792e3d2f0 --- /dev/null +++ b/res/face_128/7.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ad6da237e9dac42bd7d0904e8e110429be092e3de94934ef2ab77f038f34249e +size 2066 diff --git a/res/face_128/8.jpg b/res/face_128/8.jpg new file mode 100644 index 0000000000000000000000000000000000000000..d7db3c4c9009b60bc941453b0b9a96e5caec6a05 --- /dev/null +++ b/res/face_128/8.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:53d7c04e0ff18bc6e83a1221fff73547fd1e463f5d576f6e9b6fee09f091793e +size 2156 diff --git a/res/face_128/9.jpg b/res/face_128/9.jpg new file mode 100644 index 0000000000000000000000000000000000000000..64e852d103151afd84751d20c6250f3d2abcc42a --- /dev/null +++ b/res/face_128/9.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:17b04167fd2afeae61d5d3786eac2cf65a8351c142a805a2d90508e00139f686 +size 2195 diff --git a/res/face_512/1.jpg b/res/face_512/1.jpg new file mode 100644 index 0000000000000000000000000000000000000000..516081ef2c1dec15faf43fdaf81c6e564553fba7 --- /dev/null +++ b/res/face_512/1.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bab493a97f980c3feeed72ae9fd422daa167989c232bf953eb9ca76a75fdac74 +size 2080 diff --git a/res/face_512/10.jpg b/res/face_512/10.jpg new file mode 100644 index 0000000000000000000000000000000000000000..1c7e3c6bdfa436f772ca324d610819d922c221f9 --- /dev/null +++ b/res/face_512/10.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cd0f49f749f8a6a4643716527cc471d6b82fdb003a2ce8d84c0358f4f8bf263f +size 2130 diff --git a/res/face_512/11.jpg b/res/face_512/11.jpg new file mode 100644 index 0000000000000000000000000000000000000000..06cb5ef4a8f1ac447644f2d1d4f4633a144f340a --- /dev/null +++ b/res/face_512/11.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:872bccaf5406271d39fa176ea9df7613af264616e64db5826d756b73a8ee32d7 +size 2114 diff --git a/res/face_512/12.jpg b/res/face_512/12.jpg new file mode 100644 index 0000000000000000000000000000000000000000..2176e92549564e0c5c1362e1a511862739d55b84 --- /dev/null +++ b/res/face_512/12.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:151c31043ea88922b344026229d59643035c333f90d9455698b38415b1c10c98 +size 2141 diff --git a/res/face_512/13.jpg b/res/face_512/13.jpg new file mode 100644 index 0000000000000000000000000000000000000000..41bacc5438931a2474db83e6f13d98bcaae3a251 --- /dev/null +++ b/res/face_512/13.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:23d94218b76f5b0dbea49340b5391650ad906a23adc4aca11403dd02ece8d22b +size 2118 diff --git a/res/face_512/14.jpg b/res/face_512/14.jpg new file mode 100644 index 0000000000000000000000000000000000000000..4db839809080225ef65c560cd5df8f14166c2c57 --- /dev/null +++ b/res/face_512/14.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2a53f19515ce17df4d78d4736b711517f39ea61998e6ba96348344603e1a29e8 +size 2045 diff --git a/res/face_512/15.jpg b/res/face_512/15.jpg new file mode 100644 index 0000000000000000000000000000000000000000..95b8080c4b22b23531d41dceb7b3570ffa648553 --- /dev/null +++ b/res/face_512/15.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:572a354aba186e053ab1acae38cee4a97b97afef6bc0ef312526daf5ef662e85 +size 2120 diff --git a/res/face_512/16.jpg b/res/face_512/16.jpg new file mode 100644 index 0000000000000000000000000000000000000000..cb6dceecbe51be2b3799164a40085c713c57c3db --- /dev/null +++ b/res/face_512/16.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ee2ad8627529bdecac5389e735e54370504cb27d12c985d60cbe692405f9cbf7 +size 2181 diff --git a/res/face_512/17.jpg b/res/face_512/17.jpg new file mode 100644 index 0000000000000000000000000000000000000000..f7cdd67f36e8f02c958b3d31ac4cf4c2dd4aba61 --- /dev/null +++ b/res/face_512/17.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f76c73f92db511d6fdce9f581d67a6b3852662f1b3ab27c816ff8b39fe11385f +size 1954 diff --git a/res/face_512/18.jpg b/res/face_512/18.jpg new file mode 100644 index 0000000000000000000000000000000000000000..ab2526ef62ec770ecce3bf1cd502733ff3c8fd77 --- /dev/null +++ b/res/face_512/18.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:da9cf87b3cee5655b08a91e05487b32b0287f18e5c2629c3895eb463c785a7a9 +size 2106 diff --git a/res/face_512/19.jpg b/res/face_512/19.jpg new file mode 100644 index 0000000000000000000000000000000000000000..4a16d1c99faba62deb71252d541d302bd1fdbdf5 --- /dev/null +++ b/res/face_512/19.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:079602fe293e81ad5f6b0cd27944e2a25c535fc25b5d516ff2e4fc76161c91e0 +size 2167 diff --git a/res/face_512/2.jpg b/res/face_512/2.jpg new file mode 100644 index 0000000000000000000000000000000000000000..fb1e01305ce87e744caab52fff42767a7653f3f2 --- /dev/null +++ b/res/face_512/2.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8c3d08555ffe92ec332768dc299e422bf5b3f1e9167e0eebf3b1ffbb938409a0 +size 2118 diff --git a/res/face_512/20.jpg b/res/face_512/20.jpg new file mode 100644 index 0000000000000000000000000000000000000000..3c40b6afefc351030a1d89a933eccb4216dd48e0 --- /dev/null +++ b/res/face_512/20.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:56e91e7f8fba803f345de5dd2186df1cbe45973de1ea9dffdbd616d8e51fb3c8 +size 2047 diff --git a/res/face_512/21.jpg b/res/face_512/21.jpg new file mode 100644 index 0000000000000000000000000000000000000000..ab805723b02330b40b0e389012f80c23d7d0abc6 --- /dev/null +++ b/res/face_512/21.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:679f624b8699e01d919b92196e2f7b403012fe76a584c3ef9e351f870ff91a1a +size 2142 diff --git a/res/face_512/22.jpg b/res/face_512/22.jpg new file mode 100644 index 0000000000000000000000000000000000000000..b4f2fe67185073c90a3cd4fa64f169c2f7d462c2 --- /dev/null +++ b/res/face_512/22.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8d1f943fc0356b05455106b26370fbea4c7edcdbc0c24b09d70326a52f3645a3 +size 2065 diff --git a/res/face_512/23.jpg b/res/face_512/23.jpg new file mode 100644 index 0000000000000000000000000000000000000000..299ae7f702775d1d35f3e48337a3c00354f40942 --- /dev/null +++ b/res/face_512/23.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3a0cfb5e6af85f33289029eef767f23848eca029dc4a07d23c2799812a93a344 +size 2153 diff --git a/res/face_512/24.jpg b/res/face_512/24.jpg new file mode 100644 index 0000000000000000000000000000000000000000..2b9b6b07a93fc2652a3bda4fa7d98f536b71b39b --- /dev/null +++ b/res/face_512/24.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4a413643d880b4d668ccc5a9944efc4fa999bf6830edcb59fdcc7d5162db519c +size 2181 diff --git a/res/face_512/25.jpg b/res/face_512/25.jpg new file mode 100644 index 0000000000000000000000000000000000000000..12da2599d529188b8dcd62aa2624cfc9fa865cfe --- /dev/null +++ b/res/face_512/25.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c85a85794aa3b820e627ca5b022f0b8242662861af78e03b4caee4f7a4b7e192 +size 2182 diff --git a/res/face_512/26.jpg b/res/face_512/26.jpg new file mode 100644 index 0000000000000000000000000000000000000000..cf03944fec101ea9d6747c7350eb60bad7c0dc2f --- /dev/null +++ b/res/face_512/26.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:87c65df4e95d6bea6d34944af735bd6e6efef4c10b75b008a588662422d7d3d2 +size 2059 diff --git a/res/face_512/27.jpg b/res/face_512/27.jpg new file mode 100644 index 0000000000000000000000000000000000000000..9402b8e259864be4d0fc28df5f2d6f7566ca1ab1 --- /dev/null +++ b/res/face_512/27.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6afaa56ccd2560ad5a346aa46ca968812df4a62fdc04c0d45c48151628300d69 +size 2140 diff --git a/res/face_512/28.jpg b/res/face_512/28.jpg new file mode 100644 index 0000000000000000000000000000000000000000..7b3ce4fb5a5dda972d8f87b11f20cc09c7915a62 --- /dev/null +++ b/res/face_512/28.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3c8ba91489e199cdccfd82e7a48ed892c07497c8441605ad0a0589954098eaa9 +size 2160 diff --git a/res/face_512/29.jpg b/res/face_512/29.jpg new file mode 100644 index 0000000000000000000000000000000000000000..08ed0b0e07d9fc6e912e362200ecba786771ae64 --- /dev/null +++ b/res/face_512/29.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1b6f8bdf9dd87c824177d5eee1bea1d76fdc1b8a8cc2ba051b32e7c6a385ed24 +size 2102 diff --git a/res/face_512/3.jpg b/res/face_512/3.jpg new file mode 100644 index 0000000000000000000000000000000000000000..6149b5236848589d55311521a93b5b717f6c7a2b --- /dev/null +++ b/res/face_512/3.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fa69eaec3dd3594eb21102cb6a5727c4165d2fe29ea8e92e9b2e76136a7bbc10 +size 2116 diff --git a/res/face_512/30.jpg b/res/face_512/30.jpg new file mode 100644 index 0000000000000000000000000000000000000000..ae36276f1173b9ab0a739b1c1a5e3a1bf5f6c4c0 --- /dev/null +++ b/res/face_512/30.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3e025642f416eef7cdacd45974a0888ad57e53d99321f73d3d03e3510ba094b2 +size 2199 diff --git a/res/face_512/31.jpg b/res/face_512/31.jpg new file mode 100644 index 0000000000000000000000000000000000000000..78fe05f0a95047ca112be0bf35a851522397ef88 --- /dev/null +++ b/res/face_512/31.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9727b79dc27967f9dd4d471b4066b6da777772daeab0859d5047a25d3ec941f5 +size 2111 diff --git a/res/face_512/32.jpg b/res/face_512/32.jpg new file mode 100644 index 0000000000000000000000000000000000000000..b7e363876ff7965565763b5da2b043282aa2489b --- /dev/null +++ b/res/face_512/32.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:db45e2bc91a2982fd7fb71852d3087d7cb2b826b548341324fc3b5b88b030d33 +size 2186 diff --git a/res/face_512/4.jpg b/res/face_512/4.jpg new file mode 100644 index 0000000000000000000000000000000000000000..9cae4343534b06542a6c922eec6479e3ee011488 --- /dev/null +++ b/res/face_512/4.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1f8fa82d8febfc0277b3501f69adb5b5e763fe89b1849727bf86662f49c6db7b +size 2138 diff --git a/res/face_512/5.jpg b/res/face_512/5.jpg new file mode 100644 index 0000000000000000000000000000000000000000..142f2991bb715fba9f4ca086c1823348875b93b5 --- /dev/null +++ b/res/face_512/5.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3f716fa03c757a76813d6a02b971c8b59408a0f5354a046900287e0ede8f54e6 +size 2146 diff --git a/res/face_512/6.jpg b/res/face_512/6.jpg new file mode 100644 index 0000000000000000000000000000000000000000..637a64015b1432a8f050a3acef76d1d9858bc681 --- /dev/null +++ b/res/face_512/6.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1322e5bc1c28d43d3db461e3328a872fe621ace88e0b6c5e2d03f87c1cd14547 +size 2104 diff --git a/res/face_512/7.jpg b/res/face_512/7.jpg new file mode 100644 index 0000000000000000000000000000000000000000..e0f1c84fc2ae1ad147e9232afe456a1792e3d2f0 --- /dev/null +++ b/res/face_512/7.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ad6da237e9dac42bd7d0904e8e110429be092e3de94934ef2ab77f038f34249e +size 2066 diff --git a/res/face_512/8.jpg b/res/face_512/8.jpg new file mode 100644 index 0000000000000000000000000000000000000000..d7db3c4c9009b60bc941453b0b9a96e5caec6a05 --- /dev/null +++ b/res/face_512/8.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:53d7c04e0ff18bc6e83a1221fff73547fd1e463f5d576f6e9b6fee09f091793e +size 2156 diff --git a/res/face_512/9.jpg b/res/face_512/9.jpg new file mode 100644 index 0000000000000000000000000000000000000000..64e852d103151afd84751d20c6250f3d2abcc42a --- /dev/null +++ b/res/face_512/9.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:17b04167fd2afeae61d5d3786eac2cf65a8351c142a805a2d90508e00139f686 +size 2195 diff --git a/res/splash.png b/res/splash.png new file mode 100644 index 0000000000000000000000000000000000000000..23a29c05898d67d8e7674441fbdde4e7bff29ab0 --- /dev/null +++ b/res/splash.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bb2082423b6865fff370fd8fee39c4e0ec9ca32faab8b241b80473eb560facdc +size 9435 diff --git a/ui/.gitkeep b/ui/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/ui/web-mobile/cocos2d-js-min.335ee.js b/ui/web-mobile/cocos2d-js-min.335ee.js new file mode 100644 index 0000000000000000000000000000000000000000..2642d246297e337579dcf7d01cfc0394a3b80ae9 --- /dev/null +++ b/ui/web-mobile/cocos2d-js-min.335ee.js @@ -0,0 +1 @@ +(function(t,e,i){var n="function"==typeof require&&require;function r(i,s){var o=e[i];if(!o){var a=t[i];if(!a){var c="function"==typeof require&&require;if(!s&&c)return c(i,!0);if(n)return n(i,!0);var h=new Error("Cannot find module '"+i+"'");throw h.code="MODULE_NOT_FOUND",h}var l={};o=e[i]={exports:l},a[0]((function(t){return r(a[1][t]||t)}),o,l)}return o.exports}for(var s=0;s2||i<0)&&(t[e.renderMode]=0),cc._renderType=cc.game.RENDER_TYPE_CANVAS,cc._supportRender=!1,0===i?cc.sys.capabilities.opengl?(cc._renderType=cc.game.RENDER_TYPE_WEBGL,cc._supportRender=!0):cc.sys.capabilities.canvas&&(cc._renderType=cc.game.RENDER_TYPE_CANVAS,cc._supportRender=!0):1===i&&cc.sys.capabilities.canvas?(cc._renderType=cc.game.RENDER_TYPE_CANVAS,cc._supportRender=!0):2===i&&cc.sys.capabilities.opengl&&(cc._renderType=cc.game.RENDER_TYPE_WEBGL,cc._supportRender=!0)})(t=cc.game.config),document.body?s():window.addEventListener("load",o,!1),n=!0}}),{"./cocos2d/core/platform/CCSys":187,"./cocos2d/core/utils":227}],3:[(function(t,e,i){var n,r=t("./cocos2d/core/platform/CCEnum");cc.DebugMode=r({NONE:0,INFO:1,WARN:2,ERROR:3,INFO_FOR_WEB_PAGE:4,WARN_FOR_WEB_PAGE:5,ERROR_FOR_WEB_PAGE:6}),cc._initDebugSetting=function(t){cc.log=cc.warn=cc.error=cc.assert=function(){},t!==cc.DebugMode.NONE&&(t>cc.DebugMode.ERROR?(function(){function e(t){if(cc._canvas){if(!n){var e=document.createElement("Div");e.setAttribute("id","logInfoDiv"),e.setAttribute("width","200"),e.setAttribute("height",cc._canvas.height);var i=e.style;i.zIndex="99999",i.position="absolute",i.top=i.left="0",(n=document.createElement("textarea")).setAttribute("rows","20"),n.setAttribute("cols","30"),n.setAttribute("disabled","true");var r=n.style;r.backgroundColor="transparent",r.borderBottom="1px solid #cccccc",r.borderTopWidth=r.borderLeftWidth=r.borderRightWidth="0px",r.borderTopStyle=r.borderLeftStyle=r.borderRightStyle="none",r.padding="0px",r.margin=0,e.appendChild(n),cc._canvas.parentNode.appendChild(e)}n.value=n.value+t+"\r\n",n.scrollTop=n.scrollHeight}}cc.error=function(){e("ERROR : "+cc.js.formatStr.apply(null,arguments))},cc.assert=function(t,i){"use strict";!t&&i&&e("ASSERT: "+(i=cc.js.formatStr.apply(null,cc.js.shiftArguments.apply(null,arguments))))},t!==cc.DebugMode.ERROR_FOR_WEB_PAGE&&(cc.warn=function(){e("WARN : "+cc.js.formatStr.apply(null,arguments))}),t===cc.DebugMode.INFO_FOR_WEB_PAGE&&(cc.log=cc.info=function(){e(cc.js.formatStr.apply(null,arguments))})})():console&&console.log.apply&&(console.error||(console.error=console.log),console.warn||(console.warn=console.log),console.error.bind?cc.error=console.error.bind(console):cc.error=function(){return console.error.apply(console,arguments)},cc.assert=function(t,e){if(!t)throw e&&(e=cc.js.formatStr.apply(null,cc.js.shiftArguments.apply(null,arguments))),new Error(e)}),t!==cc.DebugMode.ERROR&&(console.warn.bind?cc.warn=console.warn.bind(console):cc.warn=function(){return console.warn.apply(console,arguments)}),t===cc.DebugMode.INFO&&(console.log.bind?cc.log=console.log.bind(console):cc.log=function(){return console.log.apply(console,arguments)},cc.info=function(){(console.info||console.log).apply(console,arguments)}))},cc._throw=function(t){var e=t.stack;e?cc.error(e):cc.error(t)};t("./DebugInfos");var s="https://github.com/cocos-creator/engine/blob/master/EngineErrorMap.md";function o(t){return function(){var e=arguments[0],i=t+" "+e+", please go to "+s+"#"+e+" to see details.";if(1===arguments.length)return i;if(2===arguments.length)return i+" Arguments: "+arguments[1];var n=cc.js.shiftArguments.apply(null,arguments);return i+" Arguments: "+n.join(", ")}}var a=o("Log");cc.logID=function(){cc.log(a.apply(null,arguments))};var c=o("Warning");cc.warnID=function(){cc.warn(c.apply(null,arguments))};var h=o("Error");cc.errorID=function(){cc.error(h.apply(null,arguments))};var l=o("Assert");cc.assertID=function(t){"use strict";t||cc.assert(!1,l.apply(null,cc.js.shiftArguments.apply(null,arguments)))},cc._getError=o("ERROR"),cc._initDebugSetting(cc.DebugMode.INFO)}),{"./DebugInfos":1,"./cocos2d/core/platform/CCEnum":180}],4:[(function(t,e,i){cc.Action=cc._Class.extend({ctor:function(){this.originalTarget=null,this.target=null,this.tag=cc.Action.TAG_INVALID},clone:function(){var t=new cc.Action;return t.originalTarget=null,t.target=null,t.tag=this.tag,t},isDone:function(){return!0},startWithTarget:function(t){this.originalTarget=t,this.target=t},stop:function(){this.target=null},step:function(t){cc.logID(1006)},update:function(t){cc.logID(1007)},getTarget:function(){return this.target},setTarget:function(t){this.target=t},getOriginalTarget:function(){return this.originalTarget},setOriginalTarget:function(t){this.originalTarget=t},getTag:function(){return this.tag},setTag:function(t){this.tag=t},retain:function(){},release:function(){}}),cc.Action.TAG_INVALID=-1,cc.FiniteTimeAction=cc.Action.extend({_duration:0,ctor:function(){cc.Action.prototype.ctor.call(this),this._duration=0},getDuration:function(){return this._duration*(this._timesForRepeat||1)},setDuration:function(t){this._duration=t},reverse:function(){return cc.logID(1008),null},clone:function(){return new cc.FiniteTimeAction}}),cc.Speed=cc.Action.extend({_speed:0,_innerAction:null,ctor:function(t,e){cc.Action.prototype.ctor.call(this),this._speed=0,this._innerAction=null,t&&this.initWithAction(t,e)},getSpeed:function(){return this._speed},setSpeed:function(t){this._speed=t},initWithAction:function(t,e){if(!t)throw new Error(cc._getError(1021));return this._innerAction=t,this._speed=e,!0},clone:function(){var t=new cc.Speed;return t.initWithAction(this._innerAction.clone(),this._speed),t},startWithTarget:function(t){cc.Action.prototype.startWithTarget.call(this,t),this._innerAction.startWithTarget(t)},stop:function(){this._innerAction.stop(),cc.Action.prototype.stop.call(this)},step:function(t){this._innerAction.step(t*this._speed)},isDone:function(){return this._innerAction.isDone()},reverse:function(){return new cc.Speed(this._innerAction.reverse(),this._speed)},setInnerAction:function(t){this._innerAction!==t&&(this._innerAction=t)},getInnerAction:function(){return this._innerAction}}),cc.speed=function(t,e){return new cc.Speed(t,e)},cc.Follow=cc.Action.extend({_followedNode:null,_boundarySet:!1,_boundaryFullyCovered:!1,_halfScreenSize:null,_fullScreenSize:null,_worldRect:null,leftBoundary:0,rightBoundary:0,topBoundary:0,bottomBoundary:0,ctor:function(t,e){cc.Action.prototype.ctor.call(this),this._followedNode=null,this._boundarySet=!1,this._boundaryFullyCovered=!1,this._halfScreenSize=null,this._fullScreenSize=null,this.leftBoundary=0,this.rightBoundary=0,this.topBoundary=0,this.bottomBoundary=0,this._worldRect=cc.rect(0,0,0,0),t&&(e?this.initWithTarget(t,e):this.initWithTarget(t))},clone:function(){var t=new cc.Follow,e=this._worldRect,i=new cc.Rect(e.x,e.y,e.width,e.height);return t.initWithTarget(this._followedNode,i),t},isBoundarySet:function(){return this._boundarySet},setBoudarySet:function(t){this._boundarySet=t},initWithTarget:function(t,e){if(!t)throw new Error(cc._getError(1022));e=e||cc.rect(0,0,0,0),this._followedNode=t,this._worldRect=e,this._boundarySet=!cc._rectEqualToZero(e),this._boundaryFullyCovered=!1;var i=cc.director.getWinSize();return this._fullScreenSize=cc.p(i.width,i.height),this._halfScreenSize=cc.pMult(this._fullScreenSize,.5),this._boundarySet&&(this.leftBoundary=-(e.x+e.width-this._fullScreenSize.x),this.rightBoundary=-e.x,this.topBoundary=-e.y,this.bottomBoundary=-(e.y+e.height-this._fullScreenSize.y),this.rightBoundary=0;i--)e.push(cc.p(t[i].x,t[i].y));return e}function r(t){for(var e=[],i=0;i=this._duration},_cloneDecoration:function(t){t._repeatForever=this._repeatForever,t._speed=this._speed,t._timesForRepeat=this._timesForRepeat,t._easeList=this._easeList,t._speedMethod=this._speedMethod,t._repeatMethod=this._repeatMethod},_reverseEaseList:function(t){if(this._easeList){t._easeList=[];for(var e=0;e1.192092896e-7?this._duration:1.192092896e-7);e=1>e?e:1,this.update(e>0?e:0),this._repeatMethod&&this._timesForRepeat>1&&this.isDone()&&(this._repeatForever||this._timesForRepeat--,this.startWithTarget(this.target),this.step(this._elapsed-this._duration))},startWithTarget:function(t){cc.Action.prototype.startWithTarget.call(this,t),this._elapsed=0,this._firstTick=!0},reverse:function(){return cc.logID(1010),null},setAmplitudeRate:function(t){cc.logID(1011)},getAmplitudeRate:function(){return cc.logID(1012),0},speed:function(t){return t<=0?(cc.logID(1013),this):(this._speedMethod=!0,this._speed*=t,this)},getSpeed:function(){return this._speed},setSpeed:function(t){return this._speed=t,this},repeat:function(t){return t=Math.round(t),isNaN(t)||t<1?(cc.logID(1014),this):(this._repeatMethod=!0,this._timesForRepeat*=t,this)},repeatForever:function(){return this._repeatMethod=!0,this._timesForRepeat=this.MAX_VALUE,this._repeatForever=!0,this}}),cc.actionInterval=function(t){return new cc.ActionInterval(t)},cc.Sequence=cc.ActionInterval.extend({_actions:null,_split:null,_last:0,_reversed:!1,ctor:function(t){cc.ActionInterval.prototype.ctor.call(this),this._actions=[];var e=t instanceof Array?t:arguments;if(1!==e.length){var i=e.length-1;if(i>=0&&null==e[i]&&cc.logID(1015),i>=0){for(var n,r=e[0],s=1;s1?e%1:e),this._last=n)},reverse:function(){var t=cc.Sequence._actionOneTwo(this._actions[1].reverse(),this._actions[0].reverse());return this._cloneDecoration(t),this._reverseEaseList(t),t._reversed=!0,t}}),cc.sequence=function(t){var e=t instanceof Array?t:arguments;if(1===e.length)return cc.errorID(1019),null;var i=e.length-1;i>=0&&null==e[i]&&cc.logID(1015);var n=null;if(i>=0){n=e[0];for(var r=1;r<=i;r++)e[r]&&(n=cc.Sequence._actionOneTwo(n,e[r]))}return n},cc.Sequence._actionOneTwo=function(t,e){var i=new cc.Sequence;return i.initWithTwoActions(t,e),i},cc.Repeat=cc.ActionInterval.extend({_times:0,_total:0,_nextDt:0,_actionInstant:!1,_innerAction:null,ctor:function(t,e){cc.ActionInterval.prototype.ctor.call(this),void 0!==e&&this.initWithAction(t,e)},initWithAction:function(t,e){var i=t._duration*e;return!!this.initWithDuration(i)&&(this._times=e,this._innerAction=t,t instanceof cc.ActionInstant&&(this._actionInstant=!0,this._times-=1),this._total=0,!0)},clone:function(){var t=new cc.Repeat;return this._cloneDecoration(t),t.initWithAction(this._innerAction.clone(),this._times),t},startWithTarget:function(t){this._total=0,this._nextDt=this._innerAction._duration/this._duration,cc.ActionInterval.prototype.startWithTarget.call(this,t),this._innerAction.startWithTarget(t)},stop:function(){this._innerAction.stop(),cc.Action.prototype.stop.call(this)},update:function(t){t=this._computeEaseTime(t);var e=this._innerAction,i=this._duration,n=this._times,r=this._nextDt;if(t>=r){for(;t>r&&this._total=1&&this._total=0&&null==e[i]&&cc.logID(1015),i>=0){for(var n,r=e[0],s=1;sr?this._two=cc.Sequence._actionOneTwo(e,cc.delayTime(n-r)):n0&&null==e[e.length-1]&&cc.logID(1015);for(var i=e[0],n=1;n180&&(i-=360),i<-180&&(i+=360),this._startAngleX=e,this._diffAngleX=i,this._startAngleY=t.rotationY%360;var n=this._dstAngleY-this._startAngleY;n>180&&(n-=360),n<-180&&(n+=360),this._diffAngleY=n},reverse:function(){cc.logID(1016)},update:function(t){t=this._computeEaseTime(t),this.target&&(this.target.rotationX=this._startAngleX+this._diffAngleX*t,this.target.rotationY=this._startAngleY+this._diffAngleY*t)}}),cc.rotateTo=function(t,e,i){return new cc.RotateTo(t,e,i)},cc.RotateBy=cc.ActionInterval.extend({_angleX:0,_startAngleX:0,_angleY:0,_startAngleY:0,ctor:function(t,e,i){cc.ActionInterval.prototype.ctor.call(this),void 0!==e&&this.initWithDuration(t,e,i)},initWithDuration:function(t,e,i){return!!cc.ActionInterval.prototype.initWithDuration.call(this,t)&&(this._angleX=e||0,this._angleY=void 0!==i?i:this._angleX,!0)},clone:function(){var t=new cc.RotateBy;return this._cloneDecoration(t),t.initWithDuration(this._duration,this._angleX,this._angleY),t},startWithTarget:function(t){cc.ActionInterval.prototype.startWithTarget.call(this,t),this._startAngleX=t.rotationX,this._startAngleY=t.rotationY},update:function(t){t=this._computeEaseTime(t),this.target&&(this.target.rotationX=this._startAngleX+this._angleX*t,this.target.rotationY=this._startAngleY+this._angleY*t)},reverse:function(){var t=new cc.RotateBy(this._duration,-this._angleX,-this._angleY);return this._cloneDecoration(t),this._reverseEaseList(t),t}}),cc.rotateBy=function(t,e,i){return new cc.RotateBy(t,e,i)},cc.MoveBy=cc.ActionInterval.extend({_positionDelta:null,_startPosition:null,_previousPosition:null,ctor:function(t,e,i){cc.ActionInterval.prototype.ctor.call(this),this._positionDelta=cc.p(0,0),this._startPosition=cc.p(0,0),this._previousPosition=cc.p(0,0),void 0!==e&&this.initWithDuration(t,e,i)},initWithDuration:function(t,e,i){return!!cc.ActionInterval.prototype.initWithDuration.call(this,t)&&(void 0!==e.x&&(i=e.y,e=e.x),this._positionDelta.x=e,this._positionDelta.y=i,!0)},clone:function(){var t=new cc.MoveBy;return this._cloneDecoration(t),t.initWithDuration(this._duration,this._positionDelta),t},startWithTarget:function(t){cc.ActionInterval.prototype.startWithTarget.call(this,t);var e=t.getPositionX(),i=t.getPositionY();this._previousPosition.x=e,this._previousPosition.y=i,this._startPosition.x=e,this._startPosition.y=i},update:function(t){if(t=this._computeEaseTime(t),this.target){var e=this._positionDelta.x*t,i=this._positionDelta.y*t,n=this._startPosition;if(cc.macro.ENABLE_STACKABLE_ACTIONS){var r=this.target.getPositionX(),s=this.target.getPositionY(),o=this._previousPosition;n.x=n.x+r-o.x,n.y=n.y+s-o.y,e+=n.x,i+=n.y,o.x=e,o.y=i,this.target.setPosition(e,i)}else this.target.setPosition(n.x+e,n.y+i)}},reverse:function(){var t=new cc.MoveBy(this._duration,cc.p(-this._positionDelta.x,-this._positionDelta.y));return this._cloneDecoration(t),this._reverseEaseList(t),t}}),cc.moveBy=function(t,e,i){return new cc.MoveBy(t,e,i)},cc.MoveTo=cc.MoveBy.extend({_endPosition:null,ctor:function(t,e,i){cc.MoveBy.prototype.ctor.call(this),this._endPosition=cc.p(0,0),void 0!==e&&this.initWithDuration(t,e,i)},initWithDuration:function(t,e,i){return!!cc.MoveBy.prototype.initWithDuration.call(this,t,e,i)&&(void 0!==e.x&&(i=e.y,e=e.x),this._endPosition.x=e,this._endPosition.y=i,!0)},clone:function(){var t=new cc.MoveTo;return this._cloneDecoration(t),t.initWithDuration(this._duration,this._endPosition),t},startWithTarget:function(t){cc.MoveBy.prototype.startWithTarget.call(this,t),this._positionDelta.x=this._endPosition.x-t.getPositionX(),this._positionDelta.y=this._endPosition.y-t.getPositionY()}}),cc.moveTo=function(t,e,i){return new cc.MoveTo(t,e,i)},cc.SkewTo=cc.ActionInterval.extend({_skewX:0,_skewY:0,_startSkewX:0,_startSkewY:0,_endSkewX:0,_endSkewY:0,_deltaX:0,_deltaY:0,ctor:function(t,e,i){cc.ActionInterval.prototype.ctor.call(this),void 0!==i&&this.initWithDuration(t,e,i)},initWithDuration:function(t,e,i){var n=!1;return cc.ActionInterval.prototype.initWithDuration.call(this,t)&&(this._endSkewX=e,this._endSkewY=i,n=!0),n},clone:function(){var t=new cc.SkewTo;return this._cloneDecoration(t),t.initWithDuration(this._duration,this._endSkewX,this._endSkewY),t},startWithTarget:function(t){cc.ActionInterval.prototype.startWithTarget.call(this,t),this._startSkewX=t.skewX%180,this._deltaX=this._endSkewX-this._startSkewX,this._deltaX>180&&(this._deltaX-=360),this._deltaX<-180&&(this._deltaX+=360),this._startSkewY=t.skewY%360,this._deltaY=this._endSkewY-this._startSkewY,this._deltaY>180&&(this._deltaY-=360),this._deltaY<-180&&(this._deltaY+=360)},update:function(t){t=this._computeEaseTime(t),this.target.skewX=this._startSkewX+this._deltaX*t,this.target.skewY=this._startSkewY+this._deltaY*t}}),cc.skewTo=function(t,e,i){return new cc.SkewTo(t,e,i)},cc.SkewBy=cc.SkewTo.extend({ctor:function(t,e,i){cc.SkewTo.prototype.ctor.call(this),void 0!==i&&this.initWithDuration(t,e,i)},initWithDuration:function(t,e,i){var n=!1;return cc.SkewTo.prototype.initWithDuration.call(this,t,e,i)&&(this._skewX=e,this._skewY=i,n=!0),n},clone:function(){var t=new cc.SkewBy;return this._cloneDecoration(t),t.initWithDuration(this._duration,this._skewX,this._skewY),t},startWithTarget:function(t){cc.SkewTo.prototype.startWithTarget.call(this,t),this._deltaX=this._skewX,this._deltaY=this._skewY,this._endSkewX=this._startSkewX+this._deltaX,this._endSkewY=this._startSkewY+this._deltaY},reverse:function(){var t=new cc.SkewBy(this._duration,-this._skewX,-this._skewY);return this._cloneDecoration(t),this._reverseEaseList(t),t}}),cc.skewBy=function(t,e,i){return new cc.SkewBy(t,e,i)},cc.JumpBy=cc.ActionInterval.extend({_startPosition:null,_delta:null,_height:0,_jumps:0,_previousPosition:null,ctor:function(t,e,i,n,r){cc.ActionInterval.prototype.ctor.call(this),this._startPosition=cc.p(0,0),this._previousPosition=cc.p(0,0),this._delta=cc.p(0,0),void 0!==n&&this.initWithDuration(t,e,i,n,r)},initWithDuration:function(t,e,i,n,r){return!!cc.ActionInterval.prototype.initWithDuration.call(this,t)&&(void 0===r&&(r=n,n=i,i=e.y,e=e.x),this._delta.x=e,this._delta.y=i,this._height=n,this._jumps=r,!0)},clone:function(){var t=new cc.JumpBy;return this._cloneDecoration(t),t.initWithDuration(this._duration,this._delta,this._height,this._jumps),t},startWithTarget:function(t){cc.ActionInterval.prototype.startWithTarget.call(this,t);var e=t.getPositionX(),i=t.getPositionY();this._previousPosition.x=e,this._previousPosition.y=i,this._startPosition.x=e,this._startPosition.y=i},update:function(t){if(t=this._computeEaseTime(t),this.target){var e=t*this._jumps%1,i=4*this._height*e*(1-e);i+=this._delta.y*t;var n=this._delta.x*t,r=this._startPosition;if(cc.macro.ENABLE_STACKABLE_ACTIONS){var s=this.target.getPositionX(),o=this.target.getPositionY(),a=this._previousPosition;r.x=r.x+s-a.x,r.y=r.y+o-a.y,n+=r.x,i+=r.y,a.x=n,a.y=i,this.target.setPosition(n,i)}else this.target.setPosition(r.x+n,r.y+i)}},reverse:function(){var t=new cc.JumpBy(this._duration,cc.p(-this._delta.x,-this._delta.y),this._height,this._jumps);return this._cloneDecoration(t),this._reverseEaseList(t),t}}),cc.jumpBy=function(t,e,i,n,r){return new cc.JumpBy(t,e,i,n,r)},cc.JumpTo=cc.JumpBy.extend({_endPosition:null,ctor:function(t,e,i,n,r){cc.JumpBy.prototype.ctor.call(this),this._endPosition=cc.p(0,0),void 0!==n&&this.initWithDuration(t,e,i,n,r)},initWithDuration:function(t,e,i,n,r){return!!cc.JumpBy.prototype.initWithDuration.call(this,t,e,i,n,r)&&(void 0===r&&(i=e.y,e=e.x),this._endPosition.x=e,this._endPosition.y=i,!0)},startWithTarget:function(t){cc.JumpBy.prototype.startWithTarget.call(this,t),this._delta.x=this._endPosition.x-this._startPosition.x,this._delta.y=this._endPosition.y-this._startPosition.y},clone:function(){var t=new cc.JumpTo;return this._cloneDecoration(t),t.initWithDuration(this._duration,this._endPosition,this._height,this._jumps),t}}),cc.jumpTo=function(t,e,i,n,r){return new cc.JumpTo(t,e,i,n,r)},cc.bezierAt=function(t,e,i,n,r){return Math.pow(1-r,3)*t+3*r*Math.pow(1-r,2)*e+3*Math.pow(r,2)*(1-r)*i+Math.pow(r,3)*n},cc.BezierBy=cc.ActionInterval.extend({_config:null,_startPosition:null,_previousPosition:null,ctor:function(t,e){cc.ActionInterval.prototype.ctor.call(this),this._config=[],this._startPosition=cc.p(0,0),this._previousPosition=cc.p(0,0),e&&this.initWithDuration(t,e)},initWithDuration:function(t,e){return!!cc.ActionInterval.prototype.initWithDuration.call(this,t)&&(this._config=e,!0)},clone:function(){var t=new cc.BezierBy;this._cloneDecoration(t);for(var e=[],i=0;ie/2?255:0}},startWithTarget:function(t){cc.ActionInterval.prototype.startWithTarget.call(this,t),this._originalState=t.opacity},stop:function(){this.target.opacity=this._originalState,cc.ActionInterval.prototype.stop.call(this)},reverse:function(){var t=new cc.Blink(this._duration,this._times);return this._cloneDecoration(t),this._reverseEaseList(t),t}}),cc.blink=function(t,e){return new cc.Blink(t,e)},cc.FadeTo=cc.ActionInterval.extend({_toOpacity:0,_fromOpacity:0,ctor:function(t,e){cc.ActionInterval.prototype.ctor.call(this),void 0!==e&&this.initWithDuration(t,e)},initWithDuration:function(t,e){return!!cc.ActionInterval.prototype.initWithDuration.call(this,t)&&(this._toOpacity=e,!0)},clone:function(){var t=new cc.FadeTo;return this._cloneDecoration(t),t.initWithDuration(this._duration,this._toOpacity),t},update:function(t){t=this._computeEaseTime(t);var e=void 0!==this._fromOpacity?this._fromOpacity:255;this.target.opacity=e+(this._toOpacity-e)*t},startWithTarget:function(t){cc.ActionInterval.prototype.startWithTarget.call(this,t),this._fromOpacity=t.opacity}}),cc.fadeTo=function(t,e){return new cc.FadeTo(t,e)},cc.FadeIn=cc.FadeTo.extend({_reverseAction:null,ctor:function(t){cc.FadeTo.prototype.ctor.call(this),null==t&&(t=0),this.initWithDuration(t,255)},reverse:function(){var t=new cc.FadeOut;return t.initWithDuration(this._duration,0),this._cloneDecoration(t),this._reverseEaseList(t),t},clone:function(){var t=new cc.FadeIn;return this._cloneDecoration(t),t.initWithDuration(this._duration,this._toOpacity),t},startWithTarget:function(t){this._reverseAction&&(this._toOpacity=this._reverseAction._fromOpacity),cc.FadeTo.prototype.startWithTarget.call(this,t)}}),cc.fadeIn=function(t){return new cc.FadeIn(t)},cc.FadeOut=cc.FadeTo.extend({ctor:function(t){cc.FadeTo.prototype.ctor.call(this),null==t&&(t=0),this.initWithDuration(t,0)},reverse:function(){var t=new cc.FadeIn;return t._reverseAction=this,t.initWithDuration(this._duration,255),this._cloneDecoration(t),this._reverseEaseList(t),t},clone:function(){var t=new cc.FadeOut;return this._cloneDecoration(t),t.initWithDuration(this._duration,this._toOpacity),t}}),cc.fadeOut=function(t){return new cc.FadeOut(t)},cc.TintTo=cc.ActionInterval.extend({_to:null,_from:null,ctor:function(t,e,i,n){cc.ActionInterval.prototype.ctor.call(this),this._to=cc.color(0,0,0),this._from=cc.color(0,0,0),e instanceof cc.Color&&(n=e.b,i=e.g,e=e.r),void 0!==n&&this.initWithDuration(t,e,i,n)},initWithDuration:function(t,e,i,n){return!!cc.ActionInterval.prototype.initWithDuration.call(this,t)&&(this._to=cc.color(e,i,n),!0)},clone:function(){var t=new cc.TintTo;this._cloneDecoration(t);var e=this._to;return t.initWithDuration(this._duration,e.r,e.g,e.b),t},startWithTarget:function(t){cc.ActionInterval.prototype.startWithTarget.call(this,t),this._from=this.target.color},update:function(t){t=this._computeEaseTime(t);var e=this._from,i=this._to;e&&this.target.setColor(cc.color(e.r+(i.r-e.r)*t,e.g+(i.g-e.g)*t,e.b+(i.b-e.b)*t))}}),cc.tintTo=function(t,e,i,n){return new cc.TintTo(t,e,i,n)},cc.TintBy=cc.ActionInterval.extend({_deltaR:0,_deltaG:0,_deltaB:0,_fromR:0,_fromG:0,_fromB:0,ctor:function(t,e,i,n){cc.ActionInterval.prototype.ctor.call(this),void 0!==n&&this.initWithDuration(t,e,i,n)},initWithDuration:function(t,e,i,n){return!!cc.ActionInterval.prototype.initWithDuration.call(this,t)&&(this._deltaR=e,this._deltaG=i,this._deltaB=n,!0)},clone:function(){var t=new cc.TintBy;return this._cloneDecoration(t),t.initWithDuration(this._duration,this._deltaR,this._deltaG,this._deltaB),t},startWithTarget:function(t){cc.ActionInterval.prototype.startWithTarget.call(this,t);var e=t.color;this._fromR=e.r,this._fromG=e.g,this._fromB=e.b},update:function(t){t=this._computeEaseTime(t),this.target.color=cc.color(this._fromR+this._deltaR*t,this._fromG+this._deltaG*t,this._fromB+this._deltaB*t)},reverse:function(){var t=new cc.TintBy(this._duration,-this._deltaR,-this._deltaG,-this._deltaB);return this._cloneDecoration(t),this._reverseEaseList(t),t}}),cc.tintBy=function(t,e,i,n){return new cc.TintBy(t,e,i,n)},cc.DelayTime=cc.ActionInterval.extend({update:function(t){},reverse:function(){var t=new cc.DelayTime(this._duration);return this._cloneDecoration(t),this._reverseEaseList(t),t},clone:function(){var t=new cc.DelayTime;return this._cloneDecoration(t),t.initWithDuration(this._duration),t}}),cc.delayTime=function(t){return new cc.DelayTime(t)},cc.ReverseTime=cc.ActionInterval.extend({_other:null,ctor:function(t){cc.ActionInterval.prototype.ctor.call(this),this._other=null,t&&this.initWithAction(t)},initWithAction:function(t){if(!t)throw new Error(cc._getError(1028));if(t===this._other)throw new Error(cc._getError(1029));return!!cc.ActionInterval.prototype.initWithDuration.call(this,t._duration)&&(this._other=t,!0)},clone:function(){var t=new cc.ReverseTime;return this._cloneDecoration(t),t.initWithAction(this._other.clone()),t},startWithTarget:function(t){cc.ActionInterval.prototype.startWithTarget.call(this,t),this._other.startWithTarget(t)},update:function(t){t=this._computeEaseTime(t),this._other&&this._other.update(1-t)},reverse:function(){return this._other.clone()},stop:function(){this._other.stop(),cc.Action.prototype.stop.call(this)}}),cc.reverseTime=function(t){return new cc.ReverseTime(t)},cc.Animate=cc.ActionInterval.extend({_animation:null,_nextFrame:0,_origFrame:null,_executedLoops:0,_splitTimes:null,_currFrameIndex:0,ctor:function(t){cc.ActionInterval.prototype.ctor.call(this),this._splitTimes=[],t&&this.initWithAnimation(t)},getAnimation:function(){return this._animation},setAnimation:function(t){this._animation=t},getCurrentFrameIndex:function(){return this._currFrameIndex},initWithAnimation:function(t){if(!t)throw new Error(cc._getError(1030));var e=t.getDuration();if(this.initWithDuration(e*t.getLoops())){this._nextFrame=0,this.setAnimation(t),this._origFrame=null,this._executedLoops=0;var i=this._splitTimes;i.length=0;var n=0,r=e/t.getTotalDelayUnits(),s=t.getFrames();cc.js.array.verifyType(s,cc.AnimationFrame);for(var o=0;othis._executedLoops&&(this._nextFrame=0,this._executedLoops++),t%=1);for(var e=this._animation.getFrames(),i=e.length,n=this._splitTimes,r=this._nextFrame;r0)for(var n=e.length-1;n>=0;n--){var r=e[n];if(!r)break;i.push(r.clone())}var s=new cc.SpriteFrameAnimation(i,t.getDelayPerUnit(),t.getLoops());s.setRestoreOriginalFrame(t.getRestoreOriginalFrame());var o=new cc.Animate(s);return this._cloneDecoration(o),this._reverseEaseList(o),o},stop:function(){this._animation.getRestoreOriginalFrame()&&this.target&&this.target.setSpriteFrame(this._origFrame),cc.Action.prototype.stop.call(this)}}),cc.animate=function(t){return new cc.Animate(t)},cc.TargetedAction=cc.ActionInterval.extend({_action:null,_forcedTarget:null,ctor:function(t,e){cc.ActionInterval.prototype.ctor.call(this),e&&this.initWithTarget(t,e)},initWithTarget:function(t,e){return!!this.initWithDuration(e._duration)&&(this._forcedTarget=t,this._action=e,!0)},clone:function(){var t=new cc.TargetedAction;return this._cloneDecoration(t),t.initWithTarget(this._forcedTarget,this._action.clone()),t},startWithTarget:function(t){cc.ActionInterval.prototype.startWithTarget.call(this,t),this._action.startWithTarget(this._forcedTarget)},stop:function(){this._action.stop()},update:function(t){t=this._computeEaseTime(t),this._action.update(t)},getForcedTarget:function(){return this._forcedTarget},setForcedTarget:function(t){this._forcedTarget!==t&&(this._forcedTarget=t)}}),cc.targetedAction=function(t,e){return new cc.TargetedAction(t,e)}}),{}],9:[(function(t,e,i){cc.ActionManager=cc._Class.extend({_elementPool:[],_searchElementByTarget:function(t,e){for(var i=0;i=n&&i.actionIndex--;break}}else cc.logID(1001)}},removeActionByTag:function(t,e){t===cc.Action.TAG_INVALID&&cc.logID(1002),cc.assertID(e,1003);var i=this._hashTargets[e.__instanceId];if(i)for(var n=i.actions.length,r=0;r=t&&e.actionIndex--,0===e.actions.length&&this._deleteHashElement(e)},_deleteHashElement:function(t){var e=!1;if(t&&!t.lock&&this._hashTargets[t.target.__instanceId]){delete this._hashTargets[t.target.__instanceId];for(var i=this._arrayTargets,n=0,r=i.length;n0?e:null})(n);for(var m=0,p=c.length;m1e-6){S=!1;break}return d._findFrameIndex=S?o:u,d}function d(t,e){var i=e.props,r=e.comps;if(i)for(var s in i){var o=_(t,s,i[s]);n.push(o)}if(r)for(var a in r){var c=t.getComponent(a);if(c){var h=r[a];for(var s in h){o=_(c,s,h[s]);n.push(o)}}}}n.length=0,e.duration=i.duration,e.speed=i.speed,e.wrapMode=i.wrapMode,e.frameRate=i.sample,(e.wrapMode&l.Loop)===l.Loop?e.repeatCount=1/0:e.repeatCount=1;var f=i.curveData,m=f.paths;for(var p in d(t,f),m){var g=cc.find(p,t);if(g)d(g,m[p])}var y=i.events;if(y)for(var v,x=0,C=y.length;x=0?T=v.events[S]:(T=new h,v.ratios.push(b),v.events.push(T)),T.add(A.func,A.params)}}d.playState=function(t,e){t.clip&&(t.curveLoaded||f(this.target,t),t.animator=this,t.play(),"number"==typeof e&&t.setTime(e),this.play())},d.stopStatesExcept=function(t){var e=this._anims,i=e.array;for(e.i=0;e.i=0?(this._anims.fastRemoveAt(e),0===this._anims.array.length&&this.stop()):cc.errorID(3908),t.animator=null},d.sample=function(){var t=this._anims,e=t.array;for(t.i=0;t.i=s)o=n[s-1];else{var h=n[c-1],l="number"==typeof h,u=h&&h.lerp;if(l||u){var _=r[c-1],d=r[c],f=this.types[c-1],m=(e-_)/(d-_);f&&(m=a(m,f));var p=n[c];l?o=h+(p-h)*m:u&&(o=h.lerp(p,m))}else o=h}else o=n[c];var g=this.subProps;if(g){for(var y=this.target[this.prop],v=y,x=0;x0?((l&s.PingPong)===s.PingPong?c*=-1:f=n,d++):1===c&&f===n-1&&hu)break}f+=c,cc.director.getAnimationManager().pushDelayEvent(this,"_fireEvent",[f])}while(f!==h&&f>-1&&f=this.events.length||this._ignoreIndex===t)){var e=this.events[t].events;if(this.target.isValid)for(var i=this.target._components,n=0;nr)return i;var s=(e=(e-n)/(r-n))/(1/i),o=0|s;return s-o<1e-6?o:~(o+1)}}}),{"../core/utils/binary-search":224,"./bezier":16,"./types":21}],14:[(function(t,e,n){var r=cc.js,s=cc.Class({ctor:function(){this.__instanceId=cc.ClassManager.getNewInstanceId(),this._anims=new r.array.MutableForwardIterator([]),this._delayEvents=[]},update:function(t){var e=this._anims,n=e.array;for(e.i=0;e.i=0?this._anims.fastRemoveAt(e):cc.errorID(3907)},pushDelayEvent:function(t,e,i){this._delayEvents.push({target:t,func:e,args:i})}});cc.AnimationManager=e.exports=s}),{}],15:[(function(t,e,i){var n=cc.js,r=t("./playable"),s=t("./types"),o=s.WrappedInfo,a=s.WrapMode,c=s.WrapModeMask;function h(t,e){r.call(this),cc.EventTarget.call(this),this._currentFramePlayed=!1,this._delay=0,this._delayTime=0,this._wrappedInfo=new o,this._lastWrappedInfo=null,this._process=u,this._clip=t,this._name=e||t&&t.name,this.animator=null,this.curves=[],this.delay=0,this.repeatCount=1,this.duration=1,this.speed=1,this.wrapMode=a.Normal,this.time=0,this._emit=this.emit,this.emit=function(){for(var t=new Array(arguments.length),e=0,i=t.length;e1&&(0|e.iterations)>(0|t.iterations)&&this.emit("lastframe",this),t.set(e));e.stopped&&(this.stop(),this.emit("finished",this))}function _(){var t=this.time,e=this.duration;t>e?0===(t%=e)&&(t=e):t<0&&0!==(t%=e)&&(t+=e);for(var i=t/e,n=this.curves,r=0,s=n.length;r0&&this._lastIterations>i||this.time<0&&this._lastIterations0&&(this._delayTime-=t,this._delayTime>0)||(this._currentFramePlayed?this.time+=t*this.speed:this._currentFramePlayed=!0,this._process())},l._needRevers=function(t){var e=this.wrapMode,i=!1;(e&c.PingPong)===c.PingPong&&(t-(0|t)==0&&t>0&&(t-=1),1&t&&(i=!i));return(e&c.Reverse)===c.Reverse&&(i=!i),i},l.getWrappedInfo=function(t,e){e=e||new o;var i=!1,n=this.duration,r=this.repeatCount,s=t>0?t/n:-t/n;if(s>=r){s=r,i=!0;var a=r-(0|r);0===a&&(a=1),t=a*n*(t>0?1:-1)}if(t>n){var h=t%n;t=0===h?n:h}else t<0&&0!==(t%=n)&&(t+=n);var l=!1,u=this._wrapMode&c.ShouldWrap;u&&(l=this._needRevers(s));var _=l?-1:1;return this.speed<0&&(_*=-1),u&&l&&(t=n-t),e.ratio=t/n,e.time=t,e.direction=_,e.stopped=i,e.iterations=s,e},l.sample=function(){for(var t=this.getWrappedInfo(this.time,this._wrappedInfo),e=this.curves,i=0,n=e.length;i0}),(function(){this.curves.length=0})),n.getset(l,"wrapMode",(function(){return this._wrapMode}),(function(t){this._wrapMode=t,this.time=0,t&c.Loop?this.repeatCount=1/0:this.repeatCount=1})),n.getset(l,"repeatCount",(function(){return this._repeatCount}),(function(t){this._repeatCount=t;var e=this._wrapMode&c.ShouldWrap,i=(this.wrapMode&c.Reverse)===c.Reverse;this._process=t!==1/0||e||i?u:_})),n.getset(l,"delay",(function(){return this._delay}),(function(t){this._delayTime=this._delay=t})),cc.AnimationState=e.exports=h}),{"./playable":20,"./types":21}],16:[(function(t,e,i){function n(t,e,i,n,r){var s=1-r;return t*s*s*s+3*e*s*s*r+3*i*s*r*r+n*r*r*r}var r=Math.cos,s=Math.acos,o=Math.max,a=2*Math.PI,c=Math.sqrt;function h(t){return t<0?-Math.pow(-t,1/3):Math.pow(t,1/3)}function l(t,e){var i=(function(t,e){var i,n,l,u,_=e-0,d=e-t[0],f=3*_,m=3*d,p=3*(e-t[2]),g=1/(-_+m-p+(e-1)),y=(f-6*d+p)*g,v=y*(1/3),x=(-f+m)*g,C=1/3*(3*x-y*y),T=C*(1/3),A=(2*y*y*y-9*y*x+_*g*27)/27,b=A/2,S=b*b+T*T*T;if(S<0){var E=1/3*-C,w=c(E*E*E),I=-A/(2*w),R=s(I<-1?-1:I>1?1:I),P=2*h(w);return n=P*r(R*(1/3))-v,l=P*r((R+a)*(1/3))-v,u=P*r((R+2*a)*(1/3))-v,0<=n&&n<=1?0<=l&&l<=1?0<=u&&u<=1?o(n,l,u):o(n,l):0<=u&&u<=1?o(n,u):n:0<=l&&l<=1?0<=u&&u<=1?o(l,u):l:u}if(0===S)return l=-(i=b<0?h(-b):-h(b))-v,0<=(n=2*i-v)&&n<=1?0<=l&&l<=1?o(n,l):n:l;var O=c(S);return n=(i=h(-b+O))-h(b+O)-v})(t,e),n=1-i;return 0*n*n*n+3*t[1]*i*n*n+3*t[3]*i*i*n+1*i*i*i}e.exports={bezier:n,bezierByTime:l}}),{}],17:[(function(t,e,i){var n={constant:function(){return 0},linear:function(t){return t},quadIn:function(t){return t*t},quadOut:function(t){return t*(2-t)},quadInOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},cubicIn:function(t){return t*t*t},cubicOut:function(t){return--t*t*t+1},cubicInOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},quartIn:function(t){return t*t*t*t},quartOut:function(t){return 1- --t*t*t*t},quartInOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},quintIn:function(t){return t*t*t*t*t},quintOut:function(t){return--t*t*t*t*t+1},quintInOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},sineIn:function(t){return 1-Math.cos(t*Math.PI/2)},sineOut:function(t){return Math.sin(t*Math.PI/2)},sineInOut:function(t){return.5*(1-Math.cos(Math.PI*t))},expoIn:function(t){return 0===t?0:Math.pow(1024,t-1)},expoOut:function(t){return 1===t?1:1-Math.pow(2,-10*t)},expoInOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))},circIn:function(t){return 1-Math.sqrt(1-t*t)},circOut:function(t){return Math.sqrt(1- --t*t)},circInOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},elasticIn:function(t){var e,i=.1;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4*Math.asin(1/i)/(2*Math.PI),-i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4))},elasticOut:function(t){var e,i=.1;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4*Math.asin(1/i)/(2*Math.PI),i*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/.4)+1)},elasticInOut:function(t){var e,i=.1;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4*Math.asin(1/i)/(2*Math.PI),(t*=2)<1?i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4)*-.5:i*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4)*.5+1)},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},backInOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)},bounceOut:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},smooth:function(t){return t<=0?0:t>=1?1:t*t*(3-2*t)},fade:function(t){return t<=0?0:t>=1?1:t*t*t*(t*(6*t-15)+10)}};function r(t,e){return function(i){return i<.5?e(2*i)/2:t(2*i-1)/2+.5}}n.quadOutIn=r(n.quadIn,n.quadOut),n.cubicOutIn=r(n.cubicIn,n.cubicOut),n.quartOutIn=r(n.quartIn,n.quartOut),n.quintOutIn=r(n.quintIn,n.quintOut),n.sineOutIn=r(n.sineIn,n.sineOut),n.expoOutIn=r(n.expoIn,n.expoOut),n.circOutIn=r(n.circIn,n.circOut),n.backOutIn=r(n.backIn,n.backOut),n.backOutIn=r(n.backIn,n.backOut),n.bounceIn=function(t){return 1-n.bounceOut(1-t)},n.bounceInOut=function(t){return t<.5?.5*n.bounceIn(2*t):.5*n.bounceOut(2*t-1)+.5},n.bounceOutIn=r(n.bounceIn,n.bounceOut),cc.Easing=e.exports=n}),{}],18:[(function(t,e,i){t("./bezier"),t("./easing"),t("./types"),t("./motion-path-helper"),t("./animation-curves"),t("./animation-clip"),t("./animation-manager"),t("./animation-state"),t("./animation-animator")}),{"./animation-animator":11,"./animation-clip":12,"./animation-curves":13,"./animation-manager":14,"./animation-state":15,"./bezier":16,"./easing":17,"./motion-path-helper":19,"./types":21}],19:[(function(t,e,i){var n=t("./animation-curves").DynamicAnimCurve,r=t("./animation-curves").computeRatioByType,s=t("./bezier").bezier,o=t("../core/utils/binary-search").binarySearchEpsilon,a=cc.v2;function c(t){this.points=t||[],this.beziers=[],this.ratios=[],this.progresses=[],this.length=0,this.computeBeziers()}function h(){this.start=a(),this.end=a(),this.startCtrlPoint=a(),this.endCtrlPoint=a()}function l(t,e,i,s){function h(t){return t instanceof cc.Vec2?{in:t,pos:t,out:t}:Array.isArray(t)&&6===t.length?{in:a(t[2],t[3]),pos:a(t[0],t[1]),out:a(t[4],t[5])}:{in:cc.Vec2.ZERO,pos:cc.Vec2.ZERO,out:cc.Vec2.ZERO}}var l=e.values;if(0!==t.length&&0!==l.length)if(1!==(l=l.map((function(t){return a(t[0],t[1])}))).length){for(var u=e.types,_=e.ratios,d=e.values=[],f=e.types=[],m=e.ratios=[],p=0,g=n.Linear,y=0,v=t.length;y0){var P=[];P.push(h(b));for(var O=0,D=C.length;O1e-6;){var N,F,z,k;if((x=r(x=I,E))<0)k=(0-x)*(F=L.beziers[0]).getLength(),z=F.start.sub(F.endCtrlPoint).normalize(),N=F.start.add(z.mul(k));else if(x>1)k=(x-1)*(F=L.beziers[L.beziers.length-1]).getLength(),z=F.end.sub(F.startCtrlPoint).normalize(),N=F.end.add(z.mul(k));else{var V=o(M,x);V<0&&(V=~V),x-=V>0?M[V-1]:0,x/=L.ratios[V],N=L.beziers[V].getPointAt(x)}w.push(N),I+=R}}else for(;1-I>1e-6;)x=r(x=I,E),w.push(b.lerp(S,x)),I+=R;g="constant"===E?E:n.Linear;for(O=0,D=w.length;O1e-6?(I-1)*A:0}_[_.length-1]!==m[m.length-1]&&U(l[l.length-1],g,_[_.length-1])}else e.values=l;function U(t,e,i){d.push(t),f.push(e),m.push(i)}}c.prototype.computeBeziers=function(){var t;this.beziers.length=0,this.ratios.length=0,this.progresses.length=0,this.length=0;for(var e=1;e0)){c=r;break}c=r-1}if(n[r=c]===i)return r/(s-1);var h=n[r];return(r+(i-h)/(n[r+1]-h))/(s-1)},e.exports={sampleMotionPaths:l,Curve:c,Bezier:h}}),{"../core/utils/binary-search":224,"./animation-curves":13,"./bezier":16}],20:[(function(t,e,i){var n=cc.js;function r(){this._isPlaying=!1,this._isPaused=!1,this._stepOnce=!1}var s=r.prototype;n.get(s,"isPlaying",(function(){return this._isPlaying}),!0),n.get(s,"isPaused",(function(){return this._isPaused}),!0);var o=function(){};s.onPlay=o,s.onPause=o,s.onResume=o,s.onStop=o,s.onError=o,s.play=function(){this._isPlaying?this._isPaused?(this._isPaused=!1,this.onResume()):this.onError(cc._getError(3912)):(this._isPlaying=!0,this.onPlay())},s.stop=function(){this._isPlaying&&(this._isPlaying=!1,this.onStop(),this._isPaused=!1)},s.pause=function(){this._isPlaying&&!this._isPaused&&(this._isPaused=!0,this.onPause())},s.resume=function(){this._isPlaying&&this._isPaused&&(this._isPaused=!1,this.onResume())},s.step=function(){this.pause(),this._stepOnce=!0,this._isPlaying||this.play()},e.exports=r}),{}],21:[(function(t,e,i){cc.js;var n={Loop:2,ShouldWrap:4,PingPong:22,Reverse:36},r=cc.Enum({Default:0,Normal:1,Reverse:n.Reverse,Loop:n.Loop,LoopReverse:n.Loop|n.Reverse,PingPong:n.PingPong,PingPongReverse:n.PingPong|n.Reverse});function s(t){t?this.set(t):(this.ratio=0,this.time=0,this.direction=1,this.stopped=!0,this.iterations=0,this.frameIndex=void 0)}cc.WrapMode=r,s.prototype.set=function(t){this.ratio=t.ratio,this.time=t.time,this.direction=t.direction,this.stopped=t.stopped,this.iterations=t.iterations,this.frameIndex=t.frameIndex},e.exports={WrapModeMask:n,WrapMode:r,WrappedInfo:s}}),{}],22:[(function(t,e,i){var n=t("../core/event/event-target"),r=t("../core/platform/CCSys"),s=t("../core/assets/CCAudioClip").LoadMode,o=!1,a=[],c=function(t){n.call(this),this._src=t,this._element=null,this.id=0,this._volume=1,this._loop=!1,this._nextTime=0,this._state=c.State.INITIALZING,this._onended=function(){this.emit("ended")}.bind(this)};cc.js.extend(c,n),c.State={ERROR:-1,INITIALZING:0,PLAYING:1,PAUSED:2},(function(t){t._bindEnded=function(t){t=t||this._onended;var e=this._element;this._src&&e instanceof HTMLAudioElement?e.addEventListener("ended",t):e.onended=t},t._unbindEnded=function(){var t=this._element;this._src&&t instanceof HTMLAudioElement?t.removeEventListener("ended",this._onended):t&&(t.onended=null)},t._onLoaded=function(){var t=this._src._nativeAsset;t instanceof HTMLAudioElement?(this._element||(this._element=document.createElement("audio")),this._element.src=t.src):this._element=new h(t,this),this.setVolume(this._volume),this.setLoop(this._loop),0!==this._nextTime&&this.setCurrentTime(this._nextTime),this._state===c.State.PLAYING?this.play():this._state=c.State.INITIALZING},t.play=function(){this._state=c.State.PLAYING,this._element&&(this._bindEnded(),this._element.play(),this._src&&this._src.loadMode===s.DOM_AUDIO&&this._element.paused&&a.push({instance:this,offset:0,audio:this._element}),o||(o=!0,cc.game.canvas.addEventListener("touchstart",(function(){for(var t;t=a.pop();)t.audio.play(t.offset)}))))},t.destroy=function(){this._element=null},t.pause=function(){this._element&&(this._unbindEnded(),this._element.pause(),this._state=c.State.PAUSED)},t.resume=function(){this._element&&this._state!==c.State.PLAYING&&(this._bindEnded(),this._element.play(),this._state=c.State.PLAYING)},t.stop=function(){if(this._element){try{this._element.currentTime=0}catch(t){}this._element.pause();for(var t=0;tthis._buffer.duration)})),t.__defineGetter__("loop",(function(){return this._loop})),t.__defineSetter__("loop",(function(t){return this._currentSource&&(this._currentSource.loop=t),this._loop=t})),t.__defineGetter__("volume",(function(){return this._volume})),t.__defineSetter__("volume",(function(t){return this._volume=t,this._gainObj.gain.setTargetAtTime?this._gainObj.gain.setTargetAtTime(this._volume,this._context.currentTime,.01):this._volume.gain.value=t,r.os===r.OS_IOS&&!this.paused&&this._currentSource&&(this._currentSource.onended=null,this.pause(),this.play()),t})),t.__defineGetter__("currentTime",(function(){return this.paused?this.playedLength:(this.playedLength=this._context.currentTime-this._startTime,this.playedLength%=this._buffer.duration,this.playedLength)})),t.__defineSetter__("currentTime",(function(t){return this.paused?this.playedLength=t:(this.pause(),this.playedLength=t,this.play()),t})),t.__defineGetter__("duration",(function(){return this._buffer.duration}))})(h.prototype),e.exports=cc.Audio=c}),{"../core/assets/CCAudioClip":44,"../core/event/event-target":114,"../core/platform/CCSys":187}],23:[(function(t,e,i){var n=t("./CCAudio"),r=t("../core/assets/CCAudioClip"),s=0,o={},a={},c=function(t){var e=s++,i=a[t];if(i||(i=a[t]=[]),l._maxAudioInstance<=i.length){var r=i.shift(),c=o[r];c.stop(),c.destroy()}var h=new n,u=function(){delete o[this.id];var t=i.indexOf(this.id);cc.js.array.fastRemoveAt(i,t)};return h.on("ended",u),h.on("stop",u),o[e]=h,h.id=e,i.push(e),h},h=function(t){return o[t]},l={AudioState:n.State,_maxWebAudioSize:2097152,_maxAudioInstance:24,_id2audio:o,play:function(t,e,i){var n,s=t;if("string"==typeof t)cc.warnID(8401,"cc.audioEngine","cc.AudioClip","AudioClip","cc.AudioClip","audio"),n=c(s=t),r._loadByUrl(s,(function(t,e){e&&(n.src=e)}));else{if(!t)return;s=t.nativeUrl,(n=c(s)).src=t}return n.setLoop(e||!1),"number"!=typeof i&&(i=1),n.setVolume(i),n.play(),n.id},setLoop:function(t,e){var i=h(t);i&&i.setLoop&&i.setLoop(e)},isLoop:function(t){var e=h(t);return!(!e||!e.getLoop)&&e.getLoop()},setVolume:function(t,e){var i=h(t);i&&i.setVolume(e)},getVolume:function(t){var e=h(t);return e?e.getVolume():1},setCurrentTime:function(t,e){var i=h(t);return!!i&&(i.setCurrentTime(e),!0)},getCurrentTime:function(t){var e=h(t);return e?e.getCurrentTime():0},getDuration:function(t){var e=h(t);return e?e.getDuration():0},getState:function(t){var e=h(t);return e?e.getState():this.AudioState.ERROR},setFinishCallback:function(t,e){var i=h(t);i&&(i.off("ended",i._finishCallback),i._finishCallback=e,i.on("ended",i._finishCallback))},pause:function(t){var e=h(t);return!!e&&(e.pause(),!0)},_pauseIDCache:[],pauseAll:function(){for(var t in o){var e=o[t];e.getState()===n.State.PLAYING&&(this._pauseIDCache.push(t),e.pause())}},resume:function(t){var e=h(t);e&&e.resume()},resumeAll:function(){for(var t=0;t0;){var n=i.pop(),r=o[n];r&&(r.stop(),r.destroy(),delete o[n])}},uncacheAll:function(){for(var t in this.stopAll(),o){var e=o[t];e&&e.destroy()}o={},a={}},getProfile:function(t){},preload:function(t,e){cc.loader.load(t,e&&function(t){t||e()})},setMaxWebAudioSize:function(t){this._maxWebAudioSize=1024*t},_breakCache:null,_break:function(){for(var t in this._breakCache=[],o){var e=o[t];e.getState()===n.State.PLAYING&&(this._breakCache.push(t),e.pause())}},_restore:function(){if(this._breakCache){for(;this._breakCache.length>0;){var t=this._breakCache.pop(),e=h(t);e&&e.resume&&e.resume()}this._breakCache=null}},_music:{id:-1,loop:!1,volume:1},_effect:{volume:1,pauseCache:[]},playMusic:function(t,e){var i=this._music;return this.stop(i.id),i.id=this.play(t,e,i.volume),i.loop=e,i.id},stopMusic:function(){this.stop(this._music.id)},pauseMusic:function(){return this.pause(this._music.id),this._music.id},resumeMusic:function(){return this.resume(this._music.id),this._music.id},getMusicVolume:function(){return this._music.volume},setMusicVolume:function(t){var e=this._music;return e.volume=t,this.setVolume(e.id,e.volume),e.volume},isMusicPlaying:function(){return this.getState(this._music.id)===this.AudioState.PLAYING},playEffect:function(t,e){return this.play(t,e||!1,this._effect.volume)},setEffectsVolume:function(t){var e=this._music.id;for(var i in this._effect.volume=t,o)i!==e&&l.setVolume(i,t)},getEffectsVolume:function(){return this._effect.volume},pauseEffect:function(t){return this.pause(t)},pauseAllEffects:function(){var t=this._music.id,e=this._effect;for(var i in e.pauseCache.length=0,o)if(i!==t){var n=o[i];n.getState()===this.AudioState.PLAYING&&(e.pauseCache.push(i),n.pause())}},resumeEffect:function(t){this.resume(t)},resumeAllEffects:function(){for(var t=this._effect.pauseCache,e=0;e0)for(e.sortAllChildren(),i=0;i0){var n=i.length;e.sortAllChildren();for(var r=0;r=0;--n)o[i]+=s.charCodeAt(i*e+n)<<8*n;return o},cc.Codec.unzipAsArray=function(t,e){e=e||1;var i,n,r,s=this.unzip(t),o=[];for(i=0,r=s.length/e;i=0;--n)o[i]+=s.charCodeAt(i*e+n)<<8*n;return o}}),{"./base64":29,"./gzip":30}],29:[(function(t,e,i){var n=t("../core/utils/misc").BASE64_VALUES,r={name:"Jacob__Codec__Base64",decode:function(t){var e,i,r,s,o,a,c=[],h=0;for(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");h>4,i=(15&s)<<4|(o=n[t.charCodeAt(h++)])>>2,r=(3&o)<<6|(a=n[t.charCodeAt(h++)]),c.push(String.fromCharCode(e)),64!==o&&c.push(String.fromCharCode(i)),64!==a&&c.push(String.fromCharCode(r));return c=c.join("")},decodeAsArray:function(t,e){var i,n,r,s=this.decode(t),o=[];for(i=0,r=s.length/e;i=0;--n)o[i]+=s.charCodeAt(i*e+n)<<8*n;return o}};e.exports=r}),{"../core/utils/misc":228}],30:[(function(t,e,i){var n=function(t){this.data=t,this.debug=!1,this.gpflags=void 0,this.files=0,this.unzipped=[],this.buf32k=new Array(32768),this.bIdx=0,this.modeZIP=!1,this.bytepos=0,this.bb=1,this.bits=0,this.nameBuf=[],this.fileout=void 0,this.literalTree=new Array(n.LITERALS),this.distanceTree=new Array(32),this.treepos=0,this.Places=null,this.len=0,this.fpos=new Array(17),this.fpos[0]=0,this.flens=void 0,this.fmax=void 0};n.gunzip=function(t){return t.constructor===Array||(t.constructor,String),new n(t).gunzip()[0][0]},n.HufNode=function(){this.b0=0,this.b1=0,this.jump=null,this.jumppos=-1},n.LITERALS=288,n.NAMEMAX=256,n.bitReverse=[0,128,64,192,32,160,96,224,16,144,80,208,48,176,112,240,8,136,72,200,40,168,104,232,24,152,88,216,56,184,120,248,4,132,68,196,36,164,100,228,20,148,84,212,52,180,116,244,12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254,1,129,65,193,33,161,97,225,17,145,81,209,49,177,113,241,9,137,73,201,41,169,105,233,25,153,89,217,57,185,121,249,5,133,69,197,37,165,101,229,21,149,85,213,53,181,117,245,13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,3,131,67,195,35,163,99,227,19,147,83,211,51,179,115,243,11,139,75,203,43,171,107,235,27,155,91,219,59,187,123,251,7,135,71,199,39,167,103,231,23,151,87,215,55,183,119,247,15,143,79,207,47,175,111,239,31,159,95,223,63,191,127,255],n.cplens=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],n.cplext=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,99,99],n.cpdist=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],n.cpdext=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],n.border=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],n.prototype.gunzip=function(){return this.outputArr=[],this.nextFile(),this.unzipped},n.prototype.readByte=function(){return this.bits+=8,this.bytepos>=1,0===this.bb&&(this.bb=this.readByte(),t=1&this.bb,this.bb=this.bb>>1|128),t},n.prototype.readBits=function(t){for(var e=0,i=t;i--;)e=e<<1|this.readBit();return t&&(e=n.bitReverse[e]>>8-t),e},n.prototype.flushBuffer=function(){this.bIdx=0},n.prototype.addBuffer=function(t){this.buf32k[this.bIdx++]=t,this.outputArr.push(String.fromCharCode(t)),32768===this.bIdx&&(this.bIdx=0)},n.prototype.IsPat=function(){for(;;){if(this.fpos[this.len]>=this.fmax)return-1;if(this.flens[this.fpos[this.len]]===this.len)return this.fpos[this.len]++;this.fpos[this.len]++}},n.prototype.Rec=function(){var t,e=this.Places[this.treepos];if(17===this.len)return-1;if(this.treepos++,this.len++,(t=this.IsPat())>=0)e.b0=t;else if(e.b0=32768,this.Rec())return-1;if((t=this.IsPat())>=0)e.b1=t,e.jump=null;else if(e.b1=32768,e.jump=this.Places[this.treepos],e.jumppos=this.treepos,this.Rec())return-1;return this.len--,0},n.prototype.CreateTree=function(t,e,i,n){var r;for(this.Places=t,this.treepos=0,this.flens=i,this.fmax=e,r=0;r<17;r++)this.fpos[r]=0;return this.len=0,this.Rec()?-1:0},n.prototype.DecodeValue=function(t){for(var e,i,n=0,r=t[n];;)if(this.readBit()){if(!(32768&r.b1))return r.b1;for(r=r.jump,e=t.length,i=0;i>1)>23?(a=a<<1|this.readBit())>199?a=(a-=128)<<1|this.readBit():(a-=48)>143&&(a+=136):a+=256,a<256)this.addBuffer(a);else{if(256===a)break;for(a-=257,m=this.readBits(n.cplext[a])+n.cplens[a],a=n.bitReverse[this.readBits(5)]>>3,n.cpdext[a]>8?(p=this.readBits(8),p|=this.readBits(n.cpdext[a]-8)<<8):p=this.readBits(n.cpdext[a]),p+=n.cpdist[a],a=0;ac)return this.flushBuffer(),1;for(d=i?_[i-1]:0;a--;)_[i++]=d}else{if(i+(a=17===a?3+this.readBits(3):11+this.readBits(7))>c)return this.flushBuffer(),1;for(;a--;)_[i++]=0}for(m=this.literalTree.length,i=0;i=256){var m,p;if(0===(a-=256))break;for(a--,m=this.readBits(n.cplext[a])+n.cplens[a],a=this.DecodeValue(this.distanceTree),n.cpdext[a]>8?(p=this.readBits(8),p|=this.readBits(n.cpdext[a]-8)<<8):p=this.readBits(n.cpdext[a]),p+=n.cpdist[a];m--;){o=this.buf32k[this.bIdx-p&32767];this.addBuffer(o)}}else this.addBuffer(a)}}while(!t);return this.flushBuffer(),this.byteAlign(),0},n.prototype.unzipFile=function(t){var e;for(this.gunzip(),e=0;e>>0;t=n}for(var r,s=1,o=0,a=t.length,c=0;0>>0}function a(e,i){this.index="number"==typeof i?i:0,this.i=0,this.buffer=e instanceof(s?Uint8Array:Array)?e:new(s?Uint8Array:Array)(32768),2*this.buffer.length<=this.index&&t(Error("invalid index")),this.buffer.length<=this.index&&this.f()}a.prototype.f=function(){var t,e=this.buffer,i=e.length,n=new(s?Uint8Array:Array)(i<<1);if(s)n.set(e);else for(t=0;t>>8&255]<<16|d[t>>>16&255]<<8|d[t>>>24&255])>>32-e:d[t]>>8-e),8>e+o)a=a<>e-n-1&1,8==++o&&(o=0,r[s++]=d[a],a=0,s===r.length&&(r=this.f()));r[s]=a,this.buffer=r,this.i=o,this.index=s},a.prototype.finish=function(){var t,e=this.buffer,i=this.index;return 0c;++c){for(var l=_=c,u=7,_=_>>>1;_;_>>>=1)l<<=1,l|=1&_,--u;h[c]=(l<>>0}var d=h;function f(t){this.buffer=new(s?Uint16Array:Array)(2*t),this.length=0}function m(t){var e,i,n,r,o,a,c,h,l,u=t.length,_=0,d=Number.POSITIVE_INFINITY;for(h=0;h_&&(_=t[h]),t[h]>=1;for(l=a;ls[n]);)r=s[i],s[i]=s[n],s[n]=r,r=s[i+1],s[i+1]=s[n+1],s[n+1]=r,i=n;return this.length},f.prototype.pop=function(){var t,e,i,n,r,s=this.buffer;for(e=s[0],t=s[1],this.length-=2,s[0]=s[this.length],s[1]=s[this.length+1],r=0;!((n=2*r+2)>=this.length)&&(n+2s[n]&&(n+=2),s[n]>s[r]);)i=s[r],s[r]=s[n],s[n]=i,i=s[r+1],s[r+1]=s[n+1],s[n+1]=i,r=n;return{index:t,value:e,length:this.length}};var g,y=2,v={NONE:0,r:1,j:y,N:3},x=[];for(g=0;288>g;g++)switch(i){case 143>=g:x.push([g+48,8]);break;case 255>=g:x.push([g-144+400,9]);break;case 279>=g:x.push([g-256+0,7]);break;case 287>=g:x.push([g-280+192,8]);break;default:t("invalid literal: "+g)}function C(t,e){this.length=t,this.G=e}function T(){var e=A;switch(i){case 3===e:return[257,e-3,0];case 4===e:return[258,e-4,0];case 5===e:return[259,e-5,0];case 6===e:return[260,e-6,0];case 7===e:return[261,e-7,0];case 8===e:return[262,e-8,0];case 9===e:return[263,e-9,0];case 10===e:return[264,e-10,0];case 12>=e:return[265,e-11,1];case 14>=e:return[266,e-13,1];case 16>=e:return[267,e-15,1];case 18>=e:return[268,e-17,1];case 22>=e:return[269,e-19,2];case 26>=e:return[270,e-23,2];case 30>=e:return[271,e-27,2];case 34>=e:return[272,e-31,2];case 42>=e:return[273,e-35,3];case 50>=e:return[274,e-43,3];case 58>=e:return[275,e-51,3];case 66>=e:return[276,e-59,3];case 82>=e:return[277,e-67,4];case 98>=e:return[278,e-83,4];case 114>=e:return[279,e-99,4];case 130>=e:return[280,e-115,4];case 162>=e:return[281,e-131,5];case 194>=e:return[282,e-163,5];case 226>=e:return[283,e-195,5];case 257>=e:return[284,e-227,5];case 258===e:return[285,e-258,0];default:t("invalid length: "+e)}}p.prototype.n=function(){var n,r,o,c,h=this.input;switch(this.h){case 0:for(o=0,c=h.length;o>>8&255,g[v++]=255&_,g[v++]=_>>>8&255,s)g.set(d,v),v+=d.length,g=g.subarray(0,v);else{for(m=0,p=d.length;mJ)for(;0J?J:138)>J-3&&Q=Q?(it[K++]=17,it[K++]=Q-3,nt[17]++):(it[K++]=18,it[K++]=Q-11,nt[18]++),J-=Q;else if(it[K++]=et[H],nt[et[H]]++,3>--J)for(;0J?J:6)>J-3&&QU;U++)Y[U]=z[j[U]];for(B=19;4=A;A++)b=T(),S[A]=b[2]<<24|b[1]<<16|b[0];var E=s?new Uint32Array(S):S;function w(n,r){function o(e,n){var r,s,o,a,c=e.G,h=[],l=0;switch(r=E[e.length],h[l++]=65535&r,h[l++]=r>>16&255,h[l++]=r>>24,i){case 1===c:s=[0,c-1,0];break;case 2===c:s=[1,c-2,0];break;case 3===c:s=[2,c-3,0];break;case 4===c:s=[3,c-4,0];break;case 6>=c:s=[4,c-5,1];break;case 8>=c:s=[5,c-7,1];break;case 12>=c:s=[6,c-9,2];break;case 16>=c:s=[7,c-13,2];break;case 24>=c:s=[8,c-17,3];break;case 32>=c:s=[9,c-25,3];break;case 48>=c:s=[10,c-33,4];break;case 64>=c:s=[11,c-49,4];break;case 96>=c:s=[12,c-65,5];break;case 128>=c:s=[13,c-97,5];break;case 192>=c:s=[14,c-129,6];break;case 256>=c:s=[15,c-193,6];break;case 384>=c:s=[16,c-257,7];break;case 512>=c:s=[17,c-385,7];break;case 768>=c:s=[18,c-513,8];break;case 1024>=c:s=[19,c-769,8];break;case 1536>=c:s=[20,c-1025,9];break;case 2048>=c:s=[21,c-1537,9];break;case 3072>=c:s=[22,c-2049,10];break;case 4096>=c:s=[23,c-3073,10];break;case 6144>=c:s=[24,c-4097,11];break;case 8192>=c:s=[25,c-6145,11];break;case 12288>=c:s=[26,c-8193,12];break;case 16384>=c:s=[27,c-12289,12];break;case 24576>=c:s=[28,c-16385,13];break;case 32768>=c:s=[29,c-24577,13];break;default:t("invalid distance")}for(r=s,h[l++]=r[0],h[l++]=r[1],h[l++]=r[2],o=0,a=h.length;o=h;)x[h++]=0;for(h=0;29>=h;)T[h++]=0}for(x[256]=1,a=0,c=r.length;a=c){for(f&&o(f,-1),h=0,l=c-a;hI&&a+Iw&&(S=b,w=I),258===I)break}d=new C(w,a-S),f?f.length2*v[d-1]+x[d]&&(v[d]=2*v[d-1]+x[d]),T[d]=Array(v[d]),A[d]=Array(v[d]);for(_=0;_r[_]?(T[d][m]=p,A[d][m]=y,g+=2):(T[d][m]=r[_],A[d][m]=_,++_);b[d]=0,1===x[d]&&i(d)}for(o=C,a=0,c=n.length;a1<l&&t("undercommitted"),i=0,n=e.length;i>>=1;return a}function P(t,e){this.input=t,this.a=new(s?Uint8Array:Array)(32768),this.h=O.j;var i,n={};for(i in!e&&(e={})||"number"!=typeof e.compressionType||(this.h=e.compressionType),e)n[i]=e[i];n.outputBuffer=this.a,this.z=new p(this.input,n)}var O=v;function D(e,i){switch(this.k=[],this.l=32768,this.e=this.g=this.c=this.q=0,this.input=s?new Uint8Array(e):e,this.s=!1,this.m=L,this.B=!1,!i&&(i={})||(i.index&&(this.c=i.index),i.bufferSize&&(this.l=i.bufferSize),i.bufferType&&(this.m=i.bufferType),i.resize&&(this.B=i.resize)),this.m){case B:this.b=32768,this.a=new(s?Uint8Array:Array)(32768+this.l+258);break;case L:this.b=0,this.a=new(s?Uint8Array:Array)(this.l),this.f=this.J,this.t=this.H,this.o=this.I;break;default:t(Error("invalid inflate mode"))}}P.prototype.n=function(){var e,i,n,r,a,c,h,l=0;switch(h=this.a,e=lt){case lt:i=Math.LOG2E*Math.log(32768)-8;break;default:t(Error("invalid compression method"))}switch(n=i<<4|e,h[l++]=n,e){case lt:switch(this.h){case O.NONE:a=0;break;case O.r:a=1;break;case O.j:a=2;break;default:t(Error("unsupported compression type"))}break;default:t(Error("invalid compression method"))}return r=a<<6|0,h[l++]=r|31-(256*n+r)%31,c=o(this.input),this.z.b=l,l=(h=this.z.n()).length,s&&((h=new Uint8Array(h.buffer)).length<=l+4&&(this.a=new Uint8Array(h.length+4),this.a.set(h),h=this.a),h=h.subarray(0,l+4)),h[l++]=c>>24&255,h[l++]=c>>16&255,h[l++]=c>>8&255,h[l++]=255&c,h},r("Zlib.Deflate",P),r("Zlib.Deflate.compress",(function(t,e){return new P(t,e).n()})),r("Zlib.Deflate.CompressionType",O),r("Zlib.Deflate.CompressionType.NONE",O.NONE),r("Zlib.Deflate.CompressionType.FIXED",O.r),r("Zlib.Deflate.CompressionType.DYNAMIC",O.j);var B=0,L=1,M={D:B,C:L};D.prototype.p=function(){for(;!this.s;){var n=tt(this,3);switch(1&n&&(this.s=i),n>>>=1){case 0:var r=this.input,o=this.c,a=this.a,c=this.b,h=e,l=e,u=e,_=a.length,d=e;switch(this.e=this.g=0,(h=r[o++])===e&&t(Error("invalid uncompressed block header: LEN (first byte)")),l=h,(h=r[o++])===e&&t(Error("invalid uncompressed block header: LEN (second byte)")),l|=h<<8,(h=r[o++])===e&&t(Error("invalid uncompressed block header: NLEN (first byte)")),u=h,(h=r[o++])===e&&t(Error("invalid uncompressed block header: NLEN (second byte)")),l===~(u|=h<<8)&&t(Error("invalid uncompressed block header: length verify")),o+l>r.length&&t(Error("input buffer is broken")),this.m){case B:for(;c+l>a.length;){if(l-=d=_-c,s)a.set(r.subarray(o,o+d),c),c+=d,o+=d;else for(;d--;)a[c++]=r[o++];this.b=c,a=this.f(),c=this.b}break;case L:for(;c+l>a.length;)a=this.f({v:2});break;default:t(Error("invalid inflate mode"))}if(s)a.set(r.subarray(o,o+l),c),c+=l,o+=l;else for(;l--;)a[c++]=r[o++];this.c=o,this.b=c,this.a=a;break;case 1:this.o(K,$);break;case 2:it(this);break;default:t(Error("unknown BTYPE: "+n))}}return this.t()};var N,F,z=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],k=s?new Uint16Array(z):z,V=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,258,258],G=s?new Uint16Array(V):V,U=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0],W=s?new Uint8Array(U):U,X=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],j=s?new Uint16Array(X):X,Y=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],H=s?new Uint8Array(Y):Y,q=new(s?Uint8Array:Array)(288);for(N=0,F=q.length;N=N?8:255>=N?9:279>=N?7:8;var J,Z,K=m(q),Q=new(s?Uint8Array:Array)(30);for(J=0,Z=Q.length;J>>n,i.e=o-n,i.c=c,r}function et(i,n){for(var r,s,o,a=i.g,c=i.e,h=i.input,l=i.c,u=n[0],_=n[1];c<_;)(r=h[l++])===e&&t(Error("input buffer is broken")),a|=r<>>16,i.g=a>>o,i.e=c-o,i.c=l,65535&s}function it(t){function e(t,e,i){var n,r,s,o;for(o=0;or)n>=c&&(this.b=n,i=this.f(),n=this.b),i[n++]=r;else for(a=G[s=r-257],0=c&&(this.b=n,i=this.f(),n=this.b);a--;)i[n]=i[n++-o];for(;8<=this.e;)this.e-=8,this.c--;this.b=n},D.prototype.I=function(t,e){var i=this.a,n=this.b;this.u=t;for(var r,s,o,a,c=i.length;256!==(r=et(this,t));)if(256>r)n>=c&&(c=(i=this.f()).length),i[n++]=r;else for(a=G[s=r-257],0c&&(c=(i=this.f()).length);a--;)i[n]=i[n++-o];for(;8<=this.e;)this.e-=8,this.c--;this.b=n},D.prototype.f=function(){var t,e,i=new(s?Uint8Array:Array)(this.b-32768),n=this.b-32768,r=this.a;if(s)i.set(r.subarray(32768,i.length));else for(t=0,e=i.length;tt;++t)r[t]=r[n+t];return this.b=32768,r},D.prototype.J=function(t){var e,i,n,r=this.input.length/this.c+1|0,o=this.input,a=this.a;return t&&("number"==typeof t.v&&(r=t.v),"number"==typeof t.F&&(r+=t.F)),2>r?i=(n=(o.length-this.c)/this.u[2]/2*258|0)e&&(this.a.length=e),t=this.a),this.buffer=t},nt.prototype.p=function(){var e,i=this.input;return e=this.A.p(),this.c=this.A.c,this.M&&((i[this.c++]<<24|i[this.c++]<<16|i[this.c++]<<8|i[this.c++])>>>0!==o(e)&&t(Error("invalid adler-32 checksum"))),e},r("Zlib.Inflate",nt),r("Zlib.Inflate.BufferType",M),M.ADAPTIVE=M.C,M.BLOCK=M.D,r("Zlib.Inflate.prototype.decompress",nt.prototype.p);s&&new Uint16Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);s&&new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,258,258]);s&&new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0]);s&&new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577]);s&&new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]);var rt,st,ot=new(s?Uint8Array:Array)(288);for(rt=0,st=ot.length;rt=rt?8:255>=rt?9:279>=rt?7:8;m(ot);var at,ct,ht=new(s?Uint8Array:Array)(30);for(at=0,ct=ht.length;at-1},getValue:function(t,e){this._inited||this._init();var i=this._valueDict;return i[t]?i[t]:e},setValue:function(t,e){this._valueDict[t]=e},gatherGPUInfo:function(){if(cc._renderType!==cc.game.RENDER_TYPE_CANVAS){this._inited||this._init();var t=cc._renderContext,e=this._valueDict;e["gl.vendor"]=t.getParameter(t.VENDOR),e["gl.renderer"]=t.getParameter(t.RENDERER),e["gl.version"]=t.getParameter(t.VERSION),this._GlExtensions="";for(var i=t.getSupportedExtensions(),n=0;n0&&this._deltaTime>1&&(this._deltaTime=1/60)),this._lastUpdate=t},convertToGL:function(t){var e=cc.game.container,i=cc.view,n=e.getBoundingClientRect(),r=n.left+window.pageXOffset-e.clientLeft,s=n.top+window.pageYOffset-e.clientTop,o=i._devicePixelRatio*(t.x-r),a=i._devicePixelRatio*(s+n.height-t.y);return i._isRotated?cc.v2(i._viewportRect.width-a,o):cc.v2(o,a)},convertToUI:function(t){var e=cc.game.container,i=cc.view,n=e.getBoundingClientRect(),r=n.left+window.pageXOffset-e.clientLeft,s=n.top+window.pageYOffset-e.clientTop,o=cc.v2(0,0);return i._isRotated?(o.x=r+t.y/i._devicePixelRatio,o.y=s+n.height-(i._viewPortRect.width-t.x)/i._devicePixelRatio):(o.x=r+t.x*i._devicePixelRatio,o.y=s+n.height-t.y*i._devicePixelRatio),o},_visitScene:function(){if(this._runningScene){var t=cc.renderer;t.childrenOrderDirty?(t.clearRenderCommands(),cc.renderer.assignedZ=0,this._runningScene._renderCmd._curLevel=0,this._runningScene.visit(),t.resetFlag()):t.transformDirty()&&t.transform()}},end:function(){this._purgeDirectorInNextLoop=!0},getContentScaleFactor:function(){return this._contentScaleFactor},getWinSize:function(){return cc.size(this._winSizeInPoints)},getWinSizeInPixels:function(){return cc.size(this._winSizeInPoints.width*this._contentScaleFactor,this._winSizeInPoints.height*this._contentScaleFactor)},getVisibleSize:null,getVisibleOrigin:null,getZEye:null,pause:function(){this._paused||(this._oldAnimationInterval=this._animationInterval,this.setAnimationInterval(.25),this._paused=!0)},popScene:function(){cc.assertID(this._runningScene,1204),this._scenesStack.pop();var t=this._scenesStack.length;0===t?this.end():(this._sendCleanupToScene=!0,this._nextScene=this._scenesStack[t-1])},purgeCachedData:function(){cc.textureCache._clear(),cc.loader.releaseAll()},purgeDirector:function(){this.getScheduler().unscheduleAll(),this._compScheduler.unscheduleAll(),this._nodeActivator.reset(),h&&h.setEnabled(!1),this._runningScene&&(this._runningScene.performRecursive(_ccsg.Node.performType.onExitTransitionDidStart),this._runningScene.performRecursive(_ccsg.Node.performType.onExit),this._runningScene.performRecursive(_ccsg.Node.performType.cleanup),cc.renderer.clearRenderCommands()),this._runningScene=null,this._nextScene=null,this._scenesStack.length=0,this.stopAnimation(),this.purgeCachedData()},reset:function(){this.purgeDirector(),h&&h.setEnabled(!0),this._actionManager&&this._scheduler.scheduleUpdate(this._actionManager,cc.Scheduler.PRIORITY_SYSTEM,!1),this._animationManager&&this._scheduler.scheduleUpdate(this._animationManager,cc.Scheduler.PRIORITY_SYSTEM,!1),this._collisionManager&&this._scheduler.scheduleUpdate(this._collisionManager,cc.Scheduler.PRIORITY_SYSTEM,!1),this._physicsManager&&this._scheduler.scheduleUpdate(this._physicsManager,cc.Scheduler.PRIORITY_SYSTEM,!1),this.startAnimation()},pushScene:function(t){cc.assertID(t,1205),this._sendCleanupToScene=!1,this._scenesStack.push(t),this._nextScene=t},runSceneImmediate:function(t,e,i){t instanceof cc.Scene&&t._load();for(var n=cc.game,r=Object.keys(n._persistRootNodes).map((function(t){return n._persistRootNodes[t]})),o=0;oi)){for(;i>t;){var n=e.pop();n.running&&(n.performRecursive(_ccsg.Node.performType.onExitTransitionDidStart),n.performRecursive(_ccsg.Node.performType.onExit)),n.performRecursive(_ccsg.Node.performType.cleanup),i--}this._nextScene=e[e.length-1],this._sendCleanupToScene=!0}}else this.end()},getScheduler:function(){return this._scheduler},setScheduler:function(t){this._scheduler!==t&&(this._scheduler=t)},getActionManager:function(){return this._actionManager},setActionManager:function(t){this._actionManager!==t&&(this._actionManager&&this._scheduler.unscheduleUpdate(this._actionManager),this._actionManager=t,this._scheduler.scheduleUpdate(this._actionManager,cc.Scheduler.PRIORITY_SYSTEM,!1))},getAnimationManager:function(){return this._animationManager},getCollisionManager:function(){return this._collisionManager},getPhysicsManager:function(){return this._physicsManager},getDeltaTime:function(){return this._deltaTime}}),cc.js.addon(cc.Director.prototype,n.prototype),cc.Director.EVENT_PROJECTION_CHANGED="director_projection_changed",cc.Director.EVENT_BEFORE_SCENE_LOADING="director_before_scene_loading",cc.Director.EVENT_BEFORE_SCENE_LAUNCH="director_before_scene_launch",cc.Director.EVENT_AFTER_SCENE_LAUNCH="director_after_scene_launch",cc.Director.EVENT_BEFORE_UPDATE="director_before_update",cc.Director.EVENT_AFTER_UPDATE="director_after_update",cc.Director.EVENT_BEFORE_VISIT="director_before_visit",cc.Director.EVENT_AFTER_VISIT="director_after_visit",cc.Director.EVENT_AFTER_DRAW="director_after_draw",cc.DisplayLinkDirector=cc.Director.extend({invalid:!1,startAnimation:function(){this._nextDeltaTimeZero=!0,this.invalid=!1},mainLoop:function(){this._purgeDirectorInNextLoop?(this._purgeDirectorInNextLoop=!1,this.purgeDirector()):this.invalid||(this.calculateDeltaTime(),this._paused||(this.emit(cc.Director.EVENT_BEFORE_UPDATE),this._compScheduler.startPhase(),this._compScheduler.updatePhase(this._deltaTime),this._scheduler.update(this._deltaTime),this._compScheduler.lateUpdatePhase(this._deltaTime),this.emit(cc.Director.EVENT_AFTER_UPDATE),cc.Object._deferredDestroy()),this._nextScene&&this.setNextScene(),this.emit(cc.Director.EVENT_BEFORE_VISIT),this._visitScene(),this.emit(cc.Director.EVENT_AFTER_VISIT),cc.g_NumberOfDraws=0,cc.renderer.clear(),cc.renderer.rendering(cc._renderContext),this._totalFrames++,this.emit(cc.Director.EVENT_AFTER_DRAW),h.frameUpdateListeners())},stopAnimation:function(){this.invalid=!0},setAnimationInterval:function(t){this._animationInterval=t,this.invalid||(this.stopAnimation(),this.startAnimation())},__fastOn:function(t,e,i){var n=this._bubblingListeners;n||(n=this._bubblingListeners=new c),n.add(t,e,i),this._addEventFlag(t,n,!1)},__fastOff:function(t,e,i){var n=this._bubblingListeners;n&&(n.remove(t,e,i),this._purgeEventFlag(t,n,!1))}}),cc.Director.sharedDirector=null,cc.Director.firstUseDirector=!0,cc.Director._getInstance=function(){return cc.Director.firstUseDirector&&(cc.Director.firstUseDirector=!1,cc.Director.sharedDirector=new cc.DisplayLinkDirector,cc.Director.sharedDirector.init()),cc.Director.sharedDirector},cc.defaultFPS=60,cc.Director.PROJECTION_2D=0,cc.Director.PROJECTION_3D=1,cc.Director.PROJECTION_CUSTOM=3,cc.Director.PROJECTION_DEFAULT=cc.Director.PROJECTION_2D}),{"./component-scheduler":72,"./event-manager":112,"./event/event-listeners":113,"./event/event-target":114,"./load-pipeline/auto-release-utils":136,"./node-activator":149,"./platform/_CCClass":190}],34:[(function(t,e,i){t("./CCDirector"),t("./CCGame");var n=t("./event-manager");cc.game.once(cc.game.EVENT_RENDERER_INITED,(function(){if(cc._renderType===cc.game.RENDER_TYPE_CANVAS){var t=cc.Director.prototype;t.getProjection=function(t){return this._projection},t.setProjection=function(t){this._projection=t,this.emit(cc.Director.EVENT_PROJECTION_CHANGED,this)},t.setDepthTest=function(){},t.setClearColor=function(t){cc.renderer._clearColor=t,cc.renderer._clearFillStyle="rgb("+t.r+","+t.g+","+t.b+")"},t.setOpenGLView=function(t){this._winSizeInPoints.width=cc._canvas.width,this._winSizeInPoints.height=cc._canvas.height,this._openGLView=t||cc.view,n&&n.setEnabled(!0)},t.getVisibleSize=function(){return this.getWinSize()},t.getVisibleOrigin=function(){return cc.p(0,0)}}}))}),{"./CCDirector":33,"./CCGame":39,"./event-manager":112}],35:[(function(t,e,i){t("./CCDirector"),t("./CCGame"),t("../kazmath");var n=t("./event-manager"),r=cc.math;cc.game.once(cc.game.EVENT_RENDERER_INITED,(function(){if(cc._renderType===cc.game.RENDER_TYPE_WEBGL){cc.DirectorDelegate=cc._Class.extend({updateProjection:function(){}});var t=cc.Director.prototype,e=function(t){if(t&&t._renderCmd){t._renderCmd.setDirtyFlag(_ccsg.Node._dirtyFlags.transformDirty);var i,n=t._children;for(i=0;i0?cc.loader.load(s,(function(i){if(i)throw new Error(JSON.stringify(i));e._prepared=!0,t&&t(),e.emit(e.EVENT_GAME_INITED)})):(t&&t(),e.emit(e.EVENT_GAME_INITED))}else cc.initEngine(this.config,(function(){e.prepare(t)}))}else this._loadConfig((function(){e.prepare(t)}))},run:function(t,e){"function"==typeof t?o.onStart=t:(t&&(o.config=t),"function"==typeof e&&(o.onStart=e)),this.prepare(o.onStart&&o.onStart.bind(o))},addPersistRootNode:function(t){if(cc.Node.isNode(t)&&t.uuid){var e=t.uuid;if(!this._persistRootNodes[e]){var i=cc.director._scene;if(cc.isValid(i)){if(t.parent){if(!(t.parent instanceof cc.Scene))return void cc.warnID(3801);if(t.parent!==i)return void cc.warnID(3802)}else t.parent=i;this._persistRootNodes[e]=t,t._persistNode=!0}}}else cc.warnID(3800)},removePersistRootNode:function(t){if(t!==this._ignoreRemovePersistNode){var e=t.uuid||"";t===this._persistRootNodes[e]&&(delete this._persistRootNodes[e],t._persistNode=!1)}},isPersistRootNode:function(t){return t._persistNode},_setAnimFrame:function(){this._lastTime=new Date;var t=o.config[o.CONFIG_KEY.frameRate];this._frameTime=1e3/t,60!==t&&30!==t?(window.requestAnimFrame=this._stTime,window.cancelAnimFrame=this._ctTime):(window.requestAnimFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||this._stTime,window.cancelAnimFrame=window.cancelAnimationFrame||window.cancelRequestAnimationFrame||window.msCancelRequestAnimationFrame||window.mozCancelRequestAnimationFrame||window.oCancelRequestAnimationFrame||window.webkitCancelRequestAnimationFrame||window.msCancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.oCancelAnimationFrame||this._ctTime)},_stTime:function(t){var e=(new Date).getTime(),i=Math.max(0,o._frameTime-(e-o._lastTime)),n=window.setTimeout((function(){t()}),i);return o._lastTime=e+i,n},_ctTime:function(t){window.clearTimeout(t)},_runMainLoop:function(){var t,e=this,i=e.config,n=e.CONFIG_KEY,r=cc.director,s=!0,o=i[n.frameRate];r.setDisplayStats(i[n.showFPS]),t=function(){if(!e._paused){if(e._intervalId=window.requestAnimFrame(t),30===o&&(s=!s))return;r.mainLoop()}},e._intervalId=window.requestAnimFrame(t),e._paused=!1},_loadConfig:function(t){if(this.config)return this._initConfig(this.config),void(t&&t());if(document.ccConfig)return this._initConfig(document.ccConfig),void(t&&t());var e=this;cc.loader.load("project.json",(function(i,n){i&&cc.logID(3818),e._initConfig(n||{}),t&&t()}))},_initConfig:function(t){var e=this.CONFIG_KEY;"number"!=typeof t[e.debugMode]&&(t[e.debugMode]=0),t[e.exposeClassName]=!!t[e.exposeClassName],"number"!=typeof t[e.frameRate]&&(t[e.frameRate]=60),"number"!=typeof t[e.renderMode]&&(t[e.renderMode]=0),"boolean"!=typeof t[e.registerSystemEvent]&&(t[e.registerSystemEvent]=!0),t[e.showFPS]=!(e.showFPS in t)||!!t[e.showFPS],this._sceneInfos=t[e.scenes]||[],this.collisionMatrix=t.collisionMatrix||[],this.groupList=t.groupList||[],cc._initDebugSetting(t[e.debugMode]),this.config=t,this._configLoaded=!0},_initRenderer:function(t,e){if(!this._rendererInitialized){if(!cc._supportRender)throw new Error(cc._getError(3820,this.config[this.CONFIG_KEY.renderMode]));var i,n,r=this.config[o.CONFIG_KEY.id],s=window,a=cc.sys.platform===cc.sys.WECHAT_GAME,c=cc.sys.platform===cc.sys.QQ_PLAY;if(a)this.container=cc.container=n=document.createElement("DIV"),this.frame=n.parentNode===document.body?document.documentElement:n.parentNode,i=cc.sys.browserType===cc.sys.BROWSER_TYPE_WECHAT_GAME_SUB?wx.getSharedCanvas():canvas,this.canvas=cc._canvas=i;else if(c)this.container=cc.container=document.createElement("DIV"),this.frame=document.documentElement,this.canvas=cc._canvas=i=canvas;else{var h=r instanceof HTMLElement?r:document.querySelector(r)||document.querySelector("#"+r);"CANVAS"===h.tagName?(t=t||h.width,e=e||h.height,this.canvas=cc._canvas=i=h,this.container=cc.container=n=document.createElement("DIV"),i.parentNode&&i.parentNode.insertBefore(n,i)):("DIV"!==h.tagName&&cc.warnID(3819),t=t||h.clientWidth,e=e||h.clientHeight,this.canvas=cc._canvas=i=document.createElement("CANVAS"),this.container=cc.container=n=document.createElement("DIV"),h.appendChild(n)),n.setAttribute("id","Cocos2dGameContainer"),n.appendChild(i),this.frame=n.parentNode===document.body?document.documentElement:n.parentNode,(function(t,e){(" "+t.className+" ").indexOf(" "+e+" ")>-1||(t.className&&(t.className+=" "),t.className+=e)})(i,"gameCanvas"),i.setAttribute("width",t||480),i.setAttribute("height",e||320),i.setAttribute("tabindex",99)}if(cc._renderType===o.RENDER_TYPE_WEBGL){var l={stencil:!0,antialias:cc.macro.ENABLE_WEBGL_ANTIALIAS,alpha:cc.macro.ENABLE_TRANSPARENT_CANVAS};a&&(l.preserveDrawingBuffer=!0),this._renderContext=cc._renderContext=cc.webglContext=cc.create3DContext(i,l)}this._renderContext?(cc.renderer=cc.rendererWebGL,s.gl=this._renderContext,cc.renderer.init()):(cc._renderType=o.RENDER_TYPE_CANVAS,cc.renderer=cc.rendererCanvas,cc.renderer.init(),this._renderContext=cc._renderContext=new cc.CanvasContextWrapper(i.getContext("2d"))),cc._gameDiv=n,o.canvas.oncontextmenu=function(){if(!cc._isContextMenuEnable)return!1},this.emit(this.EVENT_RENDERER_INITED,!0),this._rendererInitialized=!0}},_initEvents:function(){var t,e=window;this.config[this.CONFIG_KEY.registerSystemEvent]&&s.registerSystemEvent(this.canvas),void 0!==document.hidden?t="hidden":void 0!==document.mozHidden?t="mozHidden":void 0!==document.msHidden?t="msHidden":void 0!==document.webkitHidden&&(t="webkitHidden");var i=!1;function n(){i||(i=!0,o.emit(o.EVENT_HIDE,o))}function r(){i&&(i=!1,o.emit(o.EVENT_SHOW,o))}if(t)for(var a=["visibilitychange","mozvisibilitychange","msvisibilitychange","webkitvisibilitychange","qbrowserVisibilityChange"],c=0;c-1&&(e.onfocus=r),"onpageshow"in window&&"onpagehide"in window&&(e.addEventListener("pagehide",n),e.addEventListener("pageshow",r),document.addEventListener("pagehide",n),document.addEventListener("pageshow",r)),this.on(o.EVENT_HIDE,(function(){o.pause()})),this.on(o.EVENT_SHOW,(function(){o.resume()}))}};r.call(o),cc.js.addon(o,r.prototype),cc.game=e.exports=o}),{"../audio/CCAudioEngine":23,"./event/event-target":114,"./platform/BKInputManager":176,"./platform/CCInputManager":182,"./platform/CCView":188}],40:[(function(t,e,i){"use strict";var n=t("./utils/prefab-helper"),r=t("./utils/scene-graph-helper"),s=t("./event-manager"),o=cc.Object.Flags,a=o.Destroying,c=t("./utils/misc"),h=(t("./event/event"),!!cc.ActionManager),l=function(){},u=cc.Enum({TOUCH_START:"touchstart",TOUCH_MOVE:"touchmove",TOUCH_END:"touchend",TOUCH_CANCEL:"touchcancel",MOUSE_DOWN:"mousedown",MOUSE_MOVE:"mousemove",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_UP:"mouseup",MOUSE_WHEEL:"mousewheel"}),_=[u.TOUCH_START,u.TOUCH_MOVE,u.TOUCH_END,u.TOUCH_CANCEL],d=[u.MOUSE_DOWN,u.MOUSE_ENTER,u.MOUSE_MOVE,u.MOUSE_LEAVE,u.MOUSE_UP,u.MOUSE_WHEEL],f=null,m=function(t,e){var i=t.getLocation(),n=this.owner;return!!n._hitTest(i,this)&&(e.type=u.TOUCH_START,e.touch=t,e.bubbles=!0,n.dispatchEvent(e),!0)},p=function(t,e){var i=this.owner;e.type=u.TOUCH_MOVE,e.touch=t,e.bubbles=!0,i.dispatchEvent(e)},g=function(t,e){var i=t.getLocation(),n=this.owner;n._hitTest(i,this)?e.type=u.TOUCH_END:e.type=u.TOUCH_CANCEL,e.touch=t,e.bubbles=!0,n.dispatchEvent(e)},y=function(t,e){t.getLocation();var i=this.owner;e.type=u.TOUCH_CANCEL,e.touch=t,e.bubbles=!0,i.dispatchEvent(e)},v=function(t){var e=t.getLocation(),i=this.owner;i._hitTest(e,this)&&(t.type=u.MOUSE_DOWN,t.bubbles=!0,i.dispatchEvent(t),t.stopPropagation())},x=function(t){var e=t.getLocation(),i=this.owner,n=i._hitTest(e,this);if(n)this._previousIn||(f&&(t.type=u.MOUSE_LEAVE,f.dispatchEvent(t),f._mouseListener._previousIn=!1),f=this.owner,t.type=u.MOUSE_ENTER,i.dispatchEvent(t),this._previousIn=!0),t.type=u.MOUSE_MOVE,t.bubbles=!0,i.dispatchEvent(t);else{if(!this._previousIn)return;t.type=u.MOUSE_LEAVE,i.dispatchEvent(t),this._previousIn=!1,f=null}t.stopPropagation()},C=function(t){var e=t.getLocation(),i=this.owner;i._hitTest(e,this)&&(t.type=u.MOUSE_UP,t.bubbles=!0,i.dispatchEvent(t),t.stopPropagation())},T=function(t){var e=t.getLocation(),i=this.owner;i._hitTest(e,this)&&(t.type=u.MOUSE_WHEEL,t.bubbles=!0,i.dispatchEvent(t),t.stopPropagation())};function A(t){var e=cc.Mask;if(e)for(var i=0,n=t;n&&cc.Node.isNode(n);n=n._parent,++i)if(n.getComponent(e))return{index:i,node:n};return null}var b=cc.Class({name:"cc.Node",extends:t("./utils/base-node"),properties:{_opacity:255,_color:cc.Color.WHITE,_cascadeOpacityEnabled:!0,_anchorPoint:cc.p(.5,.5),_contentSize:cc.size(0,0),_rotationX:0,_rotationY:0,_scaleX:1,_scaleY:1,_position:cc.p(0,0),_skewX:0,_skewY:0,_localZOrder:0,_globalZOrder:0,_opacityModifyRGB:!1,groupIndex:{default:0,type:cc.Integer},group:{get:function(){return cc.game.groupList[this.groupIndex]||""},set:function(t){this.groupIndex=cc.game.groupList.indexOf(t),this.emit("group-changed")}},x:{get:function(){return this._position.x},set:function(t){var e=this._position;if(t!==e.x){e.x=t,this._sgNode.setPositionX(t);var i=this._hasListenerCache;i&&i["position-changed"]&&this.emit("position-changed")}}},y:{get:function(){return this._position.y},set:function(t){var e=this._position;if(t!==e.y){e.y=t,this._sgNode.setPositionY(t);var i=this._hasListenerCache;i&&i["position-changed"]&&this.emit("position-changed")}}},rotation:{get:function(){return this._rotationX!==this._rotationY&&cc.logID(1602),this._rotationX},set:function(t){if(this._rotationX!==t||this._rotationY!==t){this._rotationX=this._rotationY=t,this._sgNode.rotation=t;var e=this._hasListenerCache;e&&e["rotation-changed"]&&this.emit("rotation-changed")}}},rotationX:{get:function(){return this._rotationX},set:function(t){if(this._rotationX!==t){this._rotationX=t,this._sgNode.rotationX=t;var e=this._hasListenerCache;e&&e["rotation-changed"]&&this.emit("rotation-changed")}}},rotationY:{get:function(){return this._rotationY},set:function(t){if(this._rotationY!==t){this._rotationY=t,this._sgNode.rotationY=t;var e=this._hasListenerCache;e&&e["rotation-changed"]&&this.emit("rotation-changed")}}},scaleX:{get:function(){return this._scaleX},set:function(t){if(this._scaleX!==t){this._scaleX=t,this._sgNode.scaleX=t;var e=this._hasListenerCache;e&&e["scale-changed"]&&this.emit("scale-changed")}}},scaleY:{get:function(){return this._scaleY},set:function(t){if(this._scaleY!==t){this._scaleY=t,this._sgNode.scaleY=t;var e=this._hasListenerCache;e&&e["scale-changed"]&&this.emit("scale-changed")}}},skewX:{get:function(){return this._skewX},set:function(t){this._skewX=t,this._sgNode.skewX=t}},skewY:{get:function(){return this._skewY},set:function(t){this._skewY=t,this._sgNode.skewY=t}},opacity:{get:function(){return this._opacity},set:function(t){if(this._opacity!==t&&(this._opacity=t,this._sgNode.setOpacity(t),!this._cascadeOpacityEnabled)){var e=this._sizeProvider;e instanceof _ccsg.Node&&e!==this._sgNode&&e.setOpacity(t)}},range:[0,255]},cascadeOpacity:{get:function(){return this._cascadeOpacityEnabled},set:function(t){if(this._cascadeOpacityEnabled!==t){this._cascadeOpacityEnabled=t,this._sgNode.cascadeOpacity=t;var e=t?255:this._opacity,i=this._sizeProvider;i instanceof _ccsg.Node&&i.setOpacity(e)}}},color:{get:function(){return this._color.clone()},set:function(t){this._color.equals(t)||(this._color.fromColor(t),this._sizeProvider instanceof _ccsg.Node&&this._sizeProvider.setColor(t))}},anchorX:{get:function(){return this._anchorPoint.x},set:function(t){var e=this._anchorPoint;if(e.x!==t){e.x=t;var i=this._sizeProvider;i instanceof _ccsg.Node&&i.setAnchorPoint(e),this.emit("anchor-changed")}}},anchorY:{get:function(){return this._anchorPoint.y},set:function(t){var e=this._anchorPoint;if(e.y!==t){e.y=t;var i=this._sizeProvider;i instanceof _ccsg.Node&&i.setAnchorPoint(e),this.emit("anchor-changed")}}},width:{get:function(){if(this._sizeProvider){var t=this._sizeProvider._getWidth();return this._contentSize.width=t,t}return this._contentSize.width},set:function(t){if(t!==this._contentSize.width){var e=this._sizeProvider;e&&e.setContentSize(t,e._getHeight()),this._contentSize.width=t,this.emit("size-changed")}}},height:{get:function(){if(this._sizeProvider){var t=this._sizeProvider._getHeight();return this._contentSize.height=t,t}return this._contentSize.height},set:function(t){if(t!==this._contentSize.height){var e=this._sizeProvider;e&&e.setContentSize(e._getWidth(),t),this._contentSize.height=t,this.emit("size-changed")}}},zIndex:{get:function(){return this._localZOrder},set:function(t){this._localZOrder!==t&&(this._localZOrder=t,this._sgNode.zIndex=t,this._parent&&(function(t){t._parent._delaySort(),s._setDirtyForNode(t)})(this))}}},ctor:function(t){var e=this._sgNode=new _ccsg.Node;cc.game._isCloning||(e.cascadeOpacity=!0),this._sizeProvider=null,this._reorderChildDirty=!1,this._widget=null,this._touchListener=null,this._mouseListener=null},statics:{isNode:function(t){return t instanceof b&&(t.constructor===b||!(t instanceof cc.Scene))}},_onSetParent:function(t){var e=this._sgNode;e.parent&&e.parent.removeChild(e,!1),t&&(t._sgNode.addChild(e),t._delaySort())},_onSiblingIndexChanged:function(t){var e=this._parent,i=e._children,n=0,r=i.length;for(0;n=0&&c>=0&&l>=0&&h>=0){if(e&&e.mask){for(var u=e.mask,_=this,d=0;_&&d1){var e,i,n,r=t.length;for(e=1;e=0;){if(n._localZOrder0,this._repeat=r,this._runForever=this._repeat===cc.macro.REPEAT_FOREVER,!0},l.getInterval=function(){return this._interval},l.setInterval=function(t){this._interval=t},l.update=function(t){-1===this._elapsed?(this._elapsed=0,this._timesExecuted=0):(this._elapsed+=t,this._runForever&&!this._useDelay?this._elapsed>=this._interval&&(this.trigger(),this._elapsed=0):(this._useDelay?this._elapsed>=this._delay&&(this.trigger(),this._elapsed-=this._delay,this._timesExecuted+=1,this._useDelay=!1):this._elapsed>=this._interval&&(this.trigger(),this._elapsed=0,this._timesExecuted+=1),this._callback&&!this._runForever&&this._timesExecuted>this._repeat&&this.cancel()))},l.getCallback=function(){return this._callback},l.trigger=function(){this._target&&this._callback&&(this._lock=!0,this._callback.call(this._target,this._elapsed),this._lock=!1)},l.cancel=function(){this._scheduler.unschedule(this._callback,this._target)};var u=[];h.get=function(){return u.pop()||new h},h.put=function(t){u.length<20&&!t._lock&&(t._scheduler=t._target=t._callback=null,u.push(t))};var _=function(t){return t.__instanceId||t.uuid};cc.Scheduler=cc._Class.extend({ctor:function(){this._timeScale=1,this._updatesNegList=[],this._updates0List=[],this._updatesPosList=[],this._hashForUpdates={},this._hashForTimers={},this._currentTarget=null,this._currentTargetSalvaged=!1,this._updateHashLocked=!1,this._arrayForTimers=[]},_removeHashElement:function(t){delete this._hashForTimers[_(t.target)];for(var e=this._arrayForTimers,i=0,n=e.length;i=s&&n.timerIndex--,void(0===r.length&&(this._currentTarget===n?this._currentTargetSalvaged=!0:this._removeHashElement(n)))}}},unscheduleUpdate:function(t){if(t){var e=_(t);cc.assertID(e,1510);var i=this._hashForUpdates[e];i&&(this._updateHashLocked?i.entry.markedForDeletion=!0:this._removeUpdateFromHash(i.entry))}},unscheduleAllForTarget:function(t){if(t){var e=_(t);cc.assertID(e,1510);var i=this._hashForTimers[e];if(i){var n=i.timers;n.indexOf(i.currentTimer)>-1&&!i.currentTimerSalvaged&&(i.currentTimerSalvaged=!0);for(var r=0,s=n.length;r=0;e--)i=r[e],this.unscheduleAllForTarget(i.target);var s=0;if(t<0)for(e=0;e=t&&this.unscheduleUpdate(n.target),s==this._updatesNegList.length&&e++;if(t<=0)for(e=0;e=t&&this.unscheduleUpdate(n.target),s==this._updatesPosList.length&&e++},isScheduled:function(t,e){cc.assertID(t,1508),cc.assertID(e,1509);var i=_(e);cc.assertID(i,1510);var n=this._hashForTimers[i];if(!n)return!1;if(null==n.timers)return!1;for(var r=n.timers,s=0;s=t&&(r.paused=!0,s.push(r.target));if(t<=0)for(i=0;i=t&&(r.paused=!0,s.push(r.target));return s},resumeTargets:function(t){if(t)for(var e=0;e=r.OptimizationPolicyThreshold)?(t=this._doInstantiate(),this.data._instantiate(t)):(this.data._prefab._synced=!0,t=this.data._instantiate()),++this._instantiatedTimes,t}});cc.Prefab=e.exports=r,cc.js.obsolete(cc,"cc._Prefab","Prefab")}),{"../platform/instantiate-jit":197}],50:[(function(t,e,i){var n=t("../platform/CCObject"),r=t("../platform/js");cc.RawAsset=cc.Class({name:"cc.RawAsset",extends:n,ctor:function(){Object.defineProperty(this,"_uuid",{value:"",writable:!0})}}),r.value(cc.RawAsset,"isRawAssetType",(function(t){return cc.isChildClassOf(t,cc.RawAsset)&&!cc.isChildClassOf(t,cc.Asset)})),r.value(cc.RawAsset,"wasRawAssetType",(function(t){return t===cc.Texture2D||t===cc.AudioClip||t===cc.ParticleAsset||t===cc.Asset})),e.exports=cc.RawAsset}),{"../platform/CCObject":184,"../platform/js":199}],51:[(function(t,e,i){var n=cc.Class({name:"cc.SceneAsset",extends:cc.Asset,properties:{scene:null,asyncLoadAssets:void 0}});cc.SceneAsset=n,e.exports=n}),{}],52:[(function(t,e,i){var n=cc.Class({name:"cc.Script",extends:cc.Asset});cc._Script=n;var r=cc.Class({name:"cc.JavaScript",extends:n});cc._JavaScript=r;var s=cc.Class({name:"cc.CoffeeScript",extends:n});cc._CoffeeScript=s;var o=cc.Class({name:"cc.TypeScript",extends:n});cc._TypeScript=o}),{}],53:[(function(t,e,i){var n=cc.Class({name:"cc.SpriteAtlas",extends:cc.Asset,properties:{_spriteFrames:{default:{}}},getTexture:function(){var t=Object.keys(this._spriteFrames);if(t.length>0){var e=this._spriteFrames[t[0]];return e?e.getTexture():null}return null},getSpriteFrame:function(t){var e=this._spriteFrames[t];return e?(e.name||(e.name=t),e):null},getSpriteFrames:function(){var t=[],e=this._spriteFrames;for(var i in e)t.push(this.getSpriteFrame(i));return t}});cc.SpriteAtlas=n,e.exports=n}),{}],54:[(function(t,e,i){var n=cc.Class({name:"cc.TTFFont",extends:cc.Font,statics:{preventPreloadNativeObject:!0}});cc.TTFFont=e.exports=n}),{}],55:[(function(t,e,i){var n=cc.Class({name:"cc.TextAsset",extends:cc.Asset,properties:{text:""},toString:function(){return this.text}});e.exports=cc.TextAsset=n}),{}],56:[(function(t,e,i){t("./CCRawAsset"),t("./CCAsset"),t("./CCFont"),t("./CCPrefab"),t("./CCAudioClip"),t("./CCScripts"),t("./CCSceneAsset"),t("../sprites/CCSpriteFrame"),t("../textures/CCTexture2D"),t("./CCTTFFont"),t("./CCSpriteAtlas"),t("./CCBitmapFont"),t("./CCLabelAtlas"),t("./CCTextAsset"),t("./CCJsonAsset")}),{"../sprites/CCSpriteFrame":217,"../textures/CCTexture2D":218,"./CCAsset":43,"./CCAudioClip":44,"./CCBitmapFont":45,"./CCFont":46,"./CCJsonAsset":47,"./CCLabelAtlas":48,"./CCPrefab":49,"./CCRawAsset":50,"./CCSceneAsset":51,"./CCScripts":52,"./CCSpriteAtlas":53,"./CCTTFFont":54,"./CCTextAsset":55}],57:[(function(t,e,i){var n=t("../utils/misc"),r=t("../event-manager"),s=!!cc.ActionManager,o=function(){};cc.s_globalOrderOfArrival=1,_ccsg.Node=cc.Class({name:"ccsg.Node",properties:{_running:!1,_localZOrder:0,_globalZOrder:0,_arrivalOrder:0,_reorderChildDirty:!1,_vertexZ:0,_customZ:void 0,_rotationX:0,_rotationY:0,_scaleX:1,_scaleY:1,_position:cc.p(0,0),_skewX:0,_skewY:0,_children:[],_visible:!0,_anchorPoint:cc.p(0,0),_contentSize:cc.size(0,0),_parent:null,_ignoreAnchorPointForPosition:!1,tag:cc.macro.NODE_TAG_INVALID,_name:"",_realOpacity:255,_realColor:cc.Color.WHITE,_cascadeColorEnabled:!1,_cascadeOpacityEnabled:!1,_isTransitionFinished:!1,_actionManager:null,_scheduler:null,_renderCmd:null},ctor:function(){this.__instanceId=cc.ClassManager.getNewInstanceId(),this._renderCmd=this._createRenderCmd()},init:function(){return!0},attr:function(t){for(var e in t)this[e]=t[e]},getSkewX:function(){return this._skewX},setSkewX:function(t){this._skewX=t,this._renderCmd.setDirtyFlag(_ccsg.Node._dirtyFlags.transformDirty)},getSkewY:function(){return this._skewY},setSkewY:function(t){this._skewY=t,this._renderCmd.setDirtyFlag(_ccsg.Node._dirtyFlags.transformDirty)},setLocalZOrder:function(t){this._parent?this._parent.reorderChild(this,t):this._localZOrder=t,r._setDirtyForNode(this)},_setLocalZOrder:function(t){this._localZOrder=t},getLocalZOrder:function(){return this._localZOrder},getZOrder:function(){return cc.logID(1600),this.getLocalZOrder()},setZOrder:function(t){cc.logID(1601),this.setLocalZOrder(t)},setGlobalZOrder:function(t){this._globalZOrder!==t&&(this._globalZOrder=t,r._setDirtyForNode(this))},getGlobalZOrder:function(){return this._globalZOrder},getVertexZ:function(){return this._vertexZ},setVertexZ:function(t){this._customZ=this._vertexZ=t},getRotation:function(){return this._rotationX!==this._rotationY&&cc.logID(1602),this._rotationX},setRotation:function(t){this._rotationX=this._rotationY=t,this._renderCmd.setDirtyFlag(_ccsg.Node._dirtyFlags.transformDirty)},getRotationX:function(){return this._rotationX},setRotationX:function(t){this._rotationX=t,this._renderCmd.setDirtyFlag(_ccsg.Node._dirtyFlags.transformDirty)},getRotationY:function(){return this._rotationY},setRotationY:function(t){this._rotationY=t,this._renderCmd.setDirtyFlag(_ccsg.Node._dirtyFlags.transformDirty)},getScale:function(){return this._scaleX!==this._scaleY&&cc.logID(1603),this._scaleX},setScale:function(t,e){this._scaleX=t,this._scaleY=e||0===e?e:t,this._renderCmd.setDirtyFlag(_ccsg.Node._dirtyFlags.transformDirty)},getScaleX:function(){return this._scaleX},setScaleX:function(t){this._scaleX=t,this._renderCmd.setDirtyFlag(_ccsg.Node._dirtyFlags.transformDirty)},getScaleY:function(){return this._scaleY},setScaleY:function(t){this._scaleY=t,this._renderCmd.setDirtyFlag(_ccsg.Node._dirtyFlags.transformDirty)},setPosition:function(t,e){var i=this._position;if(void 0===e){if(i.x===t.x&&i.y===t.y)return;i.x=t.x,i.y=t.y}else{if(i.x===t&&i.y===e)return;i.x=t,i.y=e}this._renderCmd.setDirtyFlag(_ccsg.Node._dirtyFlags.transformDirty)},getPosition:function(){return cc.p(this._position)},getPositionX:function(){return this._position.x},setPositionX:function(t){this._position.x=t,this._renderCmd.setDirtyFlag(_ccsg.Node._dirtyFlags.transformDirty)},getPositionY:function(){return this._position.y},setPositionY:function(t){this._position.y=t,this._renderCmd.setDirtyFlag(_ccsg.Node._dirtyFlags.transformDirty)},getChildrenCount:function(){return this._children.length},getChildren:function(){return this._children},isVisible:function(){return this._visible},setVisible:function(t){this._visible!==t&&(this._visible=t,this._renderCmd.setDirtyFlag(_ccsg.Node._dirtyFlags.transformDirty),cc.renderer.childrenOrderDirty=!0)},getAnchorPoint:function(){return cc.p(this._anchorPoint)},setAnchorPoint:function(t,e){var i=this._anchorPoint;if(void 0===e){if(t.x===i.x&&t.y===i.y)return;i.x=t.x,i.y=t.y}else{if(t===i.x&&e===i.y)return;i.x=t,i.y=e}this._renderCmd._updateAnchorPointInPoint()},_getAnchorX:function(){return this._anchorPoint.x},_setAnchorX:function(t){this._anchorPoint.x!==t&&(this._anchorPoint.x=t,this._renderCmd._updateAnchorPointInPoint())},_getAnchorY:function(){return this._anchorPoint.y},_setAnchorY:function(t){this._anchorPoint.y!==t&&(this._anchorPoint.y=t,this._renderCmd._updateAnchorPointInPoint())},getAnchorPointInPoints:function(){return this._renderCmd.getAnchorPointInPoints()},_getWidth:function(){return this._contentSize.width},_setWidth:function(t){this._contentSize.width=t,this._renderCmd._updateAnchorPointInPoint()},_getHeight:function(){return this._contentSize.height},_setHeight:function(t){this._contentSize.height=t,this._renderCmd._updateAnchorPointInPoint()},getContentSize:function(){return cc.size(this._contentSize)},setContentSize:function(t,e){var i=this._contentSize;if(void 0===e){if(t.width===i.width&&t.height===i.height)return;i.width=t.width,i.height=t.height}else{if(t===i.width&&e===i.height)return;i.width=t,i.height=e}this._renderCmd._updateAnchorPointInPoint()},isRunning:function(){return this._running},getParent:function(){return this._parent},setParent:function(t){this._parent=t;var e=_ccsg.Node._dirtyFlags;this._renderCmd.setDirtyFlag(e.transformDirty|e.opacityDirty)},isIgnoreAnchorPointForPosition:function(){return this._ignoreAnchorPointForPosition},setIgnoreAnchorPointForPosition:function(t){t!==this._ignoreAnchorPointForPosition&&(this._ignoreAnchorPointForPosition=t,this._renderCmd.setDirtyFlag(_ccsg.Node._dirtyFlags.transformDirty))},getTag:function(){return this.tag},setTag:function(t){this.tag=t},setName:function(t){this._name=t},getName:function(){return this._name},updateOrderOfArrival:function(){this._arrivalOrder=++cc.s_globalOrderOfArrival},getScheduler:function(){return this._scheduler||cc.director.getScheduler()},setScheduler:function(t){this._scheduler!==t&&(this.unscheduleAllCallbacks(),this._scheduler=t)},boundingBox:function(){return cc.logID(1608),this.getBoundingBox()},getBoundingBox:function(){var t=cc.rect(0,0,this._contentSize.width,this._contentSize.height);return cc._rectApplyAffineTransformIn(t,this.getNodeToParentTransform())},cleanup:function(){this.stopAllActions(),this.unscheduleAllCallbacks(),r.removeListeners(this)},getChildByTag:function(t){var e=this._children;if(null!==e)for(var i=0;i-1&&this._detachChild(t,e),cc.renderer.childrenOrderDirty=!0)},removeChildByTag:function(t,e){t===cc.macro.NODE_TAG_INVALID&&cc.logID(1609);var i=this.getChildByTag(t);i?this.removeChild(i,e):cc.logID(1610,t)},removeAllChildrenWithCleanup:function(t){this.removeAllChildren(t)},removeAllChildren:function(t){var e=this._children;if(null!==e){void 0===t&&(t=!0);for(var i=0;i=0;){if(i._localZOrder=e.max)){var i,n,r,s,o,a=0,c=_ccsg.Node._performStacks[_ccsg.Node._performing];for(c||(c=[],_ccsg.Node._performStacks.push(c)),c.length=0,_ccsg.Node._performing++,r=c[0]=this;r;){if((i=r._children)&&i.length>0)for(s=0,o=i.length;s=0;--s)r=c[s],c[s]=null,r&&r.onEnter();break;case e.onExit:for(s=c.length-1;s>=0;--s)r=c[s],c[s]=null,r&&r.onExit();break;case e.onEnterTransitionDidFinish:for(s=c.length-1;s>=0;--s)r=c[s],c[s]=null,r&&r.onEnterTransitionDidFinish();break;case e.cleanup:for(s=c.length-1;s>=0;--s)r=c[s],c[s]=null,r&&r.cleanup();break;case e.onExitTransitionDidStart:for(s=c.length-1;s>=0;--s)r=c[s],c[s]=null,r&&r.onExitTransitionDidStart()}_ccsg.Node._performing--}},onEnterTransitionDidFinish:function(){this._isTransitionFinished=!0},onExitTransitionDidStart:function(){},onExit:function(){this._running=!1,this.pause()},runAction:s?function(t){return cc.assertID(t,1618),cc.director.getActionManager().addAction(t,this,!this._running),t}:o,stopAllActions:s?function(){cc.director.getActionManager().removeAllActionsFromTarget(this)}:o,stopAction:s?function(t){cc.director.getActionManager().removeAction(t)}:o,stopActionByTag:s?function(t){t!==cc.Action.TAG_INVALID?cc.director.getActionManager().removeActionByTag(t,this):cc.logID(1612)}:o,getActionByTag:s?function(t){return t===cc.Action.TAG_INVALID?(cc.logID(1613),null):cc.director.getActionManager().getActionByTag(t,this)}:function(){return null},getNumberOfRunningActions:s?function(){return cc.director.getActionManager().getNumberOfRunningActionsInTarget(this)}:function(){return 0},scheduleUpdate:function(){this.scheduleUpdateWithPriority(0)},scheduleUpdateWithPriority:function(t){this.scheduler.scheduleUpdate(this,t,!this._running)},unscheduleUpdate:function(){this.scheduler.unscheduleUpdate(this)},schedule:function(t,e,i,n,r){var s=arguments.length;"function"==typeof t?1===s?(e=0,i=cc.macro.REPEAT_FOREVER,n=0,r=this.__instanceId):2===s?"number"==typeof e?(i=cc.macro.REPEAT_FOREVER,n=0,r=this.__instanceId):(r=e,e=0,i=cc.macro.REPEAT_FOREVER,n=0):3===s?("string"==typeof i?(r=i,i=cc.macro.REPEAT_FOREVER):r=this.__instanceId,n=0):4===s&&(r=this.__instanceId):1===s?(e=0,i=cc.macro.REPEAT_FOREVER,n=0):2===s&&(i=cc.macro.REPEAT_FOREVER,n=0),cc.assertID(t,1619),cc.assertID(e>=0,1620),e=e||0,i=isNaN(i)?cc.macro.REPEAT_FOREVER:i,n=n||0,this.scheduler.schedule(t,this,e,i,n,!this._running,r)},scheduleOnce:function(t,e,i){void 0===i&&(i=this.__instanceId),this.schedule(t,0,0,e,i)},unschedule:function(t){t&&this.scheduler.unschedule(t,this)},unscheduleAllCallbacks:function(){this.scheduler.unscheduleAllForTarget(this)},resumeSchedulerAndActions:function(){cc.logID(1614),this.resume()},resume:function(){this.scheduler.resumeTarget(this),s&&cc.director.getActionManager().resumeTarget(this),r.resumeTarget(this)},pauseSchedulerAndActions:function(){cc.logID(1615),this.pause()},pause:function(){this.scheduler.pauseTarget(this),s&&cc.director.getActionManager().pauseTarget(this),r.pauseTarget(this)},getParentToNodeTransform:function(){return this._renderCmd.getParentToNodeTransform()},parentToNodeTransform:function(){return this.getParentToNodeTransform()},getNodeToWorldTransform:function(){for(var t=cc.affineTransformClone(this.getNodeToParentTransform()),e=this._parent;null!==e;e=e.parent)t=cc.affineTransformConcatIn(t,e.getNodeToParentTransform());return t},nodeToWorldTransform:function(){return this.getNodeToWorldTransform()},getWorldToNodeTransform:function(){var t=this.getNodeToWorldTransform();return cc.affineTransformInvertOut(t,t),t},worldToNodeTransform:function(){return this.getWorldToNodeTransform()},convertToNodeSpace:function(t){return cc.pointApplyAffineTransform(t,this.getWorldToNodeTransform())},convertToWorldSpace:function(t){return t=t||cc.v2(0,0),cc.pointApplyAffineTransform(t,this.getNodeToWorldTransform())},convertToNodeSpaceAR:function(t){return cc.pSub(this.convertToNodeSpace(t),this._renderCmd.getAnchorPointInPoints())},convertToWorldSpaceAR:function(t){t=t||cc.v2(0,0);var e=cc.pAdd(t,this._renderCmd.getAnchorPointInPoints());return this.convertToWorldSpace(e)},_convertToWindowSpace:function(t){var e=this.convertToWorldSpace(t);return cc.director.convertToUI(e)},convertTouchToNodeSpace:function(t){var e=t.getLocation();return this.convertToNodeSpace(e)},convertTouchToNodeSpaceAR:function(t){var e=cc.director.convertToGL(t.getLocation());return this.convertToNodeSpaceAR(e)},updateTransform:function(){for(var t=this._children,e=0;e0){for(this._reorderChildDirty&&this.sortAllChildren(),r=0;r0)for(s=r._renderCmd,o=0,a=i.length;o0?e.flags.ParentInCamera:0)},culling:function(t,e){cc.macro.ENABLE_CULLING?(this._updateCameraFlag(t),this._doCulling&&this._doCulling(),e&&s(this._node,"culling")):this._doCulling&&(this._needDraw=!0)},getNodeToParentTransform:function(){return this._dirtyFlag&n.transformDirty&&this.transform(),this._transform},setNodeToParentTransform:function(t){t?(this._transform=t,this._transformUpdated=!0):this._transformUpdated=!1,this.setDirtyFlag(n.transformDirty)},_propagateFlagsDown:function(t){if(t){var e=this._dirtyFlag,i=t._node,r=t._dirtyFlag;i._cascadeColorEnabled&&r&n.colorDirty&&(e|=n.colorDirty),i._cascadeOpacityEnabled&&r&n.opacityDirty&&(e|=n.opacityDirty),r&n.transformDirty&&(e|=n.transformDirty),r&n.cullingDirty&&(e|=n.cullingDirty),this._dirtyFlag=e}},visit:function(t){var e=this._node,i=cc.renderer;t&&(this._curLevel=t._curLevel+1),this._propagateFlagsDown(t),isNaN(e._customZ)&&(e._vertexZ=i.assignedZ,i.assignedZ+=i.assignedZStep),this._syncStatus(t)},_updateDisplayColor:function(t){var e,i,r,s,o=this._node,a=this._displayedColor,c=o._realColor;if(this._notifyRegionStatus&&this._notifyRegionStatus(_ccsg.Node.CanvasRenderCmd.RegionStatus.Dirty),this._cascadeColorEnabledDirty&&!o._cascadeColorEnabled){a.r=c.r,a.g=c.g,a.b=c.b;var h=new cc.Color(255,255,255,255);for(e=0,i=(r=o._children).length;e=0;e--)this._removeTargetInSg(t[e])}},addTarget:function(t){-1===this._targets.indexOf(t)&&(this._addSgTargetInSg(t),this._targets.push(t))},removeTarget:function(t){-1!==this._targets.indexOf(t)&&(this._removeTargetInSg(t),cc.js.array.remove(this._targets,t))},getTargets:function(){return this._targets},getNodeToCameraTransform:function(t){var e=t.getNodeToWorldTransform();return this.containsNode(t)&&(e=cc.affineTransformConcatIn(e,cc.Camera.main.viewMatrix)),e},getCameraToWorldPoint:function(t){return cc.Camera.main&&(t=cc.pointApplyAffineTransform(t,cc.Camera.main.invertViewMatrix)),t},containsNode:function(t){t instanceof cc.Node&&(t=t._sgNode);for(var e=this._sgTarges;t;){if(-1!==e.indexOf(t))return!0;t=t.parent}return!1},_setSgNodesCullingDirty:function(){for(var t=this._sgTarges,e=0;e=0;a--){var c=e[a];c._cameraInfo.touched!==i&&this._removeTargetInSg(c)}},lateUpdate:function(){this._checkSgTargets();var t=this.viewMatrix,e=this.invertViewMatrix,i=this.viewPort,n=cc.visibleRect,r=this.visibleRect,s=this.node.getNodeToWorldTransformAR(),o=.5*-(Math.atan2(s.b,s.a)+Math.atan2(-s.c,s.d)),a=1,c=0,h=0,l=1;o&&(h=Math.sin(o),a=l=Math.cos(o),c=-h);var u=this.zoomRatio;a*=u,c*=u,h*=u,l*=u,t.a=a,t.b=c,t.c=h,t.d=l;var _=n.center;t.tx=_.x-(a*s.tx+h*s.ty),t.ty=_.y-(c*s.tx+l*s.ty),cc.affineTransformInvertOut(t,e),i.x=n.bottomLeft.x,i.y=n.bottomLeft.y,i.width=n.width,i.height=n.height,cc._rectApplyAffineTransformIn(i,e),r.left.x=i.xMin,r.right.x=i.xMax,r.bottom.y=i.yMin,r.top.y=i.yMax,this._sgNode.setTransform(a,c,h,l,t.tx,t.ty);var d=this._lastViewMatrix;d.a===t.a&&d.b===t.b&&d.c===t.c&&d.d===t.d&&d.tx===t.tx&&d.ty===t.ty||(this._setSgNodesCullingDirty(),d.a=t.a,d.b=t.b,d.c=t.c,d.d=t.d,d.tx=t.tx,d.ty=t.ty)}});r.flags=cc.Enum({InCamera:1,ParentInCamera:2}),e.exports=cc.Camera=r}),{"./CCSGCameraNode":63}],63:[(function(t,e,i){var n=new cc.math.Matrix4,r=_ccsg.Node.extend({ctor:function(){this._super(),this._mat=new cc.math.Matrix4,this._mat.identity(),this._beforeVisitCmd=new cc.CustomRenderCmd(this,this._onBeforeVisit),this._afterVisitCmd=new cc.CustomRenderCmd(this,this._onAfterVisit)},setTransform:function(t,e,i,n,r,s){var o=this._mat.mat;o[0]=t,o[1]=e,o[4]=i,o[5]=n,o[12]=r,o[13]=s},addTarget:function(t){var e=t._cameraInfo;e.sgCameraNode=this,e.originVisit=t.visit,t.visit=this._visit},removeTarget:function(t){t.visit=t._cameraInfo.originVisit},_visit:function(t){var e=this._cameraInfo,i=e.sgCameraNode;cc.renderer.pushRenderCommand(i._beforeVisitCmd),e.originVisit.call(this,t),cc.renderer.pushRenderCommand(i._afterVisitCmd)},_onBeforeVisit:function(){cc.renderer._breakBatch(),cc.math.glMatrixMode(cc.math.KM_GL_PROJECTION),n.assignFrom(cc.current_stack.top),n.multiply(this._mat),cc.current_stack.push(n)},_onAfterVisit:function(){cc.renderer._breakBatch(),cc.math.glMatrixMode(cc.math.KM_GL_PROJECTION),cc.current_stack.pop()}});e.exports=_ccsg.CameraNode=r}),{}],64:[(function(t,e,i){cc.Collider.Box=cc.Class({properties:{_offset:cc.v2(0,0),_size:cc.size(100,100),offset:{tooltip:!1,get:function(){return this._offset},set:function(t){this._offset=t},type:cc.Vec2},size:{tooltip:!1,get:function(){return this._size},set:function(t){this._size.width=t.width<0?0:t.width,this._size.height=t.height<0?0:t.height},type:cc.Size}},resetInEditor:!1});var n=cc.Class({name:"cc.BoxCollider",extends:cc.Collider,mixins:[cc.Collider.Box],editor:!1});cc.BoxCollider=e.exports=n}),{}],65:[(function(t,e,i){cc.Collider.Circle=cc.Class({properties:{_offset:cc.v2(0,0),_radius:50,offset:{get:function(){return this._offset},set:function(t){this._offset=t},type:cc.Vec2},radius:{tooltip:!1,get:function(){return this._radius},set:function(t){this._radius=t<0?0:t}}},resetInEditor:!1});var n=cc.Class({name:"cc.CircleCollider",extends:cc.Collider,mixins:[cc.Collider.Circle],editor:!1});cc.CircleCollider=e.exports=n}),{}],66:[(function(t,e,i){var n=cc.Class({name:"cc.Collider",extends:cc.Component,properties:{editing:{default:!1,serializable:!1,tooltip:!1},tag:{tooltip:!1,default:0,range:[0,1e7],type:cc.Integer}},onDisable:function(){cc.director.getCollisionManager().removeCollider(this)},onEnable:function(){cc.director.getCollisionManager().addCollider(this)}});cc.Collider=e.exports=n}),{}],67:[(function(t,e,i){var n=t("./CCContact"),r=n.CollisionType,s=cc.rect(),o=cc.v2(),a=cc.Class({mixins:[cc.EventTarget],properties:{enabled:!1,enabledDrawBoundingBox:!1},ctor:function(){this.__instanceId=cc.ClassManager.getNewInstanceId(),this._contacts=[],this._colliders=[],this._debugDrawer=null,this._enabledDebugDraw=!1},update:function(t){if(this.enabled){var e,i,n=this._colliders;for(e=0,i=n.length;ep&&(p=y.x),y.xg&&(g=y.y),y.y=0){e.splice(i,1);for(var n=this._contacts,s=n.length-1;s>=0;s--){var o=n[s];o.collider1!==t&&o.collider2!==t||(o.touching&&this._doCollide(r.CollisionExit,o),n.splice(s,1))}t.node.off("group-changed",this.onNodeGroupChanged,this)}else cc.errorID(6600)},attachDebugDrawToCamera:function(t){this._debugDrawer&&t.addTarget(this._debugDrawer)},detachDebugDrawFromCamera:function(t){this._debugDrawer&&t.removeTarget(this._debugDrawer)},onNodeGroupChanged:function(t){for(var e=t.currentTarget.getComponents(cc.Collider),i=0,n=e.length;i0){t.strokeColor=cc.Color.WHITE,t.moveTo(s[0].x,s[0].y);for(var o=1;or!=u>r&&n<(l-c)*(r-h)/(u-h)+c&&(i=!i)}return i}function a(t,e,i,n){var r,s=i.x-e.x,o=i.y-e.y,a=s*s+o*o,c=((t.x-e.x)*s+(t.y-e.y)*o)/a;return r=n?a?c<0?e:c>1?i:cc.v2(e.x+c*s,e.y+c*o):e:cc.v2(e.x+c*s,e.y+c*o),s=t.x-r.x,o=t.y-r.y,Math.sqrt(s*s+o*o)}n.lineLine=r,n.lineRect=function(t,e,i){var n=new cc.Vec2(i.x,i.y),s=new cc.Vec2(i.x,i.yMax),o=new cc.Vec2(i.xMax,i.yMax),a=new cc.Vec2(i.xMax,i.y);return!!(r(t,e,n,s)||r(t,e,s,o)||r(t,e,o,a)||r(t,e,a,n))},n.linePolygon=s,n.rectRect=function(t,e){var i=t.x,n=t.y,r=t.x+t.width,s=t.y+t.height,o=e.x,a=e.y,c=e.x+e.width,h=e.y+e.height;return i<=c&&r>=o&&n<=h&&s>=a},n.rectPolygon=function(t,e){var i,n,r=new cc.Vec2(t.x,t.y),a=new cc.Vec2(t.x,t.yMax),c=new cc.Vec2(t.xMax,t.yMax),h=new cc.Vec2(t.xMax,t.y);if(s(r,a,e))return!0;if(s(a,c,e))return!0;if(s(c,h,e))return!0;if(s(h,r,e))return!0;for(i=0,n=e.length;i>>1;r<=s;o=r+s>>>1){var a=t[o],c=a.constructor._executionOrder;if(c>i)s=o-1;else if(cn)s=o-1;else{if(!(h0&&(t.array.sort(d),this._invoke(t),t.array.length=0),this._invoke(this._zero),this._zero.array.length=0;var e=this._pos;e.array.length>0&&(e.array.sort(d),this._invoke(e),e.array.length=0)}}),m=cc.Class({extends:_,add:function(t){var e=t.constructor._executionOrder;if(0===e)this._zero.array.push(t);else{var i=e<0?this._neg.array:this._pos.array,n=l(i,t);n<0&&i.splice(~n,0,t)}},remove:function(t){var e=t.constructor._executionOrder;if(0===e)this._zero.fastRemove(t);else{var i=e<0?this._neg:this._pos,n=l(i.array,t);n>=0&&i.removeAt(n)}},invoke:function(t){this._neg.array.length>0&&this._invoke(this._neg,t),this._invoke(this._zero,t),this._pos.array.length>0&&this._invoke(this._pos,t)}});function p(t,e){if("function"==typeof t)return e?function(e,i){var n=e.array;for(e.i=0;e.i=0?r.fastRemoveAt(this.scheduleInNextFrame,e):(!t.start||t._objFlags&s||this.startInvoker.remove(t),t.update&&this.updateInvoker.remove(t),t.lateUpdate&&this.lateUpdateInvoker.remove(t))},enableComp:function(t,e){if(!(t._objFlags&o)){if(t.onEnable){if(e)return void e.add(t);if(t.onEnable(),!t.node._activeInHierarchy)return}this._onEnabled(t)}},disableComp:function(t){t._objFlags&o&&(t.onDisable&&t.onDisable(),this._onDisabled(t))},_scheduleImmediate:function(t){!t.start||t._objFlags&s||this.startInvoker.add(t),t.update&&this.updateInvoker.add(t),t.lateUpdate&&this.lateUpdateInvoker.add(t)},_deferredSchedule:function(){for(var t=this.scheduleInNextFrame,e=0,i=t.length;e0&&this._deferredSchedule(),this.startInvoker.invoke()},updatePhase:function(t){this.updateInvoker.invoke(t)},lateUpdatePhase:function(t){this.lateUpdateInvoker.invoke(t),this._updating=!1}});e.exports=y}),{"./platform/CCClass":178,"./platform/CCObject":184,"./platform/js":199,"./utils/misc":228}],73:[(function(t,e,i){var n=t("../../animation/animation-animator"),r=t("../../animation/animation-clip");function s(t,e){return t===e||t&&e&&(t.name===e.name||t._uuid===e._uuid)}var o=cc.Class({name:"cc.Animation",extends:t("./CCComponent"),mixins:[cc.EventTarget],editor:!1,ctor:function(){cc.EventTarget.call(this),this._animator=null,this._nameToState={},this._didInit=!1,this._currentClip=null},properties:{_defaultClip:{default:null,type:r},defaultClip:{type:r,get:function(){return this._defaultClip},set:function(t){},tooltip:!1},currentClip:{get:function(){return this._currentClip},set:function(t){this._currentClip=t},type:r,visible:!1},_clips:{default:[],type:[r],tooltip:!1,visible:!0},playOnLoad:{default:!1,tooltip:!1}},start:function(){if(this.playOnLoad&&this._defaultClip&&!(this._animator&&this._animator.isPlaying)){var t=this.getAnimationState(this._defaultClip.name);this._animator.playState(t)}},onEnable:function(){this._animator&&this._animator.resume()},onDisable:function(){this._animator&&this._animator.pause()},onDestroy:function(){this.stop()},getClips:function(){return this._clips},play:function(t,e){var i=this.playAdditive(t,e);return this._animator.stopStatesExcept(i),i},playAdditive:function(t,e){this._init();var i=this.getAnimationState(t||this._defaultClip&&this._defaultClip.name);if(i){this.enabled=!0;var n=this._animator;n.isPlaying&&i.isPlaying?i.isPaused?n.resumeState(i):(n.stopState(i),n.playState(i,e)):n.playState(i,e),this.enabledInHierarchy||n.pause(),this.currentClip=i.clip}return i},stop:function(t){if(this._didInit)if(t){var e=this._nameToState[t];e&&this._animator.stopState(e)}else this._animator.stop()},pause:function(t){if(this._didInit)if(t){var e=this._nameToState[t];e&&this._animator.pauseState(e)}else this.enabled=!1},resume:function(t){if(this._didInit)if(t){var e=this._nameToState[t];e&&this._animator.resumeState(e)}else this.enabled=!0},setCurrentTime:function(t,e){if(this._init(),e){var i=this._nameToState[e];i&&this._animator.setStateTime(i,t)}else this._animator.setStateTime(t)},getAnimationState:function(t){this._init();var e=this._nameToState[t];return e&&!e.curveLoaded&&this._animator._reloadClip(e),e||null},addClip:function(t,e){if(t){this._init(),cc.js.array.contains(this._clips,t)||this._clips.push(t),e=e||t.name;var i=this._nameToState[e];if(i){if(i.clip===t)return i;var n=this._clips.indexOf(i.clip);-1!==n&&this._clips.splice(n,1)}var r=new cc.AnimationState(t,e);return this._nameToState[e]=r,r}cc.warnID(3900)},removeClip:function(t,e){if(t){var i;for(var n in this._init(),this._nameToState){if((i=this._nameToState[n]).clip===t)break}if(t===this._defaultClip){if(!e)return void cc.warnID(3902);this._defaultClip=null}if(i&&i.isPlaying){if(!e)return void cc.warnID(3903);this.stop(i.name)}this._clips=this._clips.filter((function(e){return e!==t})),i&&delete this._nameToState[i.name]}else cc.warnID(3901)},sample:function(t){if(this._init(),t){var e=this._nameToState[t];e&&e.sample()}else this._animator.sample()},on:function(t,e,i,n){this._init();for(var r=cc.EventTarget.prototype.on.call(this,t,e,i,n),s=this._animator._anims.array,o=0;o0&&(i=this.time/this.duration),i>=1&&(i=1,this._transitionFinished=!0),this.transition===n.COLOR?e.color=this._fromColor.lerp(this._toColor,i):this.transition===n.SCALE&&(e.scale=cc.lerp(this._fromScale,this._toScale,i))}},_registerEvent:function(){this.node.on(cc.Node.EventType.TOUCH_START,this._onTouchBegan,this),this.node.on(cc.Node.EventType.TOUCH_MOVE,this._onTouchMove,this),this.node.on(cc.Node.EventType.TOUCH_END,this._onTouchEnded,this),this.node.on(cc.Node.EventType.TOUCH_CANCEL,this._onTouchCancel,this),this.node.on(cc.Node.EventType.MOUSE_ENTER,this._onMouseMoveIn,this),this.node.on(cc.Node.EventType.MOUSE_LEAVE,this._onMouseMoveOut,this)},_getTargetSprite:function(t){var e=null;return t&&(e=t.getComponent(cc.Sprite)),e},_applyTarget:function(){this._sprite=this._getTargetSprite(this.target),this.target&&(this._originalScale=this.target.scale)},_onTouchBegan:function(t){this.interactable&&this.enabledInHierarchy&&(this._pressed=!0,this._updateState(),t.stopPropagation())},_onTouchMove:function(t){if(this.interactable&&this.enabledInHierarchy&&this._pressed){var e,i=t.touch,r=this.node._hitTest(i.getLocation());if(this.transition===n.SCALE&&this.target)r?(this._fromScale=this._originalScale,this._toScale=this._originalScale*this.zoomScale,this._transitionFinished=!1):(this.time=0,this._transitionFinished=!0,this.target.scale=this._originalScale);else e=r?"pressed":"normal",this._applyTransition(e);t.stopPropagation()}},_onTouchEnded:function(t){this.interactable&&this.enabledInHierarchy&&(this._pressed&&(cc.Component.EventHandler.emitEvents(this.clickEvents,t),this.node.emit("click",this)),this._pressed=!1,this._updateState(),t.stopPropagation())},_zoomUp:function(){this._fromScale=this._originalScale,this._toScale=this._originalScale*this.zoomScale,this.time=0,this._transitionFinished=!1},_zoomBack:function(){this._fromScale=this.target.scale,this._toScale=this._originalScale,this.time=0,this._transitionFinished=!1},_onTouchCancel:function(){this.interactable&&this.enabledInHierarchy&&(this._pressed=!1,this._updateState())},_onMouseMoveIn:function(){!this._pressed&&this.interactable&&this.enabledInHierarchy&&(this.transition!==n.SPRITE||this.hoverSprite)&&(this._hovered||(this._hovered=!0,this._updateState()))},_onMouseMoveOut:function(){this._hovered&&(this._hovered=!1,this._updateState())},_updateState:function(){var t=this._getButtonState();this._applyTransition(t),this._updateDisabledState()},onDisable:function(){this._hovered=!1,this._pressed=!1,this.node.off(cc.Node.EventType.TOUCH_START,this._onTouchBegan,this),this.node.off(cc.Node.EventType.TOUCH_MOVE,this._onTouchMove,this),this.node.off(cc.Node.EventType.TOUCH_END,this._onTouchEnded,this),this.node.off(cc.Node.EventType.TOUCH_CANCEL,this._onTouchCancel,this),this.node.off(cc.Node.EventType.MOUSE_ENTER,this._onMouseMoveIn,this),this.node.off(cc.Node.EventType.MOUSE_LEAVE,this._onMouseMoveOut,this)},_getButtonState:function(){return this.interactable?this._pressed?"pressed":this._hovered?"hover":"normal":"disabled"},_updateColorTransition:function(t){var e=this[t+"Color"],i=this.target;this._fromColor=i.color.clone(),this._toColor=e,this.time=0,this._transitionFinished=!1},_updateSpriteTransition:function(t){var e=this[t+"Sprite"];this._sprite&&e&&(this._sprite.spriteFrame=e)},_updateScaleTransition:function(t){"pressed"===t?this._zoomUp():this._zoomBack()},_applyTransition:function(t){var e=this.transition;e===n.COLOR?this._updateColorTransition(t):e===n.SPRITE?this._updateSpriteTransition(t):e===n.SCALE&&this._updateScaleTransition(t)},_resizeNodeToTargetNode:!1,_updateDisabledState:function(){this._sprite&&this._sprite._sgNode.setState(0),this.enableAutoGrayEffect&&this.transition!==n.COLOR&&(this.transition===n.SPRITE&&this.disabledSprite||this._sprite&&!this.interactable&&this._sprite._sgNode.setState(1))}});cc.Button=e.exports=r}),{"./CCComponent":78}],77:[(function(t,e,i){var n=t("../event-manager"),r={getContentSize:function(){return cc.visibleRect},setContentSize:function(t){},_getWidth:function(){return this.getContentSize().width},_getHeight:function(){return this.getContentSize().height}},s=cc.Class({name:"cc.Canvas",extends:t("./CCComponent"),editor:!1,resetInEditor:!1,statics:{instance:null},properties:{_designResolution:cc.size(960,640),designResolution:{get:function(){return cc.size(this._designResolution)},set:function(t){this._designResolution.width=t.width,this._designResolution.height=t.height,this.applySettings()},tooltip:!1},_fitWidth:!1,_fitHeight:!0,fitHeight:{get:function(){return this._fitHeight},set:function(t){this._fitHeight!==t&&(this._fitHeight=t,this.applySettings())},tooltip:!1},fitWidth:{get:function(){return this._fitWidth},set:function(t){this._fitWidth!==t&&(this._fitWidth=t,this.applySettings())},tooltip:!1}},ctor:function(){this._thisOnResized=this.onResized.bind(this)},__preload:function(){if(s.instance)return cc.errorID(6700,this.node.name,s.instance.node.name);(s.instance=this,this.node._sizeProvider)||(this.node._sizeProvider=r);cc.director.on(cc.Director.EVENT_BEFORE_VISIT,this.alignWithScreen,this),cc.sys.isMobile?window.addEventListener("resize",this._thisOnResized):n.addCustomListener("canvas-resize",this._thisOnResized),this.applySettings(),this.onResized()},onDestroy:function(){this.node._sizeProvider===r&&(this.node._sizeProvider=null),cc.director.off(cc.Director.EVENT_BEFORE_VISIT,this.alignWithScreen,this),cc.sys.isMobile?window.removeEventListener("resize",this._thisOnResized):n.removeCustomListeners("canvas-resize",this._thisOnResized),s.instance===this&&(s.instance=null)},alignWithScreen:function(){var t,e=cc.visibleRect,i=0,n=0;!this.fitHeight&&!this.fitWidth&&(i=.5*((t=cc.view.getDesignResolutionSize()).width-e.width),n=.5*(t.height-e.height)),this.node.setPosition(.5*e.width+i,.5*e.height+n)},onResized:function(){this.alignWithScreen()},applySettings:function(){var t,e=cc.ResolutionPolicy;t=this.fitHeight&&this.fitWidth?e.SHOW_ALL:this.fitHeight||this.fitWidth?this.fitWidth?e.FIXED_WIDTH:e.FIXED_HEIGHT:e.NO_BORDER;var i=this._designResolution;cc.view.setDesignResolutionSize(i.width,i.height,t)}});cc.Canvas=e.exports=s}),{"../event-manager":112,"./CCComponent":78}],78:[(function(t,e,i){var n=t("../platform/CCObject"),r=t("../platform/js"),s=new(t("../platform/id-generater"))("Comp"),o=n.Flags.IsOnEnableCalled,a=n.Flags.IsOnLoadCalled,c=cc.Class({name:"cc.Component",extends:n,ctor:function(){this.__instanceId=cc.ClassManager.getNewInstanceId(),this.__eventTargets=[]},properties:{node:{default:null,visible:!1},name:{get:function(){if(this._name)return this._name;var t=cc.js.getClassName(this),e=t.lastIndexOf(".");return e>=0&&(t=t.slice(e+1)),this.node.name+"<"+t+">"},set:function(t){this._name=t},visible:!1},_id:{default:"",serializable:!1},uuid:{get:function(){var t=this._id;return t||(t=this._id=s.getNewId()),t},visible:!1},__scriptAsset:!1,_enabled:!0,enabled:{get:function(){return this._enabled},set:function(t){if(this._enabled!==t&&(this._enabled=t,this.node._activeInHierarchy)){var e=cc.director._compScheduler;t?e.enableComp(this):e.disableComp(this)}},visible:!1},enabledInHierarchy:{get:function(){return(this._objFlags&o)>0},visible:!1},_isOnLoadCalled:{get:function(){return this._objFlags&a}}},update:null,lateUpdate:null,__preload:null,onLoad:null,start:null,onEnable:null,onDisable:null,onDestroy:null,onFocusInEditor:null,onLostFocusInEditor:null,resetInEditor:null,addComponent:function(t){return this.node.addComponent(t)},getComponent:function(t){return this.node.getComponent(t)},getComponents:function(t){return this.node.getComponents(t)},getComponentInChildren:function(t){return this.node.getComponentInChildren(t)},getComponentsInChildren:function(t){return this.node.getComponentsInChildren(t)},_getLocalBounds:null,onRestore:null,destroy:function(){this._super()&&this._enabled&&this.node._activeInHierarchy&&cc.director._compScheduler.disableComp(this)},_onPreDestroy:function(){this.unscheduleAllCallbacks();for(var t=this.__eventTargets,e=0,i=t.length;e=0,1620),e=e||0,i=isNaN(i)?cc.macro.REPEAT_FOREVER:i,n=n||0;var r=cc.director.getScheduler(),s=r.isTargetPaused(this);r.schedule(t,this,e,i,n,s)},scheduleOnce:function(t,e){this.schedule(t,0,0,e)},unschedule:function(t){t&&cc.director.getScheduler().unschedule(t,this)},unscheduleAllCallbacks:function(){cc.director.getScheduler().unscheduleAllForTarget(this)}});c._requireComponent=null,c._executionOrder=0,r.value(c,"_registerEditorProps",(function(t,e){var i=e.requireComponent;i&&(t._requireComponent=i);var n=e.executionOrder;n&&"number"==typeof n&&(t._executionOrder=n)})),c.prototype.__scriptUuid="",cc.Component=e.exports=c}),{"../platform/CCObject":184,"../platform/id-generater":195,"../platform/js":199}],79:[(function(t,e,i){cc.Component.EventHandler=cc.Class({name:"cc.ClickEvent",properties:{target:{default:null,type:cc.Node},component:{default:""},handler:{default:""},customEventData:{default:""}},statics:{emitEvents:function(t){"use strict";var e,i,n;if(arguments.length>0)for(i=0,n=(e=new Array(arguments.length-1)).length;im&&(m=p),A.height>=m&&(p=m,m=A.height,v=A.getAnchorPoint().y),this.horizontalDirection===a.RIGHT_TO_LEFT&&(b=1-A.anchorX),d=d+l*b*A.width+l*this.spacingX;var S=l*(1-b)*A.width;if(e){var E=d+S+l*(l>0?this.paddingRight:this.paddingLeft),w=this.horizontalDirection===a.LEFT_TO_RIGHT&&E>(1-c.x)*t,I=this.horizontalDirection===a.RIGHT_TO_LEFT&&E<-c.x*t;(w||I)&&(A.height>=m?(0===p&&(p=m),f+=p,p=m):(f+=m,p=A.height,m=0),d=_+l*(u+b*A.width),g++)}var R=i(A,f,g);t>=A.width+this.paddingLeft+this.paddingRight&&s&&A.setPosition(cc.p(d,R));var P,O=1,D=0===m?A.height:m;this.verticalDirection===o.TOP_TO_BOTTOM?(y=y||this.node._contentSize.height,(P=R+(O=-1)*(D*v+this.paddingBottom))y&&(y=P)),d+=S}}return y},_getVerticalBaseHeight:function(t){var e=0,i=0;if(this.resizeMode===r.CONTAINER){for(var n=0;nm&&(m=p),A.width>=m&&(p=m,m=A.width,v=A.getAnchorPoint().x),this.verticalDirection===o.TOP_TO_BOTTOM&&(b=1-A.anchorY),d=d+l*b*A.height+l*this.spacingY;var S=l*(1-b)*A.height;if(e){var E=d+S+l*(l>0?this.paddingTop:this.paddingBottom),w=this.verticalDirection===o.BOTTOM_TO_TOP&&E>(1-c.y)*t,I=this.verticalDirection===o.TOP_TO_BOTTOM&&E<-c.y*t;(w||I)&&(A.width>=m?(0===p&&(p=m),f+=p,p=m):(f+=m,p=A.width,m=0),d=_+l*(u+b*A.height),g++)}var R=i(A,f,g);t>=A.height+(this.paddingTop+this.paddingBottom)&&s&&A.setPosition(cc.p(R,d));var P,O=1,D=0===m?A.width:m;this.horizontalDirection===a.RIGHT_TO_LEFT?(O=-1,y=y||this.node._contentSize.width,(P=R+O*(D*v+this.paddingLeft))y&&(y=P)),d+=S}}return y},_doLayoutBasic:function(){for(var t=this.node.children,e=null,i=0;i0&&(this._doLayout(),this._layoutDirty=!1)}});Object.defineProperty(c.prototype,"padding",{get:function(){return cc.warnID(4100),this.paddingLeft},set:function(t){this._N$padding=t,this._migratePaddingData(),this._doLayoutDirty()}}),cc.Layout=e.exports=c}),{"./CCComponent":78}],84:[(function(t,e,i){t("../../clipping-nodes/CCClippingNode"),t("../../clipping-nodes/CCClippingNodeCanvasRenderCmd"),t("../../clipping-nodes/CCClippingNodeWebGLRenderCmd"),t("../../shape-nodes/CCDrawNode");var n=cc._RendererInSG,r=cc.Enum({RECT:0,ELLIPSE:1,IMAGE_STENCIL:2}),s=cc.Class({name:"cc.Mask",extends:n,editor:!1,properties:{_clippingStencil:{default:null,serializable:!1},_type:r.RECT,type:{get:function(){return this._type},set:function(t){this._type=t,this._refreshStencil()},type:r,tooltip:!1},spriteFrame:{default:null,type:cc.SpriteFrame,tooltip:!1,notify:function(){this._refreshStencil()}},alphaThreshold:{default:1,type:cc.Float,range:[0,1,.1],slide:!0,tooltip:!1,notify:function(){cc._renderType!==cc.game.RENDER_TYPE_CANVAS?this._sgNode.setAlphaThreshold(this.alphaThreshold):cc.warnID(4201)}},inverted:{default:!1,type:cc.Boolean,tooltip:!1,notify:function(){cc._renderType!==cc.game.RENDER_TYPE_CANVAS?this._sgNode.setInverted(this.inverted):cc.warnID(4202)}},_segements:64,segements:{get:function(){return this._segements},set:function(t){this._segements=cc.clampf(t,3,1e4),this._refreshStencil()},tooltip:!1},_resizeToTarget:{animatable:!1,set:function(t){t&&this._resizeNodeToTargetNode()}}},statics:{Type:r},_resizeNodeToTargetNode:!1,_initSgNode:function(){},_createSgNode:function(){return new cc.ClippingNode},_hitTest:function(t){var e=this.node.getContentSize(),i=e.width,n=e.height,s=this.node.getNodeToWorldTransform();if(this.type===r.RECT||this.type===r.IMAGE_STENCIL){var o=cc.rect(0,0,i,n);cc._rectApplyAffineTransformIn(o,s);var a=t.x-o.x,c=o.x+o.width-t.x,h=t.y-o.y,l=o.y+o.height-t.y;return a>=0&&c>=0&&l>=0&&h>=0}if(this.type===r.ELLIPSE){var u=i/2,_=n/2,d=s.a*u+s.c*_+s.tx,f=s.b*u+s.d*_+s.ty,m=t.x-d,p=t.y-f;return m*m/(u*u)+p*p/(_*_)<1}},onEnable:function(){this._super(),this.spriteFrame&&this.spriteFrame.ensureLoadTexture(),this._refreshStencil(),this.node.on("size-changed",this._refreshStencil,this),this.node.on("anchor-changed",this._refreshStencil,this)},onDisable:function(){this._super(),this.node.off("size-changed",this._refreshStencil,this),this.node.off("anchor-changed",this._refreshStencil,this)},_calculateCircle:function(t,e,i){for(var n=[],r=2*Math.PI/i,s=0;s=this._pages.length?this.addPage(t):(this._pages.splice(e,0,t),this.content.addChild(t),this._updatePageView()))},removePage:function(t){if(t&&this.content){var e=this._pages.indexOf(t);-1!==e?this.removePageAtIndex(e):cc.warnID(4300,t.name)}},removePageAtIndex:function(t){var e=this._pages;if(!(t<0||t>=e.length)){var i=e[t];i&&(this.content.removeChild(i),e.splice(t,1),this._updatePageView())}},removeAllPages:function(){if(this.content){for(var t=this._pages,e=0,i=t.length;e=this._pages.length||(e=void 0!==e?e:.3,this._curPageIdx=t,this.scrollToOffset(this._moveOffsetValue(t),e,!0),this.indicator&&this.indicator._changedState())},getScrollEndedEventTiming:function(){return this.pageTurningEventTiming},_syncScrollDirection:function(){this.horizontal=this.direction===r.Horizontal,this.vertical=this.direction===r.Vertical},_syncSizeMode:function(){if(this.content){var t=this.content.getComponent(cc.Layout);if(t){if(0===this._pages.length)t.padding=0;else{var e=this._pages[this._pages.length-1];this.sizeMode===n.Free&&(this.direction===r.Horizontal?(t.paddingLeft=(this.node.width-this._pages[0].width)/2,t.paddingRight=(this.node.width-e.width)/2):this.direction===r.Vertical&&(t.paddingTop=(this.node.height-this._pages[0].height)/2,t.paddingBottom=(this.node.height-e.height)/2))}t.updateLayout()}}},_updatePageView:function(){var t=this._pages.length;this._curPageIdx>=t&&(this._curPageIdx=0===t?0:t-1,this._lastPageIdx=this._curPageIdx);for(var e=0;e=0||this._pages.push(i)}this._syncScrollDirection(),this._syncSizeMode(),this._updatePageView()}},_dispatchPageTurningEvent:function(){this._lastPageIdx!==this._curPageIdx&&(this._lastPageIdx=this._curPageIdx,cc.Component.EventHandler.emitEvents(this.pageEvents,this,s.PAGE_TURNING),this.node.emit("page-turning",this))},_isScrollable:function(t,e,i){if(this.sizeMode===n.Free){var s,o;if(this.direction===r.Horizontal)return s=this._scrollCenterOffsetX[e],o=this._scrollCenterOffsetX[i],Math.abs(t.x)>=Math.abs(s-o)*this.scrollThreshold;if(this.direction===r.Vertical)return s=this._scrollCenterOffsetY[e],o=this._scrollCenterOffsetY[i],Math.abs(t.y)>=Math.abs(s-o)*this.scrollThreshold}else{if(this.direction===r.Horizontal)return Math.abs(t.x)>=this.node.width*this.scrollThreshold;if(this.direction===r.Vertical)return Math.abs(t.y)>=this.node.height*this.scrollThreshold}},_isQuicklyScrollable:function(t){if(this.direction===r.Horizontal){if(Math.abs(t.x)>this.autoPageTurningThreshold)return!0}else if(this.direction===r.Vertical&&Math.abs(t.y)>this.autoPageTurningThreshold)return!0;return!1},_moveOffsetValue:function(t){var e=cc.p(0,0);return this.sizeMode===n.Free?this.direction===r.Horizontal?e.x=this._scrollCenterOffsetX[t]:this.direction===r.Vertical&&(e.y=this._scrollCenterOffsetY[t]):this.direction===r.Horizontal?e.x=t*this.node.width:this.direction===r.Vertical&&(e.y=t*this.node.height),e},_getDragDirection:function(t){return this.direction===r.Horizontal?0===t.x?0:t.x>0?1:-1:this.direction===r.Vertical?0===t.y?0:t.y<0?1:-1:void 0},_handleReleaseLogic:function(t){var e=this._startBounceBackIfNeeded(),i=cc.pSub(this._touchBeganPosition,this._touchEndPosition);if(e){var n=this._getDragDirection(i);if(0===n)return;this._curPageIdx=n>0?this._pages.length-1:0,this.indicator&&this.indicator._changedState()}else{var r=this._curPageIdx,s=r+this._getDragDirection(i),o=this.pageTurningSpeed*Math.abs(r-s);if(s=t.length)){for(var i=0;it.length)for(i=0;i0;--i){var n=t[i-1];this.node.removeChild(n),t.splice(i-1,1)}this._layout&&this._layout.enabledInHierarchy&&this._layout.updateLayout(),this._changedState()}}}});cc.PageViewIndicator=e.exports=r}),{"./CCComponent":78}],87:[(function(t,e,i){var n=cc.Enum({HORIZONTAL:0,VERTICAL:1,FILLED:2}),r=cc.Class({name:"cc.ProgressBar",extends:t("./CCComponent"),editor:!1,_initBarSprite:function(){if(this.barSprite){var t=this.barSprite.node;if(!t)return;var e=this.node.getContentSize(),i=this.node.getAnchorPoint(),r=t.getContentSize();t.parent===this.node&&this.node.setContentSize(r),this.barSprite.fillType===cc.Sprite.FillType.RADIAL&&(this.mode=n.FILLED);var s=t.getContentSize();if(this.mode===n.HORIZONTAL?this.totalLength=s.width:this.mode===n.VERTICAL?this.totalLength=s.height:this.totalLength=this.barSprite.fillRange,t.parent===this.node){var o=-e.width*i.x;t.setPosition(cc.p(o,0))}}},_updateBarStatus:function(){if(this.barSprite){var t=this.barSprite.node;if(!t)return;var e,i,r,s=t.getAnchorPoint(),o=t.getContentSize(),a=t.getPosition(),c=cc.p(0,.5),h=cc.clamp01(this.progress),l=this.totalLength*h;switch(this.mode){case n.HORIZONTAL:this.reverse&&(c=cc.p(1,.5)),e=cc.size(l,o.height),i=this.totalLength,r=o.height;break;case n.VERTICAL:c=this.reverse?cc.p(.5,1):cc.p(.5,0),e=cc.size(o.width,l),i=o.width,r=this.totalLength}if(this.mode===n.FILLED)this.barSprite.type!==cc.Sprite.Type.FILLED?cc.warn("ProgressBar FILLED mode only works when barSprite's Type is FILLED!"):(this.reverse&&(l*=-1),this.barSprite.fillRange=l);else if(this.barSprite.type!==cc.Sprite.Type.FILLED){var u=c.x-s.x,_=c.y-s.y,d=cc.p(i*u,r*_);t.setPosition(cc.pAdd(a,d)),t.setAnchorPoint(c),t.setContentSize(e)}else cc.warn("ProgressBar non-FILLED mode only works when barSprite's Type is non-FILLED!")}},properties:{barSprite:{default:null,type:cc.Sprite,tooltip:!1,notify:function(){this._initBarSprite()},animatable:!1},mode:{default:n.HORIZONTAL,type:n,tooltip:!1,notify:function(){if(this.barSprite){var t=this.barSprite.node;if(!t)return;var e=t.getContentSize();this.mode===n.HORIZONTAL?this.totalLength=e.width:this.mode===n.VERTICAL?this.totalLength=e.height:this.mode===n.FILLED&&(this.totalLength=this.barSprite.fillRange)}},animatable:!1},_N$totalLength:1,totalLength:{range:[0,Number.MAX_VALUE],tooltip:!1,get:function(){return this._N$totalLength},set:function(t){this.mode===n.FILLED&&(t=cc.clamp01(t)),this._N$totalLength=t,this._updateBarStatus()}},progress:{default:1,type:"Float",range:[0,1,.1],slide:!0,tooltip:!1,notify:function(){this._updateBarStatus()}},reverse:{default:!1,tooltip:!1,notify:function(){this.barSprite&&(this.barSprite.fillStart=1-this.barSprite.fillStart),this._updateBarStatus()},animatable:!1}},statics:{Mode:n}});cc.ProgressBar=e.exports=r}),{"./CCComponent":78}],88:[(function(t,e,i){var n=cc.Class({extends:t("./CCSGComponent"),name:"cc._RendererInSG",ctor:function(){var t=this._sgNode=this._createSgNode();t.setVisible(!1),this._plainNode=new _ccsg.Node},__preload:function(){this._initSgNode()},onEnable:function(){this._replaceSgNode(this._sgNode)},onDisable:function(){this._replaceSgNode(this._plainNode)},onDestroy:function(){this._removeSgNode()},_replaceSgNode:function(t){var e=this.node,i=e._sgNode;i._entity=null;var n=i.getChildren().slice();i.removeAllChildren(!1),t.getChildrenCount()>0&&t.removeAllChildren(!1);for(var r=0,s=n.length;rRichText",multiline:!0,tooltip:!1,notify:function(){this._updateRichTextStatus()}},horizontalAlign:{default:n.LEFT,type:n,tooltip:!1,animatable:!1,notify:function(t){this.horizontalAlign!==t&&(this._layoutDirty=!0,this._updateRichTextStatus())}},fontSize:{default:40,tooltip:!1,notify:function(t){this.fontSize!==t&&(this._layoutDirty=!0,this._updateRichTextStatus())}},font:{default:null,type:cc.TTFFont,tooltip:!1,notify:function(t){this.font!==t&&(this._layoutDirty=!0,this.font&&this._onTTFLoaded(),this._updateRichTextStatus())}},maxWidth:{default:0,tooltip:!1,notify:function(t){this.maxWidth!==t&&(this._layoutDirty=!0,this._updateRichTextStatus())}},lineHeight:{default:40,tooltip:!1,notify:function(t){this.lineHeight!==t&&(this._layoutDirty=!0,this._updateRichTextStatus())}},imageAtlas:{default:null,type:cc.SpriteAtlas,tooltip:!1,notify:function(t){this.imageAtlas!==t&&(this._layoutDirty=!0,this._updateRichTextStatus())}},handleTouchEvent:{default:!0,tooltip:!1,notify:function(t){this.handleTouchEvent!==t&&this.enabledInHierarchy&&(this.handleTouchEvent?this._addEventListeners():this._removeEventListeners())}}},statics:{HorizontalAlign:n,VerticalAlign:r},onEnable:function(){this._super(),this.handleTouchEvent&&this._addEventListeners()},onDisable:function(){this._super(),this.handleTouchEvent&&this._removeEventListeners()},_addEventListeners:function(){this.node.on(cc.Node.EventType.TOUCH_END,this._onTouchEnded,this)},_removeEventListeners:function(){this.node.off(cc.Node.EventType.TOUCH_END,this._onTouchEnded,this)},_createSgNode:function(){var t=new _ccsg.Node;t.setCascadeOpacityEnabled(!0);var e=this;return t.setColor=function(){e._updateLabelSegmentTextAttributes()},t._setContentSize=t.setContentSize,t.setContentSize=function(){},t},_updateLabelSegmentTextAttributes:function(){this._labelSegments.forEach(function(t){this._applyTextAttribute(t)}.bind(this))},_initSgNode:function(){this._updateRichText(),this._onTTFLoaded()},_createFontLabel:function(t){return _ccsg.Label.pool.get(t,this.font,null,this.fontSize)},_getFontRawUrl:function(){return this.font instanceof cc.TTFFont?this.font.nativeUrl:""},_onTTFLoaded:function(){var t=this._getFontRawUrl();if(t){var e=this;cc.CustomFontLoader.loadTTF(t,(function(){e._layoutDirty=!0,e._updateRichText()}))}},_measureText:function(t,e){var i=this,n=function(e){var n;return 0===i._labelSegmentsCache.length?(n=i._createFontLabel(e),i._labelSegmentsCache.push(n)):(n=i._labelSegmentsCache[0]).setString(e),n._styleIndex=t,i._applyTextAttribute(n),n.getContentSize().width};return e?n(e):n},_onTouchEnded:function(t){for(var e=this.node.getComponents(cc.Component),i=0;i0&&n+this._lineOffsetX>this.maxWidth)for(var r=0;this._lineOffsetX<=this.maxWidth;){var s=this._getFirstWordLen(t,r,t.length),o=t.substr(r,s),a=this._measureText(i,o);if(!(this._lineOffsetX+a<=this.maxWidth)){if(r>0){var c=t.substr(0,r);this._addLabelSegment(c,i),t=t.substr(r,t.length),n=this._measureText(i,t)}this._updateLineInfo();break}this._lineOffsetX+=a,r+=s}if(n>this.maxWidth)for(var h=cc.TextUtils.fragmentText(t,n,this.maxWidth,this._measureText(i)),l=0;l1&&l0&&h0&&(o=c),this.maxWidth>0?(this._lineOffsetX+o>this.maxWidth&&this._updateLineInfo(),this._lineOffsetX+=o):(this._lineOffsetX+=o,this._lineOffsetX>this._labelWidth&&(this._labelWidth=this._lineOffsetX)),this._applySpriteFrame(i),n.setContentSize(o,a),n._lineCount=this._lineCount,t.style.event&&t.style.event.click&&(n._clickHandler=t.style.event.click)}else cc.warnID(4400)},_updateRichText:function(){if(this.enabled){var t=cc.htmlTextParser.parse(this.string);if(!this._needsUpdateTextLayout(t))return this._textArray=t,void this._updateLabelSegmentTextAttributes();this._textArray=t,this._resetState();for(var e,i=!1,n=0;n0){var h=this._measureText(n,c);this._updateRichTextWithMaxWidth(c,h,n),o.length>1&&athis._labelWidth&&(this._labelWidth=this._lineOffsetX),o.length>1&&a0&&(this._labelWidth=this.maxWidth),this._labelHeight=this._lineCount*this.lineHeight,this.node.setContentSize(this._labelWidth,this._labelHeight),this._sgNode._setContentSize(this._labelWidth,this._labelHeight),this._updateRichTextPosition(),this._layoutDirty=!1}},_getFirstWordLen:function(t,e,i){var n=t.charAt(e);if(cc.TextUtils.isUnicodeCJK(n)||cc.TextUtils.isUnicodeSpace(n))return 1;for(var r=1,s=e+1;se&&(t=0,e=s);var o=0;switch(this.horizontalAlign){case cc.TextAlignment.LEFT:o=0;break;case cc.TextAlignment.CENTER:o=(this._labelWidth-this._linesWidth[s-1])/2;break;case cc.TextAlignment.RIGHT:o=this._labelWidth-this._linesWidth[s-1]}r.setPositionX(t+o);var a=r.getContentSize(),c=(i-s)*this.lineHeight;r instanceof cc.Scale9Sprite&&(c+=(this.lineHeight-r.getContentSize().height)/2),r.setPositionY(c),s===e&&(t+=a.width)}},_convertLiteralColorValue:function(t){var e=t.toUpperCase();return cc.Color[e]?cc.Color[e]:cc.hexToColor(t)},_applyTextAttribute:function(t){if(!(t instanceof cc.Scale9Sprite)){var e=t._styleIndex;t.setLineHeight(this.lineHeight),t.setVerticalAlign(r.CENTER);var i=null;this._textArray[e]&&(i=this._textArray[e].style),i&&i.color?t.setColor(this._convertLiteralColorValue(i.color)):t.setColor(this.node.color),i&&i.bold?t.enableBold(!0):t.enableBold(!1),i&&i.italic?t.enableItalics(!0):t.enableItalics(!1),i&&i.underline?t.enableUnderline(!0):t.enableUnderline(!1),i&&i.outline?(t.setOutlined(!0),t.setOutlineColor(this._convertLiteralColorValue(i.outline.color)),t.setOutlineWidth(i.outline.width),t.setMargin(i.outline.width)):(t.setOutlined(!1),t.setMargin(0)),i&&i.size?t.setFontSize(i.size):t.setFontSize(this.fontSize),i&&i.event&&i.event.click&&(t._clickHandler=i.event.click)}},onDestroy:function(){this._super();for(var t=0;t0?n:-n)),i*(e/r)},_calculatePosition:function(t,e,i,r,s,o){var a=t-e;s&&(a+=Math.abs(s));var c=0;a&&(c=r/a,c=cc.clamp01(c));var h=(i-o)*c;return this.direction===n.VERTICAL?cc.p(0,h):cc.p(h,0)},_updateLength:function(t){if(this.handle){var e=this.handle.node,i=e.getContentSize();e.setAnchorPoint(cc.p(0,0)),this.direction===n.HORIZONTAL?e.setContentSize(t,i.height):e.setContentSize(i.width,t)}},_processAutoHide:function(t){if(this.enableAutoHide&&!(this._autoHideRemainingTime<=0)&&!this._touching&&(this._autoHideRemainingTime-=t,this._autoHideRemainingTime<=this.autoHideTime)){this._autoHideRemainingTime=Math.max(0,this._autoHideRemainingTime);var e=this._opacity*(this._autoHideRemainingTime/this.autoHideTime);this._setOpacity(e)}},start:function(){this.enableAutoHide&&this._setOpacity(0)},hide:function(){this._autoHideRemainingTime=0,this._setOpacity(0)},show:function(){this._autoHideRemainingTime=this.autoHideTime,this._setOpacity(this._opacity)},update:function(t){this._processAutoHide(t)}});cc.Scrollbar=e.exports=r}),{"./CCComponent":78}],93:[(function(t,e,i){var n=function(){return(new Date).getMilliseconds()},r=cc.Enum({SCROLL_TO_TOP:0,SCROLL_TO_BOTTOM:1,SCROLL_TO_LEFT:2,SCROLL_TO_RIGHT:3,SCROLLING:4,BOUNCE_TOP:5,BOUNCE_BOTTOM:6,BOUNCE_LEFT:7,BOUNCE_RIGHT:8,SCROLL_ENDED:9,TOUCH_UP:10,AUTOSCROLL_ENDED_WITH_THRESHOLD:11,SCROLL_BEGAN:12}),s={"scroll-to-top":r.SCROLL_TO_TOP,"scroll-to-bottom":r.SCROLL_TO_BOTTOM,"scroll-to-left":r.SCROLL_TO_LEFT,"scroll-to-right":r.SCROLL_TO_RIGHT,scrolling:r.SCROLLING,"bounce-bottom":r.BOUNCE_BOTTOM,"bounce-left":r.BOUNCE_LEFT,"bounce-right":r.BOUNCE_RIGHT,"bounce-top":r.BOUNCE_TOP,"scroll-ended":r.SCROLL_ENDED,"touch-up":r.TOUCH_UP,"scroll-ended-with-threshold":r.AUTOSCROLL_ENDED_WITH_THRESHOLD,"scroll-began":r.SCROLL_BEGAN},o=cc.Class({name:"cc.ScrollView",extends:t("./CCViewGroup"),editor:!1,ctor:function(){this._topBoundary=0,this._bottomBoundary=0,this._leftBoundary=0,this._rightBoundary=0,this._touchMoveDisplacements=[],this._touchMoveTimeDeltas=[],this._touchMovePreviousTimestamp=0,this._touchMoved=!1,this._autoScrolling=!1,this._autoScrollAttenuate=!1,this._autoScrollStartPosition=cc.p(0,0),this._autoScrollTargetDelta=cc.p(0,0),this._autoScrollTotalTime=0,this._autoScrollAccumulatedTime=0,this._autoScrollCurrentlyOutOfBoundary=!1,this._autoScrollBraking=!1,this._autoScrollBrakingStartPosition=cc.p(0,0),this._outOfBoundaryAmount=cc.p(0,0),this._outOfBoundaryAmountDirty=!0,this._stopMouseWheel=!1,this._mouseWheelEventElapsedTime=0,this._isScrollEndedWithThresholdEventFired=!1,this._scrollEventEmitMask=0,this._isBouncing=!1,this._scrolling=!1},properties:{content:{default:void 0,type:cc.Node,tooltip:!1},horizontal:{default:!0,animatable:!1,tooltip:!1},vertical:{default:!0,animatable:!1,tooltip:!1},inertia:{default:!0,tooltip:!1},brake:{default:.5,type:"Float",range:[0,1,.1],tooltip:!1},elastic:{default:!0,animatable:!1,tooltip:!1},bounceDuration:{default:1,range:[0,10],tooltip:!1},horizontalScrollBar:{default:void 0,type:cc.Scrollbar,tooltip:!1,notify:function(){this.horizontalScrollBar&&(this.horizontalScrollBar.setTargetScrollView(this),this._updateScrollBar(0))},animatable:!1},verticalScrollBar:{default:void 0,type:cc.Scrollbar,tooltip:!1,notify:function(){this.verticalScrollBar&&(this.verticalScrollBar.setTargetScrollView(this),this._updateScrollBar(0))},animatable:!1},scrollEvents:{default:[],type:cc.Component.EventHandler,tooltip:!1},cancelInnerEvents:{default:!0,animatable:!1,tooltip:!1}},statics:{EventType:r},scrollToBottom:function(t,e){var i=this._calculateMovePercentDelta({anchor:cc.p(0,0),applyToHorizontal:!1,applyToVertical:!0});t?this._startAutoScroll(i,t,!1!==e):this._moveContent(i,!0)},scrollToTop:function(t,e){var i=this._calculateMovePercentDelta({anchor:cc.p(0,1),applyToHorizontal:!1,applyToVertical:!0});t?this._startAutoScroll(i,t,!1!==e):this._moveContent(i)},scrollToLeft:function(t,e){var i=this._calculateMovePercentDelta({anchor:cc.p(0,0),applyToHorizontal:!0,applyToVertical:!1});t?this._startAutoScroll(i,t,!1!==e):this._moveContent(i)},scrollToRight:function(t,e){var i=this._calculateMovePercentDelta({anchor:cc.p(1,0),applyToHorizontal:!0,applyToVertical:!1});t?this._startAutoScroll(i,t,!1!==e):this._moveContent(i)},scrollToTopLeft:function(t,e){var i=this._calculateMovePercentDelta({anchor:cc.p(0,1),applyToHorizontal:!0,applyToVertical:!0});t?this._startAutoScroll(i,t,!1!==e):this._moveContent(i)},scrollToTopRight:function(t,e){var i=this._calculateMovePercentDelta({anchor:cc.p(1,1),applyToHorizontal:!0,applyToVertical:!0});t?this._startAutoScroll(i,t,!1!==e):this._moveContent(i)},scrollToBottomLeft:function(t,e){var i=this._calculateMovePercentDelta({anchor:cc.p(0,0),applyToHorizontal:!0,applyToVertical:!0});t?this._startAutoScroll(i,t,!1!==e):this._moveContent(i)},scrollToBottomRight:function(t,e){var i=this._calculateMovePercentDelta({anchor:cc.p(1,0),applyToHorizontal:!0,applyToVertical:!0});t?this._startAutoScroll(i,t,!1!==e):this._moveContent(i)},scrollToOffset:function(t,e,i){var n=this.getMaxScrollOffset(),r=cc.p(0,0);0===n.x?r.x=0:r.x=t.x/n.x,0===n.y?r.y=1:r.y=(n.y-t.y)/n.y,this.scrollTo(r,e,i)},getScrollOffset:function(){var t=this._getContentTopBoundary()-this._topBoundary,e=this._getContentLeftBoundary()-this._leftBoundary;return cc.p(e,t)},getMaxScrollOffset:function(){var t=this.node.getContentSize(),e=this.content.getContentSize(),i=e.width-t.width,n=e.height-t.height;return i=i>=0?i:0,n=n>=0?n:0,cc.p(i,n)},scrollToPercentHorizontal:function(t,e,i){var n=this._calculateMovePercentDelta({anchor:cc.p(t,0),applyToHorizontal:!0,applyToVertical:!1});e?this._startAutoScroll(n,e,!1!==i):this._moveContent(n)},scrollTo:function(t,e,i){var n=this._calculateMovePercentDelta({anchor:t,applyToHorizontal:!0,applyToVertical:!0});e?this._startAutoScroll(n,e,!1!==i):this._moveContent(n)},scrollToPercentVertical:function(t,e,i){var n=this._calculateMovePercentDelta({anchor:cc.p(0,t),applyToHorizontal:!1,applyToVertical:!0});e?this._startAutoScroll(n,e,!1!==i):this._moveContent(n)},stopAutoScroll:function(){this._autoScrolling=!1,this._autoScrollAccumulatedTime=this._autoScrollTotalTime},setContentPosition:function(t){cc.pFuzzyEqual(t,this.getContentPosition(),1e-4)||(this.content.setPosition(t),this._outOfBoundaryAmountDirty=!0)},getContentPosition:function(){return this.content.getPosition()},isScrolling:function(){return this._scrolling},isAutoScrolling:function(){return this._autoScrolling},_registerEvent:function(){this.node.on(cc.Node.EventType.TOUCH_START,this._onTouchBegan,this,!0),this.node.on(cc.Node.EventType.TOUCH_MOVE,this._onTouchMoved,this,!0),this.node.on(cc.Node.EventType.TOUCH_END,this._onTouchEnded,this,!0),this.node.on(cc.Node.EventType.TOUCH_CANCEL,this._onTouchCancelled,this,!0),this.node.on(cc.Node.EventType.MOUSE_WHEEL,this._onMouseWheel,this,!0)},_unregisterEvent:function(){this.node.off(cc.Node.EventType.TOUCH_START,this._onTouchBegan,this,!0),this.node.off(cc.Node.EventType.TOUCH_MOVE,this._onTouchMoved,this,!0),this.node.off(cc.Node.EventType.TOUCH_END,this._onTouchEnded,this,!0),this.node.off(cc.Node.EventType.TOUCH_CANCEL,this._onTouchCancelled,this,!0),this.node.off(cc.Node.EventType.MOUSE_WHEEL,this._onMouseWheel,this,!0)},_onMouseWheel:function(t,e){if(this.enabledInHierarchy&&!this._hasNestedViewGroup(t,e)){var i=cc.p(0,0),n=-.1;0,this.vertical?i=cc.p(0,t.getScrollY()*n):this.horizontal&&(i=cc.p(t.getScrollY()*n,0)),this._mouseWheelEventElapsedTime=0,this._processDeltaMove(i),this._stopMouseWheel||(this._handlePressLogic(),this.schedule(this._checkMouseWheel,1/60),this._stopMouseWheel=!0),this._stopPropagationIfTargetIsMe(t)}},_checkMouseWheel:function(t){var e=this._getHowMuchOutOfBoundary();if(!cc.pFuzzyEqual(e,cc.p(0,0),1e-4))return this._processInertiaScroll(),this.unschedule(this._checkMouseWheel),void(this._stopMouseWheel=!1);this._mouseWheelEventElapsedTime+=t,this._mouseWheelEventElapsedTime>.1&&(this._onScrollBarTouchEnded(),this.unschedule(this._checkMouseWheel),this._stopMouseWheel=!1)},_calculateMovePercentDelta:function(t){var e=t.anchor,i=t.applyToHorizontal,n=t.applyToVertical;this._calculateBoundary(),e=cc.pClamp(e,cc.p(0,0),cc.p(1,1));var r=this.node.getContentSize(),s=this.content.getContentSize(),o=this._getContentBottomBoundary()-this._bottomBoundary;o=-o;var a=this._getContentLeftBoundary()-this._leftBoundary;a=-a;var c=cc.p(0,0),h=0;return i&&(h=s.width-r.width,c.x=a-h*e.x),n&&(h=s.height-r.height,c.y=o-h*e.y),c},_moveContentToTopLeft:function(t){var e=this.content.getContentSize(),i=this._getContentBottomBoundary()-this._bottomBoundary;i=-i;var n=cc.p(0,0),r=0,s=this._getContentLeftBoundary()-this._leftBoundary;s=-s,e.height7&&!this._touchMoved&&t.target!==this.node){var r=new cc.Event.EventTouch(t.getTouches(),t.bubbles);r.type=cc.Node.EventType.TOUCH_CANCEL,r.touch=t.touch,r.simulate=!0,t.target.dispatchEvent(r),this._touchMoved=!0}this._stopPropagationIfTargetIsMe(t)}}},_onTouchEnded:function(t,e){if(this.enabledInHierarchy&&!this._hasNestedViewGroup(t,e)){this._dispatchEvent("touch-up");var i=t.touch;this.content&&this._handleReleaseLogic(i),this._touchMoved?t.stopPropagation():this._stopPropagationIfTargetIsMe(t)}},_onTouchCancelled:function(t,e){if(this.enabledInHierarchy&&!this._hasNestedViewGroup(t,e)){if(!t.simulate){var i=t.touch;this.content&&this._handleReleaseLogic(i)}this._stopPropagationIfTargetIsMe(t)}},_processDeltaMove:function(t){this._scrollChildren(t),this._gatherTouchMove(t)},_handleMoveLogic:function(t){var e=t.getDelta();this._processDeltaMove(e)},_scrollChildren:function(t){var e,i=t=this._clampDelta(t);this.elastic&&(e=this._getHowMuchOutOfBoundary(),i.x*=0===e.x?1:.5,i.y*=0===e.y?1:.5),this.elastic||(e=this._getHowMuchOutOfBoundary(i),i=cc.pAdd(i,e));var n=-1;if(i.y>0)this.content.y-this.content.anchorY*this.content.height+i.y>this._bottomBoundary&&(n="scroll-to-bottom");else if(i.y<0){this.content.y-this.content.anchorY*this.content.height+this.content.height+i.y<=this._topBoundary&&(n="scroll-to-top")}else if(i.x<0){this.content.x-this.content.anchorX*this.content.width+this.content.width+i.x<=this._rightBoundary&&(n="scroll-to-right")}else if(i.x>0){this.content.x-this.content.anchorX*this.content.width+i.x>=this._leftBoundary&&(n="scroll-to-left")}this._moveContent(i,!1),0===i.x&&0===i.y||(this._scrolling||(this._scrolling=!0,this._dispatchEvent("scroll-began")),this._dispatchEvent("scrolling")),-1!==n&&this._dispatchEvent(n)},_handlePressLogic:function(){this._autoScrolling&&this._dispatchEvent("scroll-ended"),this._autoScrolling=!1,this._isBouncing=!1,this._touchMovePreviousTimestamp=n(),this._touchMoveDisplacements.length=0,this._touchMoveTimeDeltas.length=0,this._onScrollBarTouchBegan()},_clampDelta:function(t){var e=this.content.getContentSize(),i=this.node.getContentSize();return e.width=5;)this._touchMoveDisplacements.shift(),this._touchMoveTimeDeltas.shift();this._touchMoveDisplacements.push(t);var e=n();this._touchMoveTimeDeltas.push((e-this._touchMovePreviousTimestamp)/1e3),this._touchMovePreviousTimestamp=e},_startBounceBackIfNeeded:function(){if(!this.elastic)return!1;var t=this._getHowMuchOutOfBoundary();if(t=this._clampDelta(t),cc.pFuzzyEqual(t,cc.p(0,0),1e-4))return!1;var e=Math.max(this.bounceDuration,0);return this._startAutoScroll(t,e,!0),this._isBouncing||(t.y>0&&this._dispatchEvent("bounce-top"),t.y<0&&this._dispatchEvent("bounce-bottom"),t.x>0&&this._dispatchEvent("bounce-right"),t.x<0&&this._dispatchEvent("bounce-left"),this._isBouncing=!0),!0},_processInertiaScroll:function(){if(!this._startBounceBackIfNeeded()&&this.inertia){var t=this._calculateTouchMoveVelocity();!cc.pFuzzyEqual(t,cc.p(0,0),1e-4)&&this.brake<1&&this._startInertiaScroll(t)}this._onScrollBarTouchEnded()},_handleReleaseLogic:function(t){var e=t.getDelta();this._gatherTouchMove(e),this._processInertiaScroll(),this._scrolling&&(this._scrolling=!1,this._autoScrolling||this._dispatchEvent("scroll-ended"))},_isOutOfBoundary:function(){var t=this._getHowMuchOutOfBoundary();return!cc.pFuzzyEqual(t,cc.p(0,0),1e-4)},_isNecessaryAutoScrollBrake:function(){if(this._autoScrollBraking)return!0;if(this._isOutOfBoundary()){if(!this._autoScrollCurrentlyOutOfBoundary)return this._autoScrollCurrentlyOutOfBoundary=!0,this._autoScrollBraking=!0,this._autoScrollBrakingStartPosition=this.getContentPosition(),!0}else this._autoScrollCurrentlyOutOfBoundary=!1;return!1},getScrollEndedEventTiming:function(){return 1e-4},_processAutoScrolling:function(t){var e=this._isNecessaryAutoScrollBrake(),i=e?.05:1;this._autoScrollAccumulatedTime+=t*(1/i);var n=Math.min(1,this._autoScrollAccumulatedTime/this._autoScrollTotalTime);this._autoScrollAttenuate&&(n=(function(t){return(t-=1)*t*t*t*t+1})(n));var r=cc.pAdd(this._autoScrollStartPosition,cc.pMult(this._autoScrollTargetDelta,n)),s=Math.abs(n-1)<=1e-4;if(Math.abs(n-1)<=this.getScrollEndedEventTiming()&&!this._isScrollEndedWithThresholdEventFired&&(this._dispatchEvent("scroll-ended-with-threshold"),this._isScrollEndedWithThresholdEventFired=!0),this.elastic){var o=cc.pSub(r,this._autoScrollBrakingStartPosition);e&&(o=cc.pMult(o,i)),r=cc.pAdd(this._autoScrollBrakingStartPosition,o)}else{var a=cc.pSub(r,this.getContentPosition()),c=this._getHowMuchOutOfBoundary(a);cc.pFuzzyEqual(c,cc.p(0,0),1e-4)||(r=cc.pAdd(r,c),s=!0)}s&&(this._autoScrolling=!1);var h=cc.pSub(r,this.getContentPosition());this._moveContent(this._clampDelta(h),s),this._dispatchEvent("scrolling"),this._autoScrolling||(this._isBouncing=!1,this._dispatchEvent("scroll-ended"))},_startInertiaScroll:function(t){var e=cc.pMult(t,.7);this._startAttenuatingAutoScroll(e,t)},_calculateAttenuatedFactor:function(t){return this.brake<=0?1-this.brake:(1-this.brake)*(1/(1+14e-6*t+t*t*8e-9))},_startAttenuatingAutoScroll:function(t,e){var i=this._calculateAutoScrollTimeByInitalSpeed(cc.pLength(e)),n=cc.pNormalize(t),r=this.content.getContentSize(),s=this.node.getContentSize(),o=r.width-s.width,a=r.height-s.height,c=this._calculateAttenuatedFactor(o),h=this._calculateAttenuatedFactor(a);n=cc.p(n.x*o*(1-this.brake)*c,n.y*a*h*(1-this.brake));var l=cc.pLength(t),u=cc.pLength(n)/l;n=cc.pAdd(n,t),this.brake>0&&u>7&&(u=Math.sqrt(u),n=cc.pAdd(cc.pMult(t,u),t)),this.brake>0&&u>3&&(i*=u=3),0===this.brake&&u>1&&(i*=u),this._startAutoScroll(n,i,!0)},_calculateAutoScrollTimeByInitalSpeed:function(t){return Math.sqrt(Math.sqrt(t/5))},_startAutoScroll:function(t,e,i){var n=this._flattenVectorByDirection(t);this._autoScrolling=!0,this._autoScrollTargetDelta=n,this._autoScrollAttenuate=i,this._autoScrollStartPosition=this.getContentPosition(),this._autoScrollTotalTime=e,this._autoScrollAccumulatedTime=0,this._autoScrollBraking=!1,this._isScrollEndedWithThresholdEventFired=!1,this._autoScrollBrakingStartPosition=cc.p(0,0);var r=this._getHowMuchOutOfBoundary();if(!cc.pFuzzyEqual(r,cc.p(0,0),1e-4)){this._autoScrollCurrentlyOutOfBoundary=!0;var s=this._getHowMuchOutOfBoundary(n);(r.x*s.x>0||r.y*s.y>0)&&(this._autoScrollBraking=!0)}},_calculateTouchMoveVelocity:function(){var t=0;if((t=this._touchMoveTimeDeltas.reduce((function(t,e){return t+e}),t))<=0||t>=.5)return cc.p(0,0);var e=cc.p(0,0);return e=this._touchMoveDisplacements.reduce((function(t,e){return cc.pAdd(t,e)}),e),cc.p(e.x*(1-this.brake)/t,e.y*(1-this.brake)/t)},_flattenVectorByDirection:function(t){var e=t;return e.x=this.horizontal?e.x:0,e.y=this.vertical?e.y:0,e},_moveContent:function(t,e){var i=this._flattenVectorByDirection(t),n=cc.pAdd(this.getContentPosition(),i);this.setContentPosition(n);var r=this._getHowMuchOutOfBoundary();this._updateScrollBar(r),this.elastic&&e&&this._startBounceBackIfNeeded()},_getContentLeftBoundary:function(){return this.getContentPosition().x-this.content.getAnchorPoint().x*this.content.getContentSize().width},_getContentRightBoundary:function(){var t=this.content.getContentSize();return this._getContentLeftBoundary()+t.width},_getContentTopBoundary:function(){var t=this.content.getContentSize();return this._getContentBottomBoundary()+t.height},_getContentBottomBoundary:function(){return this.getContentPosition().y-this.content.getAnchorPoint().y*this.content.getContentSize().height},_getHowMuchOutOfBoundary:function(t){if(t=t||cc.p(0,0),cc.pFuzzyEqual(t,cc.p(0,0),1e-4)&&!this._outOfBoundaryAmountDirty)return this._outOfBoundaryAmount;var e=cc.p(0,0);return this._getContentLeftBoundary()+t.x>this._leftBoundary?e.x=this._leftBoundary-(this._getContentLeftBoundary()+t.x):this._getContentRightBoundary()+t.xthis._bottomBoundary&&(e.y=this._bottomBoundary-(this._getContentBottomBoundary()+t.y)),cc.pFuzzyEqual(t,cc.p(0,0),1e-4)&&(this._outOfBoundaryAmount=e,this._outOfBoundaryAmountDirty=!1),e=this._clampDelta(e)},_updateScrollBar:function(t){this.horizontalScrollBar&&this.horizontalScrollBar._onScroll(t),this.verticalScrollBar&&this.verticalScrollBar._onScroll(t)},_onScrollBarTouchBegan:function(){this.horizontalScrollBar&&this.horizontalScrollBar._onTouchBegan(),this.verticalScrollBar&&this.verticalScrollBar._onTouchBegan()},_onScrollBarTouchEnded:function(){this.horizontalScrollBar&&this.horizontalScrollBar._onTouchEnded(),this.verticalScrollBar&&this.verticalScrollBar._onTouchEnded()},_dispatchEvent:function(t){if("scroll-ended"===t)this._scrollEventEmitMask=0;else if("scroll-to-top"===t||"scroll-to-bottom"===t||"scroll-to-left"===t||"scroll-to-right"===t){var e=1<0&&t[0].check()}},onEnable:function(){this.node.on("child-added",this._allowOnlyOneToggleChecked,this),this.node.on("child-removed",this._makeAtLeastOneToggleChecked,this)},onDisable:function(){this.node.off("child-added",this._allowOnlyOneToggleChecked,this),this.node.off("child-removed",this._makeAtLeastOneToggleChecked,this)},start:function(){this._makeAtLeastOneToggleChecked()}});t("../platform/js").get(n.prototype,"toggleItems",(function(){return this.node.getComponentsInChildren(cc.Toggle)})),cc.ToggleContainer=e.exports=n}),{"../platform/js":199}],100:[(function(t,e,i){var n=cc.Class({name:"cc.ToggleGroup",extends:cc.Component,ctor:function(){this._toggleItems=[]},editor:!1,properties:{allowSwitchOff:{tooltip:!1,default:!1},toggleItems:{get:function(){return this._toggleItems}}},updateToggles:function(t){this.enabledInHierarchy&&this._toggleItems.forEach((function(e){t.isChecked&&e!==t&&e.isChecked&&e.enabled&&(e.isChecked=!1)}))},addToggle:function(t){-1===this._toggleItems.indexOf(t)&&this._toggleItems.push(t),this._allowOnlyOneToggleChecked()},removeToggle:function(t){var e=this._toggleItems.indexOf(t);e>-1&&this._toggleItems.splice(e,1),this._makeAtLeastOneToggleChecked()},_allowOnlyOneToggleChecked:function(){var t=!1;return this._toggleItems.forEach((function(e){t&&e.enabled&&(e.isChecked=!1),e.isChecked&&e.enabled&&(t=!0)})),t},_makeAtLeastOneToggleChecked:function(){this._allowOnlyOneToggleChecked()||this.allowSwitchOff||this._toggleItems.length>0&&(this._toggleItems[0].isChecked=!0)},start:function(){this._makeAtLeastOneToggleChecked()}}),r=(t("../platform/js"),!1);cc.js.get(cc,"ToggleGroup",(function(){return r||(cc.logID(1405,"cc.ToggleGroup","cc.ToggleContainer"),r=!0),n})),cc.ToggleGroup=e.exports=n}),{"../platform/js":199}],101:[(function(t,e,i){t("../videoplayer/CCSGVideoPlayer");var n=_ccsg.VideoPlayer.EventType,r=cc.Enum({REMOTE:0,LOCAL:1}),s=cc.Class({name:"cc.VideoPlayer",extends:cc._RendererUnderSG,editor:!1,properties:{_resourceType:r.REMOTE,resourceType:{tooltip:!1,type:r,set:function(t){this._resourceType=t,this._updateVideoSource()},get:function(){return this._resourceType}},_remoteURL:"",remoteURL:{tooltip:!1,type:cc.String,set:function(t){this._remoteURL=t,this._updateVideoSource()},get:function(){return this._remoteURL}},_clip:{default:null,type:cc.Asset},clip:{tooltip:!1,get:function(){return this._clip},set:function(t){"string"==typeof t&&(cc.errorID(8401,"cc.VideoPlayer","cc.Asset","Asset","cc.Asset","video"),t={nativeUrl:t}),this._clip=t,this._updateVideoSource()},type:cc.Asset},currentTime:{tooltip:!1,type:cc.Float,set:function(t){this._sgNode&&this._sgNode.seekTo(t)},get:function(){return this._sgNode?this._sgNode.currentTime():-1}},_volume:1,volume:{get:function(){return this._volume},set:function(t){this._volume=t,this.isPlaying()&&!this._mute&&this._syncVolume()},range:[0,1],type:cc.Float,tooltip:!1},_mute:!1,mute:{get:function(){return this._mute},set:function(t){this._mute=t,this._syncVolume()},tooltip:!1},keepAspectRatio:{tooltip:!1,default:!0,type:cc.Boolean,notify:function(){this._sgNode.setKeepAspectRatioEnabled(this.keepAspectRatio)}},isFullscreen:{tooltip:!1,default:!1,type:cc.Boolean,notify:function(){this._sgNode.setFullScreenEnabled(this.isFullscreen)}},videoPlayerEvent:{default:[],type:cc.Component.EventHandler}},statics:{EventType:n,ResourceType:r},onLoad:function(){0},_syncVolume:function(){var t=this._sgNode;if(t){var e=this._mute?0:this._volume;t.setVolume(e)}},_createSgNode:function(){return new _ccsg.VideoPlayer},_updateVideoSource:function(){var t=this._sgNode,e="";this.resourceType===r.REMOTE?e=this.remoteURL:this._clip&&(e=this._clip.nativeUrl||""),e&&cc.loader.md5Pipe&&(e=cc.loader.md5Pipe.transformURL(e)),t.setURL(e)},_initSgNode:function(){var t=this._sgNode;t&&(t.createDomElementIfNeeded(),this._updateVideoSource(),t.seekTo(this.currentTime),t.setKeepAspectRatioEnabled(this.keepAspectRatio),t.setFullScreenEnabled(this.isFullscreen),t.setContentSize(this.node.getContentSize()),this.pause(),t.setEventListener(n.PLAYING,this.onPlaying.bind(this)),t.setEventListener(n.PAUSED,this.onPasued.bind(this)),t.setEventListener(n.STOPPED,this.onStopped.bind(this)),t.setEventListener(n.COMPLETED,this.onCompleted.bind(this)),t.setEventListener(n.META_LOADED,this.onMetaLoaded.bind(this)),t.setEventListener(n.CLICKED,this.onClicked.bind(this)),t.setEventListener(n.READY_TO_PLAY,this.onReadyToPlay.bind(this)))},onReadyToPlay:function(){cc.Component.EventHandler.emitEvents(this.videoPlayerEvent,this,n.READY_TO_PLAY),this.node.emit("ready-to-play",this)},onMetaLoaded:function(){cc.Component.EventHandler.emitEvents(this.videoPlayerEvent,this,n.META_LOADED),this.node.emit("meta-loaded",this)},onClicked:function(){cc.Component.EventHandler.emitEvents(this.videoPlayerEvent,this,n.CLICKED),this.node.emit("clicked",this)},onPlaying:function(){cc.Component.EventHandler.emitEvents(this.videoPlayerEvent,this,n.PLAYING),this.node.emit("playing",this)},onPasued:function(){cc.Component.EventHandler.emitEvents(this.videoPlayerEvent,this,n.PAUSED),this.node.emit("paused",this)},onStopped:function(){cc.Component.EventHandler.emitEvents(this.videoPlayerEvent,this,n.STOPPED),this.node.emit("stopped",this)},onCompleted:function(){cc.Component.EventHandler.emitEvents(this.videoPlayerEvent,this,n.COMPLETED),this.node.emit("completed",this)},play:function(){this._sgNode&&(this._syncVolume(),this._sgNode.play())},resume:function(){this._sgNode&&(this._syncVolume(),this._sgNode.resume())},pause:function(){this._sgNode&&this._sgNode.pause()},stop:function(){this._sgNode&&this._sgNode.stop()},getDuration:function(){return this._sgNode?this._sgNode.duration():-1},isPlaying:function(){return!!this._sgNode&&this._sgNode.isPlaying()}});cc.VideoPlayer=e.exports=s}),{"../videoplayer/CCSGVideoPlayer":242}],102:[(function(t,e,i){var n=cc.Class({name:"cc.ViewGroup",extends:t("./CCComponent")});cc.ViewGroup=e.exports=n}),{"./CCComponent":78}],103:[(function(t,e,i){t("../webview/CCSGWebView");var n=_ccsg.WebView.EventType;function r(){}var s=cc.Class({name:"cc.WebView",extends:cc._RendererUnderSG,editor:!1,properties:{_useOriginalSize:!0,_url:"",url:{type:String,tooltip:!1,get:function(){return this._url},set:function(t){this._url=t;var e=this._sgNode;e&&e.loadURL(t)}},webviewEvents:{default:[],type:cc.Component.EventHandler}},statics:{EventType:n},onLoad:!1,_createSgNode:function(){return new _ccsg.WebView},_initSgNode:function(){var t=this._sgNode;t&&(t.createDomElementIfNeeded(),t.loadURL(this._url),t.setContentSize(this.node.getContentSize()))},onEnable:function(){this._super();var t=this._sgNode;t.setEventListener(n.LOADED,this._onWebViewLoaded.bind(this)),t.setEventListener(n.LOADING,this._onWebViewLoading.bind(this)),t.setEventListener(n.ERROR,this._onWebViewLoadError.bind(this))},onDisable:function(){this._super();var t=this._sgNode;t.setEventListener(n.LOADED,r),t.setEventListener(n.LOADING,r),t.setEventListener(n.ERROR,r)},_onWebViewLoaded:function(){cc.Component.EventHandler.emitEvents(this.webviewEvents,this,n.LOADED),this.node.emit("loaded",this)},_onWebViewLoading:function(){return cc.Component.EventHandler.emitEvents(this.webviewEvents,this,n.LOADING),this.node.emit("loading",this),!0},_onWebViewLoadError:function(){cc.Component.EventHandler.emitEvents(this.webviewEvents,this,n.ERROR),this.node.emit("error",this)},setJavascriptInterfaceScheme:function(t){this._sgNode&&this._sgNode.setJavascriptInterfaceScheme(t)},setOnJSCallback:function(t){this._sgNode&&this._sgNode.setOnJSCallback(t)},evaluateJS:function(t){this._sgNode&&this._sgNode.evaluateJS(t)}});cc.WebView=e.exports=s}),{"../webview/CCSGWebView":243}],104:[(function(t,e,i){var n=t("../base-ui/CCWidgetManager"),r=n.AlignMode,s=n._AlignFlags,o=s.TOP,a=s.MID,c=s.BOT,h=s.LEFT,l=s.CENTER,u=s.RIGHT,_=o|c,d=h|u,f=cc.Class({name:"cc.Widget",extends:t("./CCComponent"),editor:!1,properties:{target:{get:function(){return this._target},set:function(t){this._target=t},type:cc.Node,tooltip:!1},isAlignTop:{get:function(){return(this._alignFlags&o)>0},set:function(t){this._setAlign(o,t)},animatable:!1,tooltip:!1},isAlignVerticalCenter:{get:function(){return(this._alignFlags&a)>0},set:function(t){t?(this.isAlignTop=!1,this.isAlignBottom=!1,this._alignFlags|=a):this._alignFlags&=~a},animatable:!1,tooltip:!1},isAlignBottom:{get:function(){return(this._alignFlags&c)>0},set:function(t){this._setAlign(c,t)},animatable:!1,tooltip:!1},isAlignLeft:{get:function(){return(this._alignFlags&h)>0},set:function(t){this._setAlign(h,t)},animatable:!1,tooltip:!1},isAlignHorizontalCenter:{get:function(){return(this._alignFlags&l)>0},set:function(t){t?(this.isAlignLeft=!1,this.isAlignRight=!1,this._alignFlags|=l):this._alignFlags&=~l},animatable:!1,tooltip:!1},isAlignRight:{get:function(){return(this._alignFlags&u)>0},set:function(t){this._setAlign(u,t)},animatable:!1,tooltip:!1},isStretchWidth:{get:function(){return(this._alignFlags&d)===d},visible:!1},isStretchHeight:{get:function(){return(this._alignFlags&_)===_},visible:!1},top:{get:function(){return this._top},set:function(t){this._top=t},tooltip:!1},bottom:{get:function(){return this._bottom},set:function(t){this._bottom=t},tooltip:!1},left:{get:function(){return this._left},set:function(t){this._left=t},tooltip:!1},right:{get:function(){return this._right},set:function(t){this._right=t},tooltip:!1},horizontalCenter:{get:function(){return this._horizontalCenter},set:function(t){this._horizontalCenter=t},tooltip:!1},verticalCenter:{get:function(){return this._verticalCenter},set:function(t){this._verticalCenter=t},tooltip:!1},isAbsoluteHorizontalCenter:{get:function(){return this._isAbsHorizontalCenter},set:function(t){this._isAbsHorizontalCenter=t},animatable:!1},isAbsoluteVerticalCenter:{get:function(){return this._isAbsVerticalCenter},set:function(t){this._isAbsVerticalCenter=t},animatable:!1},isAbsoluteTop:{get:function(){return this._isAbsTop},set:function(t){this._isAbsTop=t},animatable:!1},isAbsoluteBottom:{get:function(){return this._isAbsBottom},set:function(t){this._isAbsBottom=t},animatable:!1},isAbsoluteLeft:{get:function(){return this._isAbsLeft},set:function(t){this._isAbsLeft=t},animatable:!1},isAbsoluteRight:{get:function(){return this._isAbsRight},set:function(t){this._isAbsRight=t},animatable:!1},alignMode:{default:r.ON_WINDOW_RESIZE,type:r,tooltip:!1},_wasAlignOnce:{default:void 0,formerlySerializedAs:"isAlignOnce"},_target:null,_alignFlags:0,_left:0,_right:0,_top:0,_bottom:0,_verticalCenter:0,_horizontalCenter:0,_isAbsLeft:!0,_isAbsRight:!0,_isAbsTop:!0,_isAbsBottom:!0,_isAbsHorizontalCenter:!0,_isAbsVerticalCenter:!0,_originalWidth:0,_originalHeight:0},statics:{AlignMode:r},onLoad:function(){void 0!==this._wasAlignOnce&&(this.alignMode=this._wasAlignOnce?r.ONCE:r.ALWAYS,this._wasAlignOnce=void 0)},onEnable:function(){n.add(this)},onDisable:function(){n.remove(this)},_setAlign:function(t,e){if(e!=(this._alignFlags&t)>0){var i=(t&d)>0;e?(this._alignFlags|=t,i?(this.isAlignHorizontalCenter=!1,this.isStretchWidth&&(this._originalWidth=this.node.width)):(this.isAlignVerticalCenter=!1,this.isStretchHeight&&(this._originalHeight=this.node.height))):(i?this.isStretchWidth&&(this.node.width=this._originalWidth):this.isStretchHeight&&(this.node.height=this._originalHeight),this._alignFlags&=~t)}},updateAlignment:function(){n.updateAlignment(this.node)}});Object.defineProperty(f.prototype,"isAlignOnce",{get:function(){return this.alignMode===r.ONCE},set:function(t){this.alignMode=t?r.ONCE:r.ALWAYS}}),cc.Widget=e.exports=f}),{"../base-ui/CCWidgetManager":61,"./CCComponent":78}],105:[(function(t,e,i){t("./CCComponent"),t("./CCRendererInSG"),t("./CCRendererUnderSG"),t("./CCComponentEventHandler"),t("./missing-script"),e.exports=[t("./CCSprite"),t("./CCWidget"),t("./CCCanvas"),t("./CCAudioSource"),t("./CCAnimation"),t("./CCButton"),t("./CCLabel"),t("./CCProgressBar"),t("./CCMask"),t("./CCScrollBar"),t("./CCScrollView"),t("./CCPageViewIndicator"),t("./CCPageView"),t("./CCSlider"),t("./CCLayout"),t("./CCEditBox"),t("./CCVideoPlayer"),t("./CCWebView"),t("./CCSpriteDistortion"),t("./CCLabelOutline"),t("./CCRichText"),t("./CCToggleContainer"),t("./CCToggleGroup"),t("./CCToggle"),t("./CCBlockInputEvents")]}),{"./CCAnimation":73,"./CCAudioSource":74,"./CCBlockInputEvents":75,"./CCButton":76,"./CCCanvas":77,"./CCComponent":78,"./CCComponentEventHandler":79,"./CCEditBox":80,"./CCLabel":81,"./CCLabelOutline":82,"./CCLayout":83,"./CCMask":84,"./CCPageView":85,"./CCPageViewIndicator":86,"./CCProgressBar":87,"./CCRendererInSG":88,"./CCRendererUnderSG":89,"./CCRichText":90,"./CCScrollBar":92,"./CCScrollView":93,"./CCSlider":94,"./CCSprite":95,"./CCSpriteDistortion":96,"./CCToggle":98,"./CCToggleContainer":99,"./CCToggleGroup":100,"./CCVideoPlayer":101,"./CCWebView":103,"./CCWidget":104,"./missing-script":106}],106:[(function(t,e,i){var n=cc.js,r=t("../utils/misc").BUILTIN_CLASSID_RE,s=cc.Class({name:"cc.MissingClass",properties:{_$erialized:{default:null,visible:!1,editorOnly:!0}}}),o=cc.Class({name:"cc.MissingScript",extends:cc.Component,editor:{inspector:"packages://inspector/inspectors/comps/missing-script.js"},properties:{compiled:{default:!1,serializable:!1},_$erialized:{default:null,visible:!1,editorOnly:!0}},ctor:!1,statics:{safeFindClass:function(t,e){var i=n._getClassById(t);return i||(t?(cc.deserialize.reportMissingClass(t),o.getMissingWrapper(t,e)):null)},getMissingWrapper:function(t,e){return e.node&&(/^[0-9a-zA-Z+/]{23}$/.test(t)||r.test(t))?o:s}},onLoad:function(){cc.warnID(4600,this.node.name)}});cc._MissingScript=e.exports=o}),{"../utils/misc":228}],107:[(function(t,e,i){var n=40,r=400,s=t("../platform/utils"),o=t("../platform/CCSys");function a(t){var e=t.convertToWorldSpace(cc.p(0,0)),i=cc.visibleRect.height,s=.5;cc.visibleRect.width>i&&(s=.7),setTimeout((function(){if(window.scrollY320&&(t=320),window.scrollTo(t,t)}}),r)}var c=cc.Enum({DEFAULT:0,DONE:1,SEND:2,SEARCH:3,GO:4}),h=cc.Enum({ANY:0,EMAIL_ADDR:1,NUMERIC:2,PHONE_NUMBER:3,URL:4,DECIMAL:5,SINGLE_LINE:6}),l=cc.Enum({PASSWORD:0,SENSITIVE:1,INITIAL_CAPS_WORD:2,INITIAL_CAPS_SENTENCE:3,INITIAL_CAPS_ALL_CHARACTERS:4,DEFAULT:5});cc.EditBoxDelegate=cc._Class.extend({editBoxEditingDidBegan:function(t){},editBoxEditingDidEnded:function(t){},editBoxTextChanged:function(t,e){},editBoxEditingReturn:function(t){}}),_ccsg.EditBox=_ccsg.Node.extend({_backgroundSprite:null,_delegate:null,_editBoxInputMode:h.ANY,_editBoxInputFlag:l.DEFAULT,_keyboardReturnType:c.DEFAULT,_maxLength:50,_text:"",_placeholderText:"",_alwaysOnTop:!1,_placeholderFontName:"",_placeholderFontSize:14,__fullscreen:!1,__autoResize:!1,_placeholderColor:null,_className:"EditBox",ctor:function(t,e){_ccsg.Node.prototype.ctor.call(this),this._textColor=cc.Color.WHITE,this._placeholderColor=cc.Color.GRAY,this.initWithSizeAndBackgroundSprite(t,e),this._renderCmd._createLabels()},_createRenderCmd:function(){return cc._renderType===cc.game.RENDER_TYPE_CANVAS?new _ccsg.EditBox.CanvasRenderCmd(this):new _ccsg.EditBox.WebGLRenderCmd(this)},setContentSize:function(t,e){void 0!==t.width&&void 0!==t.height&&(e=t.height,t=t.width),_ccsg.Node.prototype.setContentSize.call(this,t,e),this._updateEditBoxSize(t,e)},setVisible:function(t){_ccsg.Node.prototype.setVisible.call(this,t),this._renderCmd.updateVisibility()},createDomElementIfNeeded:function(){this._renderCmd._edTxt||this._renderCmd.setInputMode(this._editBoxInputMode)},setTabIndex:function(t){this._renderCmd._edTxt&&(this._renderCmd._edTxt.tabIndex=t)},getTabIndex:function(){return this._renderCmd._edTxt?this._renderCmd._edTxt.tabIndex:(cc.warnID(4700),-1)},setFocus:function(){this._renderCmd._edTxt&&this._renderCmd._edTxt.focus()},isFocused:function(){return this._renderCmd._edTxt?document.activeElement===this._renderCmd._edTxt:(cc.warnID(4700),!1)},stayOnTop:function(t){this._alwaysOnTop!==t&&(this._alwaysOnTop=t,this._renderCmd.stayOnTop(this._alwaysOnTop))},cleanup:function(){this._super(),this._renderCmd.removeDom()},_onTouchBegan:function(t){var e=t.getLocation(),i=cc.rect(0,0,this._contentSize.width,this._contentSize.height);return!!cc.rectContainsPoint(i,this.convertToNodeSpace(e))||(this._renderCmd._endEditing(),!1)},_onTouchEnded:function(){this._renderCmd._beginEditing()},_updateBackgroundSpriteSize:function(t,e){this._backgroundSprite&&this._backgroundSprite.setContentSize(t,e)},_updateEditBoxSize:function(t,e){var i="number"==typeof t.width?t.width:t,n="number"==typeof t.height?t.height:e;this._updateBackgroundSpriteSize(i,n),this._renderCmd.updateSize(i,n)},setLineHeight:function(t){this._renderCmd.setLineHeight(t)},setFont:function(t,e){this._renderCmd.setFont(t,e)},_setFont:function(t){this._renderCmd._setFont(t)},getBackgroundSprite:function(){return this._backgroundSprite},setFontName:function(t){this._renderCmd.setFontName(t)},setFontSize:function(t){this._renderCmd.setFontSize(t)},setString:function(t){t.length>=this._maxLength&&(t=t.slice(0,this._maxLength)),this._text=t,this._renderCmd.setString(t)},setFontColor:function(t){this._textColor=t,this._renderCmd.setFontColor(t)},setMaxLength:function(t){isNaN(t)||(t<0&&(t=65535),this._maxLength=t,this._renderCmd.setMaxLength(t))},getMaxLength:function(){return this._maxLength},setPlaceHolder:function(t){null!==t&&(this._renderCmd.setPlaceHolder(t),this._placeholderText=t)},setPlaceholderFont:function(t,e){this._placeholderFontName=t,this._placeholderFontSize=e,this._renderCmd._updateDOMPlaceholderFontStyle()},_setPlaceholderFont:function(t){var e=cc.LabelTTF._fontStyleRE.exec(t);e&&(this._placeholderFontName=e[2],this._placeholderFontSize=parseInt(e[1]),this._renderCmd._updateDOMPlaceholderFontStyle())},setPlaceholderFontName:function(t){this._placeholderFontName=t,this._renderCmd._updateDOMPlaceholderFontStyle()},setPlaceholderFontSize:function(t){this._placeholderFontSize=t,this._renderCmd._updateDOMPlaceholderFontStyle()},setPlaceholderFontColor:function(t){this._placeholderColor=t,this._renderCmd.setPlaceholderFontColor(t)},setInputFlag:function(t){this._editBoxInputFlag=t,this._renderCmd.setInputFlag(t)},getString:function(){return this._text},initWithSizeAndBackgroundSprite:function(t,e){return this._backgroundSprite&&this._backgroundSprite.removeFromParent(),this._backgroundSprite=e,_ccsg.Node.prototype.setContentSize.call(this,t),this._backgroundSprite&&!this._backgroundSprite.parent&&(this._backgroundSprite.setAnchorPoint(cc.p(0,0)),this.addChild(this._backgroundSprite),this._updateBackgroundSpriteSize(t.width,t.height)),this.x=0,this.y=0,!0},setDelegate:function(t){this._delegate=t},getPlaceHolder:function(){return this._placeholderText},setInputMode:function(t){if(this._editBoxInputMode!==t){var e=this.getString();this._editBoxInputMode=t,this._renderCmd.setInputMode(t),this._renderCmd.transform(),this.setString(e),this._renderCmd._updateLabelPosition(this.getContentSize())}},setReturnType:function(t){this._keyboardReturnType=t,this._renderCmd._updateDomInputType()},initWithBackgroundColor:function(t,e){this._edWidth=t.width,this.dom.style.width=this._edWidth.toString()+"px",this._edHeight=t.height,this.dom.style.height=this._edHeight.toString()+"px",this.dom.style.backgroundColor=cc.colorToHex(e)}});var u=_ccsg.EditBox.prototype;cc.defineGetterSetter(u,"font",null,u._setFont),cc.defineGetterSetter(u,"fontName",null,u.setFontName),cc.defineGetterSetter(u,"fontSize",null,u.setFontSize),cc.defineGetterSetter(u,"fontColor",null,u.setFontColor),cc.defineGetterSetter(u,"string",u.getString,u.setString),cc.defineGetterSetter(u,"maxLength",u.getMaxLength,u.setMaxLength),cc.defineGetterSetter(u,"placeholder",u.getPlaceHolder,u.setPlaceHolder),cc.defineGetterSetter(u,"placeholderFont",null,u._setPlaceholderFont),cc.defineGetterSetter(u,"placeholderFontName",null,u.setPlaceholderFontName),cc.defineGetterSetter(u,"placeholderFontSize",null,u.setPlaceholderFontSize),cc.defineGetterSetter(u,"placeholderFontColor",null,u.setPlaceholderFontColor),cc.defineGetterSetter(u,"inputFlag",null,u.setInputFlag),cc.defineGetterSetter(u,"delegate",null,u.setDelegate),cc.defineGetterSetter(u,"inputMode",null,u.setInputMode),cc.defineGetterSetter(u,"returnType",null,u.setReturnType),u=null,_ccsg.EditBox.InputMode=h,_ccsg.EditBox.InputFlag=l,_ccsg.EditBox.KeyboardReturnType=c,(function(t){t._polyfill={zoomInvalid:!1},o.OS_ANDROID!==o.os||o.browserType!==o.BROWSER_TYPE_SOUGOU&&o.browserType!==o.BROWSER_TYPE_360||(t._polyfill.zoomInvalid=!0)})(_ccsg.EditBox),(function(t){var e=function(){}.prototype=Object.create(Object.prototype);e.updateMatrix=function(){if(this._edTxt){var e=this._node,i=cc.view._scaleX,n=cc.view._scaleY,r=cc.view._devicePixelRatio,s=this._worldTransform;i/=r,n/=r;var o=cc.game.container,a=s.a*i,c=s.b,h=s.c,l=s.d*n,u=o&&o.style.paddingLeft&&parseInt(o.style.paddingLeft),_=o&&o.style.paddingBottom&&parseInt(o.style.paddingBottom),d=s.tx*i+u,f=s.ty*n+_;t.zoomInvalid&&(this.updateSize(e._contentSize.width*a,e._contentSize.height*l),a=1,l=1);var m="matrix("+a+","+-c+","+-h+","+l+","+d+","+-f+")";this._edTxt.style.transform=m,this._edTxt.style["-webkit-transform"]=m,this._edTxt.style["transform-origin"]="0px 100% 0px",this._edTxt.style["-webkit-transform-origin"]="0px 100% 0px"}},e.updateVisibility=function(){this._edTxt&&(this._node.visible?this._edTxt.style.visibility="visible":this._edTxt.style.visibility="hidden")},e.stayOnTop=function(t){t?(this._removeLabels(),this._edTxt.style.display=""):(this._createLabels(),this._edTxt.style.display="none",this._showLabels())},e._beginEditingOnMobile=function(t){this.__orientationChanged=function(){a(t)},window.addEventListener("orientationchange",this.__orientationChanged),cc.view.isAutoFullScreenEnabled()?(this.__fullscreen=!0,cc.view.enableAutoFullScreen(!1),cc.screen.exitFullScreen()):this.__fullscreen=!1,this.__autoResize=cc.view.__resizeWithBrowserSize,cc.view.resizeWithBrowserSize(!1)},e._endEditingOnMobile=function(){if(this.__rotateScreen){cc.container.style["-webkit-transform"]="rotate(90deg)",cc.container.style.transform="rotate(90deg)";var t=cc.view,e=t._originalDesignResolutionSize.width,i=t._originalDesignResolutionSize.height;e>0&&t.setDesignResolutionSize(e,i,t._resolutionPolicy),this.__rotateScreen=!1}window.removeEventListener("orientationchange",this.__orientationChanged),window.scrollTo(0,0),this.__fullscreen&&cc.view.enableAutoFullScreen(!0),this.__autoResize&&cc.view.resizeWithBrowserSize(!0)},e._onFocusOnMobile=function(t){cc.view._isRotated?(cc.container.style["-webkit-transform"]="rotate(0deg)",cc.container.style.transform="rotate(0deg)",cc.view._isRotated=!1,cc.view.getResolutionPolicy().apply(cc.view,cc.view.getDesignResolutionSize()),cc.view._isRotated=!0,window.scrollTo(35,35),this.__rotateScreen=!0):this.__rotateScreen=!1;a(t)},e._createDomInput=function(){this.removeDom();var t=this,e=this._edTxt=document.createElement("input");function i(e){var i=t._editBox;e.value.length>e.maxLength&&(e.value=e.value.slice(0,e.maxLength)),i._delegate&&i._delegate.editBoxTextChanged&&i._text!==e.value&&(i._text=e.value,t._updateDomTextCases(),i._delegate.editBoxTextChanged(i,i._text))}e.type="text",e.style.fontSize=this._edFontSize+"px",e.style.color="#000000",e.style.border=0,e.style.background="transparent",e.style.width="100%",e.style.height="100%",e.style.active=0,e.style.outline="medium",e.style.padding="0",e.style.textTransform="uppercase",e.style.display="none",e.style.position="absolute",e.style.bottom="0px",e.style.left="2px",e.style["-moz-appearance"]="textfield",e.style.className="cocosEditBox";var n=!1;return e.addEventListener("compositionstart",(function(){n=!0})),e.addEventListener("compositionend",(function(){n=!1,i(this)})),e.addEventListener("input",(function(){n||i(this)})),e.addEventListener("keypress",(function(e){var i=t._editBox;e.keyCode===cc.KEY.enter&&(e.stopPropagation(),e.preventDefault(),""===this.value&&(this.style.fontSize=i._placeholderFontSize+"px",this.style.color=cc.colorToHex(i._placeholderColor)),i._text=this.value,t._updateDomTextCases(),t._endEditing(),i._delegate&&i._delegate.editBoxEditingReturn&&i._delegate.editBoxEditingReturn(i),cc._canvas.focus())})),e.addEventListener("focus",(function(){var e=t._editBox;this.style.fontSize=t._edFontSize+"px",this.style.color=cc.colorToHex(e._textColor),t._hiddenLabels(),o.isMobile&&t._onFocusOnMobile(e),e._delegate&&e._delegate.editBoxEditingDidBegan&&e._delegate.editBoxEditingDidBegan(e)})),e.addEventListener("blur",(function(){var e=t._editBox;e._text=this.value,t._updateDomTextCases(),e._delegate&&e._delegate.editBoxEditingDidEnded&&e._delegate.editBoxEditingDidEnded(e),""===this.value&&(this.style.fontSize=e._placeholderFontSize+"px",this.style.color=cc.colorToHex(e._placeholderColor)),t._endEditing()})),this._addDomToGameContainer(),e},e._createDomTextArea=function(){this.removeDom();var t=this,e=this._edTxt=document.createElement("textarea");function i(e){e.value.length>e.maxLength&&(e.value=e.value.slice(0,e.maxLength));var i=t._editBox;i._delegate&&i._delegate.editBoxTextChanged&&i._text.toLowerCase()!==e.value.toLowerCase()&&(i._text=e.value,t._updateDomTextCases(),i._delegate.editBoxTextChanged(i,i._text))}e.type="text",e.style.fontSize=this._edFontSize+"px",e.style.color="#000000",e.style.border=0,e.style.background="transparent",e.style.width="100%",e.style.height="100%",e.style.active=0,e.style.outline="medium",e.style.padding="0",e.style.resize="none",e.style.textTransform="uppercase",e.style.overflow_y="scroll",e.style.display="none",e.style.position="absolute",e.style.bottom="0px",e.style.left="2px",e.style.className="cocosEditBox";var n=!1;return e.addEventListener("compositionstart",(function(){n=!0})),e.addEventListener("compositionend",(function(){n=!1,i(this)})),e.addEventListener("input",(function(){n||i(this)})),e.addEventListener("focus",(function(){var e=t._editBox;t._hiddenLabels(),this.style.fontSize=t._edFontSize+"px",this.style.color=cc.colorToHex(e._textColor),o.isMobile&&t._onFocusOnMobile(e),e._delegate&&e._delegate.editBoxEditingDidBegan&&e._delegate.editBoxEditingDidBegan(e)})),e.addEventListener("keypress",(function(e){var i=t._editBox;e.keyCode===cc.KEY.enter&&(e.stopPropagation(),i._delegate&&i._delegate.editBoxEditingReturn&&i._delegate.editBoxEditingReturn(i))})),e.addEventListener("blur",(function(){var e=t._editBox;e._text=this.value,t._updateDomTextCases(),e._delegate&&e._delegate.editBoxEditingDidEnded&&e._delegate.editBoxEditingDidEnded(e),""===this.value&&(this.style.fontSize=e._placeholderFontSize+"px",this.style.color=cc.colorToHex(e._placeholderColor)),t._endEditing()})),this._addDomToGameContainer(),e},e._createWXInput=function(t){this.removeDom();var e=this,i=this._edTxt=document.createElement("input");i.type="text",i.focus=function(){var i=e._editBox;wx.showKeyboard({defaultValue:i._text,maxLength:140,multiple:t,confirmHold:!0,confirmType:"done",success:function(t){i._delegate&&i._delegate.editBoxEditingDidBegan&&i._delegate.editBoxEditingDidBegan(i)},fail:function(t){cc.warn(t.errMsg),e._endEditing()}}),wx.onKeyboardConfirm((function(t){i._text=t.value,e._updateDomTextCases(),i._delegate&&i._delegate.editBoxEditingReturn&&i._delegate.editBoxEditingReturn(i),wx.hideKeyboard({success:function(t){i._delegate&&i._delegate.editBoxEditingDidEnded&&i._delegate.editBoxEditingDidEnded(i)},fail:function(t){cc.warn(t.errMsg)}})})),wx.onKeyboardInput((function(t){i._delegate&&i._delegate.editBoxTextChanged&&i._text!==t.value&&(i._text=t.value,e._updateDomTextCases(),i._delegate.editBoxTextChanged(i,i._text))})),wx.onKeyboardComplete((function(){e._endEditing(),wx.offKeyboardConfirm(),wx.offKeyboardInput(),wx.offKeyboardComplete()}))}},e._createLabels=function(){var t=this._editBox.getContentSize();this._textLabel||(this._textLabel=_ccsg.Label.pool.get(),this._textLabel.setAnchorPoint(cc.p(0,1)),this._textLabel.setOverflow(_ccsg.Label.Overflow.CLAMP),this._editBox.addChild(this._textLabel,100)),this._placeholderLabel||(this._placeholderLabel=_ccsg.Label.pool.get(),this._placeholderLabel.setAnchorPoint(cc.p(0,1)),this._placeholderLabel.setColor(cc.Color.GRAY),this._editBox.addChild(this._placeholderLabel,100)),this._updateLabelPosition(t)},e._removeLabels=function(){this._textLabel&&(this._editBox.removeChild(this._textLabel),this._textLabel=null)},e._updateLabelPosition=function(t){if(this._textLabel&&this._placeholderLabel){var e=cc.size(t.width-2,t.height);this._textLabel.setContentSize(e),this._placeholderLabel.setLineHeight(t.height);var i=this._placeholderLabel.getContentSize();this._editBox._editBoxInputMode===h.ANY?(this._textLabel.setPosition(2,t.height),this._placeholderLabel.setPosition(2,t.height),this._placeholderLabel.setVerticalAlign(cc.VerticalTextAlignment.TOP),this._textLabel.setVerticalAlign(cc.VerticalTextAlignment.TOP),this._textLabel.enableWrapText(!0)):(this._textLabel.enableWrapText(!1),this._textLabel.setPosition(2,t.height),this._placeholderLabel.setPosition(2,(t.height+i.height)/2),this._placeholderLabel.setVerticalAlign(cc.VerticalTextAlignment.CENTER),this._textLabel.setVerticalAlign(cc.VerticalTextAlignment.CENTER))}},e.setLineHeight=function(t){this._textLabel&&this._textLabel.setLineHeight(t)},e._hiddenLabels=function(){this._textLabel&&this._textLabel.setVisible(!1),this._placeholderLabel&&this._placeholderLabel.setVisible(!1)},e._updateDomTextCases=function(){var t=this._editBox._editBoxInputFlag;t===l.INITIAL_CAPS_ALL_CHARACTERS?this._editBox._text=this._editBox._text.toUpperCase():t===l.INITIAL_CAPS_WORD?this._editBox._text=(function(t){return t.replace(/(?:^|\s)\S/g,(function(t){return t.toUpperCase()}))})(this._editBox._text):t===l.INITIAL_CAPS_SENTENCE&&(this._editBox._text=(function(t){return t.charAt(0).toUpperCase()+t.slice(1)})(this._editBox._text)),this._edTxt&&(this._edTxt.value=this._editBox._text)},e._updateLabelStringStyle=function(){if("password"===this._edTxt.type){for(var t="",e=this._editBox._text.length,i=0;i=0);)++n;e.gt0Index=n}}},_sortListenersOfFixedPriorityAsc:function(t,e){return t._getFixedPriority()-e._getFixedPriority()},_onUpdateListeners:function(t){var e,i,n,r=t.getFixedPriorityListeners(),s=t.getSceneGraphPriorityListeners(),o=this._toRemovedListeners;if(s)for(e=0;e0,3508),!(e>1)){var i;(i=this._listenersMap[cc._EventListenerTouchOneByOne.LISTENER_ID])&&this._onUpdateListeners(i),(i=this._listenersMap[cc._EventListenerTouchAllAtOnce.LISTENER_ID])&&this._onUpdateListeners(i),cc.assertID(1===e,3509);var n=this._toAddedListeners;if(0!==n.length){for(var r=0,s=n.length;r0&&-1!==(r=t._claimedTouches.indexOf(n))&&(o=!0,a===c.MOVED&&t.onTouchMoved?t.onTouchMoved(n,i):a===c.ENDED?(t.onTouchEnded&&t.onTouchEnded(n,i),t._registered&&t._claimedTouches.splice(r,1)):a===c.CANCELLED&&(t.onTouchCancelled&&t.onTouchCancelled(n,i),t._registered&&t._claimedTouches.splice(r,1))),i.isStopped()?(s._updateTouchListeners(i),!0):!!(o&&t._registered&&t.swallowTouches)&&(e.needsMutableSet&&e.touches.splice(n,1),!0)},_dispatchTouchEvent:function(t){this._sortEventListeners(cc._EventListenerTouchOneByOne.LISTENER_ID),this._sortEventListeners(cc._EventListenerTouchAllAtOnce.LISTENER_ID);var e=this._getListeners(cc._EventListenerTouchOneByOne.LISTENER_ID),i=this._getListeners(cc._EventListenerTouchAllAtOnce.LISTENER_ID);if(null!==e||null!==i){var n=t.getTouches(),r=cc.js.array.copy(n),s={event:t,needsMutableSet:e&&i,touches:r,selTouch:null};if(e)for(var o=0;o0&&(this._dispatchEventToListeners(i,this._onTouchesEventCallback,{event:t,touches:r}),t.isStopped())||this._updateTouchListeners(t)}},_onTouchesEventCallback:function(t,e){if(!t._registered)return!1;var i=cc.Event.EventTouch,n=e.event,r=e.touches,o=n.getEventCode();return n.currentTarget=t._node,o===i.BEGAN&&t.onTouchesBegan?t.onTouchesBegan(r,n):o===i.MOVED&&t.onTouchesMoved?t.onTouchesMoved(r,n):o===i.ENDED&&t.onTouchesEnded?t.onTouchesEnded(r,n):o===i.CANCELLED&&t.onTouchesCancelled&&t.onTouchesCancelled(r,n),!!n.isStopped()&&(s._updateTouchListeners(n),!0)},_associateNodeAndEventListener:function(t,e){var i=this._nodeListenersMap[t.__instanceId];i||(i=[],this._nodeListenersMap[t.__instanceId]=i),i.push(e)},_dissociateNodeAndEventListener:function(t,e){var i=this._nodeListenersMap[t.__instanceId];i&&(cc.js.array.remove(i,e),0===i.length&&delete this._nodeListenersMap[t.__instanceId])},_dispatchEventToListeners:function(t,e,i){var n,r,s=!1,o=t.getFixedPriorityListeners(),a=t.getSceneGraphPriorityListeners(),c=0;if(o&&0!==o.length)for(;c0){for(var a;n0},a.on=function(t,e,i,r){if("boolean"==typeof i?(r=i,i=void 0):r=!!r,e){var s=null;return(s=r?this._capturingListeners=this._capturingListeners||new n:this._bubblingListeners=this._bubblingListeners||new n).has(t,e,i)||(s.add(t,e,i),i&&i.__eventTargets&&i.__eventTargets.push(this),this._addEventFlag(t,s,r)),e}cc.errorID(6800)},a.off=function(t,e,i,n){if("boolean"==typeof i?(n=i,i=void 0):n=!!n,e){var s=n?this._capturingListeners:this._bubblingListeners;s&&(s.remove(t,e,i),i&&i.__eventTargets&&r(i.__eventTargets,this),this._purgeEventFlag(t,s,n))}else this._capturingListeners&&this._capturingListeners.removeAll(t),this._bubblingListeners&&this._bubblingListeners.removeAll(t),this._hasListenerCache&&delete this._hasListenerCache[t]},a.targetOff=function(t){this._capturingListeners&&(this._capturingListeners.removeAll(t),this._resetFlagForTarget(t,this._capturingListeners,!0)),this._bubblingListeners&&(this._bubblingListeners.removeAll(t),this._resetFlagForTarget(t,this._bubblingListeners,!1))},a.once=function(t,e,i,n){var r="__ONCE_FLAG:"+t,s=n?this._capturingListeners:this._bubblingListeners;if(!(s&&s.has(r,e,i))){var o=this,a=function(c){o.off(t,a,i,n),s.remove(r,e,i),e.call(this,c)};this.on(t,a,i,n),s||(s=n?this._capturingListeners:this._bubblingListeners),s.add(r,e,i)}},a.dispatchEvent=function(t){(function(t,e){var i,n;for(e.target=t,s.length=0,t._getCapturingTargets(e.type,s),e.eventPhase=1,n=s.length-1;n>=0;--n)if((i=s[n])._isTargetActive(e.type)&&i._capturingListeners&&(e.currentTarget=i,i._capturingListeners.invoke(e,s),e._propagationStopped))return void(s.length=0);if(s.length=0,t._isTargetActive(e.type)&&(e.eventPhase=2,e.currentTarget=t,t._capturingListeners&&t._capturingListeners.invoke(e),!e._propagationImmediateStopped&&t._bubblingListeners&&t._bubblingListeners.invoke(e)),!e._propagationStopped&&e.bubbles)for(t._getBubblingTargets(e.type,s),e.eventPhase=3,n=0;n80*i){n=c=t[0],a=h=t[1];for(var x=i;xc&&(c=l),d>h&&(h=d);m=Math.max(c-n,h-a)}return o(y,v,i,n,a,m),v}function r(t,e,i,n,r){var s,o;if(r===S(t,e,i,n)>0)for(s=e;s=e;s-=n)o=T(s,t[s],t[s+1],o);return o&&y(o,o.next)&&(A(o),o=o.next),o}function s(t,e){if(!t)return t;e||(e=t);var i,n=t;do{if(i=!1,n.steiner||!y(n,n.next)&&0!==g(n.prev,n,n.next))n=n.next;else{if(A(n),(n=e=n.prev)===n.next)return null;i=!0}}while(i||n!==e);return e}function o(t,e,i,n,r,u,_){if(t){!_&&u&&(function(t,e,i,n){var r=t;do{null===r.z&&(r.z=d(r.x,r.y,e,i,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,(function(t){var e,i,n,r,s,o,a,c,h=1;do{for(i=t,t=null,s=null,o=0;i;){for(o++,n=i,a=0,e=0;e0||c>0&&n;)0===a?(r=n,n=n.nextZ,c--):0!==c&&n?i.z<=n.z?(r=i,i=i.nextZ,a--):(r=n,n=n.nextZ,c--):(r=i,i=i.nextZ,a--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;i=n}s.nextZ=null,h*=2}while(o>1)})(r)})(t,n,r,u);for(var f,m,p=t;t.prev!==t.next;)if(f=t.prev,m=t.next,u?c(t,n,r,u):a(t))e.push(f.i/i),e.push(t.i/i),e.push(m.i/i),A(t),t=m.next,p=m.next;else if((t=m)===p){_?1===_?o(t=h(t,e,i),e,i,n,r,u,2):2===_&&l(t,e,i,n,r,u):o(s(t),e,i,n,r,u,1);break}}}function a(t){var e=t.prev,i=t,n=t.next;if(g(e,i,n)>=0)return!1;for(var r=t.next.next;r!==t.prev;){if(m(e.x,e.y,i.x,i.y,n.x,n.y,r.x,r.y)&&g(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function c(t,e,i,n){var r=t.prev,s=t,o=t.next;if(g(r,s,o)>=0)return!1;for(var a=r.xs.x?r.x>o.x?r.x:o.x:s.x>o.x?s.x:o.x,l=r.y>s.y?r.y>o.y?r.y:o.y:s.y>o.y?s.y:o.y,u=d(a,c,e,i,n),_=d(h,l,e,i,n),f=t.nextZ;f&&f.z<=_;){if(f!==t.prev&&f!==t.next&&m(r.x,r.y,s.x,s.y,o.x,o.y,f.x,f.y)&&g(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(f=t.prevZ;f&&f.z>=u;){if(f!==t.prev&&f!==t.next&&m(r.x,r.y,s.x,s.y,o.x,o.y,f.x,f.y)&&g(f.prev,f,f.next)>=0)return!1;f=f.prevZ}return!0}function h(t,e,i){var n=t;do{var r=n.prev,s=n.next.next;!y(r,s)&&v(r,n,n.next,s)&&x(r,s)&&x(s,r)&&(e.push(r.i/i),e.push(n.i/i),e.push(s.i/i),A(n),A(n.next),n=t=s),n=n.next}while(n!==t);return n}function l(t,e,i,n,r,a){var c=t;do{for(var h=c.next.next;h!==c.prev;){if(c.i!==h.i&&p(c,h)){var l=C(c,h);return c=s(c,c.next),l=s(l,l.next),o(c,e,i,n,r,a),void o(l,e,i,n,r,a)}h=h.next}c=c.next}while(c!==t)}function u(t,e){return t.x-e.x}function _(t,e){if(e=(function(t,e){var i,n=e,r=t.x,s=t.y,o=-1/0;do{if(s<=n.y&&s>=n.next.y){var a=n.x+(s-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=r&&a>o){if(o=a,a===r){if(s===n.y)return n;if(s===n.next.y)return n.next}i=n.x=n.x&&n.x>=l&&m(si.x)&&x(n,t)&&(i=n,_=c),n=n.next;return i})(t,e)){var i=C(e,t);s(i,i.next)}}function d(t,e,i,n,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)/r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)/r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function f(t){var e=t,i=t;do{e.x=0&&(t-o)*(n-a)-(i-o)*(e-a)>=0&&(i-o)*(s-a)-(r-o)*(n-a)>=0}function p(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!(function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&v(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1})(t,e)&&x(t,e)&&x(e,t)&&(function(t,e){var i=t,n=!1,r=(t.x+e.x)/2,s=(t.y+e.y)/2;do{i.y>s!=i.next.y>s&&r<(i.next.x-i.x)*(s-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==t);return n})(t,e)}function g(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function y(t,e){return t.x===e.x&&t.y===e.y}function v(t,e,i,n){return!!(y(t,e)&&y(i,n)||y(t,n)&&y(i,e))||g(t,e,i)>0!=g(t,e,n)>0&&g(i,n,t)>0!=g(i,n,e)>0}function x(t,e){return g(t.prev,t,t.next)<0?g(t,e,t.next)>=0&&g(t,t.prev,e)>=0:g(t,e,t.prev)<0||g(t,t.next,e)<0}function C(t,e){var i=new b(t.i,t.x,t.y),n=new b(e.i,e.x,e.y),r=t.next,s=e.prev;return t.next=e,e.prev=t,i.next=r,r.prev=i,n.next=i,i.prev=n,s.next=n,n.prev=s,n}function T(t,e,i,n){var r=new b(t,e,i);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function A(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function b(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function S(t,e,i,n){for(var r=0,s=e,o=i-n;s0&&(n+=t[r-1].length,i.holes.push(n))}return i}}),{}],119:[(function(t,e,i){cc.js;var n=t("./types").LineCap,r=t("./types").LineJoin,s=t("./helper"),o=function(t){this._rootCtor(t),this._needDraw=!0,this.cmds=[],this.style={strokeStyle:"black",fillStyle:"white",lineCap:"butt",lineJoin:"miter",miterLimit:10}},a=o.prototype=Object.create(_ccsg.Node.CanvasRenderCmd.prototype);a.constructor=o,a._updateCurrentRegions=function(){var t=this._currentRegion;this._currentRegion=this._oldRegion,this._oldRegion=t,this._currentRegion.setTo(0,0,cc.visibleRect.width,cc.visibleRect.height)},a.rendering=function(t,e,i){var n=t||cc._renderContext,r=n.getContext();n.setTransform(this._worldTransform,e,i),r.save(),r.scale(1,-1);var s=this.style;r.strokeStyle=s.strokeStyle,r.fillStyle=s.fillStyle,r.lineWidth=s.lineWidth,r.lineJoin=s.lineJoin,r.miterLimit=s.miterLimit;for(var o=!0,a=this.cmds,c=0,h=a.length;ci?i:t}var x=cc.Enum({PT_CORNER:1,PT_LEFT:2,PT_BEVEL:4,PT_INNERBEVEL:8});function C(t,e){a.call(this,t,e),this.reset()}function T(){this.reset()}function A(){this.vertsOffset=0,this.vertsVBO=gl.createBuffer(),this.vertsBuffer=null,this.uint32VertsBuffer=null,this.vertsDirty=!1,this.indicesOffset=0,this.indicesVBO=gl.createBuffer(),this.indicesBuffer=null,this.indicesDirty=!1}function b(t){this._rootCtor(t),this._needDraw=!0;cc._renderContext;this._buffers=[],this._buffer=null,this._allocBuffer(),this._matrix=new cc.math.Matrix4,this._matrix.identity(),this._paths=[],this._points=[],this._curColorValue=0,this._blendFunc=new cc.BlendFunc(cc.macro.BLEND_SRC,cc.macro.BLEND_DST);var e=new cc.GLProgram;e.initWithVertexShaderByteArray(cc.PresetShaders.POSITION_COLOR_VERT,cc.PresetShaders.POSITION_COLOR_FRAG),e.addAttribute(cc.macro.ATTRIBUTE_NAME_POSITION,cc.macro.VERTEX_ATTRIB_POSITION),e.addAttribute(cc.macro.ATTRIBUTE_NAME_COLOR,cc.macro.VERTEX_ATTRIB_COLOR),e.link(),e.updateUniforms(),this._shaderProgram=e,this._allocVerts(h)}c.extend(C,a),C.prototype.reset=function(){this.dx=0,this.dy=0,this.dmx=0,this.dmy=0,this.flags=0,this.len=0},T.prototype.reset=function(){this.closed=!1,this.nbevel=0,this.complex=!0,this.points?this.points.length=0:this.points=[]},A.prototype.clear=function(){this.vertsOffset=0,this.indicesOffset=0},A.prototype.alloc=function(t,e){var i=this.vertsOffset+t;if(i>65535)return!1;var n=this.vertsBuffer,r=n?n.length/3:0;if(i>r){for(0===r&&(r=h);i>r;)r*=2;var s=new Float32Array(3*r),o=new Uint32Array(s.buffer);if(n)for(var a=this.uint32VertsBuffer,c=0,l=n.length;cd){for(0===d&&(d=3*h);_>d;)d*=2;var f=new Uint16Array(d);if(u)for(c=0,l=u.length;c>>0)+(t.b<<16)+(t.g<<8)+t.r,this._expandStroke(),this._updatePathOffset=!0},S.fill=function(){var t=this._fillColor;this._curColorValue=(t.a<<24>>>0)+(t.b<<16)+(t.g<<8)+t.r,this._expandFill(),this._updatePathOffset=!0,this._filling=!1},S._strokeColor=null,S._fillColor=null,S.setStrokeColor=function(t){this._strokeColor=t},S.getStrokeColor=function(){return this._strokeColor},S.setFillColor=function(t){this._fillColor=t},S.getFillColor=function(){return this._fillColor},S.setLineWidth=function(t){this.lineWidth=t},S.setLineJoin=function(t){this.lineJoin=t},S.setLineCap=function(t){this.lineCap=t},S.setMiterLimit=function(t){this.miterLimit=t},c.getset(S,"strokeColor",S.getStrokeColor,S.setStrokeColor),c.getset(S,"fillColor",S.getFillColor,S.setFillColor),S._render=function(){var t=this._buffers;if(0!==t.length){for(var e=cc._renderContext,i=0,n=t.length;i0&&(n=1/t);for(var s=this._paths,o=this._pathOffset,a=this._pathLength;o1e-6){var A=1/p;A>600&&(A=600),f.dmx*=A,f.dmy*=A}f.dx*d.dy-d.dx*f.dy>0&&(0,f.flags|=x.PT_LEFT),p*(g=_(11,u(d.len,f.len)*n))*g<1&&(f.flags|=x.PT_INNERBEVEL),f.flags&x.PT_CORNER&&(p*i*i<1||e===r.BEVEL||e===r.ROUND)&&(f.flags|=x.PT_BEVEL),0!=(f.flags&(x.PT_BEVEL|x.PT_INNERBEVEL))&&c.nbevel++,d=f,f=h[m+1]}}},S._vset=function(t,e){var i=this._buffer,n=3*i.vertsOffset,r=i.vertsBuffer;r[n]=t,r[n+1]=e,i.uint32VertsBuffer[n+2]=this._curColorValue,i.vertsOffset++},S._chooseBevel=function(t,e,i,n){var r,s,o,a,c=i.x,h=i.y;return 0!==t?(r=c+e.dy*n,s=h-e.dx*n,o=c+i.dy*n,a=h-i.dx*n):(r=o=c+i.dmx*n,s=a=h+i.dmy*n),[r,s,o,a]},S._buttCap=function(t,e,i,n,r){var s=t.x-e*r,o=t.y-i*r,a=i,c=-e;this._vset(s+a*n,o+c*n),this._vset(s-a*n,o-c*n)},S._roundCapStart=function(t,e,i,n,r){for(var s=t.x,o=t.y,a=i,c=-e,h=0;hT&&(I-=2*l),this._vset(_,f),this._vset(h-s*n,e.y-o*n);for(var A=v(d((T-I)/l)*r,2,r),b=0;b10||(f=.5*(r+o),m=.5*(s+a),p=.5*((l=.5*(t+i))+(_=.5*(i+r))),g=.5*((u=.5*(e+n))+(d=.5*(n+s))),((E=y((i-o)*(S=a-e)-(n-a)*(b=o-t)))+(w=y((r-o)*S-(s-a)*b)))*(E+w)=2*n)g=2*n;else for(;g<0;)g+=2*n;else if(c(g)>=2*n)g=2*-n;else for(;g>0;)g-=2*n;for(m=0|s(1,r(c(g)/(.5*n)+.5,5)),y=c(4/3*(1-o(d=g/m/2))/a(d)),_||(y=-y),f=0;f<=m;f++)C=e+(v=o(p=l+g*(f/m)))*h,T=i+(x=a(p))*h,A=-x*h*y,b=v*h*y,0===f?t.moveTo(C,T):t.bezierCurveTo(S+w,E+I,C-A,T-b,C,T),S=C,E=T,w=A,I=b},ellipse:function(t,e,i,n,r){t.moveTo(e-n,i),t.bezierCurveTo(e-n,i+r*l,e-n*l,i+r,e,i+r),t.bezierCurveTo(e+n*l,i+r,e+n,i+r*l,e+n,i),t.bezierCurveTo(e+n,i-r*l,e+n*l,i-r,e,i-r),t.bezierCurveTo(e-n*l,i-r,e-n,i-r*l,e-n,i),t.close()},roundRect:function(t,e,i,n,s,o){if(o<.1)t.rect(e,i,n,s);else{var a=r(o,.5*c(n))*h(n),u=r(o,.5*c(s))*h(s);t.moveTo(e,i+u),t.lineTo(e,i+s-u),t.bezierCurveTo(e,i+s-u*(1-l),e+a*(1-l),i+s,e+a,i+s),t.lineTo(e+n-a,i+s),t.bezierCurveTo(e+n-a*(1-l),i+s,e+n,i+s-u*(1-l),e+n,i+s-u),t.lineTo(e+n,i+u),t.bezierCurveTo(e+n,i+u*(1-l),e+n-a*(1-l),i,e+n-a,i),t.lineTo(e+a,i),t.bezierCurveTo(e+a*(1-l),i,e,i+u*(1-l),e,i+u),t.close()}}}}),{}],124:[(function(t,e,i){"use strict";var n;(n=_ccsg.GraphicsNode=t("./graphics-node"))&&t("../utils/misc").propertyDefine(n,["lineWidth","lineCap","lineJoin","miterLimit","strokeColor","fillColor"],{});t("./graphics")}),{"../utils/misc":228,"./graphics":122,"./graphics-node":120}],125:[(function(t,e,i){"use strict";var n=cc.Enum({BUTT:0,ROUND:1,SQUARE:2}),r=cc.Enum({BEVEL:0,ROUND:1,MITER:2});e.exports={LineCap:n,LineJoin:r}}),{}],126:[(function(t,e,i){t("./platform"),t("./assets"),t("./CCNode"),t("./CCScene"),t("./components"),t("./graphics"),t("./collider"),t("./collider/CCIntersection"),t("./physics"),t("./camera/CCCamera"),t("./base-ui/CCWidgetManager")}),{"./CCNode":40,"./CCScene":41,"./assets":56,"./base-ui/CCWidgetManager":61,"./camera/CCCamera":62,"./collider":71,"./collider/CCIntersection":69,"./components":105,"./graphics":124,"./physics":160,"./platform":196}],127:[(function(t,e,i){var n=/^(click)(\s)*=/,r=/(\s)*src(\s)*=|(\s)*height(\s)*=|(\s)*width(\s)*=|(\s)*click(\s)*=/;cc.HtmlTextParser=function(){this._parsedObject={},this._specialSymbolArray=[],this._specialSymbolArray.push([/</g,"<"]),this._specialSymbolArray.push([/>/g,">"]),this._specialSymbolArray.push([/&/g,"&"]),this._specialSymbolArray.push([/"/g,'"']),this._specialSymbolArray.push([/'/g,"'"])},cc.HtmlTextParser.prototype={constructor:cc.HtmlTextParser,parse:function(t){this._resultObjectArray=[],this._stack=[];for(var e=0,i=t.length;e",e);-1===r?r=n:"/"===t.charAt(n+1)?this._stack.pop():this._addToStack(t.substring(n+1,r)),e=r+1}}return this._resultObjectArray},_attributeToObject:function(t){var e,i,n,s,o={},a=(t=t.trim()).match(/^(color|size)(\s)*=/);if(a){if(e=a[0],""===(t=t.substring(e.length).trim()))return o;switch(i=t.indexOf(" "),e[0]){case"c":o.color=i>-1?t.substring(0,i).trim():t;break;case"s":o.size=parseInt(t)}return i>-1&&(s=t.substring(i+1).trim(),n=this._processEventHandler(s),o.event=n),o}if((a=t.match(/^(br(\s)*\/)/))&&a[0].length>0&&(e=a[0].trim()).startsWith("br")&&"/"===e[e.length-1])return o.isNewLine=!0,this._resultObjectArray.push({text:"",style:{newline:!0}}),o;if((a=t.match(/^(img(\s)*src(\s)*=[^>]+\/)/))&&a[0].length>0&&(e=a[0].trim()).startsWith("img")&&"/"===e[e.length-1]){var c;a=t.match(r);for(var h=!1;a;)e=(t=t.substring(t.indexOf(a[0]))).substr(0,a[0].length),u=(i=(c=t.substring(e.length).trim()).indexOf(" "))>-1?c.substr(0,i):c,e=(e=e.replace(/[^a-zA-Z]/g,"").trim()).toLocaleLowerCase(),t=c.substring(i).trim(),"src"===e?(o.isImage=!0,u.endsWith("/")&&(u=u.substring(0,u.length-1)),0===u.indexOf("'")?(h=!0,u=u.substring(1,u.length-1)):0===u.indexOf('"')&&(h=!0,u=u.substring(1,u.length-1)),o.src=u):"height"===e?o.imageHeight=parseInt(u):"width"===e?o.imageWidth=parseInt(u):"click"===e&&(o.event=this._processEventHandler(e+"="+u)),a=t.match(r);return h&&o.isImage&&this._resultObjectArray.push({text:"",style:o}),{}}if(a=t.match(/^(outline(\s)*[^>]*)/)){var l={color:"#ffffff",width:1};if(t=a[0].substring("outline".length).trim()){var u,_=/(\s)*color(\s)*=|(\s)*width(\s)*=|(\s)*click(\s)*=/;for(a=t.match(_);a;)e=(t=t.substring(t.indexOf(a[0]))).substr(0,a[0].length),u=(i=(c=t.substring(e.length).trim()).indexOf(" "))>-1?c.substr(0,i):c,e=(e=e.replace(/[^a-zA-Z]/g,"").trim()).toLocaleLowerCase(),t=c.substring(i).trim(),"click"===e?o.event=this._processEventHandler(e+"="+u):"color"===e?l.color=u:"width"===e&&(l.width=parseInt(u)),a=t.match(_)}o.outline=l}if((a=t.match(/^(on|u|b|i)(\s)*/))&&a[0].length>0){switch(e=a[0],t=t.substring(e.length).trim(),e[0]){case"u":o.underline=!0;break;case"i":o.italic=!0;break;case"b":o.bold=!0}if(""===t)return o;n=this._processEventHandler(t),o.event=n}return o},_processEventHandler:function(t){for(var e=0,i={},r=t.match(n),s=!1;r;){var o=r[0],a="";if(s=!1,'"'===(t=t.substring(o.length).trim()).charAt(0))(e=t.indexOf('"',1))>-1&&(a=t.substring(1,e).trim(),s=!0),e++;else if("'"===t.charAt(0))(e=t.indexOf("'",1))>-1&&(a=t.substring(1,e).trim(),s=!0),e++;else{var c=t.match(/(\S)+/);e=(a=c?c[0]:"").length}s&&(i[o=o.substring(0,o.length-1).trim()]=a),r=(t=t.substring(e).trim()).match(n)}return i},_addToStack:function(t){var e=this._attributeToObject(t);if(0===this._stack.length)this._stack.push(e);else{if(e.isNewLine||e.isImage)return;var i=this._stack[this._stack.length-1];for(var n in i)e[n]||(e[n]=i[n]);this._stack.push(e)}},_processResult:function(t){""!==t&&(t=this._escapeSpecialSymbol(t),this._stack.length>0?this._resultObjectArray.push({text:t,style:this._stack[this._stack.length-1]}):this._resultObjectArray.push({text:t}))},_escapeSpecialSymbol:function(t){for(var e=0;e0&&this._isVerticalClamp()&&this._shrinkLabelToContentSize(this._isVerticalClamp.bind(this));if(!this._updateQuads()){t=!1,this._overFlow===_ccsg.Label.Overflow.SHRINK&&this._shrinkLabelToContentSize(this._isHorizontalClamp.bind(this));break}}while(0);return t},_isHorizontalClamped:function(t,e){var i=this._linesWidth[e],n=t>this._contentSize.width||t<0;return this._isWrapText?i>this._contentSize.width&&n:n},_updateQuads:function(){var t=!0;this._spriteBatchNode.removeAllChildren();for(var e=0;e0){if(n>this._tailoredTopY){var r=n-this._tailoredTopY;this._reusedRect.y+=r,this._reusedRect.height-=r,n-=r}n-i._height*this._bmfontScale0&&this._isHorizontalClamped(o,s))if(this._overFlow===_ccsg.Label.Overflow.CLAMP)this._reusedRect.width=0;else if(this._overFlow===_ccsg.Label.Overflow.SHRINK){if(this._contentSize.width>i._width){t=!1;break}this._reusedRect.width=0}if(this._reusedRect.height>0&&this._reusedRect.width>0){var a=this.getChildByTag(e),c=this._spriteBatchNode._texture,h=this._spriteFrame,l=this._spriteFrame.isRotated(),u=h._originalSize,_=h._rect,d=h._offset,f=d.x+(u.width-_.width)/2,m=d.y-(u.height-_.height)/2;if(l){var p=this._reusedRect.x;this._reusedRect.x=_.x+_.height-this._reusedRect.y-this._reusedRect.height-m,this._reusedRect.y=p+_.y-f,this._reusedRect.y<0&&(this._reusedRect.height=this._reusedRect.height+m)}else this._reusedRect.x+=_.x-f,this._reusedRect.y+=_.y+m;a?a.setTextureRect(this._reusedRect,l):((a=new _ccsg.Sprite).initWithTexture(c,this._reusedRect,l),a.setAnchorPoint(cc.p(0,1)));var g=this._lettersInfo[e]._positionX+this._linesOffsetX[this._lettersInfo[e]._lineIndex];a.setPosition(g,n),this._updateLetterSpriteScale(a),this._spriteBatchNode.addChild(a)}}return t},_updateLetterSpriteScale:function(t){this._labelType===_ccsg.Label.Type.BMFont&&this._fontSize>0&&t.setScale(this._bmfontScale)},_recordPlaceholderInfo:function(t,e){if(t>=this._lettersInfo.length){var i=new o;this._lettersInfo.push(i)}this._lettersInfo[t]._char=e,this._lettersInfo[t]._valid=!1},_recordLetterInfo:function(t,e,i,n){if(i>=this._lettersInfo.length){var r=new o;this._lettersInfo.push(r)}e=e.charCodeAt(0),this._lettersInfo[i]._lineIndex=n,this._lettersInfo[i]._char=e,this._lettersInfo[i]._valid=this._fontAtlas._letterDefinitions[e]._validDefinition,this._lettersInfo[i]._positionX=t.x,this._lettersInfo[i]._positionY=t.y},_setDimensions:function(t,e){var i="number"==typeof t.width?t.width:t,n="number"==typeof t.height?t.height:e,r=this.getContentSize();_ccsg.Node.prototype.setContentSize.call(this,t,e),n===r.height&&i===r.width||(this._setupBMFontOverflowMetrics(i,n),this._drawFontsize>0&&this._restoreFontSize(),this._notifyLabelSkinDirty())},_restoreFontSize:function(){this._fontSize=this._drawFontsize},_multilineTextWrap:function(t){var e=this.getStringLength(),i=0,n=0,r=0,s=0,o=0,a=this._lineSpacing,c=0,h=0,l=null,u=cc.p(0,0);this._updateBMFontScale();for(var _=0;_0&&n>0&&T+l._width*this._bmfontScale>this._maxLineWidth&&!cc.TextUtils.isUnicodeSpace(d)){this._linesWidth.push(o),o=0,i++,n=0,r-=this._lineHeight*this._bmfontScale+a,v=!0;break}u.x=T,u.y=r-l._offsetY*this._bmfontScale,this._recordLetterInfo(u,d,C,i),C+1u.y-l._height*this._bmfontScale&&(p=u.y-l._height*this._bmfontScale)}else this._recordPlaceholderInfo(C,d),console.log("Can't find letter definition in texture atlas "+this._config.atlasName+" for letter:"+d);else this._recordPlaceholderInfo(C,d)}v||(n=y,o=g,cp&&(h=p),s1&&(this._textDesiredHeight+=(this._numberOfLines-1)*this._lineSpacing);var A=cc.size(this._labelWidth,this._labelHeight);return this._labelWidth<=0&&(A.width=parseFloat(s.toFixed(2))),this._labelHeight<=0&&(A.height=parseFloat(this._textDesiredHeight.toFixed(2))),_ccsg.Node.prototype.setContentSize.call(this,A),this._tailoredTopY=A.height,this._tailoredBottomY=0,c>0&&(this._tailoredTopY=A.height+c),h<-this._textDesiredHeight&&(this._tailoredBottomY=this._textDesiredHeight+h),!0},_multilineTextWrapByWord:function(){return this._multilineTextWrap(this._getFirstWordLen.bind(this))},_multilineTextWrapByChar:function(){return this._multilineTextWrap(this._getFirstCharLen.bind(this))},_isVerticalClamp:function(){return this._textDesiredHeight>this._contentSize.height},_isHorizontalClamp:function(){for(var t=!1,e=0;e0)if(this._isWrapText){if(this._linesWidth[r]>this._contentSize.width&&(n>this._contentSize.width||n<0)){t=!0;break}}else if(n>this._contentSize.width){t=!0;break}}return t},_shrinkLabelToContentSize:function(t){for(var e=this.getFontSize(),i=0,n=this._fontAtlas.cloneLetterDefinition(),r=this._lineHeight,s=!0;t();){var o=e-++i;if(s=!1,o<=0)break;var a=o/e;this._fontAtlas.assignLetterDefinitions(n),this._fontAtlas.scaleFontLetterDefinition(a),this._lineHeight=r*a,this._lineBreakWithoutSpaces?this._multilineTextWrapByChar():this._multilineTextWrapByWord(),this._computeAlignmentOffset()}this._lineHeight=r,this._fontAtlas.assignLetterDefinitions(n),s||e-i>=0&&this._scaleFontSizeDown(e-i)},_scaleFontSizeDown:function(t){var e=!0;this._labelType===_ccsg.Label.Type.BMFont&&(t||(t=.1,e=!1),this._fontSize=t,e&&this._updateContent())},_updateContent:function(){this._fontAtlas&&(this._computeHorizontalKerningForText(this._string),this._alignText())},_computeAlignmentOffset:function(){switch(this._linesOffsetX=[],this._hAlign){case cc.TextAlignment.LEFT:for(var t=0;tthis._maxLineWidth&&!cc.TextUtils.isUnicodeSpace(n)&&this._maxLineWidth>0)return r;if(o+=s._xAdvance*this._bmfontScale+this._spacingX,"\n"===n||cc.TextUtils.isUnicodeSpace(n)||cc.TextUtils.isUnicodeCJK(n))break;r++}return r},_updateBMFontScale:function(){if(this._labelType===_ccsg.Label.Type.BMFont){var t=this._fontAtlas._fontSize;this._bmfontScale=this._fontSize/t}else this._bmfontScale=1},_initBMFontWithString:function(t,e){if(this._config)return cc.logID(4002),!1;this._string=t,this._setBMFontFile(e)},_createSpriteBatchNode:function(t){this._spriteBatchNode=new cc.SpriteBatchNode(t,this._string.length),this._spriteBatchNode.setCascadeColorEnabled(!0),this._spriteBatchNode.setCascadeOpacityEnabled(!0),this.addChild(this._spriteBatchNode),this._updateContent(),this.setColor(this.color)},_createFontChars:function(){if(this._config){this._fontAtlas=new cc.FontAtlas(this._config),this._lineHeight||(this._lineHeight=this._fontAtlas._lineHeight);var t=this._config.fontDefDictionary;for(var e in t){var i=new s,n=t[e].rect;i._offsetX=parseInt(t[e].xOffset),i._offsetY=parseInt(t[e].yOffset),i._width=parseInt(n.width),i._height=parseInt(n.height),i._u=parseInt(n.x)+this._imageOffset.x,i._v=parseInt(n.y)+this._imageOffset.y,i._textureID=0,i._validDefinition=!0,i._xAdvance=parseInt(t[e].xAdvance),this._fontAtlas.addLetterDefinitions(e,i)}}},_rescaleWithOriginalFontSize:function(){var t=this.getFontSize();this._drawFontsize-t>=1&&this._overFlow===_ccsg.Label.Overflow.SHRINK&&(this._labelType===_ccsg.Label.Type.BMFont?this._scaleFontSizeDown(this._drawFontsize):this._fontSize=this._drawFontsize)},_computeHorizontalKerningForText:function(){for(var t=this.getStringLength(),e=this._config.kerningDict,i=-1,n=0;nc||o>a;){if(u?h=_/2|0:_=h=_-1,h<=0){cc.logID(4003);break}for(t._fontSize=h,i=this._constructFontDesc(),this._labelContext.font=i,this._splitedStrings=[],s=0,r=0;rc?_=0|h:(u=!1,s=c+1))}}else{for(s=e.length*this._getLineHeight(),r=0;ro?r:o}s=this._splitedStrings.length*this._getLineHeight(),this._canvasSize.width=Math.round(r.toFixed(2))+2*this._getMargin(),this._canvasSize.height=Math.round(s.toFixed(2)),e._isItalic&&(this._canvasSize.width+=e._drawFontsize*Math.tan(.20943951)),_ccsg.Node.prototype.setContentSize.call(e,this._canvasSize)}this._labelCanvas.width=this._canvasSize.width,this._labelCanvas.height=this._canvasSize.height},t._calculateFillTextStartPosition=function(){var t,e,i=this._node,n=this._getLineHeight(),r=this._splitedStrings.length;return t=cc.TextAlignment.RIGHT===i._hAlign?this._canvasSize.width-this._getMargin():cc.TextAlignment.CENTER===i._hAlign?this._canvasSize.width/2:0+this._getMargin(),e=cc.VerticalTextAlignment.TOP===i._vAlign?0:cc.VerticalTextAlignment.CENTER===i._vAlign?this._canvasSize.height/2-n*(r-1)/2:this._canvasSize.height-n*(r-1),cc.p(t,e)},t._calculateTextBaseline=function(){var t,e,i=this._node;t=cc.TextAlignment.RIGHT===i._hAlign?"right":cc.TextAlignment.CENTER===i._hAlign?"center":"left",this._labelContext.textAlign=t,e=cc.VerticalTextAlignment.TOP===i._vAlign?"top":cc.VerticalTextAlignment.CENTER===i._vAlign?"middle":"bottom",this._labelContext.textBaseline=e},t._bakeLabel=function(){var t=this._node;this._drawFontsize=t._drawFontsize,this._canvasSize=this._calculateCanvasSize(),this._fontDesc=this._calculateLabelFont(),this._calculateSplitedStrings(),this._updateLabelDimensions(),this._calculateTextBaseline(),this._updateTexture()},t._calculateUnderlineStartPosition=function(){var t,e,i=this._node,n=this._getLineHeight(),r=this._splitedStrings.length;return t=0+this._getMargin(),e=cc.VerticalTextAlignment.TOP===i._vAlign?i._fontSize:cc.VerticalTextAlignment.CENTER===i._vAlign?this._canvasSize.height/2-n*(r-1)/2+i._fontSize/2:this._canvasSize.height-n*(r-1),cc.p(t,e)},t._updateTexture=function(){this._labelContext.clearRect(0,0,this._canvasSize.width,this._canvasSize.height),this._labelContext.font=this._fontDesc;var t=this._calculateFillTextStartPosition(),e=this._getLineHeight();this._labelContext.lineJoin="round";var i,n=this._displayedColor;this._labelContext.fillStyle="rgb("+n.r+","+n.g+","+n.b+")";for(var r=0;ra||sc)},t.rendering=function(t,e,i){var n=this._node;if(n._labelType===_ccsg.Label.Type.TTF||n._labelType===_ccsg.Label.Type.SystemFont){var r=this._displayedOpacity,s=r/255;if(0===r)return;var o=t||cc._renderContext,a=o.getContext();if(o.setTransform(this._worldTransform,e,i),o.setCompositeOperation(_ccsg.Node.CanvasRenderCmd._getCompositeOperationByBlendFunc(n._blendFunc)),o.setGlobalAlpha(s),this._texture){var c,h,l,u,_;0,l=-this._node._contentSize.height,u=this._node._contentSize.width,_=this._node._contentSize.height,0,0,c=this._texture.getPixelWidth(),h=this._texture.getPixelHeight();var d=this._texture._image;""!==this._texture._pattern?(o.setFillStyle(a.createPattern(d,this._texture._pattern)),a.fillRect(0,l,u,_)):0!==c&&0!==h&&0!==u&&0!==_&&a.drawImage(d,0,0,c,h,0,l,u,_)}cc.g_NumberOfDraws=cc.g_NumberOfDraws+1}}})()}),{}],130:[(function(t,e,i){var n,r={premultiplyAlpha:!0};_ccsg.Label.WebGLRenderCmd=function(t){this._rootCtor(t),this._needDraw=!0,this._texture=new cc.Texture2D,this._texture.update(r),n=n||document.createElement("canvas"),this._labelCanvas=n,this._texture.initWithElement(this._labelCanvas),this._labelContext=this._labelCanvas.getContext("2d"),this._labelCanvas.width=1,this._labelCanvas.height=1,this._splitedStrings=null,this._drawFontsize=0,this._vertices=[{x:0,y:0,u:0,v:0},{x:0,y:0,u:0,v:1},{x:0,y:0,u:1,v:0},{x:0,y:0,u:1,v:1}],this._color=new Uint32Array(1),this._dirty=!1,this._shaderProgram=cc.shaderCache.programForKey(cc.macro.SHADER_SPRITE_POSITION_TEXTURECOLOR)};var s=_ccsg.Label.WebGLRenderCmd.prototype=Object.create(_ccsg.Node.WebGLRenderCmd.prototype);cc.js.mixin(s,_ccsg.Label.TTFLabelBaker.prototype),s.constructor=_ccsg.Label.WebGLRenderCmd,s.updateTransform=function(t){this.originUpdateTransform(t);this._node;var e=this._node.width,i=this._node.height,n=this._worldTransform,r=this._vertices;r[0].x=0*n.a+i*n.c+n.tx,r[0].y=0*n.b+i*n.d+n.ty,r[1].x=0*n.a+0*n.c+n.tx,r[1].y=0*n.b+0*n.d+n.ty,r[2].x=e*n.a+i*n.c+n.tx,r[2].y=e*n.b+i*n.d+n.ty,r[3].x=e*n.a+0*n.c+n.tx,r[3].y=e*n.b+0*n.d+n.ty},s._doCulling=function(){var t=this._node;if(t._string&&(t._labelType===_ccsg.Label.Type.TTF||t._labelType===_ccsg.Label.Type.SystemFont)){var e=cc.visibleRect;this._cameraFlag>0&&(e=cc.Camera.main.visibleRect);var i=e.left.x,n=e.right.x,r=e.top.y,s=e.bottom.y,o=this._vertices;(o[0].x-i&o[1].x-i&o[2].x-i&o[3].x-i)>>31||(n-o[0].x&n-o[1].x&n-o[2].x&n-o[3].x)>>31||(o[0].y-s&o[1].y-s&o[2].y-s&o[3].y-s)>>31||(r-o[0].y&r-o[1].y&r-o[2].y&r-o[3].y)>>31?this._needDraw=!1:this._needDraw=!0}},s.uploadData=function(t,e,i){var n=this._node;if(!n._string||n._labelType!==_ccsg.Label.Type.TTF&&n._labelType!==_ccsg.Label.Type.SystemFont)return 0;var r=this._displayedOpacity;this._color[0]=~~r<<24>>>0|~~r<<16|~~r<<8|~~r;var s,o,a=n._vertexZ,c=this._vertices,h=c.length,l=i;for(s=0;s\u3001\u2018\u201c\u300b\uff1f\u3002\uff0c\uff01]/,label_lastWordRex:/([a-zA-Z0-9\xc4\xd6\xdc\xe4\xf6\xfc\xdf\xe9\xe8\xe7\xe0\xf9\xea\xe2\xee\xf4\xfb\u0430\xed\xec\xcd\xcc\xef\xc1\xc0\xe1\xe0\xc9\xc8\xd2\xd3\xf2\xf3\u0150\u0151\xd9\xda\u0170\xfa\u0171\xf1\xd1\xe6\xc6\u0153\u0152\xc3\xc2\xe3\xd4\xf5\u011b\u0161\u010d\u0159\u017e\xfd\xe1\xed\xe9\xf3\xfa\u016f\u0165\u010f\u0148\u011a\u0160\u010c\u0158\u017d\xc1\xcd\xc9\xd3\xda\u0164\u017c\u017a\u015b\xf3\u0144\u0142\u0119\u0107\u0105\u017b\u0179\u015a\xd3\u0143\u0141\u0118\u0106\u0104-\u044f\u0410-\u042f\u0401\u0451]+|\S)$/,label_lastEnglish:/[a-zA-Z0-9\xc4\xd6\xdc\xe4\xf6\xfc\xdf\xe9\xe8\xe7\xe0\xf9\xea\xe2\xee\xf4\xfb\u0430\xed\xec\xcd\xcc\xef\xc1\xc0\xe1\xe0\xc9\xc8\xd2\xd3\xf2\xf3\u0150\u0151\xd9\xda\u0170\xfa\u0171\xf1\xd1\xe6\xc6\u0153\u0152\xc3\xc2\xe3\xd4\xf5\u011b\u0161\u010d\u0159\u017e\xfd\xe1\xed\xe9\xf3\xfa\u016f\u0165\u010f\u0148\u011a\u0160\u010c\u0158\u017d\xc1\xcd\xc9\xd3\xda\u0164\u017c\u017a\u015b\xf3\u0144\u0142\u0119\u0107\u0105\u017b\u0179\u015a\xd3\u0143\u0141\u0118\u0106\u0104-\u044f\u0410-\u042f\u0401\u0451]+$/,label_firstEnglish:/^[a-zA-Z0-9\xc4\xd6\xdc\xe4\xf6\xfc\xdf\xe9\xe8\xe7\xe0\xf9\xea\xe2\xee\xf4\xfb\u0430\xed\xec\xcd\xcc\xef\xc1\xc0\xe1\xe0\xc9\xc8\xd2\xd3\xf2\xf3\u0150\u0151\xd9\xda\u0170\xfa\u0171\xf1\xd1\xe6\xc6\u0153\u0152\xc3\xc2\xe3\xd4\xf5\u011b\u0161\u010d\u0159\u017e\xfd\xe1\xed\xe9\xf3\xfa\u016f\u0165\u010f\u0148\u011a\u0160\u010c\u0158\u017d\xc1\xcd\xc9\xd3\xda\u0164\u017c\u017a\u015b\xf3\u0144\u0142\u0119\u0107\u0105\u017b\u0179\u015a\xd3\u0143\u0141\u0118\u0106\u0104-\u044f\u0410-\u042f\u0401\u0451]/,label_wrapinspection:!0,isUnicodeCJK:function(t){return/^[\u4E00-\u9FFF\u3400-\u4DFF]+$/.test(t)||/[\u3000-\u303F]|[\u3040-\u309F]|[\u30A0-\u30FF]|[\uFF00-\uFFEF]|[\u4E00-\u9FAF]|[\u2605-\u2606]|[\u2190-\u2195]|\u203B/g.test(t)||/^[\u1100-\u11FF]|[\u3130-\u318F]|[\uA960-\uA97F]|[\uAC00-\uD7AF]|[\uD7B0-\uD7FF]+$/.test(t)},isUnicodeSpace:function(t){return(t=t.charCodeAt(0))>=9&&t<=13||32===t||133===t||160===t||5760===t||t>=8192&&t<=8202||8232===t||8233===t||8239===t||8287===t||12288===t},fragmentText:function(t,e,i,n){var r=[];if(0===t.length||i<0)return r.push(""),r;for(var s=t;e>i&&s.length>1;){for(var o=s.length*(i/e)|0,a=s.substr(o),c=e-n(a),h=a,l=0,u=0;c>i&&u++<10;)o*=i/c,o|=0,c=e-n(a=s.substr(o));for(u=0;c<=i&&u++<10;){if(a){var _=this.label_wordRex.exec(a);l=_?_[0].length:1,h=a}o+=l,c=e-n(a=s.substr(o))}0==(o-=l)&&(o=1,h=h.substr(1));var d,f=s.substr(0,o);this.label_wrapinspection&&this.label_symbolRex.test(h||a)&&(0==(o-=(d=this.label_lastWordRex.exec(f))?d[0].length:0)&&(o=1),h=s.substr(o),f=s.substr(0,o)),this.label_firstEnglish.test(h)&&(d=this.label_lastEnglish.exec(f))&&f!==d[0]&&(o-=d[0].length,h=s.substr(o),f=s.substr(0,o)),0===r.length?r.push(f):(f=f.trim()).length>0&&r.push(f),e=n(s=h||a)}return 0===r.length?r.push(s):(s=s.trim()).length>0&&r.push(s),r}},cc.CustomFontLoader=e.exports=r}),{}],132:[(function(t,e,i){var n=t("../platform/js"),r=t("./pipeline"),s=t("./loading-items"),o=t("./asset-loader"),a=t("./downloader"),c=t("./loader"),h=t("./asset-table"),l=t("../platform/utils").callInNextTick,u=t("./auto-release-utils"),_=new h;var d={url:null,raw:!1};function f(t){var e,i,n;if("object"==typeof t){if(i=t,t.url)return i;e=t.uuid}else i={},e=t;return n=i.type?"uuid"===i.type:cc.AssetLibrary._uuidInSettings(e),cc.AssetLibrary._getAssetInfoInRuntime(e,d),i.url=n?d.url:e,d.url&&"uuid"===i.type&&d.raw?(i.type=null,i.isRawAsset=!0):n||(i.isRawAsset=!0),i}var m=[],p=[];function g(){var t=new o,e=new a,i=new c;r.call(this,[t,e,i]),this.assetLoader=t,this.downloader=e,this.loader=i,this.onProgress=null,this._autoReleaseSetting={}}n.extend(g,r);var y=g.prototype;y.init=function(t){},y.getXMLHttpRequest=function(){return window.XMLHttpRequest?new window.XMLHttpRequest:new ActiveXObject("MSXML2.XMLHTTP")},y.addDownloadHandlers=function(t){this.downloader.addHandlers(t)},y.addLoadHandlers=function(t){this.loader.addHandlers(t)},y.load=function(t,e,i){void 0===i&&(i=e,e=this.onProgress||null);var n=this,r=!1;t instanceof Array||(r=!0,t=t?[t]:[]),m.length=0;for(var o=0;o0){var r=this,s=t.map((function(t){return{type:"uuid",uuid:t}}));this.load(s,e,(function(t,e){if(i){for(var o=[],a=n&&[],c=0;ce.length){var i=t.charCodeAt(e.length);return 46===i||47===i}return!0}var o=r.prototype;o.getUuid=function(t,e){t=cc.url.normalize(t);var i=this._pathToUuid[t];if(i)if(Array.isArray(i)){if(!e)return i[0].uuid;for(var n=0;n0&&n.src===r)return n;(function(){function i(){n.removeEventListener("load",i),n.removeEventListener("error",s),e(null,n)}function s(){n.removeEventListener("load",i),n.removeEventListener("error",s),"https:"!==window.location.protocol&&n.crossOrigin&&"anonymous"===n.crossOrigin.toLowerCase()?d(t,e,!1,n):e(new Error(cc._getError(4930,r)))}n.addEventListener("load",i),n.addEventListener("error",s),n.src=r})()}var f={".eot":"embedded-opentype",".ttf":"truetype",".ttc":"truetype",".woff":"woff",".svg":"svg"};function m(t,e,i){var n=document,r=document.createElement("style");r.type="text/css",n.body.appendChild(r);var s="";if(isNaN(t-0)?s+="@font-face { font-family:"+t+"; src:":s+="@font-face { font-family:'"+t+"'; src:",e instanceof Array)for(var a=0,c=e.length;a=0)&&(s.deps&&f(t,s,!0))){n=!0;break}}}return i||(d.length=0),n}var m=function(t,e,i,r){n.call(this),this._id=++o,a[this._id]=this,this._pipeline=t,this._errorUrls=[],this._appending=!1,this._ownerQueue=null,this.onProgress=i,this.onComplete=r,this.map={},this.completed={},this.totalCount=0,this.completedCount=0,this._pipeline?this.active=!0:this.active=!1,e&&(e.length>0?this.append(e):this.allComplete())};m.ItemState=new cc.Enum(h),m.create=function(t,e,i,n){void 0===i?"function"==typeof e&&(n=e,e=i=null):void 0===n&&("function"==typeof e?(n=i,i=e,e=null):(n=i,i=null));var r=c.pop();return r?(r._pipeline=t,r.onProgress=i,r.onComplete=n,a[r._id]=r,r._pipeline&&(r.active=!0),e&&r.append(e)):r=new m(t,e,i,n),r},m.getQueue=function(t){return t.queueId?a[t.queueId]:null},m.itemComplete=function(t){var e=a[t.queueId];e&&e.itemComplete(t.id)},m.initQueueDeps=function(t){var e=l[t._id];e?(e.completed.length=0,e.deps.length=0):e=l[t._id]={completed:[],deps:[]}},m.registerQueueDep=function(t,e){var i=t.queueId||t;if(!i)return!1;var n=l[i];if(n)-1===n.deps.indexOf(e)&&n.deps.push(e);else if(t.id)for(var r in l){var s=l[r];-1!==s.deps.indexOf(t.id)&&-1===s.deps.indexOf(e)&&s.deps.push(e)}},m.finishDep=function(t){for(var e in l){var i=l[e];-1!==i.deps.indexOf(t)&&-1===i.completed.indexOf(t)&&i.completed.push(t)}};var p=m.prototype;s.mixin(p,n.prototype),p.append=function(t,e){if(!this.active)return[];e&&!e.deps&&(e.deps=[]),this._appending=!0;var i,n,r,s=[];for(i=0;i=this.totalCount},p.isItemCompleted=function(t){return!!this.completed[t]},p.exists=function(t){return!!this.map[t]},p.getContent=function(t){var e=this.map[t],i=null;return e&&(e.content?i=e.content:e.alias&&(i=e.alias.content)),i},p.getError=function(t){var e=this.map[t],i=null;return e&&(e.error?i=e.error:e.alias&&(i=e.alias.error)),i},p.addListener=n.prototype.add,p.hasListener=n.prototype.has,p.removeListener=n.prototype.remove,p.removeAllListeners=n.prototype.removeAll,p.removeItem=function(t){var e=this.map[t];e&&this.completed[e.alias||t]&&(delete this.completed[t],delete this.map[t],e.alias&&(delete this.completed[e.alias.id],delete this.map[e.alias.id]),this.completedCount--,this.totalCount--)},p.itemComplete=function(t){var e=this.map[t];if(e){var i=this._errorUrls.indexOf(t);if(e.error&&-1===i?this._errorUrls.push(t):e.error||-1===i||this._errorUrls.splice(i,1),this.completed[t]=e,this.completedCount++,m.finishDep(e.id),this.onProgress){var n=l[this._id];this.onProgress(n?n.completed.length:this.completedCount,n?n.deps.length:this.totalCount,e)}this.invoke(t,e),this.removeAll(t),!this._appending&&this.completedCount>=this.totalCount&&this.allComplete()}},p.destroy=function(){this.active=!1,this._appending=!1,this._pipeline=null,this._ownerQueue=null,this._errorUrls.length=0,this.onProgress=null,this.onComplete=null,this.map={},this.completed={},this.totalCount=0,this.completedCount=0,n.call(this),a[this._id]=null,l[this._id]&&(l[this._id].completed.length=0,l[this._id].deps.length=0),-1===c.indexOf(this)&&c.length<10&&c.push(this)},cc.LoadingItems=e.exports=m}),{"../platform/callbacks-invoker":192,"../platform/js":199,"../utils/CCPath":221}],141:[(function(t,e,i){var n=t("./pipeline"),r="MD5Pipe",s=/(\.[^.\n\\/]*)$/,o=function(t,e,i){this.id=r,this.async=!1,this.pipeline=null,this.md5AssetsMap=t,this.libraryBase=e,this.rawAssetsBase=i};o.ID=r,o.prototype.handle=function(t){return t.url=this.transformURL(t.url),t},o.prototype.transformURL=function(t,e){var i=t.indexOf("?"),n=t;if(-1!==i&&(n=t.substr(0,i)),n.startsWith(this.libraryBase))n=n.slice(this.libraryBase.length);else{if(!n.startsWith(this.rawAssetsBase))return t;n=n.slice(this.rawAssetsBase.length)}var r=this.md5AssetsMap[n];if(r)if(e){var o=cc.path.dirname(t),a=cc.path.basename(t);t=o+"."+r+"/"+a}else{var c=!1;t=t.replace(s,(function(t,e){return c=!0,"."+r+e})),c||(t=t+"."+r)}return t},n.MD5Pipe=e.exports=o}),{"./pipeline":143}],142:[(function(t,e,i){var n=t("./unpackers"),r=t("../utils/misc").pushToMap,s={Invalid:0,Removed:1,Downloading:2,Loaded:3};function o(){this.unpacker=null,this.state=s.Invalid}var a={},c={},h={};function l(t,e){return new Error("Can not retrieve "+t+" from packer "+e)}e.exports={initPacks:function(t){for(var e in c=t,t)for(var i=t[e],n=0;ne&&(e=a,i=r)}}return e!==s.Invalid?i:t[0]},load:function(t,e){var i=t.uuid,n=a[i];if(n){Array.isArray(n)&&(n=this._selectLoadedPack(n));var r=h[n];if(r&&r.state===s.Loaded){var c=r.unpacker.retrieve(i);return c||l(i,n)}return r||(console.log("Create unpacker %s for %s",n,i),(r=h[n]=new o).state=s.Downloading),this._loadNewPack(i,n,e),null}}}}),{"../utils/misc":228,"./unpackers":146}],143:[(function(t,e,i){t("../platform/js");var n=t("./loading-items"),r=n.ItemState;function s(t,e){var i=t.id,n=e.states[i],o=t.next,a=t.pipeline;if(!e.error&&n!==r.WORKING&&n!==r.ERROR)if(n===r.COMPLETE)o?s(o,e):a.flowOut(e);else{e.states[i]=r.WORKING;var c=t.handle(e,(function(t,n){t?(e.error=t,e.states[i]=r.ERROR,a.flowOut(e)):(n&&(e.content=n),e.states[i]=r.COMPLETE,o?s(o,e):a.flowOut(e))}));c instanceof Error?(e.error=c,e.states[i]=r.ERROR,a.flowOut(e)):void 0!==c&&(null!==c&&(e.content=c),e.states[i]=r.COMPLETE,o?s(o,e):a.flowOut(e))}}var o=function(t){this._pipes=t,this._cache={};for(var e=0;ethis._pipes.length)cc.warnID(4921);else if(this._pipes.indexOf(t)>0)cc.warnID(4922);else{t.pipeline=this;var i=null;e0&&(n=this._pipes[e-1]),n&&(n.next=t),t.next=i,this._pipes.splice(e,0,t)}},a.insertPipeAfter=function(t,e){var i=this._pipes.indexOf(t);i<0||this.insertPipe(e,i+1)},a.appendPipe=function(t){t.handle&&t.id&&(t.pipeline=this,t.next=null,this._pipes.length>0&&(this._pipes[this._pipes.length-1].next=t),this._pipes.push(t))},a.flowIn=function(t){var e,i,n=this._pipes[0];if(n){for(e=0;es&&(this._accumulator=s);this._accumulator>r;)e.Step(r,i,n),this._accumulator-=r}else{var o=1/cc.game.config.frameRate;e.Step(o,i,n)}e.DrawDebugData(),this._steping=!1;for(var a=this._delayEvents,c=0,h=a.length;c0){for(var a=n.getPoints(),l=n.getNormals(),u=n.getFractions(),_=[],d=0,f=r.length;d0}function h(t,e,i){return p(t,e,i)>=0}function l(t,e,i){return p(t,e,i)<=0}function u(t,e){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n}function _(t){d(t)||t.reverse()}function d(t){return t.length<3||(function(t){var e,i=0;for(e=0;e0}function f(t,e,i,n){var r=cc.v2(),s=e.y-t.y,o=t.x-e.x,a=s*t.x+o*t.y,c=n.y-i.y,h=i.x-n.x,l=c*i.x+h*i.y,u=s*h-c*o;return (function(t,e){return Math.abs(t-e)<=1e-6})(u,0)||(r.x=(h*a-o*l)/u,r.y=(s*l-c*a)/u),r}function m(t,e,i,n,r){if(t==i||t==n||e==i||e==n)return!1;var s=t.x,o=t.y,a=e.x,c=e.y,h=i.x,l=i.y,u=n.x,_=n.y;if(Math.max(s,a)w&&(I=S,w=R)}g=r(b,I,e),y=r(I,b,e)}return v=(v=v.concat(t(g))).concat(t(y))}v.push(e);for(b=v.length-1;b>=0;b--)0==v[b].length&&v.splice(b,0);return v},ForceCounterClockWise:_,IsCounterClockWise:d}}),{}],154:[(function(t,e,i){var n=t("./CCPhysicsTypes").PTM_RATIO,r=t("./CCPhysicsTypes").ANGLE_TO_PHYSICS_ANGLE,s=t("./CCPhysicsTypes").PHYSICS_ANGLE_TO_ANGLE,o=t("./utils").getWorldRotation,a=t("./CCPhysicsTypes").BodyType,c=new b2.Vec2,h=new b2.Vec2,l=cc.Vec2.ZERO,u=cc.Class({name:"cc.RigidBody",extends:cc.Component,editor:!1,properties:{_type:a.Dynamic,_allowSleep:!0,_gravityScale:1,_linearDamping:0,_angularDamping:0,_linearVelocity:cc.v2(0,0),_angularVelocity:0,_fixedRotation:!1,enabled:{get:function(){return this._enabled},set:function(){cc.warnID("8200")},visible:!1,override:!0},enabledContactListener:{default:!1,tooltip:!1},bullet:{default:!1,tooltip:!1},type:{type:a,tooltip:!1,get:function(){return this._type},set:function(t){this._type=t,this._b2Body&&(t===a.Animated?this._b2Body.SetType(a.Kinematic):this._b2Body.SetType(t))}},allowSleep:{tooltip:!1,get:function(){return this._b2Body?this._b2Body.IsSleepingAllowed():this._allowSleep},set:function(t){this._allowSleep=t,this._b2Body&&this._b2Body.SetSleepingAllowed(t)}},gravityScale:{tooltip:!1,get:function(){return this._gravityScale},set:function(t){this._gravityScale=t,this._b2Body&&this._b2Body.SetGravityScale(t)}},linearDamping:{tooltip:!1,get:function(){return this._linearDamping},set:function(t){this._linearDamping=t,this._b2Body&&this._b2Body.SetLinearDamping(this._linearDamping)}},angularDamping:{tooltip:!1,get:function(){return this._angularDamping},set:function(t){this._angularDamping=t,this._b2Body&&this._b2Body.SetAngularDamping(t)}},linearVelocity:{tooltip:!1,type:cc.Vec2,get:function(){var t=this._linearVelocity;if(this._b2Body){var e=this._b2Body.GetLinearVelocity();t.x=e.x*n,t.y=e.y*n}return t},set:function(t){this._linearVelocity=t;var e=this._b2Body;if(e){var i=e.m_linearVelocity;i.Set(t.x/n,t.y/n),e.SetLinearVelocity(i)}}},angularVelocity:{tooltip:!1,get:function(){return this._b2Body?this._b2Body.GetAngularVelocity()*s:this._angularVelocity},set:function(t){this._angularVelocity=t,this._b2Body&&this._b2Body.SetAngularVelocity(t*r)}},fixedRotation:{tooltip:!1,get:function(){return this._fixedRotation},set:function(t){this._fixedRotation=t,this._b2Body&&this._b2Body.SetFixedRotation(t)}},awake:{tooltip:!1,get:function(){return!!this._b2Body&&this._b2Body.IsAwake()},set:function(t){this._b2Body&&this._b2Body.SetAwake(t)}},active:{visible:!1,get:function(){return!!this._b2Body&&this._b2Body.IsActive()},set:function(t){this._b2Body&&this._b2Body.SetActive(t)}}},getLocalPoint:function(t,e){if(e=e||cc.v2(),this._b2Body){c.Set(t.x/n,t.y/n);var i=this._b2Body.GetLocalPoint(c);e.x=i.x*n,e.y=i.y*n}return e},getWorldPoint:function(t,e){if(e=e||cc.v2(),this._b2Body){c.Set(t.x/n,t.y/n);var i=this._b2Body.GetWorldPoint(c);e.x=i.x*n,e.y=i.y*n}return e},getWorldVector:function(t,e){if(e=e||cc.v2(),this._b2Body){c.Set(t.x/n,t.y/n);var i=this._b2Body.GetWorldVector(c);e.x=i.x*n,e.y=i.y*n}return e},getLocalVector:function(t,e){if(e=e||cc.v2(),this._b2Body){c.Set(t.x/n,t.y/n);var i=this._b2Body.GetLocalVector(c);e.x=i.x*n,e.y=i.y*n}return e},getWorldPosition:function(t){if(t=t||cc.v2(),this._b2Body){var e=this._b2Body.GetPosition();t.x=e.x*n,t.y=e.y*n}return t},getWorldRotation:function(){return this._b2Body?this._b2Body.GetAngle()*s:0},getLocalCenter:function(t){if(t=t||cc.v2(),this._b2Body){var e=this._b2Body.GetLocalCenter();t.x=e.x*n,t.y=e.y*n}return t},getWorldCenter:function(t){if(t=t||cc.v2(),this._b2Body){var e=this._b2Body.GetWorldCenter();t.x=e.x*n,t.y=e.y*n}return t},getLinearVelocityFromWorldPoint:function(t,e){if(e=e||cc.v2(),this._b2Body){c.Set(t.x/n,t.y/n);var i=this._b2Body.GetLinearVelocityFromWorldPoint(c);e.x=i.x*n,e.y=i.y*n}return e},getMass:function(){return this._b2Body?this._b2Body.GetMass():0},getInertia:function(){return this._b2Body?this._b2Body.GetInertia()*n*n:0},getJointList:function(){if(!this._b2Body)return[];var t=[],e=this._b2Body.GetJointList();if(!e)return[];t.push(e.joint._joint);for(var i=e.prev;i;)t.push(i.joint._joint),i=i.prev;for(var n=e.next;n;)t.push(n.joint._joint),n=n.next;return t},applyForce:function(t,e,i){this._b2Body&&(c.Set(t.x/n,t.y/n),h.Set(e.x/n,e.y/n),this._b2Body.ApplyForce(c,h,i))},applyForceToCenter:function(t,e){this._b2Body&&(c.Set(t.x/n,t.y/n),this._b2Body.ApplyForceToCenter(c,e))},applyTorque:function(t,e){this._b2Body&&this._b2Body.ApplyTorque(t/n,e)},applyLinearImpulse:function(t,e,i){this._b2Body&&(c.Set(t.x/n,t.y/n),h.Set(e.x/n,e.y/n),this._b2Body.ApplyLinearImpulse(c,h,i))},applyAngularImpulse:function(t,e){this._b2Body&&this._b2Body.ApplyAngularImpulse(t/n/n,e)},syncPosition:function(t){var e=this._b2Body;if(e){var i,r=this.node.convertToWorldSpaceAR(l);if((i=this.type===a.Animated?e.GetLinearVelocity():e.GetPosition()).x=r.x/n,i.y=r.y/n,this.type===a.Animated&&t){var s=e.GetPosition(),o=cc.game.config.frameRate;i.x=(i.x-s.x)*o,i.y=(i.y-s.y)*o,e.SetAwake(!0),e.SetLinearVelocity(i)}else e.SetTransform(i,e.GetAngle())}},syncRotation:function(t){var e=this._b2Body;if(e){var i=r*o(this.node);if(this.type===a.Animated&&t){var n=e.GetAngle(),s=cc.game.config.frameRate;e.SetAwake(!0),e.SetAngularVelocity((i-n)*s)}else e.SetTransform(e.GetPosition(),i)}},resetVelocity:function(){var t=this._b2Body;if(t){var e=t.m_linearVelocity;e.Set(0,0),t.SetLinearVelocity(e),t.SetAngularVelocity(0)}},onEnable:function(){this._init()},onDisable:function(){this._destroy()},_registerNodeEvents:function(){var t=this.node;t.on("position-changed",this._onNodePositionChanged,this),t.on("rotation-changed",this._onNodeRotationChanged,this),t.on("scale-changed",this._onNodeScaleChanged,this)},_unregisterNodeEvents:function(){var t=this.node;t.off("position-changed",this._onNodePositionChanged,this),t.off("rotation-changed",this._onNodeRotationChanged,this),t.off("scale-changed",this._onNodeScaleChanged,this)},_onNodePositionChanged:function(){this.syncPosition(!0)},_onNodeRotationChanged:function(t){this.syncRotation(!0)},_onNodeScaleChanged:function(t){if(this._b2Body)for(var e=this.getComponents(cc.PhysicsCollider),i=0;i=0;n--){var r=t[n];r.collider=null,i._unregisterContactFixture(r),e&&e.DestroyFixture(r)}this.body=null,this._fixtures.length=0,this._shapes.length=0,this._inited=!1}},_createShape:function(){},apply:function(){this._destroy(),this._init()},getAABB:function(){for(var t=1e7,e=1e7,i=-1e7,r=-1e7,s=this._fixtures,o=0;oi&&(i=l.upperBound.x),l.upperBound.y>r&&(r=l.upperBound.y)}t*=n,e*=n,i*=n,r*=n;var u=this._rect;return u.x=t,u.y=e,u.width=i-t,u.height=r-e,u}});cc.PhysicsCollider=e.exports=s}),{"../CCPhysicsTypes":152,"../utils":175}],159:[(function(t,e,i){var n=t("../CCPhysicsTypes").PTM_RATIO,r=t("../CCPolygonSeparator"),s=cc.Class({name:"cc.PhysicsPolygonCollider",extends:cc.PhysicsCollider,mixins:[cc.Collider.Polygon],editor:{menu:!1,inspector:!1,requireComponent:cc.RigidBody},_createShape:function(t){var e=[],i=this.points;i.length>0&&i[0].equals(i[i.length-1])&&(i.length-=1);for(var s=r.ConvexPartition(i),o=this.offset,a=0;a=2?1:n)},n.prototype.getFixtures=function(){return this._fixtures},n.prototype.getPoints=function(){return this._points},n.prototype.getNormals=function(){return this._normals},n.prototype.getFractions=function(){return this._fractions},cc.PhysicsRayCastCallback=e.exports=n}),{}],174:[(function(t,e,i){var n=t("../CCPhysicsTypes").PHYSICS_ANGLE_TO_ANGLE,r=t("../CCPhysicsTypes").PTM_RATIO,s=t("../utils").convertToNodeRotation,o=cc.v2();function a(){}a.prototype.addB2Body=function(t){},a.prototype.removeB2Body=function(t){},a.prototype.syncNode=function(){for(var t=cc.director.getPhysicsManager()._bodies,e=0,i=t.length;e0?s:null,!0);var _=a.prototype;if(e&&(l||(n.extend(a,e),_=a.prototype),a.$super=e),i){for(var d=i.length-1;d>=0;d--){var f=i[d];y(_,f.prototype),y(a,f,(function(t){return f.hasOwnProperty(t)&&!0})),I._isCCClass(f)&&y(o.getClassAttrs(a).constructor.prototype,o.getClassAttrs(f).constructor.prototype)}_.constructor=a}return l||(_.__initProps__=A),n.setClassName(t,a),a}function x(t){for(var e=n.getClassName(t),i=t.constructor,r="new "+e+"(",s=0;s0){var o=!(i&&i.startsWith("cc."));o&&(r+="try{\n");var a="].apply(this,arguments);\n";if(1===s)r+="CCClass.__ctors__[0"+a;else{r+="var cs=CCClass.__ctors__;\n";for(var c=0;c=0)){var o=e[s];if("function"==typeof o){var a=n.getPropertyDescriptor(t.prototype,s);if(a){var c=a.value;if("function"==typeof c){S.test(o)&&(r=!0,e[s]=(function(t,e){return function(){var i=this._super;this._super=t;var n=e.apply(this,arguments);return this._super=i,n}})(c,o));continue}}0}}return r}function w(t,e,i,n,r,s){if(t.__props__=[],n&&n.__props__&&(t.__props__=n.__props__.slice()),r)for(var o=0;o=0)){var d=t[u];h.validateMethodWithProps(d,u,e,s,i)&&n.value(s.prototype,u,d,!0,!0)}var f=t.editor;return f&&cc.isChildClassOf(i,cc.Component)&&cc.Component._registerEditorProps(s,f),s}I._isCCClass=function(t){return t&&t.hasOwnProperty("__ctors__")},I._fastDefine=function(t,e,i){n.setClassName(t,e);for(var r=e.__props__=Object.keys(i),s=o.getClassAttrsProto(e),c=0;c=2&&((h||u())[l+"min"]=g[0],h[l+"max"]=g[1],g.length>2&&(h[l+"step"]=g[2])),p("min","number"),p("max","number"),p("step","number"),_}cc.Class=I,e.exports={isArray:function(t){return t=g(t),Array.isArray(t)},fastDefine:I._fastDefine,getNewValueTypeCode:x,IDENTIFIER_RE:T,escapeForJS:C,getDefault:g}}),{"./CCEnum":180,"./attribute":191,"./js":199,"./preprocess-class":200,"./requiring-frame":201,"./utils":203}],179:[(function(t,e,i){t("./CCClass");var n=t("./preprocess-class"),r=t("./js"),s="__ccclassCache__";function o(t){return t}function a(t,e){return t[e]||(t[e]={})}function c(t){return function(e){return"function"==typeof e?t(e):function(i){return t(i,e)}}}function h(t,e,i){return function(t){return function(i){return e(i,t)}}}var l=h.bind(null,!1);function u(t){return h.bind(null,!1)}var _=u(),d=u();function f(t,e){return a(t,s)}var m=c((function(t,e){var i=r.getSuper(t);i===Object&&(i=null);var n={name:e,extends:i,ctor:t,__ES6__:!0},o=t[s];if(o){var a=o.proto;a&&r.mixin(n,a),t[s]=void 0}return cc.Class(n)}));function p(t,e,i){return t((function(t,n){var r=f(t);if(r){var s=void 0!==i?i:n;a(a(r,"proto"),"editor")[e]=s}}),e)}function g(t){return t(o)}var y=g(c),v=p(l,"requireComponent"),x=g(_),C=p(d,"executionOrder"),T=g(c),A=g(c),b=g(_),S=g(_),E=g(_);cc._decorator=e.exports={ccclass:m,property:function(t,e,i){var s=null;function o(t,e,i){var o=f(t.constructor);if(o){var c=a(a(o,"proto"),"properties");(function(t,e,i,s,o,a){var c;s&&(c=(c=n.getFullFormOfProperty(s))||s);var h=e[i],l=r.mixin(h||{},c||{});if(o&&(o.get||o.set))o.get&&(l.get=o.get),o.set&&(l.set=o.set);else{var u=void 0;if(o)o.initializer&&(u=(function(t){var e;try{e=t()}catch(e){return t}return"object"!=typeof e||null===e?e:t})(o.initializer));else{var _=a.default||(a.default=(function(t){var e;try{e=new t}catch(t){return{}}return e})(t));_.hasOwnProperty(i)&&(u=_[i])}l.default=u}e[i]=l})(t.constructor,c,e,s,i,o)}}if(void 0===e)return s=t,o;o(t,e,i)},executeInEditMode:y,requireComponent:v,menu:x,executionOrder:C,disallowMultiple:T,playOnFocus:A,inspector:b,icon:S,help:E,mixins:function(){for(var t=[],e=0;ea)return this._removeUsedIndexBit(i),delete this._touchesIntegerDict[n.getID()],i;t>>=1}return-1},_removeUsedIndexBit:function(t){if(!(t<0||t>=this._maxTouches)){var e=1<0){this._glView._convertTouchesWithScale(r);var _=new cc.Event.EventTouch(r);_._eventCode=cc.Event.EventTouch.BEGAN,o.dispatchEvent(_)}},handleTouchesMove:function(t){for(var e,i,n,r=[],a=this._touches,c=s.now(),h=0,l=t.length;h0){this._glView._convertTouchesWithScale(r);var u=new cc.Event.EventTouch(r);u._eventCode=cc.Event.EventTouch.MOVED,o.dispatchEvent(u)}},handleTouchesEnd:function(t){var e=this.getSetOfTouchesEndOrCancel(t);if(e.length>0){this._glView._convertTouchesWithScale(e);var i=new cc.Event.EventTouch(e);i._eventCode=cc.Event.EventTouch.ENDED,o.dispatchEvent(i)}},handleTouchesCancel:function(t){var e=this.getSetOfTouchesEndOrCancel(t);if(e.length>0){this._glView._convertTouchesWithScale(e);var i=new cc.Event.EventTouch(e);i._eventCode=cc.Event.EventTouch.CANCELLED,o.dispatchEvent(i)}},getSetOfTouchesEndOrCancel:function(t){for(var e,i,n,r=[],s=this._touches,o=this._touchesIntegerDict,a=0,c=t.length;a=0;r--)if(i[r].getID()===n){e=i[r];break}return e||(e=t),e},setPreTouch:function(t){for(var e=!1,i=this._preTouchPool,n=t.getID(),r=i.length-1;r>=0;r--)if(i[r].getID()===n){i[r]=t,e=!0;break}e||(i.length<=50?i.push(t):(i[this._preTouchPoolPointer]=t,this._preTouchPoolPointer=(this._preTouchPoolPointer+1)%50))},getTouchByXY:function(t,e,i){var n=this._preTouchPoint,r=this._glView.convertToLocationInView(t,e,i),s=new cc.Touch(r.x,r.y);return s._setPrevPoint(n.x,n.y),n.x=r.x,n.y=r.y,s},getMouseEvent:function(t,e,i){var n=this._prevMousePoint,r=new cc.Event.EventMouse(i);return r._setPrevCursor(n.x,n.y),n.x=t.x,n.y=t.y,this._glView._convertMouseToLocationInView(n,e),r.setLocation(n.x,n.y),r},getPointByEvent:function(t,e){return null!=t.pageX?{x:t.pageX,y:t.pageY}:(s.platform===s.WECHAT_GAME?(e.left=0,e.top=0):(e.left-=document.body.scrollLeft,e.top-=document.body.scrollTop),{x:t.clientX,y:t.clientY})},getTouchesByEvent:function(t,e){for(var i,n,r,o=[],a=this._glView,c=this._preTouchPoint,h=t.changedTouches.length,l=0;lthis._accelInterval&&(this._accelCurTime-=this._accelInterval,o.dispatchEvent(new cc.Event.EventAcceleration(this._acceleration))),this._accelCurTime+=t}};n.get(cc,"inputManager",(function(){return cc.warnID(1405,"cc.inputManager","cc.systemEvent"),c})),e.exports=_cc.inputManager=c}),{"../event-manager":112,"../platform/js":199,"./CCMacro":183,"./CCSys":187}],183:[(function(t,e,i){t("./_CCClass"),cc.KEY={none:0,back:6,menu:18,backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,pause:19,capslock:20,escape:27,space:32,pageup:33,pagedown:34,end:35,home:36,left:37,up:38,right:39,down:40,select:41,insert:45,Delete:46,0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,a:65,b:66,c:67,d:68,e:69,f:70,g:71,h:72,i:73,j:74,k:75,l:76,m:77,n:78,o:79,p:80,q:81,r:82,s:83,t:84,u:85,v:86,w:87,x:88,y:89,z:90,num0:96,num1:97,num2:98,num3:99,num4:100,num5:101,num6:102,num7:103,num8:104,num9:105,"*":106,"+":107,"-":109,numdel:110,"/":111,f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123,numlock:144,scrolllock:145,";":186,semicolon:186,equal:187,"=":187,",":188,comma:188,dash:189,".":190,period:190,forwardslash:191,grave:192,"[":219,openbracket:219,backslash:220,"]":221,closebracket:221,quote:222,dpadLeft:1e3,dpadRight:1001,dpadUp:1003,dpadDown:1004,dpadCenter:1005},cc.ImageFormat=cc.Enum({JPG:0,PNG:1,TIFF:2,WEBP:3,PVR:4,ETC:5,S3TC:6,ATITC:7,TGA:8,RAWDATA:9,UNKNOWN:10}),cc.getImageFormatByData=function(t){return t.length>8&&137===t[0]&&80===t[1]&&78===t[2]&&71===t[3]&&13===t[4]&&10===t[5]&&26===t[6]&&10===t[7]?cc.ImageFormat.PNG:t.length>2&&(73===t[0]&&73===t[1]||77===t[0]&&77===t[1]||255===t[0]&&216===t[1])?cc.ImageFormat.TIFF:cc.ImageFormat.UNKNOWN},cc.macro={INVALID_INDEX:-1,NODE_TAG_INVALID:-1,PI:Math.PI,PI2:2*Math.PI,FLT_MAX:parseFloat("3.402823466e+38F"),FLT_MIN:parseFloat("1.175494351e-38F"),RAD:Math.PI/180,DEG:180/Math.PI,UINT_MAX:4294967295,REPEAT_FOREVER:Number.MAX_VALUE-1,FLT_EPSILON:1.192092896e-7,ONE:1,ZERO:0,SRC_ALPHA:770,SRC_ALPHA_SATURATE:776,SRC_COLOR:768,DST_ALPHA:772,DST_COLOR:774,ONE_MINUS_SRC_ALPHA:771,ONE_MINUS_SRC_COLOR:769,ONE_MINUS_DST_ALPHA:773,ONE_MINUS_DST_COLOR:775,ONE_MINUS_CONSTANT_ALPHA:32772,ONE_MINUS_CONSTANT_COLOR:32770,LINEAR:9729,BLEND_DST:771,WEB_ORIENTATION_PORTRAIT:0,WEB_ORIENTATION_LANDSCAPE_LEFT:-90,WEB_ORIENTATION_PORTRAIT_UPSIDE_DOWN:180,WEB_ORIENTATION_LANDSCAPE_RIGHT:90,ORIENTATION_PORTRAIT:1,ORIENTATION_LANDSCAPE:2,ORIENTATION_AUTO:3,DENSITYDPI_DEVICE:"device-dpi",DENSITYDPI_HIGH:"high-dpi",DENSITYDPI_MEDIUM:"medium-dpi",DENSITYDPI_LOW:"low-dpi",VERTEX_ATTRIB_FLAG_NONE:0,VERTEX_ATTRIB_FLAG_POSITION:1,VERTEX_ATTRIB_FLAG_COLOR:2,VERTEX_ATTRIB_FLAG_TEX_COORDS:4,VERTEX_ATTRIB_FLAG_POS_COLOR_TEX:7,GL_ALL:0,VERTEX_ATTRIB_POSITION:0,VERTEX_ATTRIB_COLOR:1,VERTEX_ATTRIB_TEX_COORDS:2,VERTEX_ATTRIB_MAX:3,UNIFORM_PMATRIX:0,UNIFORM_MVMATRIX:1,UNIFORM_MVPMATRIX:2,UNIFORM_TIME:3,UNIFORM_SINTIME:4,UNIFORM_COSTIME:5,UNIFORM_RANDOM01:6,UNIFORM_SAMPLER:7,UNIFORM_MAX:8,SHADER_POSITION_TEXTURECOLOR:"ShaderPositionTextureColor",SHADER_SPRITE_POSITION_TEXTURECOLOR:"ShaderSpritePositionTextureColor",SHADER_POSITION_TEXTURECOLORALPHATEST:"ShaderPositionTextureColorAlphaTest",SHADER_SPRITE_POSITION_TEXTURECOLORALPHATEST:"ShaderSpritePositionTextureColorAlphaTest",SHADER_POSITION_COLOR:"ShaderPositionColor",SHADER_SPRITE_POSITION_COLOR:"ShaderSpritePositionColor",SHADER_POSITION_TEXTURE:"ShaderPositionTexture",SHADER_POSITION_TEXTURE_UCOLOR:"ShaderPositionTexture_uColor",SHADER_POSITION_TEXTUREA8COLOR:"ShaderPositionTextureA8Color",SHADER_POSITION_UCOLOR:"ShaderPosition_uColor",SHADER_POSITION_LENGTHTEXTURECOLOR:"ShaderPositionLengthTextureColor",UNIFORM_PMATRIX_S:"CC_PMatrix",UNIFORM_MVMATRIX_S:"CC_MVMatrix",UNIFORM_MVPMATRIX_S:"CC_MVPMatrix",UNIFORM_TIME_S:"CC_Time",UNIFORM_SINTIME_S:"CC_SinTime",UNIFORM_COSTIME_S:"CC_CosTime",UNIFORM_RANDOM01_S:"CC_Random01",UNIFORM_SAMPLER_S:"CC_Texture0",UNIFORM_ALPHA_TEST_VALUE_S:"CC_alpha_value",ATTRIBUTE_NAME_COLOR:"a_color",ATTRIBUTE_NAME_POSITION:"a_position",ATTRIBUTE_NAME_TEX_COORD:"a_texCoord",ITEM_SIZE:32,CURRENT_ITEM:3233828865,ZOOM_ACTION_TAG:3233828866,NORMAL_TAG:8801,SELECTED_TAG:8802,DISABLE_TAG:8803,FIX_ARTIFACTS_BY_STRECHING_TEXEL:0,FIX_ARTIFACTS_BY_STRECHING_TEXEL_TMX:1,DIRECTOR_STATS_POSITION:cc.p(0,0),DIRECTOR_FPS_INTERVAL:.5,COCOSNODE_RENDER_SUBPIXEL:1,SPRITEBATCHNODE_RENDER_SUBPIXEL:1,AUTO_PREMULTIPLIED_ALPHA_FOR_PNG:0,OPTIMIZE_BLEND_FUNC_FOR_PREMULTIPLIED_ALPHA:0,TEXTURE_NPOT_SUPPORT:0,USE_LA88_LABELS:1,SPRITE_DEBUG_DRAW:0,LABELBMFONT_DEBUG_DRAW:0,LABELATLAS_DEBUG_DRAW:0,ENABLE_STACKABLE_ACTIONS:1,ENABLE_GL_STATE_CACHE:1,TOUCH_TIMEOUT:5e3,BATCH_VERTEX_COUNT:2e4,ENABLE_GC_FOR_NATIVE_OBJECTS:!0,ENABLE_TILEDMAP_CULLING:!0,DOWNLOAD_MAX_CONCURRENT:64,ENABLE_TRANSPARENT_CANVAS:!1,ENABLE_WEBGL_ANTIALIAS:!1};var n=!0;cc.defineGetterSetter(cc.macro,"ENABLE_CULLING",(function(){return n}),(function(t){n=t;var e=cc.director.getScene();e&&(e._sgNode._renderCmd.setDirtyFlag(_ccsg.Node._dirtyFlags.cullingDirty),cc.renderer.childrenOrderDirty=!0)})),cc.defineGetterSetter(cc.macro,"BLEND_SRC",(function(){return cc._renderType===cc.game.RENDER_TYPE_WEBGL&&cc.macro.OPTIMIZE_BLEND_FUNC_FOR_PREMULTIPLIED_ALPHA?cc.macro.ONE:cc.macro.SRC_ALPHA})),cc.lerp=function(t,e,i){return t+(e-t)*i},cc.rand=function(){return 16777215*Math.random()},cc.randomMinus1To1=function(){return 2*(Math.random()-.5)},cc.random0To1=Math.random,cc.degreesToRadians=function(t){return t*cc.macro.RAD},cc.radiansToDegrees=function(t){return t*cc.macro.DEG},cc.nodeDrawSetup=function(t){t._shaderProgram&&(t._shaderProgram.use(),t._shaderProgram.setUniformForModelViewAndProjectionMatrixWithMat4())},cc.incrementGLDraws=function(t){cc.g_NumberOfDraws+=t},cc.checkGLErrorDebug=function(){if(cc._renderType===cc.game.RENDER_TYPE_WEBGL){var t=cc._renderContext.getError();t&&cc.logID(2400,t)}},e.exports=cc.macro}),{"./_CCClass":190}],184:[(function(t,e,i){var n=t("./js"),r=t("./CCClass"),s=1;function o(){this._name="",this._objFlags=0}r.fastDefine("cc.Object",o,{_name:"",_objFlags:0}),n.value(o,"Flags",{Destroyed:s,DontSave:8,EditorOnly:16,Dirty:32,DontDestroy:64,PersistentMask:-4192741,Destroying:128,Deactivating:256,LockedInEditor:512,IsPreloadStarted:8192,IsOnLoadStarted:32768,IsOnLoadCalled:16384,IsOnEnableCalled:2048,IsStartCalled:65536,IsEditorOnEnableCalled:4096,IsPositionLocked:1<<21,IsRotationLocked:1<<17,IsScaleLocked:1<<18,IsAnchorLocked:1<<19,IsSizeLocked:1<<20});var a=[];function c(){for(var t=a.length,e=0;e=6.2;break;case n.BROWSER_TYPE_ANDROID:n.osMainVersion&&n.osMainVersion>=5&&(E=!0);break;case n.BROWSER_TYPE_CHROME:E=w>=30;break;case n.BROWSER_TYPE_UC:E=w>11;break;case n.BROWSER_TYPE_360:E=!1}}var I,R=n.capabilities={canvas:S,opengl:E,webp:b};(void 0!==a.ontouchstart||void 0!==o.ontouchstart||s.msPointerEnabled)&&(R.touches=!0),void 0!==a.onmouseup&&(R.mouse=!0),void 0!==a.onkeyup&&(R.keyboard=!0),(r.DeviceMotionEvent||r.DeviceOrientationEvent)&&(R.accelerometer=!0),(function(){n.browserVersion;var t=!!(window.AudioContext||window.webkitAudioContext||window.mozAudioContext);I={ONLY_ONE:!1,WEB_AUDIO:t,DELAY_CREATE_CTX:!1},n.os===n.OS_IOS&&(I.USE_LOADER_EVENT="loadedmetadata"),n.browserType===n.BROWSER_TYPE_FIREFOX&&(I.DELAY_CREATE_CTX=!0,I.USE_LOADER_EVENT="canplay"),n.os===n.OS_ANDROID&&n.browserType===n.BROWSER_TYPE_UC&&(I.ONE_SOURCE=!0)})();try{I.WEB_AUDIO&&(I.context=new(window.AudioContext||window.webkitAudioContext||window.mozAudioContext),I.DELAY_CREATE_CTX&&setTimeout((function(){I.context=new(window.AudioContext||window.webkitAudioContext||window.mozAudioContext)}),0))}catch(t){I.WEB_AUDIO=!1,cc.logID(5201)}I.format=(function(){var t=[],e=document.createElement("audio");return e.canPlayType&&(e.canPlayType('audio/ogg; codecs="vorbis"')&&t.push(".ogg"),e.canPlayType("audio/mpeg")&&t.push(".mp3"),e.canPlayType('audio/wav; codecs="1"')&&t.push(".wav"),e.canPlayType("audio/mp4")&&t.push(".mp4"),e.canPlayType("audio/x-m4a")&&t.push(".m4a")),t})(),n.__audioSupport=I;n.garbageCollect=function(){},n.dumpRoot=function(){},n.restartVM=function(){},n.cleanScript=function(t){},n.isObjectValid=function(t){return!!t},n.dump=function(){var t="";t+="isMobile : "+this.isMobile+"\r\n",t+="language : "+this.language+"\r\n",t+="browserType : "+this.browserType+"\r\n",t+="browserVersion : "+this.browserVersion+"\r\n",t+="capabilities : "+JSON.stringify(this.capabilities)+"\r\n",t+="os : "+this.os+"\r\n",t+="osVersion : "+this.osVersion+"\r\n",t+="platform : "+this.platform+"\r\n",t+="Using "+(cc._renderType===cc.game.RENDER_TYPE_WEBGL?"WEBGL":"CANVAS")+" renderer.\r\n",cc.log(t)},n.openURL=function(t){window.open(t)},n.now=function(){return Date.now?Date.now():+new Date},e.exports=n}}),{}],188:[(function(t,e,i){var n=t("../event-manager"),r={init:function(){this.html=document.getElementsByTagName("html")[0]},availWidth:function(t){return t&&t!==this.html?t.clientWidth:window.innerWidth},availHeight:function(t){return t&&t!==this.html?t.clientHeight:window.innerHeight},meta:{width:"device-width"},adaptationType:cc.sys.browserType};switch(cc.sys.os===cc.sys.OS_IOS&&(r.adaptationType=cc.sys.BROWSER_TYPE_SAFARI),r.adaptationType){case cc.sys.BROWSER_TYPE_SAFARI:r.meta["minimal-ui"]="true",r.availWidth=function(t){return t.clientWidth},r.availHeight=function(t){return t.clientHeight};break;case cc.sys.BROWSER_TYPE_CHROME:r.__defineGetter__("target-densitydpi",(function(){return cc.view._targetDensityDPI}));break;case cc.sys.BROWSER_TYPE_SOUGOU:case cc.sys.BROWSER_TYPE_UC:r.availWidth=function(t){return t.clientWidth},r.availHeight=function(t){return t.clientHeight};break;case cc.sys.BROWSER_TYPE_MIUI:r.init=function(t){if(!t.__resizeWithBrowserSize){var e=function(){t.setDesignResolutionSize(t._designResolutionSize.width,t._designResolutionSize.height,t._resolutionPolicy),window.removeEventListener("resize",e,!1)};window.addEventListener("resize",e,!1)}};break;case cc.sys.BROWSER_TYPE_WECHAT_GAME:r.availWidth=function(){return window.innerWidth},r.availHeight=function(){return window.innerHeight};break;case cc.sys.BROWSER_TYPE_WECHAT_GAME_SUB:var s=wx.getSharedCanvas();r.availWidth=function(){return s.width},r.availHeight=function(){return s.height}}var o=null,a=cc._Class.extend({ctor:function(){var t=this,e=cc.ContainerStrategy,i=cc.ContentStrategy;r.init(this),t._frameSize=cc.size(0,0),t._initFrameSize();var n=cc.game.canvas.width,s=cc.game.canvas.height;t._designResolutionSize=cc.size(n,s),t._originalDesignResolutionSize=cc.size(n,s),t._viewPortRect=cc.rect(0,0,n,s),t._visibleRect=cc.rect(0,0,n,s),t._contentTranslateLeftTop={left:0,top:0},t._autoFullScreen=!1,t._devicePixelRatio=1,t._viewName="Cocos2dHTML5",t._resizeCallback=null,t._orientationChanging=!0,t._resizing=!1,t._scaleX=1,t._originalScaleX=1,t._scaleY=1,t._originalScaleY=1,t._isRotated=!1,t._orientation=3;cc.sys;t.enableRetina(!0),cc.visibleRect&&cc.visibleRect.init(t._visibleRect),t._resolutionPolicy=null,t._rpExactFit=new cc.ResolutionPolicy(e.EQUAL_TO_FRAME,i.EXACT_FIT),t._rpShowAll=new cc.ResolutionPolicy(e.PROPORTION_TO_FRAME,i.SHOW_ALL),t._rpNoBorder=new cc.ResolutionPolicy(e.EQUAL_TO_FRAME,i.NO_BORDER),t._rpFixedHeight=new cc.ResolutionPolicy(e.EQUAL_TO_FRAME,i.FIXED_HEIGHT),t._rpFixedWidth=new cc.ResolutionPolicy(e.EQUAL_TO_FRAME,i.FIXED_WIDTH),t._initialized=!1,t._contentTranslateLeftTop=null,t._frameZoomFactor=1,t.__resizeWithBrowserSize=!1,t._isAdjustViewPort=!0,t._targetDensityDPI=cc.macro.DENSITYDPI_HIGH,t.enableAntiAlias(!0)},_resizeEvent:function(){var t,e=(t=this.setDesignResolutionSize?this:cc.view)._frameSize.width,i=t._frameSize.height,r=t._isRotated;if(cc.sys.isMobile){var s=cc.game.container.style,o=s.margin;s.margin="0",s.display="none",t._initFrameSize(),s.margin=o,s.display="block"}else t._initFrameSize();if(t._isRotated!==r||t._frameSize.width!==e||t._frameSize.height!==i){var a=t._originalDesignResolutionSize.width,c=t._originalDesignResolutionSize.height;t._resizing=!0,a>0&&t.setDesignResolutionSize(a,c,t._resolutionPolicy),t._resizing=!1,n.dispatchCustomEvent("canvas-resize"),t._resizeCallback&&t._resizeCallback.call()}},_orientationChange:function(){cc.view._orientationChanging=!0,cc.view._resizeEvent()},setTargetDensityDPI:function(t){this._targetDensityDPI=t,this._adjustViewportMeta()},getTargetDensityDPI:function(){return this._targetDensityDPI},resizeWithBrowserSize:function(t){t?this.__resizeWithBrowserSize||(this.__resizeWithBrowserSize=!0,window.addEventListener("resize",this._resizeEvent),window.addEventListener("orientationchange",this._orientationChange)):this.__resizeWithBrowserSize&&(this.__resizeWithBrowserSize=!1,window.removeEventListener("resize",this._resizeEvent),window.removeEventListener("orientationchange",this._orientationChange))},setResizeCallback:function(t){"function"!=typeof t&&null!=t||(this._resizeCallback=t)},setOrientation:function(t){if((t&=cc.macro.ORIENTATION_AUTO)&&this._orientation!==t){this._orientation=t;var e=this._originalDesignResolutionSize.width,i=this._originalDesignResolutionSize.height;this.setDesignResolutionSize(e,i,this._resolutionPolicy)}},_initFrameSize:function(){var t=this._frameSize,e=r.availWidth(cc.game.frame),i=r.availHeight(cc.game.frame),n=e>=i;!cc.sys.isMobile||n&&this._orientation&cc.macro.ORIENTATION_LANDSCAPE||!n&&this._orientation&cc.macro.ORIENTATION_PORTRAIT?(t.width=e,t.height=i,cc.container.style["-webkit-transform"]="rotate(0deg)",cc.container.style.transform="rotate(0deg)",this._isRotated=!1):(t.width=i,t.height=e,cc.container.style["-webkit-transform"]="rotate(90deg)",cc.container.style.transform="rotate(90deg)",cc.container.style["-webkit-transform-origin"]="0px 0px 0px",cc.container.style.transformOrigin="0px 0px 0px",this._isRotated=!0),this._orientationChanging&&setTimeout((function(){cc.view._orientationChanging=!1}),1e3)},_adjustSizeKeepCanvasSize:function(){var t=this._originalDesignResolutionSize.width,e=this._originalDesignResolutionSize.height;t>0&&this.setDesignResolutionSize(t,e,this._resolutionPolicy)},_setViewportMeta:function(t,e){var i=document.getElementById("cocosMetaElement");i&&e&&document.head.removeChild(i);var n,r,s,o=document.getElementsByName("viewport"),a=o?o[0]:null;for(r in n=a?a.content:"",(i=i||document.createElement("meta")).id="cocosMetaElement",i.name="viewport",i.content="",t)-1==n.indexOf(r)?n+=","+r+"="+t[r]:e&&(s=new RegExp(r+"s*=s*[^,]+"),n.replace(s,r+"="+t[r]));/^,/.test(n)&&(n=n.substr(1)),i.content=n,a&&(a.content=n),document.head.appendChild(i)},_adjustViewportMeta:function(){this._isAdjustViewPort&&(this._setViewportMeta(r.meta,!1),this._isAdjustViewPort=!1)},_resetScale:function(){this._scaleX=this._originalScaleX,this._scaleY=this._originalScaleY},_adjustSizeToBrowser:function(){},initialize:function(){this._initialized=!0},adjustViewPort:function(t){this._isAdjustViewPort=t},enableRetina:function(t){this._retinaEnabled=!!t},isRetinaEnabled:function(){return this._retinaEnabled},enableAntiAlias:function(t){if(this._antiAliasEnabled!==t)if(this._antiAliasEnabled=t,cc._renderType===cc.game.RENDER_TYPE_WEBGL){var e=cc.loader._cache;for(var i in e){var n=e[i],r=n&&n.content instanceof cc.Texture2D?n.content:null;r&&(t?r.setAntiAliasTexParameters():r.setAliasTexParameters())}}else if(cc._renderType===cc.game.RENDER_TYPE_CANVAS){var s=cc._canvas.getContext("2d");s.imageSmoothingEnabled=t,s.mozImageSmoothingEnabled=t;var o=cc.rendererCanvas._dirtyRegion;if(o){var a=new cc.Region;a.setTo(0,0,cc.visibleRect.width,cc.visibleRect.height),o.addRegion(a)}}},isAntiAliasEnabled:function(){return this._antiAliasEnabled},enableAutoFullScreen:function(t){t&&t!==this._autoFullScreen&&cc.sys.isMobile&&cc.sys.browserType!==cc.sys.BROWSER_TYPE_WECHAT?(this._autoFullScreen=!0,cc.screen.autoFullScreen(cc.game.frame)):this._autoFullScreen=!1},isAutoFullScreenEnabled:function(){return this._autoFullScreen},isViewReady:function(){return cc.game.canvas&&cc._renderContext},setFrameZoomFactor:function(t){this._frameZoomFactor=t,cc.director.setProjection(cc.director.getProjection())},setContentTranslateLeftTop:function(t,e){this._contentTranslateLeftTop={left:t,top:e}},getContentTranslateLeftTop:function(){return this._contentTranslateLeftTop},setCanvasSize:function(t,e){var i=cc.game.canvas,n=cc.game.container;i.width=t*this._devicePixelRatio,i.height=e*this._devicePixelRatio,i.style.width=t+"px",i.style.height=e+"px",n.style.width=t+"px",n.style.height=e+"px",this._resizeEvent()},getCanvasSize:function(){return cc.size(cc.game.canvas.width,cc.game.canvas.height)},getFrameSize:function(){return cc.size(this._frameSize.width,this._frameSize.height)},setFrameSize:function(t,e){this._frameSize.width=t,this._frameSize.height=e,cc.game.frame.style.width=t+"px",cc.game.frame.style.height=e+"px",this._resizeEvent(),cc.director.setProjection(cc.director.getProjection())},getVisibleSize:function(){return cc.size(this._visibleRect.width,this._visibleRect.height)},getVisibleSizeInPixel:function(){return cc.size(this._visibleRect.width*this._scaleX,this._visibleRect.height*this._scaleY)},getVisibleOrigin:function(){return cc.p(this._visibleRect.x,this._visibleRect.y)},getVisibleOriginInPixel:function(){return cc.p(this._visibleRect.x*this._scaleX,this._visibleRect.y*this._scaleY)},canSetContentScaleFactor:function(){return!0},getResolutionPolicy:function(){return this._resolutionPolicy},setResolutionPolicy:function(t){var e=this;if(t instanceof cc.ResolutionPolicy)e._resolutionPolicy=t;else{var i=cc.ResolutionPolicy;t===i.EXACT_FIT&&(e._resolutionPolicy=e._rpExactFit),t===i.SHOW_ALL&&(e._resolutionPolicy=e._rpShowAll),t===i.NO_BORDER&&(e._resolutionPolicy=e._rpNoBorder),t===i.FIXED_HEIGHT&&(e._resolutionPolicy=e._rpFixedHeight),t===i.FIXED_WIDTH&&(e._resolutionPolicy=e._rpFixedWidth)}},setDesignResolutionSize:function(t,e,i){if(t>0||e>0){this.setResolutionPolicy(i);var n=this._resolutionPolicy;if(n&&n.preApply(this),cc.sys.isMobile&&this._adjustViewportMeta(),this._orientationChanging=!0,this._resizing||this._initFrameSize(),n){this._originalDesignResolutionSize.width=this._designResolutionSize.width=t,this._originalDesignResolutionSize.height=this._designResolutionSize.height=e;var r=n.apply(this,this._designResolutionSize);if(r.scale&&2===r.scale.length&&(this._scaleX=r.scale[0],this._scaleY=r.scale[1]),r.viewport){var s=this._viewPortRect,o=this._visibleRect,a=r.viewport;s.x=a.x,s.y=a.y,s.width=a.width,s.height=a.height,o.x=-s.x/this._scaleX,o.y=-s.y/this._scaleY,o.width=cc.game.canvas.width/this._scaleX,o.height=cc.game.canvas.height/this._scaleY,cc._renderContext.setOffset&&cc._renderContext.setOffset(s.x,-s.y)}var c=cc.director;c._winSizeInPoints.width=this._designResolutionSize.width,c._winSizeInPoints.height=this._designResolutionSize.height,n.postApply(this),cc.winSize.width=c._winSizeInPoints.width,cc.winSize.height=c._winSizeInPoints.height,cc._renderType===cc.game.RENDER_TYPE_WEBGL?c.setGLDefaultValues():cc._renderType===cc.game.RENDER_TYPE_CANVAS&&(cc.renderer._allNeedDraw=!0),this._originalScaleX=this._scaleX,this._originalScaleY=this._scaleY,cc.visibleRect&&cc.visibleRect.init(this._visibleRect)}else cc.logID(2201)}else cc.logID(2200)},getDesignResolutionSize:function(){return cc.size(this._designResolutionSize.width,this._designResolutionSize.height)},setRealPixelResolution:function(t,e,i){this._setViewportMeta({width:t},!0),document.documentElement.style.width=t+"px",document.body.style.width=t+"px",document.body.style.left="0px",document.body.style.top="0px",this.setDesignResolutionSize(t,e,i)},setViewPortInPoints:function(t,e,i,n){var r=this._frameZoomFactor,s=this._scaleX,o=this._scaleY;cc._renderContext.viewport(t*s*r+this._viewPortRect.x*r,e*o*r+this._viewPortRect.y*r,i*s*r,n*o*r)},setScissorInPoints:function(t,e,i,n){var r=this._frameZoomFactor,s=this._scaleX,a=this._scaleY,c=Math.ceil(t*s*r+this._viewPortRect.x*r),h=Math.ceil(e*a*r+this._viewPortRect.y*r),l=Math.ceil(i*s*r),u=Math.ceil(n*a*r);if(!o){var _=gl.getParameter(gl.SCISSOR_BOX);o=cc.rect(_[0],_[1],_[2],_[3])}o.x===c&&o.y===h&&o.width===l&&o.height===u||(o.x=c,o.y=h,o.width=l,o.height=u,cc._renderContext.scissor(c,h,l,u))},isScissorEnabled:function(){return cc._renderContext.isEnabled(gl.SCISSOR_TEST)},getScissorRect:function(){if(!o){var t=gl.getParameter(gl.SCISSOR_BOX);o=cc.rect(t[0],t[1],t[2],t[3])}var e=1/this._scaleX,i=1/this._scaleY;return cc.rect((o.x-this._viewPortRect.x)*e,(o.y-this._viewPortRect.y)*i,o.width*e,o.height*i)},setViewName:function(t){null!=t&&t.length>0&&(this._viewName=t)},getViewName:function(){return this._viewName},getViewPortRect:function(){return this._viewPortRect},getScaleX:function(){return this._scaleX},getScaleY:function(){return this._scaleY},getDevicePixelRatio:function(){return this._devicePixelRatio},convertToLocationInView:function(t,e,i){var n=this._devicePixelRatio*(t-i.left),r=this._devicePixelRatio*(i.top+i.height-e);return this._isRotated?{x:this._viewPortRect.width-r,y:n}:{x:n,y:r}},_convertMouseToLocationInView:function(t,e){var i=this._viewPortRect;t.x=(this._devicePixelRatio*(t.x-e.left)-i.x)/this._scaleX,t.y=(this._devicePixelRatio*(e.top+e.height-t.y)-i.y)/this._scaleY},_convertPointWithScale:function(t){var e=this._viewPortRect;t.x=(t.x-e.x)/this._scaleX,t.y=(t.y-e.y)/this._scaleY},_convertTouchesWithScale:function(t){for(var e,i,n,r=this._viewPortRect,s=this._scaleX,o=this._scaleY,a=0;a=0;n--){var r=i[n];r.hasOwnProperty("__attrs__")&&r.__attrs__||s(r,0,(e=i[n+1])&&e.__attrs__)}return s(t,0,(e=i[0])&&e.__attrs__),t.__attrs__})(t)}function c(t){return a(t).constructor.prototype}function h(t,e){0}cc.Integer="Integer",cc.Float="Float",cc.Boolean="Boolean",cc.String="String",e.exports={attr:o,getClassAttrs:a,getClassAttrsProto:c,setClassAttr:function(t,e,i,n){c(t)[e+r+i]=n},DELIMETER:r,getTypeChecker:h,ObjectType:function(t){return{type:"Object",ctor:t,_onAfterProp:!1}},ScriptUuid:{}}}),{"./CCClass":178,"./js":199,"./utils":203}],192:[(function(t,e,i){var n=t("./js"),r=n.array.fastRemoveAt;function s(){this.callbacks=[],this.targets=[],this.isInvoking=!1,this.containCanceled=!1}var o=s.prototype;o.removeBy=function(t,e){for(var i=this.callbacks,n=this.targets,s=0;s0?this.deserializedList[0]:[]}else this.deserializedList.length=1,this.deserializedData=t?this._deserializeObject(t,!1):null,this.deserializedList[0]=this.deserializedData;return (function(t){var e,i,n,r=t.deserializedList,s=t._idPropList,o=t._idList,a=t._idObjList;for(t._classFinder&&t._classFinder.onDereferenced,e=0;e0&&(i=f+this.globalVariables.join(",")+";");var n=h.flattenCodeArray(["return (function(R){",i||[],this.codeArray,"return o;","})"]);this.result=Function("O","F",n)(this.objs,this.funcs);for(var r=0,s=this.objsToClear_iN$t.length;r1)t.push(p+"="+this._targetExp+";"),e=p;else{if(1!==this._exps.length)return;e=this._targetExp}for(var i=0;i=0&&(d(t,i),!0)}o.formatStr=function(){var t=arguments.length;if(0===t)return"";var e=arguments[0];if(1===t)return""+e;if("string"==typeof e&&u.test(e))for(var i=1;i=0&&(t[i]=t[t.length-1],--t.length)},removeAt:d,fastRemoveAt:function(t,e){var i=t.length;e<0||e>=i||(t[e]=t[i-1],t.length=i-1)},contains:function(t,e){return t.indexOf(e)>=0},verifyType:function(t,e){if(t&&t.length>0)for(var i=0;i0){--this.count;var t=this._pool[this.count];return this._pool[this.count]=null,t}return null},p.prototype.put=function(t){var e=this._pool;if(this.count=0&&(this._pool.length=t,this.count>t&&(this.count=t))},o.Pool=p,cc.js=o,e.exports=o}),{"../utils/mutable-forward-iterator":229,"./id-generater":195}],200:[(function(t,e,i){var n={url:{canUsedInGet:!0},default:{},serializable:{},editorOnly:{},formerlySerializedAs:{}};function r(t,e,i,r){if(!t.get&&!t.set)if(t.hasOwnProperty("default")){var s="_N$"+e;t.get=function(){return this[s]},t.set=function(t){var e=this[s];this[s]=t,i.call(this,e)};var o={};for(var a in r[s]=o,n){var c=n[a];t.hasOwnProperty(a)&&(o[a]=t[a],c.canUsedInGet||delete t[a])}}else 0}function s(t,e,i,n){Array.isArray(n)&&n.length>0&&(n=n[0]),t.type=n}function o(t,e,i,n){if(Array.isArray(e)){if(!(e.length>0))return cc.errorID(5508,i,n);if(cc.RawAsset.isRawAssetType(e[0]))return t.url=e[0],void delete t.type;t.type=e=e[0]}}i.getFullFormOfProperty=function(t,e,i){if(!(t&&t.constructor===Object)){if(Array.isArray(t)&&t.length>0){var n=t[0];return{default:[],type:t,_short:!0}}if("function"==typeof t){n=t;return cc.RawAsset.isRawAssetType(n)||cc.RawAsset.wasRawAssetType(n)?{default:"",url:n,_short:!0}:{default:cc.isChildClassOf(n,cc.ValueType)?new n:null,type:n,_short:!0}}return{default:t,_short:!0}}return null},i.preprocessAttrs=function(t,e,n,a){for(var c in t){var h=t[c],l=i.getFullFormOfProperty(h,c,e);if(l&&(h=t[c]=l),h){var u=h.notify;u&&r(h,c,u,t),"type"in h&&o(h,h.type,e,c),"url"in h&&s(h,0,0,h.url),"type"in h&&h.type}}},i.validateMethodWithProps=function(t,e,i,n,r){return"function"==typeof t||null===t}}),{"./CCClass":178}],201:[(function(t,e,i){var n=[];cc._RF={push:function(t,e,i){void 0===i&&(i=e,e=""),n.push({uuid:e,script:i,module:t,exports:t.exports,beh:null})},pop:function(){var t=n.pop(),e=t.module,i=e.exports;if(i===t.exports){for(var r in i)return;e.exports=i=t.cls}},peek:function(){return n[n.length-1]}}}),{}],202:[(function(t,e,i){cc.url={_rawAssets:"",normalize:function(t){return t&&(46===t.charCodeAt(0)&&47===t.charCodeAt(1)?t=t.slice(2):47===t.charCodeAt(0)&&(t=t.slice(1))),t},raw:function(t){if((t=this.normalize(t)).startsWith("resources/")){var e=cc.loader._getResUuid(t.slice(10),cc.Asset,!0);if(e)return cc.AssetLibrary.getLibUrlNoExt(e,!0)+cc.path.extname(t)}else cc.errorID(7002,t);return this._rawAssets+t},_init:function(t){this._rawAssets=cc.path.stripSep(t)+"/"}},e.exports=cc.url}),{}],203:[(function(t,e,i){e.exports={contains:function(t,e){if("function"==typeof t.contains)return t.contains(e);if("function"==typeof t.compareDocumentPosition)return!!(16&t.compareDocumentPosition(e));var i=e.parentNode;if(i)do{if(i===t)return!0;i=i.parentNode}while(null!==i);return!1},isDomNode:"object"==typeof window&&("function"==typeof Node?function(t){return t instanceof Node}:function(t){return t&&"object"==typeof t&&"number"==typeof t.nodeType&&"string"==typeof t.nodeName}),callInNextTick:function(t,e,i){t&&setTimeout((function(){t(e,i)}),0)}}}),{}],204:[(function(t,e,i){t("./platform/js"),t("./value-types"),t("./utils"),t("./platform/CCInputManager"),t("./platform/CCInputExtension"),t("./event"),t("./platform/CCSys"),t("./platform/CCMacro"),t("./load-pipeline"),t("./textures"),t("./CCDirector"),t("./CCDirectorWebGL"),t("./CCDirectorCanvas"),t("./platform/CCView"),t("./platform/CCScreen"),t("./CCScheduler"),t("./event-manager"),t("./renderer")}),{"./CCDirector":33,"./CCDirectorCanvas":34,"./CCDirectorWebGL":35,"./CCScheduler":42,"./event":116,"./event-manager":112,"./load-pipeline":138,"./platform/CCInputExtension":181,"./platform/CCInputManager":182,"./platform/CCMacro":183,"./platform/CCScreen":186,"./platform/CCSys":187,"./platform/CCView":188,"./platform/js":199,"./renderer":208,"./textures":220,"./utils":227,"./value-types":241}],205:[(function(t,e,i){var n=function(){this._minX=0,this._minY=0,this._maxX=0,this._maxY=0,this._width=0,this._height=0,this._area=0},r=n.prototype,s=[];function o(){var t=s.pop();return t||(t=new n),t}function a(t){s.push(t)}function c(t,e){var i=t._minXe._maxX?t._maxX:e._maxX)-i)*((t._maxY>e._maxY?t._maxY:e._maxY)-n)}r.setTo=function(t,e,i,n){return this._minX=t,this._minY=e,this._maxX=i,this._maxY=n,this.updateArea(),this},r.intValues=function(){this._minX=Math.floor(this._minX),this._minY=Math.floor(this._minY),this._maxX=Math.ceil(this._maxX),this._maxY=Math.ceil(this._maxY),this.updateArea()},r.updateArea=function(){this._width=this._maxX-this._minX,this._height=this._maxY-this._minY,this._area=this._width*this._height},r.union=function(t){this.isEmpty()?this.setTo(t._minX,t._minY,t._maxX,t._maxY):(this._minX>t._minX&&(this._minX=t._minX),this._minY>t._minY&&(this._minY=t._minY),this._maxXt._minX?this._minX:t._minX,i=this._maxXi)&&(e=this._minY>t._minY?this._minY:t._minY)<=(i=this._maxYv&&(S=g,g=v,v=S),C>A&&(S=C,C=A,A=S),i=(gA?v:A)+1,y>x&&(S=y,y=x,x=S),T>b&&(S=T,T=b,b=S),n=(yb?x:b)+1}this._minX=i,this._minY=n,this._maxX=r,this._maxY=s,this._width=r-i,this._height=s-n,this._area=this._width*this._height}else this.setEmpty()};var h=function(){this.dirtyList=[],this.hasClipRect=!1,this.clipWidth=0,this.clipHeight=0,this.clipArea=0,this.clipRectChanged=!1},l=h.prototype;l.setClipRect=function(t,e){this.hasClipRect=!0,this.clipRectChanged=!0,this.clipWidth=Math.ceil(t),this.clipHeight=Math.ceil(e),this.clipArea=this.clipWidth*this.clipHeight},l.addRegion=function(t){var e=t._minX,i=t._minY,n=t._maxX,r=t._maxY;if(this.hasClipRect&&(e<0&&(e=0),i<0&&(i=0),n>this.clipWidth&&(n=this.clipWidth),r>this.clipHeight&&(r=this.clipHeight)),e>=n||i>=r)return!1;if(this.clipRectChanged)return!0;var s=this.dirtyList,a=o();return s.push(a.setTo(e,i,n,r)),this.mergeDirtyList(s),!0},l.clear=function(){for(var t=this.dirtyList,e=t.length,i=0;i0)for(var n=0;n3?Number.POSITIVE_INFINITY:0,r=0,s=0,o=0,h=0;hd&&(r=h,s=u,n=d)}}if(i&&o/this.clipArea>.95&&(this.clipRectChanged=!0),r!==s){var f=t[s];return t[r].union(f),a(f),t.splice(s,1),!0}return!1},cc.Region=n,cc.DirtyRegion=h}),{}],206:[(function(t,e,i){cc.rendererCanvas={childrenOrderDirty:!0,assignedZ:0,assignedZStep:1e-4,_transformNodePool:[],_renderCmds:[],_isCacheToCanvasOn:!1,_cacheToCanvasCmds:{},_cacheInstanceIds:[],_currentID:0,_clearColor:cc.color(),_clearFillStyle:"rgb(0, 0, 0)",_dirtyRegion:null,_allNeedDraw:!0,_enableDirtyRegion:!1,_debugDirtyRegion:!1,_dirtyRegionCountThreshold:10,init:function(){cc.sys.browserType===cc.sys.BROWSER_TYPE_IE&&this.enableDirtyRegion(!1)},getRenderCmd:function(t){return t._createRenderCmd()},enableDirtyRegion:function(t){this._enableDirtyRegion=t},isDirtyRegionEnabled:function(){return this._enableDirtyRegion},setDirtyRegionCountThreshold:function(t){this._dirtyRegionCountThreshold=t},_collectDirtyRegion:function(){var t,e,i=this._renderCmds,n=this._dirtyRegion,r=_ccsg.Node.CanvasRenderCmd.RegionStatus,s=0,o=!0;for(t=0,e=i.length;tr.NotDirty&&(++s>this._dirtyRegionCountThreshold&&(o=!1),o&&(!l.isEmpty()&&n.addRegion(l),a._regionFlag>r.Dirty&&!h.isEmpty()&&n.addRegion(h)),a._regionFlag=r.NotDirty)}return o},_beginDrawDirtyRegion:function(t){var e=t.getContext(),i=this._dirtyRegion.getDirtyRegions();e.save(),t.setTransform({a:1,b:0,c:0,d:1,tx:0,ty:0},1,1),e.beginPath();for(var n=0,r=0,s=0,o=0,a=t._scaleX,c=t._scaleY,h=0,l=i.length;h0},_sortNodeByLevelAsc:function(t,e){return t._curLevel-e._curLevel},pushDirtyNode:function(t){this._transformNodePool.push(t)},clear:function(){},clearRenderCommands:function(){this._renderCmds.length=0,this._cacheInstanceIds.length=0,this._isCacheToCanvasOn=!1,this._allNeedDraw=!0},pushRenderCommand:function(t){if(t.rendering)if(this._isCacheToCanvasOn){var e=this._currentID,i=this._cacheToCanvasCmds[e];-1===i.indexOf(t)&&i.push(t)}else-1===this._renderCmds.indexOf(t)&&this._renderCmds.push(t)}},(function(){cc.CanvasContextWrapper=function(t){this._context=t,this._saveCount=0,this._currentAlpha=t.globalAlpha,this._currentCompositeOperation=t.globalCompositeOperation,this._currentFillStyle=t.fillStyle,this._currentStrokeStyle=t.strokeStyle,this._offsetX=0,this._offsetY=0,this._realOffsetY=this.height,this._armatureMode=0};var t=cc.CanvasContextWrapper.prototype;t.resetCache=function(){var t=this._context;this._currentAlpha=t.globalAlpha,this._currentCompositeOperation=t.globalCompositeOperation,this._currentFillStyle=t.fillStyle,this._currentStrokeStyle=t.strokeStyle,this._realOffsetY=this._context.canvas.height+this._offsetY},t.setOffset=function(t,e){this._offsetX=t,this._offsetY=e,this._realOffsetY=this._context.canvas.height+this._offsetY},t.computeRealOffsetY=function(){this._realOffsetY=this._context.canvas.height+this._offsetY},t.setViewScale=function(t,e){this._scaleX=t,this._scaleY=e},t.getContext=function(){return this._context},t.save=function(){this._context.save(),this._saveCount++},t.restore=function(){this._context.restore(),this._currentAlpha=this._context.globalAlpha,this._saveCount--},t.setGlobalAlpha=function(t){this._saveCount>0?this._context.globalAlpha=t:this._currentAlpha!==t&&(this._currentAlpha=t,this._context.globalAlpha=t)},t.setCompositeOperation=function(t){this._saveCount>0?this._context.globalCompositeOperation=t:this._currentCompositeOperation!==t&&(this._currentCompositeOperation=t,this._context.globalCompositeOperation=t)},t.setFillStyle=function(t){this._context.fillStyle=t},t.setStrokeStyle=function(t){this._saveCount>0?this._context.strokeStyle=t:this._currentStrokeStyle!==t&&(this._currentStrokeStyle=t,this._context.strokeStyle=t)},t.setTransform=function(t,e,i){this._armatureMode>0?(this.restore(),this.save(),this._context.transform(t.a,-t.b,-t.c,t.d,t.tx*e,-t.ty*i)):this._context.setTransform(t.a*e,-t.b*i,-t.c*e,t.d*i,this._offsetX+t.tx*e,this._realOffsetY-t.ty*i)},t._switchToArmatureMode=function(t,e,i,n){t?(this._armatureMode++,this._context.setTransform(e.a,e.c,e.b,e.d,this._offsetX+e.tx*i,this._realOffsetY-e.ty*n),this.save()):(this._armatureMode--,this.restore())}})()}),{}],207:[(function(t,e,i){var n={texture:null,blendSrc:null,blendDst:null,shader:null},r=!1,s=null,o=null,a=0,c=0,h=0,l=6,u=null,_=null,d=null,f=null,m=0,p=!0;function g(t){var e=cc._renderContext;null===s&&(o=e.createBuffer(),s=e.createBuffer()),(function(t){var e=cc._renderContext;if(s){var i=6*Math.ceil(t/4);e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,s),f=new Uint16Array(i);for(var n=0,r=0,c=i;r0},_sortNodeByLevelAsc:function(t,e){return t._curLevel-e._curLevel},pushDirtyNode:function(t){this._transformNodePool.push(t)},clearRenderCommands:function(){this._renderCmds.length=0},clear:function(){var t=cc._renderContext;t.clearColor(this._clearColor.r,this._clearColor.g,this._clearColor.b,this._clearColor.a),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT)},setDepthTest:function(t){var e=cc._renderContext;t?(e.clearDepth(1),e.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL)):e.disable(e.DEPTH_TEST)},pushRenderCommand:function(t){if(t.rendering||t.uploadData)if(this._isCacheToBufferOn){var e=this._currentID,i=this._cacheToBufferCmds[e];-1===i.indexOf(t)&&i.push(t)}else this._renderCmds.push(t)},_increaseBatchingSize:function(t,e,i){var n,r;switch(e=e||y.QUAD){case y.QUAD:for(n=0;n=a&&this._batchRendering();var e=t._node,i=t._texture||e._texture||e._spriteFrame&&e._spriteFrame._texture,s=e._blendFunc.src,o=e._blendFunc.dst,u=t._shaderProgram;(r||n.texture!==i||n.blendSrc!==s||n.blendDst!==o||n.shader!==u)&&(this._batchRendering(),n.texture=i,n.blendSrc=s,n.blendDst=o,n.shader=u,r=!1);var m=t.uploadData(_,d,c*l);if(m>0){var g,v;switch(t.vertexType||y.QUAD){case y.QUAD:for(g=0;g.5*a;if(i&&(i.use(),i._updateProjectionUniform()),cc.gl.blendFunc(n.blendSrc,n.blendDst),cc.gl.bindTexture2DN(0,e),t.bindBuffer(t.ARRAY_BUFFER,o),r)t.bufferData(t.ARRAY_BUFFER,_,t.DYNAMIC_DRAW);else{var u=_.subarray(0,c*l);t.bufferData(t.ARRAY_BUFFER,u,t.DYNAMIC_DRAW)}t.enableVertexAttribArray(cc.macro.VERTEX_ATTRIB_POSITION),t.enableVertexAttribArray(cc.macro.VERTEX_ATTRIB_COLOR),t.enableVertexAttribArray(cc.macro.VERTEX_ATTRIB_TEX_COORDS),t.vertexAttribPointer(cc.macro.VERTEX_ATTRIB_POSITION,3,t.FLOAT,!1,24,0),t.vertexAttribPointer(cc.macro.VERTEX_ATTRIB_COLOR,4,t.UNSIGNED_BYTE,!0,24,12),t.vertexAttribPointer(cc.macro.VERTEX_ATTRIB_TEX_COORDS,2,t.FLOAT,!1,24,16),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,s),(!m||!p||h>m)&&(r?t.bufferData(t.ELEMENT_ARRAY_BUFFER,f,t.DYNAMIC_DRAW):t.bufferData(t.ELEMENT_ARRAY_BUFFER,f.subarray(0,h),t.DYNAMIC_DRAW)),t.drawElements(t.TRIANGLES,h,t.UNSIGNED_SHORT,0),cc.g_NumberOfDraws++,p?m=h:(m=0,p=!0),c=0,h=0}},rendering:function(t,e){var i,r,s,o=e||this._renderCmds,a=t||cc._renderContext;for(a.bindBuffer(a.ARRAY_BUFFER,null),cc.gl.bindTexture2DN(0,null),i=0,r=o.length;i0&&this._batchRendering(),s.rendering(a)));this._batchRendering(),n.texture=null}}}),{}],208:[(function(t,e,i){t("./RendererCanvas"),t("./RendererWebGL"),t("./DirtyRegion")}),{"./DirtyRegion":205,"./RendererCanvas":206,"./RendererWebGL":207}],209:[(function(t,e,i){_ccsg.Scene=_ccsg.Node.extend({_className:"Scene",ctor:function(){_ccsg.Node.prototype.ctor.call(this),this._ignoreAnchorPointForPosition=!0,this.setAnchorPoint(.5,.5),this.setContentSize(cc.director.getWinSize())}})}),{}],210:[(function(t,e,i){var n=t("../event/event-target"),r=t("../utils/misc");_ccsg.Sprite=_ccsg.Node.extend({dirty:!1,_recursiveDirty:null,_shouldBeHidden:!1,_transformToBatch:null,_blendFunc:null,_texture:null,_rect:null,_rectRotated:!1,_offsetPosition:null,_unflippedOffsetPositionFromCenter:null,_opacityModifyRGB:!1,_flippedX:!1,_flippedY:!1,_textureLoaded:!1,_className:"Sprite",ctor:function(t,e,i){_ccsg.Node.prototype.ctor.call(this),n.call(this),this._shouldBeHidden=!1,this._offsetPosition=cc.p(0,0),this._unflippedOffsetPositionFromCenter=cc.p(0,0),this._blendFunc={src:cc.macro.BLEND_SRC,dst:cc.macro.BLEND_DST},this._rect=cc.rect(0,0,0,0),this._softInit(t,e,i)},textureLoaded:function(){return this._textureLoaded},addLoadedEventListener:function(t,e){this.once("load",t,e)},isDirty:function(){return this.dirty},setDirty:function(t){this.dirty=t},isTextureRectRotated:function(){return this._rectRotated},getTextureRect:function(){return cc.rect(this._rect)},getOffsetPosition:function(){return cc.p(this._offsetPosition)},_getOffsetX:function(){return this._offsetPosition.x},_getOffsetY:function(){return this._offsetPosition.y},getBlendFunc:function(){return this._blendFunc},initWithSpriteFrame:function(t){cc.assertID(t,2606),t.textureLoaded()||(this._textureLoaded=!1,t.once("load",this._renderCmd._spriteFrameLoadedCallback,this._renderCmd));var e=cc._renderType!==cc.game.RENDER_TYPE_CANVAS&&t._rotated,i=this.initWithTexture(t.getTexture(),t.getRect(),e);return this.setSpriteFrame(t),i},initWithSpriteFrameName:function(){cc.warnID(2608)},setVertexRect:function(t){var e=this._rect;e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height},setFlippedX:function(t){this._flippedX!==t&&(this._flippedX=t,this.setTextureRect(this._rect,this._rectRotated,this._contentSize),this.setNodeDirty(!0))},setFlippedY:function(t){this._flippedY!==t&&(this._flippedY=t,this.setTextureRect(this._rect,this._rectRotated,this._contentSize),this.setNodeDirty(!0))},isFlippedX:function(){return this._flippedX},isFlippedY:function(){return this._flippedY},setOpacityModifyRGB:function(t){this._opacityModifyRGB!==t&&(this._opacityModifyRGB=t,this._renderCmd._setColorDirty())},isOpacityModifyRGB:function(){return this._opacityModifyRGB},setDisplayFrameWithAnimationName:function(t,e){cc.assertID(t,2610);var i=cc.spriteFrameAnimationCache.getAnimation(t);if(i){var n=i.getFrames()[e];n?this.setSpriteFrame(n.getSpriteFrame()):cc.logID(2603)}else cc.logID(2602)},getTexture:function(){return this._texture},_softInit:function(t,e,i){void 0===t?_ccsg.Sprite.prototype.init.call(this):t instanceof cc.Texture2D?this.initWithTexture(t,e,i):t instanceof cc.SpriteFrame&&this.initWithSpriteFrame(t)},setBlendFunc:function(t,e){var i=this._blendFunc;void 0===e?(i.src=t.src,i.dst=t.dst):(i.src=t,i.dst=e),this._renderCmd.updateBlendFunc(i)},init:function(){var t=this;return arguments.length>0?t.initWithFile(arguments[0],arguments[1]):(t.dirty=t._recursiveDirty=!1,t._blendFunc.src=cc.macro.BLEND_SRC,t._blendFunc.dst=cc.macro.BLEND_DST,t.texture=null,t._flippedX=t._flippedY=!1,t.anchorX=.5,t.anchorY=.5,t._offsetPosition.x=0,t._offsetPosition.y=0,t.setTextureRect(cc.rect(0,0,0,0),!1,cc.size(0,0)),!0)},initWithFile:function(t,e){cc.assertID(t,2609);var i=cc.textureCache.getTextureForKey(t);if(i){if(!e){var n=i.getContentSize();e=cc.rect(0,0,n.width,n.height)}return this.initWithTexture(i,e)}return i=cc.textureCache.addImage(t),this.initWithTexture(i,e||cc.rect(0,0,i.width,i.height))},initWithTexture:function(t,e,i,n){var r=this;cc.assertID(0!==arguments.length,2710),i=i||!1,t=this._renderCmd._handleTextureForRotatedTexture(t,e,i,n),r._recursiveDirty=!1,r.dirty=!1,r._opacityModifyRGB=!0,r._blendFunc.src=cc.macro.BLEND_SRC,r._blendFunc.dst=cc.macro.BLEND_DST,r._flippedX=r._flippedY=!1,r.setAnchorPoint(.5,.5),r._offsetPosition.x=0,r._offsetPosition.y=0;var s=t.loaded;return r._textureLoaded=s,s?(e||(e=cc.rect(0,0,t.width,t.height)),this._renderCmd._checkTextureBoundary(t,e,i),r.setTexture(t),r.setTextureRect(e,i),this.emit("load"),!0):(r._rectRotated=i,e&&(r._rect.x=e.x,r._rect.y=e.y,r._rect.width=e.width,r._rect.height=e.height),r.texture&&r.texture.off("load",r._renderCmd._textureLoadedCallback,r._renderCmd),t.once("load",r._renderCmd._textureLoadedCallback,r._renderCmd),r.setTexture(t),!0)},setTextureRect:function(t,e,i,n){var r=this;r._rectRotated=e||!1,r.setContentSize(i||t),r.setVertexRect(t),r._renderCmd._setTextureCoords(t,n);var s=r._unflippedOffsetPositionFromCenter.x,o=r._unflippedOffsetPositionFromCenter.y;r._flippedX&&(s=-s),r._flippedY&&(o=-o);var a=r._rect;r._offsetPosition.x=s+(r._contentSize.width-a.width)/2,r._offsetPosition.y=o+(r._contentSize.height-a.height)/2},setSpriteFrame:function(t){var e=this;cc.assertID(t,2712),this.setNodeDirty(!0);var i=t.getOffset();e._unflippedOffsetPositionFromCenter.x=i.x,e._unflippedOffsetPositionFromCenter.y=i.y;var n=t.getTexture();t.textureLoaded()?(e._textureLoaded=!0,n!==e._texture&&(e._setTexture(n),e.setColor(e._realColor)),e.setTextureRect(t.getRect(),t.isRotated(),t.getOriginalSize())):(e._textureLoaded=!1,t.once("load",(function(t){var i=t.currentTarget;e._textureLoaded=!0;var n=i.getTexture();n!==e._texture&&e._setTexture(n),e.setTextureRect(i.getRect(),i.isRotated(),i.getOriginalSize()),e.emit("load"),e.setColor(e._realColor)}),e)),this._renderCmd._updateForSetSpriteFrame(n)},setDisplayFrame:function(t){cc.logID(2604),this.setSpriteFrame(t)},isFrameDisplayed:function(t){return this._renderCmd.isFrameDisplayed(t)},displayFrame:function(){return this.getSpriteFrame()},getSpriteFrame:function(){return new cc.SpriteFrame(this._texture,this._rect,this._rectRotated,this._unflippedOffsetPositionFromCenter,this._contentSize)},setTexture:function(t){if(!t)return this._renderCmd._setTexture(null);var e=cc.js.isString(t);e&&(t=cc.textureCache.addImage(t)),t.loaded?(this._setTexture(t,e),this.setColor(this._realColor),this._textureLoaded=!0,this.emit("load")):(this._renderCmd._setTexture(t),t.once("load",(function(i){this._setTexture(t,e),this.setColor(this._realColor),this._textureLoaded=!0,this.emit("load")}),this))},_setTexture:function(t,e){this._renderCmd._setTexture(t),e&&this._changeRectWithTexture(t)},_changeRectWithTexture:function(t){var e=cc.rect(0,0,t.width,t.height);this.setTextureRect(e)},_createRenderCmd:function(){return cc._renderType===cc.game.RENDER_TYPE_CANVAS?new _ccsg.Sprite.CanvasRenderCmd(this):new _ccsg.Sprite.WebGLRenderCmd(this)}}),cc.js.addon(_ccsg.Sprite.prototype,n.prototype);r.propertyDefine(_ccsg.Sprite,["opacity","color","texture"],{opacityModifyRGB:["isOpacityModifyRGB","setOpacityModifyRGB"],flippedX:["isFlippedX","setFlippedX"],flippedY:["isFlippedY","setFlippedY"],offsetX:["_getOffsetX"],offsetY:["_getOffsetY"],textureRectRotated:["isTextureRectRotated"]})}),{"../event/event-target":114,"../utils/misc":228}],211:[(function(t,e,i){function n(t){this._rootCtor(t),this._needDraw=!0,this._textureCoord={renderX:0,renderY:0,x:0,y:0,width:0,height:0,validRect:!1},this._blendFuncStr="source-over",this._colorized=!1,this._textureToRender=null}var r=n.prototype=Object.create(_ccsg.Node.CanvasRenderCmd.prototype);r.constructor=n,r.setDirtyRecursively=function(t){},r._setTexture=function(t){var e=this._node;if(e._texture!==t){e._textureLoaded=!!t&&t.loaded,e._texture=t;var i=cc.rect(0,0,t.width,t.height);e.setTextureRect(i),this._updateColor()}},r._setColorDirty=function(){this.setDirtyFlag(_ccsg.Node._dirtyFlags.colorDirty|_ccsg.Node._dirtyFlags.opacityDirty)},r.isFrameDisplayed=function(t){var e=this._node;return t.getTexture()===e._texture&&cc.rectEqualToRect(t.getRect(),e._rect)},r.updateBlendFunc=function(t){this._blendFuncStr=_ccsg.Node.CanvasRenderCmd._getCompositeOperationByBlendFunc(t)},r._handleTextureForRotatedTexture=function(t,e,i,r){return i&&t.loaded&&(t=n._createRotatedTexture(t,e,r),e.x=e.y=0,this._node._rect=cc.rect(0,0,e.width,e.height)),t},r._checkTextureBoundary=function(t,e,i){if(t&&t.url){var n=e.x+e.width,r=e.y+e.height;n>t.width&&cc.errorID(3300,t.url),r>t.height&&cc.errorID(3400,t.url)}},r.rendering=function(t,e,i){var n=this._node,r=this._textureCoord,s=this._displayedOpacity/255,o=this._textureToRender||n._texture;if((!o||0!==r.width&&0!==r.height&&o.loaded)&&0!==s){var a,c,h,l,u,_,d,f,m,p=t||cc._renderContext,g=p.getContext(),y=n._offsetPosition.x,v=n._rect.height,x=n._rect.width,C=-n._offsetPosition.y-v;if(p.setTransform(this._worldTransform,e,i),p.setCompositeOperation(this._blendFuncStr),p.setGlobalAlpha(s),(n._flippedX||n._flippedY)&&p.save(),n._flippedX&&(y=-y-x,g.scale(-1,1)),n._flippedY&&(C=n._offsetPosition.y,g.scale(1,-1)),this._colorized?(c=0,h=0):(c=r.renderX,h=r.renderY),l=r.width,u=r.height,_=y,d=C,f=x,m=v,o&&o._image)a=o._image,""!==o._pattern?(p.setFillStyle(g.createPattern(a,o._pattern)),g.fillRect(_,d,f,m)):g.drawImage(a,c,h,l,u,_,d,f,m);else{var T=n._contentSize;if(r.validRect){var A=this._displayedColor;p.setFillStyle("rgba("+A.r+","+A.g+","+A.b+",1)"),g.fillRect(_,d,T.width,T.height)}}(n._flippedX||n._flippedY)&&p.restore(),cc.g_NumberOfDraws++}},r._updateColor=function(){var t=this._node._texture,e=this._textureCoord,i=this._displayedColor;t&&(255!==i.r||255!==i.g||255!==i.b?(this._textureToRender=t._generateColorTexture(i.r,i.g,i.b,e),this._colorized=!0):t&&(this._textureToRender=t,this._colorized=!1))},r._updateForSetSpriteFrame=function(t,e){if(this._colorized=!1,this._textureCoord.renderX=this._textureCoord.x,this._textureCoord.renderY=this._textureCoord.y,e=e||t.loaded){var i=this._node.getColor();255===i.r&&255===i.g&&255===i.b||this._updateColor()}},r._spriteFrameLoadedCallback=function(t){var e=this._node,i=t.currentTarget;e.setTextureRect(i.getRect(),i.isRotated(),i.getOriginalSize()),this._updateColor(),e.emit("load")},r._textureLoadedCallback=function(t){var e=this._node,i=t.currentTarget;if(!e._textureLoaded){e._textureLoaded=!0;var n=e._rect;n?cc._rectEqualToZero(n)&&(n.width=i.width,n.height=i.height):n=cc.rect(0,0,i.width,i.height),e.texture=i,e.setTextureRect(n,e._rectRotated);var r=this._displayedColor;255===r.r&&255===r.g&&255===r.b||this._updateColor(),e.emit("load")}},r._setTextureCoords=function(t){var e=this._textureCoord;e.renderX=e.x=0|t.x,e.renderY=e.y=0|t.y,e.width=0|t.width,e.height=0|t.height,e.validRect=!(0===e.width||0===e.height||e.x<0||e.y<0)},n._cutRotateImageToCanvas=function(t,e,i){if(!t)return null;if(!e)return t;i=null==i||i;var n=document.createElement("canvas");n.width=e.width,n.height=e.height;var r=n.getContext("2d");return r.translate(n.width/2,n.height/2),i?r.rotate(-1.5707963267948966):r.rotate(1.5707963267948966),r.drawImage(t,e.x,e.y,e.height,e.width,-e.height/2,-e.width/2,e.height,e.width),n},n._createRotatedTexture=function(t,e,i){var r=new cc.Texture2D;return r._nativeAsset=n._cutRotateImageToCanvas(t._nativeAsset,e,i),r},_ccsg.Sprite.CanvasRenderCmd=n}),{}],212:[(function(t,e,i){var n=cc.macro;_ccsg.Sprite.WebGLRenderCmd=function(t){this._rootCtor(t),this._needDraw=!0,this._vertices=[{x:0,y:0,u:0,v:0},{x:0,y:0,u:0,v:0},{x:0,y:0,u:0,v:0},{x:0,y:0,u:0,v:0}],this._dirty=!1,this._recursiveDirty=!1,this._shaderProgram=cc.shaderCache.programForKey(n.SHADER_SPRITE_POSITION_TEXTURECOLOR)};var r=_ccsg.Sprite.WebGLRenderCmd.prototype=Object.create(_ccsg.Node.WebGLRenderCmd.prototype);r.constructor=_ccsg.Sprite.WebGLRenderCmd,r.updateBlendFunc=function(t){},r.setDirtyFlag=function(t){_ccsg.Node.WebGLRenderCmd.prototype.setDirtyFlag.call(this,t),this._dirty=!0},r.setDirtyRecursively=function(t){this._recursiveDirty=t,this._dirty=t;for(var e,i=this._node._children,n=i?i.length:0,r=0;rt.width&&cc.errorID(3300,t.url),r>t.height&&cc.errorID(3400,t.url))},r.transform=function(t,e){this.originTransform(t,e);var i=this._node,n=i._offsetPosition.x,r=n+i._rect.width,s=i._offsetPosition.y,o=s+i._rect.height,a=this._worldTransform,c=this._vertices;c[0].x=n*a.a+o*a.c+a.tx,c[0].y=n*a.b+o*a.d+a.ty,c[1].x=n*a.a+s*a.c+a.tx,c[1].y=n*a.b+s*a.d+a.ty,c[2].x=r*a.a+o*a.c+a.tx,c[2].y=r*a.b+o*a.d+a.ty,c[3].x=r*a.a+s*a.c+a.tx,c[3].y=r*a.b+s*a.d+a.ty},r.needDraw=function(){var t=this._node._texture;return this._needDraw&&t},r.uploadData=function(t,e,i){var n=this._node,r=n._texture;if(!(r&&r.loaded&&n._rect.width&&n._rect.height&&this._displayedOpacity))return 0;var s,o=this._displayedOpacity,a=this._displayedColor._val;if(n._opacityModifyRGB){var c=o/255,h=this._displayedColor.r*c,l=this._displayedColor.g*c;s=(o<<24>>>0)+(this._displayedColor.b*c<<16)+(l<<8)+h}else s=(o<<24>>>0)+((65280&a)<<8)+((16711680&a)>>8)+(a>>>24);var u,_,d=n._vertexZ,f=this._vertices,m=f.length,p=i;for(u=0;u=t){e=this._lengths[i];break}return e?this._pool[e].pop():void 0}},a=cc.macro,c={_rebuildQuads_base:function(t){var e,i,n,r,a=t._spriteFrame,c=t._contentSize,h=t._isTrimmedContentSize,l=t._vertices,u=t._corner;if(h)e=0,i=0,n=c.width,r=c.height;else{var _=a._originalSize,d=a._rect,f=a._offset,m=c.width,p=c.height,g=_.width,y=_.height,v=d.width,x=d.height,C=m/g,T=p/y,A=f.x+(g-v)/2,b=f.x-(g-v)/2;e=A*C,i=(f.y+(y-x)/2)*T,n=m+b*C,r=p+(f.y-(y-x)/2)*T}if(l.length<8&&(o.put(l),l=o.get(8)||new Float32Array(8),t._vertices=l),s){var S=t._renderCmd._worldTransform,E=S.a,w=S.b,I=S.c,R=S.d,P=S.tx,O=S.ty,D=e*E,B=e*w,L=n*E,M=n*w,N=r*I+P,F=r*R+O,z=i*I+P,k=i*R+O;l[0]=D+z,l[1]=B+k,l[2]=L+z,l[3]=M+k,l[4]=D+N,l[5]=B+F,l[6]=L+N,l[7]=M+F}else l[0]=e,l[1]=i,l[2]=n,l[3]=i,l[4]=e,l[5]=r,l[6]=n,l[7]=r;u[0]=0,u[1]=2,u[2]=4,u[3]=6,t._uvsDirty&&this._calculateUVs(t,a),t._vertCount=4},_calculateUVs:function(t,e){var i,n,r,s,c=t._uvs,h=e._texture.width,l=e._texture.height,u=e._rect;c.length<8&&(o.put(c),c=o.get(8)||new Float32Array(8),t._uvs=c);var _=a.FIX_ARTIFACTS_BY_STRECHING_TEXEL?.5:0;e._rotated?(i=(u.x+_)/h,n=(u.y+u.width-_)/l,r=(u.x+u.height-_)/h,s=(u.y+_)/l,c[0]=i,c[1]=s,c[2]=i,c[3]=n,c[4]=r,c[5]=s,c[6]=r,c[7]=n):(i=(u.x+_)/h,n=(u.y+u.height-_)/l,r=(u.x+u.width-_)/h,s=(u.y+_)/l,c[0]=i,c[1]=n,c[2]=r,c[3]=n,c[4]=i,c[5]=s,c[6]=r,c[7]=s)}},h={x:new Array(4),y:new Array(4),_rebuildQuads_base:function(t){var e,i,n,r,a=t._spriteFrame,c=t._contentSize,h=t._insetLeft,l=t._insetRight,u=t._insetTop,_=t._insetBottom,d=t._vertices,f=t._renderCmd._worldTransform,m=t._corner;e=h,i=l,n=u,r=_;var p=c,g=p.width-e-i,y=p.height-n-r,v=p.width/(e+i),x=p.height/(n+r);v=isNaN(v)||v>1?1:v,x=isNaN(x)||x>1?1:x,g=g<0?0:g,y=y<0?0:y;var C=this.x,T=this.y;C[0]=0,C[1]=e*v,C[2]=C[1]+g,C[3]=p.width,T[0]=0,T[1]=r*x,T[2]=T[1]+y,T[3]=p.height,d.length<32&&(o.put(d),d=o.get(32)||new Float32Array(32),t._vertices=d);var A,b,S=0;if(s)for(A=0;A<4;A++)for(b=0;b<4;b++)d[S]=C[b]*f.a+T[A]*f.c+f.tx,d[S+1]=C[b]*f.b+T[A]*f.d+f.ty,S+=2;else for(A=0;A<4;A++)for(b=0;b<4;b++)d[S]=C[b],d[S+1]=T[A],S+=2;m[0]=0,m[1]=6,m[2]=24,m[3]=30,t._uvsDirty&&this._calculateUVs(t,a,h,l,u,_)},_calculateUVs:function(t,e,i,n,r,s){var c,h,l,u,_,d,f=t._uvs,m=e._rect,p=e._texture.width,g=e._texture.height,y=e._rect;c=i,l=n,h=m.width-c-l,u=r,d=s,_=m.height-u-d,f.length<32&&(o.put(f),f=o.get(32)||new Float32Array(32),t._uvs=f);var v,x,C=this.x,T=this.y,A=a.FIX_ARTIFACTS_BY_STRECHING_TEXEL?.5:0,b=0;if(e._rotated)for(C[0]=(y.x+A)/p,C[1]=(d+y.x)/p,C[2]=(d+_+y.x)/p,C[3]=(y.x+y.height-A)/p,T[3]=(y.y+A)/g,T[2]=(c+y.y)/g,T[1]=(c+h+y.y)/g,T[0]=(y.y+y.width-A)/g,v=0;v<4;v++)for(x=0;x<4;x++)f[b]=C[v],f[b+1]=T[3-x],b+=2;else for(C[0]=(y.x+A)/p,C[1]=(c+y.x)/p,C[2]=(c+h+y.x)/p,C[3]=(y.x+y.width-A)/p,T[3]=(y.y+A)/g,T[2]=(u+y.y)/g,T[1]=(u+_+y.y)/g,T[0]=(y.y+y.height-A)/g,v=0;v<4;v++)for(x=0;x<4;x++)f[b]=C[x],f[b+1]=T[v],b+=2}},l={_rebuildQuads_base:function(t,e,i){e=t._spriteFrame,i=t._contentSize;var n,r,c,h,l=t._vertices,u=t._corner,_=t._renderCmd._worldTransform,d=t._uvs,f=e._texture.width,m=e._texture.height,p=e._rect,g=a.FIX_ARTIFACTS_BY_STRECHING_TEXEL?.5:0;e._rotated?(n=(p.x+g)/f,c=(p.x+p.height-g)/f,r=(p.y+p.width-g)/m,h=(p.y+g)/m):(n=(p.x+g)/f,c=(p.x+p.width-g)/f,r=(p.y+p.height-g)/m,h=(p.y+g)/m);var y=p.width,v=p.height,x=i.width/y,C=i.height/v,T=Math.ceil(C),A=Math.ceil(x);T*A>16384&&cc.errorID(2625);var b=T*A*4*2;l.lengthb)return}u[0]=0,u[1]=8*(A-1)+2,u[2]=(T-1)*A*8+4,u[3]=b-2}},u={_rebuildQuads_base:function(t){var e=t._spriteFrame,i=t._contentSize,n=t._fillStart,r=t._fillRange;r<0&&(n+=r,r=-r),r=n+r,n=(n=n>1?1:n)<0?0:n,r=(r=r>1?1:r)<0?0:r,r-=n;var c,h,l,u,_,d=t._fillType,f=t._vertices,m=t._corner,g=t._renderCmd._worldTransform,y=t._uvs,v=0,x=0,C=i.width,T=i.height,A=e._texture.width,b=e._texture.height,S=e._rect,E=a.FIX_ARTIFACTS_BY_STRECHING_TEXEL?.5:0;e._rotated?(h=(S.x+E)/A,l=(S.y+S.width-E)/b,u=(S.x+S.height-E)/A,_=(S.y+E)/b):(h=(S.x+E)/A,l=(S.y+S.height-E)/b,u=(S.x+S.width-E)/A,_=(S.y+E)/b),f.length<8&&(o.put(f),f=o.get(8)||new Float32Array(8),t._vertices=f),y.length<8&&(o.put(y),y=o.get(8)||new Float32Array(8),t._uvs=y);var w,I=new Array(8);switch(e._rotated?(I[0]=I[2]=h,I[4]=I[6]=u,I[3]=I[7]=l,I[1]=I[5]=_):(I[0]=I[4]=h,I[2]=I[6]=u,I[1]=I[3]=l,I[5]=I[7]=_),c=(c=(n=(n=n>1?1:n)<0?0:n)+(r=r<0?0:r))>1?1:c,d){case p.HORIZONTAL:w=v+(C-v)*c,v=v+(C-v)*n,C=w,y[0]=I[0]+(I[2]-I[0])*n,y[1]=I[1],y[2]=I[0]+(I[2]-I[0])*c,y[3]=I[3],y[4]=I[4]+(I[6]-I[4])*n,y[5]=I[5],y[6]=I[4]+(I[6]-I[4])*c,y[7]=I[7];break;case p.VERTICAL:w=x+(T-x)*c,x=x+(T-x)*n,T=w,y[0]=I[0],y[1]=I[1]+(I[5]-I[1])*n,y[2]=I[2],y[3]=I[3]+(I[7]-I[3])*n,y[4]=I[4],y[5]=I[1]+(I[5]-I[1])*c,y[6]=I[6],y[7]=I[3]+(I[7]-I[3])*c;break;default:cc.errorID(2626)}if(s){var R=v*g.a,P=v*g.b,O=C*g.a,D=C*g.b,B=T*g.c+g.tx,L=T*g.d+g.ty,M=x*g.c+g.tx,N=x*g.d+g.ty;f[0]=R+M,f[1]=P+N,f[2]=O+M,f[3]=D+N,f[4]=R+B,f[5]=P+L,f[6]=O+B,f[7]=D+L}else f[0]=v,f[1]=x,f[2]=C,f[3]=x,f[4]=v,f[5]=T,f[6]=C,f[7]=T;t._vertCount=4,m[0]=0,m[1]=2,m[2]=4,m[3]=6}},_={_vertPos:[cc.v2(0,0),cc.v2(0,0),cc.v2(0,0),cc.v2(0,0)],_vertices:[cc.v2(0,0),cc.v2(0,0)],_uvs:[cc.v2(0,0),cc.v2(0,0)],_intersectPoint_1:[cc.v2(0,0),cc.v2(0,0),cc.v2(0,0),cc.v2(0,0)],_intersectPoint_2:[cc.v2(0,0),cc.v2(0,0),cc.v2(0,0),cc.v2(0,0)],outVerts:null,outUvs:null,rawVerts:null,rawUvs:null,_rebuildQuads_base:function(t){var e=t._spriteFrame,i=t._contentSize,n=t._fillStart,r=t._fillRange;r<0&&(n+=r,r=-r),t._isTriangle=!0,t._rawVerts||(t._rawVerts=o.get(8)||new Float32Array(8),t._rawUvs=o.get(8)||new Float32Array(8));for(var s=t._fillCenter,a=t._vertices,c=t._corner,h=t._uvs,l=t._rawVerts,u=t._rawUvs,_=t._renderCmd._worldTransform;n>=1;)n-=1;for(;n<0;)n+=1;var d=s.x*i.width,f=s.y*i.height,m=cc.v2(d,f),p=(n*=2*Math.PI)+(r*=2*Math.PI);this.outVerts=a,this.outUvs=h,this.rawVerts=l,this.rawUvs=u,this._calculateVertices(_,e,i),this._calculateUVs(e);var g=this._vertPos,y=this._vertices;g[0].x=g[3].x=y[0].x,g[1].x=g[2].x=y[1].x,g[0].y=g[1].y=y[0].y,g[2].y=g[3].y=y[1].y,m.x>y[1].x&&(m.x=y[1].x),m.xy[1].y&&(m.y=y[1].y),l[0]=l[4]=this._vertices[0].x,l[2]=l[6]=this._vertices[1].x,l[1]=l[3]=this._vertices[0].y,l[5]=l[7]=this._vertices[1].y,e._rotated?(u[0]=u[2]=this._uvs[0].x,u[4]=u[6]=this._uvs[1].x,u[3]=u[7]=this._uvs[0].y,u[1]=u[5]=this._uvs[1].y):(u[0]=u[4]=this._uvs[0].x,u[2]=u[6]=this._uvs[1].x,u[1]=u[3]=this._uvs[0].y,u[5]=u[7]=this._uvs[1].y);var v=[null,null,null,null];m.x!==this._vertices[0].x&&(v[0]=[3,0]),m.x!==this._vertices[1].x&&(v[2]=[1,2]),m.y!==this._vertices[0].y&&(v[1]=[0,1]),m.y!==this._vertices[1].y&&(v[3]=[2,3]),this._getInsectedPoints(this._vertices[0].x,this._vertices[1].x,this._vertices[0].y,this._vertices[1].y,m,n,this._intersectPoint_1),this._getInsectedPoints(this._vertices[0].x,this._vertices[1].x,this._vertices[0].y,this._vertices[1].y,m,n+r,this._intersectPoint_2);a.length<30&&(o.put(a),a=o.get(30)||new Float32Array(30),this.outVerts=t._vertices=a),h.length<30&&(o.put(h),h=o.get(30)||new Float32Array(30),this.outUvs=t._uvs=h);for(var x=0,C=0,T=0;T<4;++T){var A=v[T];if(null!==A)if(r>=2*Math.PI)this._generateTriangle(_,x,m,this._vertPos[A[0]],this._vertPos[A[1]]),x+=6,C+=3;else{var b=this._getVertAngle(m,this._vertPos[A[0]]),S=this._getVertAngle(m,this._vertPos[A[1]]);S=p||(b>=n?(S>=p?this._generateTriangle(_,x,m,this._vertPos[A[0]],this._intersectPoint_2[T]):this._generateTriangle(_,x,m,this._vertPos[A[0]],this._vertPos[A[1]]),x+=6,C+=3):S<=n||(S<=p?(this._generateTriangle(_,x,m,this._intersectPoint_1[T],this._vertPos[A[1]]),x+=6,C+=3):(this._generateTriangle(_,x,m,this._intersectPoint_1[T],this._intersectPoint_2[T]),x+=6,C+=3))),b+=2*Math.PI,S+=2*Math.PI}}t._vertCount=C;for(var w,I,R=1/0,P=1/0,O=-1/0,D=-1/0,B=0,L=x;B=O&&(O=w,c[1]=B),I<=P?(P=I,c[2]=B):I>=D&&(D=I,c[3]=B)},_generateTriangle:function(t,e,i,n,r){var o,a,c=this.rawVerts,h=this.rawUvs,l=this.outVerts,u=c[0],_=c[1],d=c[6],f=c[7];s?(l[e]=i.x*t.a+i.y*t.c+t.tx,l[e+1]=i.x*t.b+i.y*t.d+t.ty,l[e+2]=n.x*t.a+n.y*t.c+t.tx,l[e+3]=n.x*t.b+n.y*t.d+t.ty,l[e+4]=r.x*t.a+r.y*t.c+t.tx,l[e+5]=r.x*t.b+r.y*t.d+t.ty):(l[e]=i.x,l[e+1]=i.y,l[e+2]=n.x,l[e+3]=n.y,l[e+4]=r.x,l[e+5]=r.y),o=(i.x-u)/(d-u),a=(i.y-_)/(f-_),this._generateUV(o,a,h,e),o=(n.x-u)/(d-u),a=(n.y-_)/(f-_),this._generateUV(o,a,h,e+2),o=(r.x-u)/(d-u),a=(r.y-_)/(f-_),this._generateUV(o,a,h,e+4)},_generateUV:function(t,e,i,n){var r=this.outUvs,s=i[0]+(i[2]-i[0])*t,o=i[4]+(i[6]-i[4])*t,a=i[1]+(i[3]-i[1])*t,c=i[5]+(i[7]-i[5])*t;r[n]=s+(o-s)*e,r[n+1]=a+(c-a)*e},_isAngleIn:function(t,e,i){for(var n=2*Math.PI;t=e+n;)t=e+n&&(t-=n);return t<=e+i},_getVertAngle:function(t,e){var i,n;if(i=e.x-t.x,n=e.y-t.y,0!==i||0!==n){if(0===i)return n>0?.5*Math.PI:1.5*Math.PI;var r=Math.atan(n/i);return i<0&&(r+=Math.PI),r}},_getInsectedPoints:function(t,e,i,n,r,s,o){var a,c,h=Math.sin(s),l=Math.cos(s);if(0!==Math.cos(s)){if(a=h/l,(t-r.x)*l>0){var u=r.y+a*(t-r.x);o[0].x=t,o[0].y=u}if((e-r.x)*l>0){var _=r.y+a*(e-r.x);o[2].x=e,o[2].y=_}}if(0!==Math.sin(s)){if(c=l/h,(n-r.y)*h>0){var d=r.x+c*(n-r.y);o[3].x=d,o[3].y=n}if((i-r.y)*h>0){var f=r.x+c*(i-r.y);o[1].x=f,o[1].y=i}}return[null,null,null,null]},_calculateVertices:function(t,e,i){var n,r;n=i.width,r=i.height,this._vertices[0].x=0,this._vertices[0].y=0,this._vertices[1].x=n,this._vertices[1].y=r},_calculateUVs:function(t){var e,i,n,r,s=t._texture.width,o=t._texture.height,c=t._rect,h=a.FIX_ARTIFACTS_BY_STRECHING_TEXEL?.5:0;t._rotated?(e=(c.x+h)/s,i=(c.x+c.height-h)/s,n=(c.y+h)/o,r=(c.y+c.width-h)/o):(e=(c.x+h)/s,i=(c.x+c.width-h)/s,n=(c.y+h)/o,r=(c.y+c.height-h)/o),this._uvs[0].x=e,this._uvs[0].y=r,this._uvs[1].x=i,this._uvs[1].y=n}},d={_rebuildQuads_base:function(t,e,i){if(cc._renderType!==cc.game.RENDER_TYPE_CANVAS&&(i=t._meshPolygonInfo)){var n=t._renderCmd._worldTransform,r=i.triangles.verts,s=t._vertices,a=t._uvs,c=r.length,h=t._corner,l=2*c;s.lengthd&&(d=p,h[1]=2*m),g<_&&(_=g,h[2]=2*m),g>f&&(f=g,h[3]=2*m)}t._vertCount=c}}};cc.Scale9Sprite=_ccsg.Node.extend({_spriteFrame:null,_insetLeft:0,_insetRight:0,_insetTop:0,_insetBottom:0,_blendFunc:null,_renderingType:1,_brightState:0,_rawVerts:null,_rawUvs:null,_vertices:null,_uvs:null,_vertCount:0,_quadsDirty:!0,_uvsDirty:!0,_isTriangle:!1,_isTrimmedContentSize:!0,_fillType:0,_fillCenter:null,_fillStart:0,_fillRange:2*Math.PI,_distortionOffset:null,_distortionTiling:null,_meshPolygonInfo:null,ctor:function(t){_ccsg.Node.prototype.ctor.call(this),this._renderCmd.setState(this._brightState),this._blendFunc=cc.BlendFunc._alphaNonPremultiplied(),this._fillCenter=cc.v2(0,0),this.setAnchorPoint(cc.p(.5,.5)),this._rawVerts=null,this._rawUvs=null,this._vertices=o.get(8)||new Float32Array(8),this._uvs=o.get(8)||new Float32Array(8),t&&this.setSpriteFrame(t),void 0===s&&(s=cc._renderType===cc.game.RENDER_TYPE_WEBGL),this._corner=[]},loaded:function(){return null!==this._spriteFrame&&this._spriteFrame.textureLoaded()},setTexture:function(t){var e=new cc.SpriteFrame(t);this.setSpriteFrame(e)},setSpriteFrame:function(t){if(t){this._spriteFrame=t,this._quadsDirty=!0,this._uvsDirty=!0,this._renderCmd._needDraw=!1;var e=this;function i(){e._spriteFrame&&0===e._contentSize.width&&0===e._contentSize.height&&e.setContentSize(e._spriteFrame._rect),e._renderCmd._needDraw=!0,e._renderCmd.setDirtyFlag(_ccsg.Node._dirtyFlags.contentDirty)}t.textureLoaded()?i():t.once("load",i,this)}},setBlendFunc:function(t,e){void 0===e?(this._blendFunc.src=t.src,this._blendFunc.dst=t.dst):(this._blendFunc.src=t,this._blendFunc.dst=e),this._renderCmd.setDirtyFlag(_ccsg.Node._dirtyFlags.contentDirty)},getBlendFunc:function(){return new cc.BlendFunc(this._blendFunc.src,this._blendFunc.dst)},setContentSize:function(t,e){void 0===e&&(e=t.height,t=t.width),t===this._contentSize.width&&e===this._contentSize.height||(_ccsg.Node.prototype.setContentSize.call(this,t,e),this._quadsDirty=!0)},enableTrimmedContentSize:function(t){this._isTrimmedContentSize!==t&&(this._isTrimmedContentSize=t,this._quadsDirty=!0,this._renderCmd.setDirtyFlag(_ccsg.Node._dirtyFlags.contentDirty))},setState:function(t){this._brightState=t,this._renderCmd.setState(t),this._renderCmd.setDirtyFlag(_ccsg.Node._dirtyFlags.contentDirty)},getState:function(){return this._brightState},setRenderingType:function(t){this._renderingType!==t&&(this._renderingType=t,this._quadsDirty=!0,this._uvsDirty=!0,this._renderCmd.setDirtyFlag(_ccsg.Node._dirtyFlags.contentDirty))},getRenderingType:function(){return this._renderingType},setInsetLeft:function(t){this._insetLeft=t,this._quadsDirty=!0,this._uvsDirty=!0,this._renderCmd.setDirtyFlag(_ccsg.Node._dirtyFlags.contentDirty)},getInsetLeft:function(){return this._insetLeft},setInsetTop:function(t){this._insetTop=t,this._quadsDirty=!0,this._uvsDirty=!0,this._renderCmd.setDirtyFlag(_ccsg.Node._dirtyFlags.contentDirty)},getInsetTop:function(){return this._insetTop},setInsetRight:function(t){this._insetRight=t,this._quadsDirty=!0,this._uvsDirty=!0,this._renderCmd.setDirtyFlag(_ccsg.Node._dirtyFlags.contentDirty)},getInsetRight:function(){return this._insetRight},setInsetBottom:function(t){this._insetBottom=t,this._quadsDirty=!0,this._uvsDirty=!0,this._renderCmd.setDirtyFlag(_ccsg.Node._dirtyFlags.contentDirty)},getInsetBottom:function(){return this._insetBottom},setFillType:function(t){this._fillType!==t&&(this._fillType=t,this._renderingType===m.FILLED&&(this._quadsDirty=!0,this._renderCmd.setDirtyFlag(_ccsg.Node._dirtyFlags.contentDirty)))},getFillType:function(){return this._fillType},setFillCenter:function(t,e){this._fillCenter=cc.v2(t,e),this._renderingType===m.FILLED&&this._fillType===p.RADIAL&&(this._quadsDirty=!0,this._renderCmd.setDirtyFlag(_ccsg.Node._dirtyFlags.contentDirty))},setDistortionTiling:function(t,e){void 0===e&&(e=t.y,t=t.x),this._distortionTiling=this._distortionTiling||cc.v2(0,0),this._distortionTiling.x=t,this._distortionTiling.y=e},setDistortionOffset:function(t,e){void 0===e&&(e=t.y,t=t.x),this._distortionOffset=this._distortionOffset||cc.v2(0,0),this._distortionOffset.x=t,this._distortionOffset.y=e},getFillCenter:function(){return cc.v2(this._fillCenter)},setFillStart:function(t){this._fillStart!==t&&(this._fillStart=t,this._renderingType===m.FILLED&&(this._quadsDirty=!0,this._renderCmd.setDirtyFlag(_ccsg.Node._dirtyFlags.contentDirty)))},getFillStart:function(){return this._fillStart},setFillRange:function(t){this._fillRange!==t&&(this._fillRange=t,this._renderingType===m.FILLED&&(this._quadsDirty=!0,this._renderCmd.setDirtyFlag(_ccsg.Node._dirtyFlags.contentDirty)))},getFillRange:function(){return this._fillRange},_rebuildQuads:function(){if(this._spriteFrame&&this._spriteFrame.textureLoaded()){var t;switch(this._isTriangle=!1,this._renderingType){case m.SIMPLE:t=c;break;case m.SLICED:t=h;break;case m.TILED:t=l;break;case m.FILLED:t=this._fillType===p.RADIAL?_:u;break;case m.MESH:t=d}t?t._rebuildQuads_base(this):(this._quadsDirty=!1,this._uvsDirty=!1,this._renderCmd._needDraw=!1,cc.errorID(2627)),this._quadsDirty=!1,this._uvsDirty=!1}else this._renderCmd._needDraw=!1},_createRenderCmd:function(){return cc._renderType===cc.game.RENDER_TYPE_CANVAS?new cc.Scale9Sprite.CanvasRenderCmd(this):new cc.Scale9Sprite.WebGLRenderCmd(this)},setMeshPolygonInfo:function(t){this.setRenderingType(m.MESH),this._meshPolygonInfo=t,this._quadsDirty=!0,this._uvsDirty=!0},getMeshPolygonInfo:function(){return this._meshPolygonInfo}});var f=cc.Scale9Sprite.prototype;cc.js.addon(f,n.prototype),cc.defineGetterSetter(f,"insetLeft",f.getInsetLeft,f.setInsetLeft),cc.defineGetterSetter(f,"insetTop",f.getInsetTop,f.setInsetTop),cc.defineGetterSetter(f,"insetRight",f.getInsetRight,f.setInsetRight),cc.defineGetterSetter(f,"insetBottom",f.getInsetBottom,f.setInsetBottom),cc.Scale9Sprite.state={NORMAL:0,GRAY:1,DISTORTION:2};var m=cc.Scale9Sprite.RenderingType=cc.Enum({SIMPLE:0,SLICED:1,TILED:2,FILLED:3,MESH:4}),p=cc.Scale9Sprite.FillType=cc.Enum({HORIZONTAL:0,VERTICAL:1,RADIAL:2})}),{"../event/event-target":114}],214:[(function(t,e,i){cc.Scale9Sprite.CanvasRenderCmd=function(t){this._rootCtor(t),this._node.loaded()?this._needDraw=!0:this._needDraw=!1,this._state=cc.Scale9Sprite.state.NORMAL,this._originalTexture=this._textureToRender=null};var n=cc.Scale9Sprite.CanvasRenderCmd.prototype=Object.create(_ccsg.Node.CanvasRenderCmd.prototype);n.constructor=cc.Scale9Sprite.CanvasRenderCmd,n.updateTransform=function(t){this.originUpdateTransform(t),this._node._rebuildQuads()},n._doCulling=function(){var t=cc.visibleRect,e=this._currentRegion,i=e._minX,n=e._maxX,r=e._minY,s=e._maxY,o=t.left.x,a=t.right.x,c=t.top.y,h=t.bottom.y;this._needDraw=!(na||sc)},n._updateDisplayColor=function(t){_ccsg.Node.WebGLRenderCmd.prototype._updateDisplayColor.call(this,t),this._originalTexture=this._textureToRender=null},n._syncDisplayColor=function(t){_ccsg.Node.WebGLRenderCmd.prototype._syncDisplayColor.call(this,t),this._originalTexture=this._textureToRender=null},n.setState=function(t){this._state!==t&&(this._state=t,this._originalTexture=this._textureToRender=null)},n.rendering=function(t,e,i){var n=this._node,r=this._displayedOpacity,s=r/255,o=null;if(n._spriteFrame&&(o=n._spriteFrame._texture),n.loaded()&&0!==r){if((null===this._textureToRender||this._originalTexture!==o)&&(this._textureToRender=this._originalTexture=o,cc.Scale9Sprite.state.GRAY===this._state&&(this._textureToRender=this._textureToRender._generateGrayTexture()),cc.sys.browserType!==cc.sys.BROWSER_TYPE_WECHAT_GAME_SUB)){var a=n.getDisplayedColor();!o||255===a.r&&255===a.g&&255===a.b||(this._textureToRender=this._textureToRender._generateColorTexture(a.r,a.g,a.b))}var c=t||cc._renderContext,h=c.getContext();if(c.setTransform(this._worldTransform,e,i),c.setCompositeOperation(_ccsg.Node.CanvasRenderCmd._getCompositeOperationByBlendFunc(n._blendFunc)),c.setGlobalAlpha(s),this._textureToRender){var l,u,_,d,f,m,p,g;n._quadsDirty&&n._rebuildQuads();var y=this._textureToRender.width,v=this._textureToRender.height,x=this._textureToRender._image,C=n._vertices,T=n._uvs,A=0,b=0;if(n._isTriangle){var S=n._rawVerts,E=n._rawUvs;f=S[0],m=S[1],p=S[6]-f,m=-m-(g=S[7]-m),l=E[4]*y,u=E[5]*v,_=(E[6]-E[0])*y,d=(E[1]-E[7])*v,c.save(),h.beginPath();var w=Math.floor(n._vertCount/3);for(A=0,b=0;A0&&d>0&&p>0&&g>0&&h.drawImage(x,l,u,_,d,f,m,p,g),c.restore(),cc.g_NumberOfDraws+=w}else if(n._renderingType===cc.Scale9Sprite.RenderingType.SLICED){for(var I=0;I<3;++I)for(var R=0;R<3;++R)f=C[b=8*I+2*R],m=C[b+1],p=C[b+10]-f,m=-m-(g=C[b+11]-m),l=T[b]*y,u=T[b+11]*v,_=(T[b+10]-T[b])*y,d=(T[b+1]-T[b+11])*v,_>0&&d>0&&p>0&&g>0&&h.drawImage(x,l,u,_,d,f,m,p,g);cc.g_NumberOfDraws+=9}else{var P=Math.floor(n._vertCount/4);for(A=0,b=0;A0&&d>0&&p>0&&g>0&&h.drawImage(x,l,u,_,d,f,m,p,g),b+=8;cc.g_NumberOfDraws+=P}}}}}),{}],215:[(function(t,e,i){cc.gl;cc.Scale9Sprite.WebGLRenderCmd=function(t){this._rootCtor(t),this._node.loaded()?this._needDraw=!0:this._needDraw=!1,this.vertexType=cc.renderer.VertexType.QUAD,this._dirty=!1,this._shaderProgram=cc.shaderCache.programForKey(cc.macro.SHADER_SPRITE_POSITION_TEXTURECOLOR)};var n=cc.Scale9Sprite,r=n.WebGLRenderCmd.prototype=Object.create(_ccsg.Node.WebGLRenderCmd.prototype);r.constructor=n.WebGLRenderCmd,r._uploadSliced=function(t,e,i,n,r,s,o){for(var a,c=0;c<3;++c)for(var h=0;h<3;++h)a=8*c+2*h,r[o]=t[a],r[o+1]=t[a+1],r[o+2]=n,s[o+3]=i,r[o+4]=e[a],r[o+5]=e[a+1],r[o+=6]=t[a+2],r[o+1]=t[a+3],r[o+2]=n,s[o+3]=i,r[o+4]=e[a+2],r[o+5]=e[a+3],r[o+=6]=t[a+8],r[o+1]=t[a+9],r[o+2]=n,s[o+3]=i,r[o+4]=e[a+8],r[o+5]=e[a+9],r[o+=6]=t[a+10],r[o+1]=t[a+11],r[o+2]=n,s[o+3]=i,r[o+4]=e[a+10],r[o+5]=e[a+11],o+=6;return 36},r.updateTransform=function(t){this.originUpdateTransform(t),this._node._rebuildQuads()},r._doCulling=function(){var t=this._node,e=cc.visibleRect;this._cameraFlag>0&&(e=cc.Camera.main.visibleRect);var i=e.left.x,n=e.right.x,r=e.top.y,s=e.bottom.y,o=t._vertices,a=t._corner,c=a[0],h=a[1],l=a[2],u=a[3],_=o[c],d=o[h],f=o[l],m=o[u],p=o[c+1],g=o[h+1],y=o[l+1],v=o[u+1];this._needDraw=!((_-i&d-i&f-i&m-i)>>31||(n-_&n-d&n-f&n-m)>>31||(p-s&g-s&y-s&v-s)>>31||(r-p&r-g&r-y&r-v)>>31)},r.uploadData=function(t,e,i){var r=this._node;if(0===this._displayedOpacity)return 0;r._quadsDirty&&r._rebuildQuads(),r._distortionOffset&&this._shaderProgram===n.WebGLRenderCmd._distortionProgram&&(this._shaderProgram.use(),this._shaderProgram.setUniformLocationWith2f(n.WebGLRenderCmd._distortionOffset,r._distortionOffset.x,r._distortionOffset.y),this._shaderProgram.setUniformLocationWith2f(n.WebGLRenderCmd._distortionTiling,r._distortionTiling.x,r._distortionTiling.y),cc.renderer._breakBatch());var s,o=this._displayedOpacity,a=this._displayedColor._val;if(r._opacityModifyRGB){var c=o/255,h=this._displayedColor.r*c,l=this._displayedColor.g*c;s=(o<<24>>>0)+(this._displayedColor.b*c<<16)+(l<<8)+h}else s=(o<<24>>>0)+((65280&a)<<8)+((16711680&a)>>8)+(a>>>24);var u=r._vertexZ,_=r._vertices,d=r._uvs,f=n.RenderingType,m=i,p=0;switch(r._renderingType){case f.SIMPLE:case f.TILED:case f.FILLED:case f.MESH:p=this._node._vertCount;for(var g=0,y=0;gt.width&&cc.errorID(3300,t.url+"/"+this.name,i,t.width),n>t.height&&cc.errorID(3400,t.url+"/"+this.name,n,t.height)},_serialize:!1,_deserialize:function(t,e){var i=t.rect;i&&this.setRect(new cc.Rect(i[0],i[1],i[2],i[3])),t.offset&&this.setOffset(new cc.Vec2(t.offset[0],t.offset[1])),t.originalSize&&this.setOriginalSize(new cc.Size(t.originalSize[0],t.originalSize[1])),this._rotated=1===t.rotated,this._name=t.name;var n=t.capInsets;n&&(this.insetLeft=n[0],this.insetTop=n[1],this.insetRight=n[2],this.insetBottom=n[3]);var r=t.texture;r&&e.result.push(this,"_textureSetter",r)}}),s=r.prototype;s.copyWithZone=s.clone,s.copy=s.clone,s.initWithTexture=s.setTexture,cc.SpriteFrame=r,e.exports=r}),{"../assets/CCAsset":43,"../event/event-target":114}],218:[(function(t,e,i){var n=t("../event/event-target"),r=t("../platform/CCSys"),s=t("../platform/js"),o=(t("../utils/misc"),t("../CCGame"));t("../platform/CCClass");var a=[{format:6407,internalFormat:6407,pixelType:33635},{format:6408,internalFormat:6408,pixelType:32820},{format:6408,internalFormat:6408,pixelType:32819},{format:6407,internalFormat:6407,pixelType:5121},{format:6408,internalFormat:6408,pixelType:5121},{format:6406,internalFormat:6406,pixelType:5121},{format:6409,internalFormat:6409,pixelType:5121},{format:6410,internalFormat:6410,pixelType:5121}],c=cc.Enum({RGB565:0,RGB5A1:1,RGBA4444:2,RGB888:3,RGBA8888:4,A8:5,I8:6,AI8:7}),h=cc.Enum({REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648}),l=cc.Enum({LINEAR:9729,NEAREST:9728}),u=cc.Class({name:"cc.Texture2D",extends:t("../assets/CCAsset"),mixins:[n],ctor:function(t){this.url="",this.loaded=!1,this.width=0,this.height=0,this._image=null,cc._renderType===o.RENDER_TYPE_CANVAS?(this._pattern="",this._grayElementObj=null,this._backupElement=null,this._isGray=!1):cc._renderType===o.RENDER_TYPE_WEBGL&&(this._gl=t||cc._renderContext,this._glID=null)},properties:{_nativeAsset:{get:function(){return this._image},set:function(t){this.initWithElement(t),this.handleLoadedTexture()},override:!0},_hasMipmap:!1,_format:c.RGBA8888,_compressed:!1,_premultiplyAlpha:!1,_minFilter:l.LINEAR,_magFilter:l.LINEAR,_wrapS:h.CLAMP_TO_EDGE,_wrapT:h.CLAMP_TO_EDGE},statics:{WrapMode:h,PixelFormat:c,Filter:l,extnames:[".png",".jpg",".jpeg",".bmp",".webp"]},update:function(t){},toString:function(){return this.url||""},getPixelWidth:function(){return this.width},getPixelHeight:function(){return this.height},getContentSize:function(){return cc.size(this.width,this.height)},getContentSizeInPixels:function(){return this.getContentSize()},initWithElement:function(t){t&&(this._image=t,this.width=t.width,this.height=t.height,this.loaded=!0)},initWithData:function(t,e,i,n,r){return!1},initWithImage:function(t){return!1},getHtmlElementObj:function(){return this._image},load:function(t){if(this.loaded)t&&t();else if(this.url){var e=this;cc.loader.load({url:this.url,_owner:this},(function(i,n){n&&(e.loaded||(e._nativeAsset=n)),t&&t(i)}))}else t&&t()},isLoaded:function(){return this.loaded},handleLoadedTexture:function(){if(this._image&&this._image.width&&this._image.height){var t=this._image;this.width=t.width,this.height=t.height,this.loaded=!0,this.emit("load")}},description:function(){return""},_releaseTexture:function(){this._gl&&null!==this._glID&&(this._gl.deleteTexture(this._glID),this._glID=null)},destroy:function(){this._releaseTexture(),cc.textureCache.removeTextureForKey(this.url),this._super()},getPixelFormat:function(){return this._format},hasPremultipliedAlpha:function(){return this._premultiplyAlpha||!1},hasMipmaps:function(){return this._hasMipmap||!1},setTexParameters:function(t,e,i,n){void 0!==e&&(t={minFilter:t,magFilter:e,wrapS:i,wrapT:n}),t.wrapS!==h.REPEAT||t.wrapT!==h.REPEAT?t.wrapS!==h.REPEAT?t.wrapT!==h.REPEAT?this._pattern="":this._pattern="repeat-y":this._pattern="repeat-x":this._pattern="repeat"},setAntiAliasTexParameters:function(){},setAliasTexParameters:function(){},_serialize:!1,_deserialize:function(t,e){var i=t.split(",")[0];if(i){var n=i.charCodeAt(0)-48,r=u.extnames[n];this._setRawAsset(r||i);var s=e.customEnv,o=s&&s.uuid;if(o){this._uuid=o;var a=this.nativeUrl;this.url=a,cc.textureCache.cacheImage(a,this)}}}}),_=u.prototype;s.get(_,"pixelFormat",_.getPixelFormat),s.get(_,"pixelWidth",_.getPixelWidth),s.get(_,"pixelHeight",_.getPixelHeight),o.once(o.EVENT_RENDERER_INITED,(function(){if(cc._renderType===o.RENDER_TYPE_CANVAS)(function(){function t(t,e,i){if(null===t)return null;i=i||document.createElement("canvas"),e=e||cc.rect(0,0,t.width,t.height),i.width=e.width,i.height=e.height;var n=i.getContext("2d");n.drawImage(t,e.x,e.y,e.width,e.height,0,0,e.width,e.height);for(var r=n.getImageData(0,0,e.width,e.height),s=r.data,o=0,a=s.length;o"},getTextureForKey:function(t){return this._textures[t]},getKeyByTexture:function(t){for(var e in this._textures)if(this._textures[e]===t)return e;return null},_generalTextureKey:function(t){return"_textureKey_"+t},getTextureColors:function(t){var e=t._image,i=this.getKeyByTexture(e);return i||(i=e instanceof HTMLImageElement?e.src:this._generalTextureKey(t.__instanceId)),this._textureColorsCache[i]||(this._textureColorsCache[i]=t._generateTextureCacheForColor()),this._textureColorsCache[i]},getAllTextures:function(){var t=[];for(var e in this._textures){var i=this._textures[e];t.push(i)}return t},removeAllTextures:function(){var t=this._textures;for(var e in t)t[e]&&t[e]._releaseTexture();this._textures={}},removeTexture:function(t){if(t){var e=this._textures;for(var i in e)e[i]===t&&(e[i]._releaseTexture(),delete e[i])}},removeTextureForKey:function(t){if("string"==typeof t){var e=this._textures[t];e&&(e._releaseTexture(),delete this._textures[t])}},addImage:function(t,e,i){cc.assertID(t,3103);var s=this._textures,o=s[t];return o?o.loaded?e&&e.call(i,o):o.once("load",(function(){e&&e.call(i,o)}),i):((o=s[t]=new n).url=t,cc.loader.load(t,(function(n,s){if(n)return e&&e.call(i,n||new Error("Unknown error"));r.handleLoadedTexture(t),e&&e.call(i,o)}))),o},addImageAsync:null,cacheImage:function(t,e){if(cc.assertID(t,3009),e instanceof n)this._textures[t]=e;else{var i=new n;i.initWithElement(e),i.handleLoadedTexture(),this._textures[t]=i}},dumpCachedTextureInfo:function(){var t=0,e=0,i=this._textures;for(var n in i){var r=i[n];t++,r.getHtmlElementObj()instanceof HTMLImageElement?cc.logID(3005,n,r.getHtmlElementObj().src,r.getPixelWidth(),r.getPixelHeight()):cc.logID(3006,n,r.getPixelWidth(),r.getPixelHeight()),e+=r.getPixelWidth()*r.getPixelHeight()*4}var s=this._textureColorsCache;for(n in s){var o=s[n];for(var a in o){var c=o[a];t++,cc.logID(3006,n,c.width,c.height),e+=c.width*c.height*4}}cc.logID(3007,t,e/1024,(e/1048576).toFixed(2))},_clear:function(){this._textures={},this._textureColorsCache={},this._textureKeySeq=0|1e3*Math.random()},handleLoadedTexture:function(t){var e=this._textures,i=e[t];i||(cc.assertID(t,3009),(i=e[t]=new n).url=t),i.handleLoadedTexture()}};r.addImageAsync=r.addImage,cc.textureCache=e.exports=r}),{"./CCTexture2D":218}],220:[(function(t,e,i){t("./CCTexture2D"),t("./CCTextureCache")}),{"./CCTexture2D":218,"./CCTextureCache":219}],221:[(function(t,e,i){t("../platform/CCSys");var n=/(\.[^\.\/\?\\]*)(\?.*)?$/,r=/((.*)(\/|\\|\\\\))?(.*?\..*$)?/,s=/[^\.\/]+\/\.\.\//;cc.path={join:function(){for(var t=arguments.length,e="",i=0;i0&&(t=t.substring(0,i));var n=/(\/|\\\\)([^(\/|\\\\)]+)$/g.exec(t.replace(/(\/|\\\\)$/,""));if(!n)return null;var r=n[2];return e&&t.substring(t.length-e.length).toLowerCase()===e.toLowerCase()?r.substring(0,r.length-e.length):r},dirname:function(t){var e=r.exec(t);return e?e[2]:""},changeExtname:function(t,e){e=e||"";var i=t.indexOf("?"),n="";return i>0&&(n=t.substring(i),t=t.substring(0,i)),(i=t.lastIndexOf("."))<0?t+e+n:t.substring(0,i)+e+n},changeBasename:function(t,e,i){if(0===e.indexOf("."))return this.changeExtname(t,e);var n=t.indexOf("?"),r="",s=i?this.extname(t):"";return n>0&&(r=t.substring(n),t=t.substring(0,n)),n=(n=t.lastIndexOf("/"))<=0?0:n+1,t.substring(0,n)+e+s+r},_normalize:function(t){var e=t=String(t);do{e=t,t=t.replace(s,"")}while(e.length!==t.length);return t},sep:cc.sys.os===cc.sys.OS_WINDOWS?"\\":"/",stripSep:function(t){return t.replace(/[\/\\]$/,"")}},e.exports=cc.path}),{"../platform/CCSys":187}],222:[(function(t,e,i){var n=t("../../../external/pstats/pstats"),r=t("../platform/CCMacro"),s=document.createElement("div");s.id="fps";var o=null,a=!1;function c(){o("frame").start(),o("logic").start()}function h(){cc.director.isPaused()?o("frame").start():o("logic").end(),o("render").start()}function l(){o("render").end(),o("draws").value=cc.g_NumberOfDraws,o("frame").end(),o("fps").frame(),o().tick()}cc.profiler=e.exports={isShowingStats:function(){return a},hideStats:function(){a&&(s.parentElement===document.body&&document.body.removeChild(s),cc.director.off(cc.Director.EVENT_BEFORE_UPDATE,c),cc.director.off(cc.Director.EVENT_AFTER_VISIT,h),cc.director.off(cc.Director.EVENT_AFTER_DRAW,l),a=!1)},showStats:function(){a||(o||(o=n.new(s,{showGraph:!1,values:{frame:{desc:"Frame time (ms)",min:0,max:50,average:500},fps:{desc:"Framerate (FPS)",below:30,average:500},draws:{desc:"Draw call"},logic:{desc:"Game Logic (ms)",min:0,max:50,average:500,color:"#080"},render:{desc:"Renderer (ms)",min:0,max:50,average:500,color:"#f90"},mode:{desc:cc._renderType===cc.game.RENDER_TYPE_WEBGL?"WebGL":"Canvas",min:1}},css:".pstats {left: "+r.DIRECTOR_STATS_POSITION.x+"px; bottom: "+r.DIRECTOR_STATS_POSITION.y+"px;}"})),null===s.parentElement&&document.body.appendChild(s),cc.director.on(cc.Director.EVENT_BEFORE_UPDATE,c),cc.director.on(cc.Director.EVENT_AFTER_VISIT,h),cc.director.on(cc.Director.EVENT_AFTER_DRAW,l),a=!0)}}}),{"../../../external/pstats/pstats":313,"../platform/CCMacro":183}],223:[(function(t,e,i){var n=t("./prefab-helper"),r=t("../platform/CCObject").Flags,s=t("./misc"),o=t("../platform/id-generater"),a=t("../event-manager"),c=cc.js,h=r.Destroying,l=r.DontDestroy,u=r.Deactivating,_=new o("Node");function d(t){return t?"string"==typeof t?c.getClassByName(t):t:(cc.errorID(3804),null)}function f(t,e){if(e._sealed)for(var i=0;i0},set:function(t){t?this._objFlags|=l:this._objFlags&=~l}},name:{get:function(){return this._name},set:function(t){this._name=t}},_id:{default:"",editorOnly:!0},uuid:{get:function(){var t=this._id;return t||(t=this._id=_.getNewId()),t}},children:{get:function(){return this._children}},childrenCount:{get:function(){return this._children.length}},active:{get:function(){return this._active},set:function(t){if(t=!!t,this._active!==t){this._active=t;var e=this._parent;if(e)e._activeInHierarchy&&cc.director._nodeActivator.activateNode(this,t)}}},activeInHierarchy:{get:function(){return this._activeInHierarchy}}},ctor:function(t){this._name=void 0!==t?t:"New Node",this._activeInHierarchy=!1,this.__instanceId=this._id||cc.ClassManager.getNewInstanceId(),this.__eventTargets=[]},getTag:function(){return this._tag},setTag:function(t){this._tag=t},getParent:function(){return this._parent},setParent:function(t){if(this._parent!==t){0;var e=this._parent;if(this._parent=t||null,this._onSetParent(t),t&&(a._setDirtyForNode(this),t._children.push(this),t.emit("child-added",this)),e){if(!(e._objFlags&h)){var i=e._children.indexOf(this);0,e._children.splice(i,1),e.emit("child-removed",this),this._onHierarchyChanged(e)}}else t&&this._onHierarchyChanged(null)}},init:function(){return!0},attr:function(t){c.mixin(this,t)},getChildByTag:function(t){var e=this._children;if(null!==e)for(var i=0;i-1&&((e||void 0===e)&&t.cleanup(),t.parent=null)},removeChildByTag:function(t,e){t===cc.macro.NODE_TAG_INVALID&&cc.logID(1609);var i=this.getChildByTag(t);i?this.removeChild(i,e):cc.logID(1610,t)},removeAllChildren:function(t){var e=this._children;void 0===t&&(t=!0);for(var i=e.length-1;i>=0;i--){var n=e[i];n&&(t&&n.cleanup(),n.parent=null)}this._children.length=0},isChildOf:function(t){var e=this;do{if(e===t)return!0;e=e._parent}while(e);return!1},getComponent:function(t){var e=d(t);return e?f(this,e):null},getComponents:function(t){var e=d(t),i=[];return e&&m(this,e,i),i},getComponentInChildren:function(t){var e=d(t);return e?(function t(e,i){for(var n=0;n0&&(s=t(r._children,i)))return s}return null})(this._children,e):null},getComponentsInChildren:function(t){var e=d(t),i=[];return e&&(m(this,e,i),(function t(e,i,n){for(var r=0;r0&&t(s._children,i,n)}})(this._children,e,i)),i},_checkMultipleComp:!1,addComponent:function(t){var e;if("string"==typeof t){if(!(e=c.getClassByName(t)))return cc.errorID(3807,t),cc._RFpeek()&&cc.errorID(3808,t),null}else{if(!t)return cc.errorID(3804),null;e=t}if("function"!=typeof e)return cc.errorID(3809),null;if(!cc.isChildClassOf(e,cc.Component))return cc.errorID(3810),null;var i=e._requireComponent;if(i&&!this.getComponent(i)&&!this.addComponent(i))return null;var n=new e;return n.node=this,this._components.push(n),this._activeInHierarchy&&cc.director._nodeActivator.activateComp(n),n},_addComponentAt:!1,removeComponent:function(t){t?(t instanceof cc.Component||(t=this.getComponent(t)),t&&t.destroy()):cc.errorID(3813)},_getDependComponent:!1,_removeComponent:function(t){if(t){if(!(this._objFlags&h)){var e=this._components.indexOf(t);-1!==e?this._components.splice(e,1):t.node!==this&&cc.errorID(3815)}}else cc.errorID(3814)},_disableChildComps:function(){var t,e=this._components.length;for(t=0;t>>1;i<=r;s=i+r>>>1){var o=t[s];if(o>e+n)r=s-1;else{if(!(o>2],o[a[i++]]=r[(3&s)<<2|c>>4],o[a[i++]]=r[15&c]}return o.join("")}}),{"./misc":228}],226:[(function(t,e,i){cc.find=e.exports=function(t,e){if(null==t)return cc.errorID(5600),null;if(e)0;else{var i=cc.director.getScene();if(!i)return null;e=i}for(var n=e,r="/"!==t[0]?0:1,s=t.split("/"),o=r;o>1,t|=t>>2,t|=t>>4,t|=t>>8,(t|=t>>16)+1},s.imagePool=new n.Pool(function(t){return t instanceof HTMLImageElement&&(t.src=this._smallImg,!0)},10),s.imagePool.get=function(){return this._get()||new Image},s.imagePool._smallImg="data:image/gif;base64,R0lGODlhAQABAAAAACwAAAAAAQABAAA=",r.os!==r.OS_WINDOWS&&r.os!==r.OS_LINUX||r.browserType===r.BROWSER_TYPE_CHROME||s.imagePool.resize(0),s.BUILTIN_CLASSID_RE=/^(?:cc|dragonBones|sp|ccsg)\..+/;for(var o=new Array(123),a=0;a<123;++a)o[a]=64;for(var c=0;c<64;++c)o["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charCodeAt(c)]=c;s.BASE64_VALUES=o,s.pushToMap=function(t,e,i,n){var r=t[e];r?Array.isArray(r)?n?(r.push(r[0]),r[0]=i):r.push(i):t[e]=n?[i,r]:[r,i]:t[e]=i}}),{"../platform/CCSys":187,"../platform/js":199}],229:[(function(t,e,i){function n(t){this.i=0,this.array=t}var r=n.prototype;r.remove=function(t){var e=this.array.indexOf(t);e>=0&&this.removeAt(e)},r.removeAt=function(t){this.array.splice(t,1),t<=this.i&&--this.i},r.fastRemove=function(t){var e=this.array.indexOf(t);e>=0&&this.fastRemoveAt(e)},r.fastRemoveAt=function(t){var e=this.array;e[t]=e[e.length-1],--e.length,t<=this.i&&--this.i},r.push=function(t){this.array.push(t)},e.exports=n}),{}],230:[(function(t,e,i){cc._PrefabInfo=cc.Class({name:"cc.PrefabInfo",properties:{root:null,asset:null,fileId:"",sync:!1,_synced:{default:!1,serializable:!1}}}),e.exports={syncWithPrefab:function(t){var e=t._prefab;if(e._synced=!0,!e.asset)return cc.errorID(3701,t.name),void(t._prefab=null);var i=t._objFlags,n=t._parent,r=t._id,s=t._name,o=t._active,a=t._position.x,c=t._position.y,h=t._rotationX,l=t._rotationY,u=t._localZOrder,_=t._globalZOrder;cc.game._isCloning=!0,e.asset._doInstantiate(t),cc.game._isCloning=!1,t._objFlags=i,t._parent=n,t._id=r,t._prefab=e,t._name=s,t._active=o,t._position.x=a,t._position.y=c,t._rotationX=h,t._rotationY=l,t._localZOrder=u,t._globalZOrder=_}}}),{}],231:[(function(t,e,i){var n={removeSgNode:function(){var t=this._sgNode;if(t){var e=t._parent;e?e.removeChild(t):t.performRecursive(_ccsg.Node.performType.cleanup),t._entity&&(t._entity=null)}}};e.exports=n}),{}],232:[(function(t,e,i){cc.AffineTransform=function(t,e,i,n,r,s){this.a=t,this.b=e,this.c=i,this.d=n,this.tx=r,this.ty=s},cc.affineTransformMake=function(t,e,i,n,r,s){return{a:t,b:e,c:i,d:n,tx:r,ty:s}},cc.affineTransformClone=function(t){return{a:t.a,b:t.b,c:t.c,d:t.d,tx:t.tx,ty:t.ty}},cc.pointApplyAffineTransform=function(t,e,i){var n,r;return void 0===i?(i=e,n=t.x,r=t.y):(n=t,r=e),{x:i.a*n+i.c*r+i.tx,y:i.b*n+i.d*r+i.ty}},cc._pointApplyAffineTransformIn=function(t,e,i,n){var r,s,o;void 0===n?(o=e,r=t.x,s=t.y,n=i):(r=t,s=e,o=i),n.x=o.a*r+o.c*s+o.tx,n.y=o.b*r+o.d*s+o.ty},cc._pointApplyAffineTransform=function(t,e,i){return cc.pointApplyAffineTransform(t,e,i)},cc.sizeApplyAffineTransform=function(t,e){return{width:e.a*t.width+e.c*t.height,height:e.b*t.width+e.d*t.height}},cc.affineTransformMakeIdentity=function(){return{a:1,b:0,c:0,d:1,tx:0,ty:0}},cc.affineTransformIdentity=function(){return{a:1,b:0,c:0,d:1,tx:0,ty:0}},cc.rectApplyAffineTransform=function(t,e){var i=t.x,n=t.y,r=i+t.width,s=n+t.height,o=e.a*i+e.c*n+e.tx,a=e.b*i+e.d*n+e.ty,c=e.a*r+e.c*n+e.tx,h=e.b*r+e.d*n+e.ty,l=e.a*i+e.c*s+e.tx,u=e.b*i+e.d*s+e.ty,_=e.a*r+e.c*s+e.tx,d=e.b*r+e.d*s+e.ty,f=Math.min(o,c,l,_),m=Math.max(o,c,l,_),p=Math.min(a,h,u,d),g=Math.max(a,h,u,d);return cc.rect(f,p,m-f,g-p)},cc._rectApplyAffineTransformIn=function(t,e){var i=t.x,n=t.y,r=i+t.width,s=n+t.height,o=e.a*i+e.c*n+e.tx,a=e.b*i+e.d*n+e.ty,c=e.a*r+e.c*n+e.tx,h=e.b*r+e.d*n+e.ty,l=e.a*i+e.c*s+e.tx,u=e.b*i+e.d*s+e.ty,_=e.a*r+e.c*s+e.tx,d=e.b*r+e.d*s+e.ty,f=Math.min(o,c,l,_),m=Math.max(o,c,l,_),p=Math.min(a,h,u,d),g=Math.max(a,h,u,d);return t.x=f,t.y=p,t.width=m-f,t.height=g-p,t},cc.obbApplyAffineTransform=function(t,e,i,n,r,s){var o=t.x,a=t.y,c=t.width,h=t.height,l=e.a*o+e.c*a+e.tx,u=e.b*o+e.d*a+e.ty,_=e.a*c,d=e.b*c,f=e.c*h,m=e.d*h;n.x=l,n.y=u,r.x=_+l,r.y=d+u,i.x=f+l,i.y=m+u,s.x=_+f+l,s.y=d+m+u},cc.affineTransformTranslate=function(t,e,i){return{a:t.a,b:t.b,c:t.c,d:t.d,tx:t.tx+t.a*e+t.c*i,ty:t.ty+t.b*e+t.d*i}},cc.affineTransformScale=function(t,e,i){return{a:t.a*e,b:t.b*e,c:t.c*i,d:t.d*i,tx:t.tx,ty:t.ty}},cc.affineTransformRotate=function(t,e){var i=Math.sin(e),n=Math.cos(e);return{a:t.a*n+t.c*i,b:t.b*n+t.d*i,c:t.c*n-t.a*i,d:t.d*n-t.b*i,tx:t.tx,ty:t.ty}},cc.affineTransformConcat=function(t,e){return{a:t.a*e.a+t.b*e.c,b:t.a*e.b+t.b*e.d,c:t.c*e.a+t.d*e.c,d:t.c*e.b+t.d*e.d,tx:t.tx*e.a+t.ty*e.c+e.tx,ty:t.tx*e.b+t.ty*e.d+e.ty}},cc.affineTransformConcatIn=function(t,e){var i=t.a,n=t.b,r=t.c,s=t.d,o=t.tx,a=t.ty;return t.a=i*e.a+n*e.c,t.b=i*e.b+n*e.d,t.c=r*e.a+s*e.c,t.d=r*e.b+s*e.d,t.tx=o*e.a+a*e.c+e.tx,t.ty=o*e.b+a*e.d+e.ty,t},cc.affineTransformEqualToTransform=function(t,e){return t.a===e.a&&t.b===e.b&&t.c===e.c&&t.d===e.d&&t.tx===e.tx&&t.ty===e.ty},cc.affineTransformInvert=function(t){var e=1/(t.a*t.d-t.b*t.c);return{a:e*t.d,b:-e*t.b,c:-e*t.c,d:e*t.a,tx:e*(t.c*t.ty-t.d*t.tx),ty:e*(t.b*t.tx-t.a*t.ty)}},cc.affineTransformInvertIn=function(t){var e=t.a,i=t.b,n=t.c,r=t.d,s=1/(e*r-i*n),o=t.tx,a=t.ty;return t.a=s*r,t.b=-s*i,t.c=-s*n,t.d=s*e,t.tx=s*(n*a-r*o),t.ty=s*(i*o-e*a),t},cc.affineTransformInvertOut=function(t,e){var i=t.a,n=t.b,r=t.c,s=t.d,o=t.tx,a=t.ty,c=1/(i*s-n*r);e.a=c*s,e.b=-c*n,e.c=-c*r,e.d=c*i,e.tx=c*(r*a-s*o),e.ty=c*(n*o-i*a)}}),{}],233:[(function(t,e,i){var n=t("./CCValueType"),r=t("../platform/js"),s=(function(){function e(t,e,i,n){"object"==typeof t&&(e=t.g,i=t.b,n=t.a,t=t.r),t=t||0,e=e||0,i=i||0,n="number"==typeof n?n:255,this._val=(~~t<<24>>>0)+(~~e<<16)+(~~i<<8)+~~n}r.extend(e,n),t("../platform/CCClass").fastDefine("cc.Color",e,{r:0,g:0,b:0,a:255});var i={WHITE:[255,255,255,255],BLACK:[0,0,0,255],TRANSPARENT:[0,0,0,0],GRAY:[127.5,127.5,127.5],RED:[255,0,0],GREEN:[0,255,0],BLUE:[0,0,255],YELLOW:[255,235,4],ORANGE:[255,127,0],CYAN:[0,255,255],MAGENTA:[255,0,255]};for(var s in i)r.get(e,s,(function(t){return function(){return new e(t[0],t[1],t[2],t[3])}})(i[s]));var o=e.prototype;return o.clone=function(){var t=new e;return t._val=this._val,t},o.equals=function(t){return t&&this._val===t._val},o.lerp=function(t,i,n){n=n||new e;var r=this.r,s=this.g,o=this.b,a=this.a;return n.r=r+(t.r-r)*i,n.g=s+(t.g-s)*i,n.b=o+(t.b-o)*i,n.a=a+(t.a-a)*i,n},o.toString=function(){return"rgba("+this.r.toFixed()+", "+this.g.toFixed()+", "+this.b.toFixed()+", "+this.a.toFixed()+")"},o.getR=function(){return(4278190080&this._val)>>>24},o.setR=function(t){return this._val=(16777215&this._val|~~t<<24>>>0)>>>0,this},o.getG=function(){return(16711680&this._val)>>16},o.setG=function(t){return this._val=(4278255615&this._val|~~t<<16)>>>0,this},o.getB=function(){return(65280&this._val)>>8},o.setB=function(t){return this._val=(4294902015&this._val|~~t<<8)>>>0,this},o.getA=function(){return 255&this._val},o.setA=function(t){return this._val=(4294967040&this._val|~~t)>>>0,this},r.getset(o,"r",o.getR,o.setR,!0),r.getset(o,"g",o.getG,o.setG,!0),r.getset(o,"b",o.getB,o.setB,!0),r.getset(o,"a",o.getA,o.setA,!0),o.toCSS=function(t){return"rgba"===t?"rgba("+(0|this.r)+","+(0|this.g)+","+(0|this.b)+","+(this.a/255).toFixed(2)+")":"rgb"===t?"rgb("+(0|this.r)+","+(0|this.g)+","+(0|this.b)+")":"#"+this.toHEX(t)},o.clamp=function(){},o.fromHEX=function(t){t.length<8&&(t+="FF");var e=parseInt(t.indexOf("#")>-1?t.substring(1):t,16);return this._val=(0&this._val|e)>>>0,this},o.toHEX=function(t){var e=[(0|this.r).toString(16),(0|this.g).toString(16),(0|this.b).toString(16)],i=-1;if("#rgb"===t)for(i=0;i1&&(e[i]=e[i][0]);else if("#rrggbb"===t)for(i=0;i>>0)+(r.g<<16)+(r.b<<8)+this.a,this},o.toHSV=function(){return e.rgb2hsv(this.r,this.g,this.b)},o.fromColor=function(t){t._val?this._val=t._val:(this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a)},e})();s.rgb2hsv=function(t,e,i){t/=255,e/=255,i/=255;var n={h:0,s:0,v:0},r=Math.max(t,e,i),s=Math.min(t,e,i),o=0;return n.v=r,n.s=r?(r-s)/r:0,n.s?(o=r-s,n.h=t===r?(e-i)/o:e===r?2+(i-t)/o:4+(t-e)/o,n.h/=6,n.h<0&&(n.h+=1)):n.h=0,n},s.hsv2rgb=function(t,e,i){var n={r:0,g:0,b:0};if(0===e)n.r=n.g=n.b=i;else if(0===i)n.r=n.g=n.b=0;else{1===t&&(t=0),t*=6,e=e,i=i;var r=Math.floor(t),s=t-r,o=i*(1-e),a=i*(1-e*s),c=i*(1-e*(1-s));switch(r){case 0:n.r=i,n.g=c,n.b=o;break;case 1:n.r=a,n.g=i,n.b=o;break;case 2:n.r=o,n.g=i,n.b=c;break;case 3:n.r=o,n.g=a,n.b=i;break;case 4:n.r=c,n.g=o,n.b=i;break;case 5:n.r=i,n.g=o,n.b=a}}return n.r*=255,n.g*=255,n.b*=255,n},cc.Color=s,cc.color=function(t,e,i,n){return"string"==typeof t?(new cc.Color).fromHEX(t):"object"==typeof t?new cc.Color(t.r,t.g,t.b,t.a):new cc.Color(t,e,i,n)},cc.colorEqual=function(t,e){return void 0!==t._val&&void 0!==e._val?t._val===e._val:t.r===e.r&&t.g===e.g&&t.b===e.b},cc.hexToColor=function(t){t=t.replace(/^#?/,"0x");var e=parseInt(t),i=e>>16,n=(65280&e)>>8,r=255&e;return cc.color(i,n,r)},cc.colorToHex=function(t){var e=t.r.toString(16),i=t.g.toString(16),n=t.b.toString(16);return"#"+(t.r<16?"0"+e:e)+(t.g<16?"0"+i:i)+(t.b<16?"0"+n:n)},e.exports=cc.Color}),{"../platform/CCClass":178,"../platform/js":199,"./CCValueType":239}],234:[(function(t,e,i){var n=parseFloat("1.192092896e-07F");cc.pNeg=function(t){return cc.p(-t.x,-t.y)},cc.pAdd=function(t,e){return cc.p(t.x+e.x,t.y+e.y)},cc.pSub=function(t,e){return cc.p(t.x-e.x,t.y-e.y)},cc.pMult=function(t,e){return cc.p(t.x*e,t.y*e)},cc.pMidpoint=function(t,e){return cc.pMult(cc.pAdd(t,e),.5)},cc.pDot=function(t,e){return t.x*e.x+t.y*e.y},cc.pCross=function(t,e){return t.x*e.y-t.y*e.x},cc.pPerp=function(t){return cc.p(-t.y,t.x)},cc.pRPerp=function(t){return cc.p(t.y,-t.x)},cc.pProject=function(t,e){return cc.pMult(e,cc.pDot(t,e)/cc.pDot(e,e))},cc.pLengthSQ=function(t){return cc.pDot(t,t)},cc.pDistanceSQ=function(t,e){return cc.pLengthSQ(cc.pSub(t,e))},cc.pLength=function(t){return Math.sqrt(cc.pLengthSQ(t))},cc.pDistance=function(t,e){return cc.pLength(cc.pSub(t,e))},cc.pNormalize=function(t){var e=cc.pLength(t);return 0===e?cc.p(t):cc.pMult(t,1/e)},cc.pForAngle=function(t){return cc.p(Math.cos(t),Math.sin(t))},cc.pToAngle=function(t){return Math.atan2(t.y,t.x)},cc.clampf=function(t,e,i){if(e>i){var n=e;e=i,i=n}return t=0&&r.x<=1&&r.y>=0&&r.y<=1)},cc.pIntersectPoint=function(t,e,i,n){var r=cc.p(0,0);if(cc.pLineIntersect(t,e,i,n,r)){var s=cc.p(0,0);return s.x=t.x+r.x*(e.x-t.x),s.y=t.y+r.x*(e.y-t.y),s}return cc.p(0,0)},cc.pSameAs=function(t,e){return null!=t&&null!=e&&(t.x===e.x&&t.y===e.y)},cc.pZeroIn=function(t){t.x=0,t.y=0},cc.pIn=function(t,e){t.x=e.x,t.y=e.y},cc.pMultIn=function(t,e){t.x*=e,t.y*=e},cc.pSubIn=function(t,e){t.x-=e.x,t.y-=e.y},cc.pAddIn=function(t,e){t.x+=e.x,t.y+=e.y},cc.pNormalizeIn=function(t){cc.pMultIn(t,1/Math.sqrt(t.x*t.x+t.y*t.y))}}),{}],235:[(function(t,e,i){var n=t("./CCValueType"),r=t("../platform/js");function s(t,e,i,n){t&&"object"==typeof t&&(e=t.y,i=t.width,n=t.height,t=t.x),this.x=t||0,this.y=e||0,this.width=i||0,this.height=n||0}r.extend(s,n),t("../platform/CCClass").fastDefine("cc.Rect",s,{x:0,y:0,width:0,height:0}),s.fromMinMax=function(t,e){var i=Math.min(t.x,e.x),n=Math.min(t.y,e.y);return new s(i,n,Math.max(t.x,e.x)-i,Math.max(t.y,e.y)-n)},s.contain=function(t,e){return t.xe.x+e.width&&t.ye.y+e.height?1:e.xt.x+t.width&&e.yt.y+t.height?-1:0};var o=s.prototype;o.clone=function(){return new s(this.x,this.y,this.width,this.height)},o.equals=function(t){return t&&this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height},o.lerp=function(t,e,i){i=i||new s;var n=this.x,r=this.y,o=this.width,a=this.height;return i.x=n+(t.x-n)*e,i.y=r+(t.y-r)*e,i.width=o+(t.width-o)*e,i.height=a+(t.height-a)*e,i},o.toString=function(){return"("+this.x.toFixed(2)+", "+this.y.toFixed(2)+", "+this.width.toFixed(2)+", "+this.height.toFixed(2)+")"},r.getset(o,"xMin",(function(){return this.x}),(function(t){this.width+=this.x-t,this.x=t})),r.getset(o,"yMin",(function(){return this.y}),(function(t){this.height+=this.y-t,this.y=t})),r.getset(o,"xMax",(function(){return this.x+this.width}),(function(t){this.width=t-this.x})),r.getset(o,"yMax",(function(){return this.y+this.height}),(function(t){this.height=t-this.y})),r.getset(o,"center",(function(){return new cc.Vec2(this.x+.5*this.width,this.y+.5*this.height)}),(function(t){this.x=t.x-.5*this.width,this.y=t.y-.5*this.height})),r.getset(o,"origin",(function(){return new cc.Vec2(this.x,this.y)}),(function(t){this.x=t.x,this.y=t.y})),r.getset(o,"size",(function(){return new cc.Size(this.width,this.height)}),(function(t){this.width=t.width,this.height=t.height})),o.intersects=function(t){return cc.rectIntersectsRect(this,t)},o.contains=function(t){return this.x<=t.x&&this.x+this.width>=t.x&&this.y<=t.y&&this.y+this.height>=t.y},o.containsRect=function(t){return this.x<=t.x&&this.x+this.width>=t.x+t.width&&this.y<=t.y&&this.y+this.height>=t.y+t.height},cc.Rect=s,cc.rect=function(t,e,i,n){return new s(t,e,i,n)},cc.rectEqualToRect=function(t,e){return t&&e&&t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height},cc._rectEqualToZero=function(t){return t&&0===t.x&&0===t.y&&0===t.width&&0===t.height},cc.rectContainsRect=function(t,e){return!(!t||!e)&&!(t.x>=e.x||t.y>=e.y||t.x+t.width<=e.x+e.width||t.y+t.height<=e.y+e.height)},cc.rectGetMaxX=function(t){return t.x+t.width},cc.rectGetMidX=function(t){return t.x+t.width/2},cc.rectGetMinX=function(t){return t.x},cc.rectGetMaxY=function(t){return t.y+t.height},cc.rectGetMidY=function(t){return t.y+t.height/2},cc.rectGetMinY=function(t){return t.y},cc.rectContainsPoint=function(t,e){return e.x>=cc.rectGetMinX(t)&&e.x<=cc.rectGetMaxX(t)&&e.y>=cc.rectGetMinY(t)&&e.y<=cc.rectGetMaxY(t)},cc.rectIntersectsRect=function(t,e){var i=t.x+t.width,n=t.y+t.height,r=e.x+e.width,s=e.y+e.height;return!(i=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y&&t.z>=this.min.z&&t.z<=this.max.z},cc.math.AABB.containsPoint=function(t,e){return t.x>=e.min.x&&t.x<=e.max.x&&t.y>=e.min.y&&t.y<=e.max.y&&t.z>=e.min.z&&t.z<=e.max.z},cc.math.AABB.prototype.assignFrom=function(t){this.min.assignFrom(t.min),this.max.assignFrom(t.max)},cc.math.AABB.assign=function(t,e){return t.min.assignFrom(e.min),t.max.assignFrom(e.max),t}}),{}],247:[(function(t,e,i){cc.math.Matrix4Stack=function(t,e){this.top=t,this.stack=e||[],this.lastUpdated=0};var n=cc.math.Matrix4Stack.prototype;n.initialize=function(){this.stack.length=0,this.top=null},n.push=function(t){t=t||this.top,this.stack.push(this.top),this.top=new cc.math.Matrix4(t),this.update()},n.pop=function(){this.top=this.stack.pop(),this.update()},n.update=function(){this.lastUpdated++},n.release=function(){this.stack=null,this.top=null,this._matrixPool=null},n._getFromPool=function(t){var e=this._matrixPool;if(0===e.length)return new cc.math.Matrix4(t);var i=e.pop();return i.assignFrom(t),i},n._putInPool=function(t){this._matrixPool.push(t)}}),{}],248:[(function(t,e,i){var n=cc.math;n.KM_GL_MODELVIEW=5888,n.KM_GL_PROJECTION=5889,n.KM_GL_TEXTURE=5890,n.modelview_matrix_stack=new n.Matrix4Stack,n.projection_matrix_stack=new n.Matrix4Stack,n.texture_matrix_stack=new n.Matrix4Stack,cc.current_stack=null;var r=!1;(function(){if(!r){var t=new n.Matrix4;n.modelview_matrix_stack.initialize(),n.projection_matrix_stack.initialize(),n.texture_matrix_stack.initialize(),cc.current_stack=n.modelview_matrix_stack,r=!0,t.identity(),n.modelview_matrix_stack.push(t),n.projection_matrix_stack.push(t),n.texture_matrix_stack.push(t)}})(),n.glFreeAll=function(){n.modelview_matrix_stack.release(),n.modelview_matrix_stack=null,n.projection_matrix_stack.release(),n.projection_matrix_stack=null,n.texture_matrix_stack.release(),n.texture_matrix_stack=null,r=!1,cc.current_stack=null},n.glPushMatrix=function(){cc.current_stack.push(cc.current_stack.top),cc.current_stack.update()},n.glPushMatrixWitMat4=function(t){cc.current_stack.stack.push(cc.current_stack.top),t.assignFrom(cc.current_stack.top),cc.current_stack.top=t,cc.current_stack.update()},n.glPopMatrix=function(){cc.current_stack.top=cc.current_stack.stack.pop(),cc.current_stack.update()},n.glMatrixMode=function(t){switch(t){case n.KM_GL_MODELVIEW:cc.current_stack=n.modelview_matrix_stack;break;case n.KM_GL_PROJECTION:cc.current_stack=n.projection_matrix_stack;break;case n.KM_GL_TEXTURE:cc.current_stack=n.texture_matrix_stack;break;default:throw new Error(cc._getError(7908))}},n.glLoadIdentity=function(){cc.current_stack.top.identity(),cc.current_stack.update()},n.glLoadMatrix=function(t){cc.current_stack.top.assignFrom(t),cc.current_stack.update()},n.glMultMatrix=function(t){cc.current_stack.top.multiply(t),cc.current_stack.update()};var s=new n.Matrix4;n.glTranslatef=function(t,e,i){var r=n.Matrix4.createByTranslation(t,e,i,s);cc.current_stack.top.multiply(r),cc.current_stack.update()};var o=new n.Vec3;n.glRotatef=function(t,e,i,r){o.fill(e,i,r);var a=n.Matrix4.createByAxisAndAngle(o,cc.degreesToRadians(t),s);cc.current_stack.top.multiply(a),cc.current_stack.update()},n.glScalef=function(t,e,i){var r=n.Matrix4.createByScale(t,e,i,s);cc.current_stack.top.multiply(r),cc.current_stack.update()},n.glGetMatrix=function(t,e){switch(t){case n.KM_GL_MODELVIEW:e.assignFrom(n.modelview_matrix_stack.top);break;case n.KM_GL_PROJECTION:e.assignFrom(n.projection_matrix_stack.top);break;case n.KM_GL_TEXTURE:e.assignFrom(n.texture_matrix_stack.top);break;default:throw new Error(cc._getError(7908))}}}),{}],249:[(function(t,e,i){t("./utility"),t("./vec2"),t("./vec3"),t("./vec4"),t("./ray2"),t("./mat3"),t("./mat4"),t("./plane"),t("./quaternion"),t("./aabb"),t("./gl/mat4stack"),t("./gl/matrix")}),{"./aabb":246,"./gl/mat4stack":247,"./gl/matrix":248,"./mat3":250,"./mat4":251,"./plane":252,"./quaternion":253,"./ray2":254,"./utility":255,"./vec2":256,"./vec3":257,"./vec4":258}],250:[(function(t,e,i){window.Uint16Array=window.Uint16Array||window.Array,window.Float32Array=window.Float32Array||window.Array,cc.math.Matrix3=function(t){t&&t.mat?this.mat=new Float32Array(t.mat):this.mat=new Float32Array(9)};var n=cc.math.Matrix3.prototype;n.fill=function(t){var e=this.mat,i=t.mat;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this},n.adjugate=function(){var t=this.mat,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],o=t[5],a=t[6],c=t[7],h=t[8];return t[0]=s*h-o*c,t[1]=n*c-i*h,t[2]=i*o-n*s,t[3]=o*a-r*h,t[4]=e*h-n*a,t[5]=n*r-e*o,t[6]=r*c-s*a,t[8]=e*s-i*r,this},n.identity=function(){var t=this.mat;return t[1]=t[2]=t[3]=t[5]=t[6]=t[7]=0,t[0]=t[4]=t[8]=1,this};var r=new cc.math.Matrix3;n.inverse=function(t){if(0===t)return this;r.assignFrom(this);var e=1/t;return this.adjugate(),this.multiplyScalar(e),this},n.isIdentity=function(){var t=this.mat;return 1===t[0]&&0===t[1]&&0===t[2]&&0===t[3]&&1===t[4]&&0===t[5]&&0===t[6]&&0===t[7]&&1===t[8]},n.transpose=function(){var t=this.mat,e=t[1],i=t[2],n=t[3],r=t[5],s=t[6],o=t[7];return t[1]=n,t[2]=s,t[3]=e,t[5]=o,t[6]=i,t[7]=r,this},n.determinant=function(){var t=this.mat,e=t[0]*t[4]*t[8]+t[1]*t[5]*t[6]+t[2]*t[3]*t[7];return e-=t[2]*t[4]*t[6]+t[0]*t[5]*t[7]+t[1]*t[3]*t[8]},n.multiply=function(t){var e=this.mat,i=t.mat,n=e[0],r=e[1],s=e[2],o=e[3],a=e[4],c=e[5],h=e[6],l=e[7],u=e[8],_=i[0],d=i[1],f=i[2],m=i[3],p=i[4],g=i[5],y=i[6],v=i[7],x=i[8];return e[0]=n*_+o*d+h*f,e[1]=r*_+a*d+l*f,e[2]=s*_+c*d+u*f,e[3]=s*_+c*d+u*f,e[4]=r*m+a*p+l*g,e[5]=s*m+c*p+u*g,e[6]=n*y+o*v+h*x,e[7]=r*y+a*v+l*x,e[8]=s*y+c*v+u*x,this},n.multiplyScalar=function(t){var e=this.mat;return e[0]*=t,e[1]*=t,e[2]*=t,e[3]*=t,e[4]*=t,e[5]*=t,e[6]*=t,e[7]*=t,e[8]*=t,this},cc.math.Matrix3.rotationAxisAngle=function(t,e){var i=Math.cos(e),n=Math.sin(e),r=new cc.math.Matrix3,s=r.mat;return s[0]=i+t.x*t.x*(1-i),s[1]=t.z*n+t.y*t.x*(1-i),s[2]=-t.y*n+t.z*t.x*(1-i),s[3]=-t.z*n+t.x*t.y*(1-i),s[4]=i+t.y*t.y*(1-i),s[5]=t.x*n+t.z*t.y*(1-i),s[6]=t.y*n+t.x*t.z*(1-i),s[7]=-t.x*n+t.y*t.z*(1-i),s[8]=i+t.z*t.z*(1-i),r},n.assignFrom=function(t){if(this===t)return cc.logID(7900),this;var e=this.mat,i=t.mat;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this},n.equals=function(t){if(this===t)return!0;for(var e=cc.math.EPSILON,i=this.mat,n=t.mat,r=0;r<9;++r)if(!(i[r]+e>n[r]&&i[r]-e=c&&(c=a,_=n,u=r);if(++m[u],_!==u){for(s=0;s<4;s++)t.swap(_,s,u,s);for(s=0;s<4;s++)e.swap(_,s,u,s)}if(f[i]=_,d[i]=u,0===t.get(u,u))return!1;for(l=1/t.get(u,u),t.set(u,u,1),s=0;s<4;s++)t.set(u,s,t.get(u,s)*l);for(s=0;s<4;s++)e.set(u,s,e.get(u,s)*l);for(o=0;o<4;o++)if(o!==u){for(h=t.get(o,u),t.set(o,u,0),s=0;s<4;s++)t.set(o,s,t.get(o,s)-t.get(u,s)*h);for(s=0;s<4;s++)e.set(o,s,t.get(o,s)-e.get(u,s)*h)}}for(s=3;s>=0;s--)if(f[s]!==d[s])for(r=0;r<4;r++)t.swap(r,f[s],r,d[s]);return!0};var r=(new cc.math.Matrix4).identity();cc.math.mat4Inverse=function(t,e){var i=new cc.math.Matrix4(e),n=new cc.math.Matrix4(r);return!1===cc.math.Matrix4._gaussj(i,n)?null:(t.assignFrom(i),t)},n.inverse=function(){var t=new cc.math.Matrix4(this),e=new cc.math.Matrix4(r);return!1===cc.math.Matrix4._gaussj(t,e)?null:t},n.isIdentity=function(){var t=this.mat;return 1===t[0]&&0===t[1]&&0===t[2]&&0===t[3]&&0===t[4]&&1===t[5]&&0===t[6]&&0===t[7]&&0===t[8]&&0===t[9]&&1===t[10]&&0===t[11]&&0===t[12]&&0===t[13]&&0===t[14]&&1===t[15]},n.transpose=function(){var t=this.mat,e=t[1],i=t[2],n=t[3],r=t[4],s=t[6],o=t[7],a=t[8],c=t[9],h=t[11],l=t[12],u=t[13],_=t[14];return t[1]=r,t[2]=a,t[3]=l,t[4]=e,t[6]=c,t[7]=u,t[8]=i,t[9]=s,t[11]=_,t[12]=n,t[13]=o,t[14]=h,this},cc.math.mat4Multiply=function(t,e,i){var n=t.mat,r=e.mat,s=i.mat,o=r[0],a=r[1],c=r[2],h=r[3],l=r[4],u=r[5],_=r[6],d=r[7],f=r[8],m=r[9],p=r[10],g=r[11],y=r[12],v=r[13],x=r[14],C=r[15],T=s[0],A=s[1],b=s[2],S=s[3],E=s[4],w=s[5],I=s[6],R=s[7],P=s[8],O=s[9],D=s[10],B=s[11],L=s[12],M=s[13],N=s[14],F=s[15];return n[0]=T*o+A*l+b*f+S*y,n[1]=T*a+A*u+b*m+S*v,n[2]=T*c+A*_+b*p+S*x,n[3]=T*h+A*d+b*g+S*C,n[4]=E*o+w*l+I*f+R*y,n[5]=E*a+w*u+I*m+R*v,n[6]=E*c+w*_+I*p+R*x,n[7]=E*h+w*d+I*g+R*C,n[8]=P*o+O*l+D*f+B*y,n[9]=P*a+O*u+D*m+B*v,n[10]=P*c+O*_+D*p+B*x,n[11]=P*h+O*d+D*g+B*C,n[12]=L*o+M*l+N*f+F*y,n[13]=L*a+M*u+N*m+F*v,n[14]=L*c+M*_+N*p+F*x,n[15]=L*h+M*d+N*g+F*C,t},n.multiply=function(t){var e=this.mat,i=t.mat,n=e[0],r=e[1],s=e[2],o=e[3],a=e[4],c=e[5],h=e[6],l=e[7],u=e[8],_=e[9],d=e[10],f=e[11],m=e[12],p=e[13],g=e[14],y=e[15],v=i[0],x=i[1],C=i[2],T=i[3],A=i[4],b=i[5],S=i[6],E=i[7],w=i[8],I=i[9],R=i[10],P=i[11],O=i[12],D=i[13],B=i[14],L=i[15];return e[0]=v*n+x*a+C*u+T*m,e[1]=v*r+x*c+C*_+T*p,e[2]=v*s+x*h+C*d+T*g,e[3]=v*o+x*l+C*f+T*y,e[4]=A*n+b*a+S*u+E*m,e[5]=A*r+b*c+S*_+E*p,e[6]=A*s+b*h+S*d+E*g,e[7]=A*o+b*l+S*f+E*y,e[8]=w*n+I*a+R*u+P*m,e[9]=w*r+I*c+R*_+P*p,e[10]=w*s+I*h+R*d+P*g,e[11]=w*o+I*l+R*f+P*y,e[12]=O*n+D*a+B*u+L*m,e[13]=O*r+D*c+B*_+L*p,e[14]=O*s+D*h+B*d+L*g,e[15]=O*o+D*l+B*f+L*y,this},cc.math.getMat4MultiplyValue=function(t,e){var i=t.mat,n=e.mat,r=new Float32Array(16);return r[0]=i[0]*n[0]+i[4]*n[1]+i[8]*n[2]+i[12]*n[3],r[1]=i[1]*n[0]+i[5]*n[1]+i[9]*n[2]+i[13]*n[3],r[2]=i[2]*n[0]+i[6]*n[1]+i[10]*n[2]+i[14]*n[3],r[3]=i[3]*n[0]+i[7]*n[1]+i[11]*n[2]+i[15]*n[3],r[4]=i[0]*n[4]+i[4]*n[5]+i[8]*n[6]+i[12]*n[7],r[5]=i[1]*n[4]+i[5]*n[5]+i[9]*n[6]+i[13]*n[7],r[6]=i[2]*n[4]+i[6]*n[5]+i[10]*n[6]+i[14]*n[7],r[7]=i[3]*n[4]+i[7]*n[5]+i[11]*n[6]+i[15]*n[7],r[8]=i[0]*n[8]+i[4]*n[9]+i[8]*n[10]+i[12]*n[11],r[9]=i[1]*n[8]+i[5]*n[9]+i[9]*n[10]+i[13]*n[11],r[10]=i[2]*n[8]+i[6]*n[9]+i[10]*n[10]+i[14]*n[11],r[11]=i[3]*n[8]+i[7]*n[9]+i[11]*n[10]+i[15]*n[11],r[12]=i[0]*n[12]+i[4]*n[13]+i[8]*n[14]+i[12]*n[15],r[13]=i[1]*n[12]+i[5]*n[13]+i[9]*n[14]+i[13]*n[15],r[14]=i[2]*n[12]+i[6]*n[13]+i[10]*n[14]+i[14]*n[15],r[15]=i[3]*n[12]+i[7]*n[13]+i[11]*n[14]+i[15]*n[15],r},cc.math.mat4Assign=function(t,e){if(t===e)return cc.logID(7901),t;var i=t.mat,n=e.mat;return i[0]=n[0],i[1]=n[1],i[2]=n[2],i[3]=n[3],i[4]=n[4],i[5]=n[5],i[6]=n[6],i[7]=n[7],i[8]=n[8],i[9]=n[9],i[10]=n[10],i[11]=n[11],i[12]=n[12],i[13]=n[13],i[14]=n[14],i[15]=n[15],t},n.assignFrom=function(t){if(this===t)return cc.logID(7902),this;var e=this.mat,i=t.mat;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],this},n.equals=function(t){if(this===t)return cc.logID(7903),!0;for(var e=this.mat,i=t.mat,n=cc.math.EPSILON,r=0;r<16;r++)if(!(e[r]+n>i[r]&&e[r]-n.001?cc.math.Plane.POINT_INFRONT_OF_PLANE:e<-.001?cc.math.Plane.POINT_BEHIND_PLANE:cc.math.Plane.POINT_ON_PLANE}}),{}],253:[(function(t,e,i){cc.math.Quaternion=function(t,e,i,n){t&&void 0===e?(this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=n||0)};var n=cc.math.Quaternion.prototype;n.conjugate=function(t){return this.x=-t.x,this.y=-t.y,this.z=-t.z,this.w=t.w,this},n.dot=function(t){return this.w*t.w+this.x*t.x+this.y*t.y+this.z*t.z},n.exponential=function(){return this},n.identity=function(){return this.x=0,this.y=0,this.z=0,this.w=1,this},n.inverse=function(){var t=this.length();return Math.abs(t)>cc.math.EPSILON?(this.x=0,this.y=0,this.z=0,this.w=0,this):(this.conjugate(this).scale(1/t),this)},n.isIdentity=function(){return 0===this.x&&0===this.y&&0===this.z&&1===this.w},n.length=function(){return Math.sqrt(this.lengthSq())},n.lengthSq=function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},n.multiply=function(t){var e=this.x,i=this.y,n=this.z,r=this.w;return this.w=r*t.w-e*t.x-i*t.y-n*t.z,this.x=r*t.x+e*t.w+i*t.z-n*t.y,this.y=r*t.y+i*t.w+n*t.x-e*t.z,this.z=r*t.z+n*t.w+e*t.y-i*t.x,this},n.normalize=function(){var t=this.length();if(Math.abs(t)<=cc.math.EPSILON)throw new Error(cc._getError(7909));return this.scale(1/t),this},n.rotationAxis=function(t,e){var i=.5*e,n=Math.sin(i);return this.w=Math.cos(i),this.x=t.x*n,this.y=t.y*n,this.z=t.z*n,this},cc.math.Quaternion.rotationMatrix=function(t){if(!t)return null;var e,i,n,r,s=[],o=t.mat,a=0;s[0]=o[0],s[1]=o[3],s[2]=o[6],s[4]=o[1],s[5]=o[4],s[6]=o[7],s[8]=o[2],s[9]=o[5],s[10]=o[8],s[15]=1;var c=s[0],h=c[0]+c[5]+c[10]+1;return h>cc.math.EPSILON?(a=2*Math.sqrt(h),e=(c[9]-c[6])/a,i=(c[2]-c[8])/a,n=(c[4]-c[1])/a,r=.25*a):c[0]>c[5]&&c[0]>c[10]?(e=.25*(a=2*Math.sqrt(1+c[0]-c[5]-c[10])),i=(c[4]+c[1])/a,n=(c[2]+c[8])/a,r=(c[9]-c[6])/a):c[5]>c[10]?(a=2*Math.sqrt(1+c[5]-c[0]-c[10]),e=(c[4]+c[1])/a,i=.25*a,n=(c[9]+c[6])/a,r=(c[2]-c[8])/a):(a=2*Math.sqrt(1+c[10]-c[0]-c[5]),e=(c[2]+c[8])/a,i=(c[9]+c[6])/a,n=.25*a,r=(c[4]-c[1])/a),new cc.math.Quaternion(e,i,n,r)},cc.math.Quaternion.rotationYawPitchRoll=function(t,e,i){var n,r,s,o,a,c,h,l,u,_,d;n=cc.degreesToRadians(e)/2,r=cc.degreesToRadians(t)/2,s=cc.degreesToRadians(i)/2,o=Math.cos(n),a=Math.cos(r),c=Math.cos(s),h=Math.sin(n),_=a*c,d=(l=Math.sin(r))*(u=Math.sin(s));var f=new cc.math.Quaternion;return f.w=o*_+h*d,f.x=h*_-o*d,f.y=o*l*c+h*a*u,f.z=o*a*u-h*l*c,f.normalize(),f},n.slerp=function(t,e){if(this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w)return this;var i=this.dot(t),n=Math.acos(i),r=Math.sqrt(1-cc.math.square(i)),s=Math.sin(e*n)/r,o=Math.sin((1-e)*n)/r,a=new cc.math.Quaternion(t);return this.scale(o),a.scale(s),this.add(a),this},n.toAxisAndAngle=function(){var t,e,i,n=new cc.math.Vec3;return t=Math.acos(this.w),(e=Math.sqrt(cc.math.square(this.x)+cc.math.square(this.y)+cc.math.square(this.z)))>-cc.math.EPSILON&&e2*Math.PI-cc.math.EPSILON?(i=0,n.x=0,n.y=0,n.z=1):(i=2*t,n.x=this.x/e,n.y=this.y/e,n.z=this.z/e,n.normalize()),{axis:n,angle:i}},n.scale=function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},n.assignFrom=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this},n.add=function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this},cc.math.Quaternion.rotationBetweenVec3=function(t,e,i){var n=new cc.math.Vec3(t),r=new cc.math.Vec3(e);n.normalize(),r.normalize();var s=n.dot(r),o=new cc.math.Quaternion;if(s>=1)return o.identity(),o;if(s<1e-6-1)if(Math.abs(i.lengthSq())-cc.math.EPSILON&&fMath.max(t.x,e.x)+cc.math.EPSILON||sMath.max(t.y,e.y)+cc.math.EPSILON)&&(!(rMath.max(o,c)+cc.math.EPSILON||sMath.max(a,h)+cc.math.EPSILON)&&(i.x=r,i.y=s,!0)))},cc.math.Ray2.prototype.intersectTriangle=function(t,e,i,r,s){var o,a=new cc.math.Vec2,c=new cc.math.Vec2,h=new cc.math.Vec2,l=1e4,u=!1;return this.intersectLineSegment(t,e,a)&&(u=!0,(o=a.subtract(this.start).length())e&&t-cc.math.EPSILONt.x-cc.math.EPSILON&&this.yt.y-cc.math.EPSILON}}),{}],257:[(function(t,e,i){cc.math.Vec3=cc.math.Vec3=function(t,e,i){t&&void 0===e?(this.x=t.x,this.y=t.y,this.z=t.z):(this.x=t||0,this.y=e||0,this.z=i||0)},cc.math.vec3=function(t,e,i){return new cc.math.Vec3(t,e,i)};var n=cc.math.Vec3.prototype;n.fill=function(t,e,i){return t&&void 0===e?(this.x=t.x,this.y=t.y,this.z=t.z):(this.x=t,this.y=e,this.z=i),this},n.length=function(){return Math.sqrt(cc.math.square(this.x)+cc.math.square(this.y)+cc.math.square(this.z))},n.lengthSq=function(){return cc.math.square(this.x)+cc.math.square(this.y)+cc.math.square(this.z)},n.normalize=function(){var t=1/this.length();return this.x*=t,this.y*=t,this.z*=t,this},n.cross=function(t){var e=this.x,i=this.y,n=this.z;return this.x=i*t.z-n*t.y,this.y=n*t.x-e*t.z,this.z=e*t.y-i*t.x,this},n.dot=function(t){return this.x*t.x+this.y*t.y+this.z*t.z},n.add=function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this},n.subtract=function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this},n.transform=function(t){var e=this.x,i=this.y,n=this.z,r=t.mat;return this.x=e*r[0]+i*r[4]+n*r[8]+r[12],this.y=e*r[1]+i*r[5]+n*r[9]+r[13],this.z=e*r[2]+i*r[6]+n*r[10]+r[14],this},n.transformNormal=function(t){var e=this.x,i=this.y,n=this.z,r=t.mat;return this.x=e*r[0]+i*r[4]+n*r[8],this.y=e*r[1]+i*r[5]+n*r[9],this.z=e*r[2]+i*r[6]+n*r[10],this},n.transformCoord=function(t){var e=new cc.math.Vec4(this.x,this.y,this.z,1);return e.transform(t),this.x=e.x/e.w,this.y=e.y/e.w,this.z=e.z/e.w,this},n.scale=function(t){return this.x*=t,this.y*=t,this.z*=t,this},n.equals=function(t){var e=cc.math.EPSILON;return this.xt.x-e&&this.yt.y-e&&this.zt.z-e},n.inverseTransform=function(t){var e=t.mat,i=new cc.math.Vec3(this.x-e[12],this.y-e[13],this.z-e[14]);return this.x=i.x*e[0]+i.y*e[1]+i.z*e[2],this.y=i.x*e[4]+i.y*e[5]+i.z*e[6],this.z=i.x*e[8]+i.y*e[9]+i.z*e[10],this},n.inverseTransformNormal=function(t){var e=this.x,i=this.y,n=this.z,r=t.mat;return this.x=e*r[0]+i*r[1]+n*r[2],this.y=e*r[4]+i*r[5]+n*r[6],this.z=e*r[8]+i*r[9]+n*r[10],this},n.assignFrom=function(t){return t?(this.x=t.x,this.y=t.y,this.z=t.z,this):this},cc.math.Vec3.zero=function(t){return t.x=t.y=t.z=0,t},n.toTypeArray=function(){var t=new Float32Array(3);return t[0]=this.x,t[1]=this.y,t[2]=this.z,t}}),{}],258:[(function(t,e,i){cc.math.Vec4=function(t,e,i,n){t&&void 0===e?(this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=n||0)};var n=cc.math.Vec4.prototype;n.fill=function(t,e,i,n){t&&void 0===e?(this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w):(this.x=t,this.y=e,this.z=i,this.w=n)},n.add=function(t){return t?(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this):this},n.dot=function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},n.length=function(){return Math.sqrt(cc.math.square(this.x)+cc.math.square(this.y)+cc.math.square(this.z)+cc.math.square(this.w))},n.lengthSq=function(){return cc.math.square(this.x)+cc.math.square(this.y)+cc.math.square(this.z)+cc.math.square(this.w)},n.lerp=function(t,e){return this},n.normalize=function(){var t=1/this.length();return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},n.scale=function(t){return this.normalize(),this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},n.subtract=function(t){this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w},n.transform=function(t){var e=this.x,i=this.y,n=this.z,r=this.w,s=t.mat;return this.x=e*s[0]+i*s[4]+n*s[8]+r*s[12],this.y=e*s[1]+i*s[5]+n*s[9]+r*s[13],this.z=e*s[2]+i*s[6]+n*s[10]+r*s[14],this.w=e*s[3]+i*s[7]+n*s[11]+r*s[15],this},cc.math.Vec4.transformArray=function(t,e){for(var i=[],n=0;nt.x-e&&this.yt.y-e&&this.zt.z-e&&this.wt.w-e},n.assignFrom=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this},n.toTypeArray=function(){var t=new Float32Array(4);return t[0]=this.x,t[1]=this.y,t[2]=this.z,t[3]=this.w,t}}),{}],259:[(function(t,e,i){t("./CCSGMotionStreak"),t("./CCSGMotionStreakWebGLRenderCmd");var n=cc.Class({name:"cc.MotionStreak",extends:cc.Component,editor:!1,ctor:function(){this._root=null,this._motionStreak=null},properties:{preview:{default:!1,editorOnly:!0,notify:!1,animatable:!1},_fadeTime:1,fadeTime:{get:function(){return this._fadeTime},set:function(t){this._fadeTime=t,this._motionStreak&&this._motionStreak.setFadeTime(t)},animatable:!1,tooltip:!1},_minSeg:1,minSeg:{get:function(){return this._minSeg},set:function(t){this._minSeg=t,this._motionStreak&&this._motionStreak.setMinSeg(t)},animatable:!1,tooltip:!1},_stroke:64,stroke:{get:function(){return this._stroke},set:function(t){this._stroke=t,this._motionStreak&&this._motionStreak.setStroke(t)},animatable:!1,tooltip:!1},_texture:{default:null,type:cc.Texture2D},texture:{get:function(){return this._texture},set:function(t){this._texture=t,this._motionStreak&&this._motionStreak.setTexture(t)},type:cc.Texture2D,animatable:!1,tooltip:!1},_color:cc.Color.WHITE,color:{get:function(){return this._color},set:function(t){this._color=t,this._motionStreak&&this._motionStreak.tintWithColor(t)},tooltip:!1},_fastMode:!1,fastMode:{get:function(){return this._fastMode},set:function(t){this._fastMode=t,this._motionStreak&&this._motionStreak.setFastMode(t)},animatable:!1,tooltip:!1}},onFocusInEditor:!1,onLostFocusInEditor:!1,reset:function(){this._motionStreak.reset()},__preload:function(){if(cc._renderType===cc.game.RENDER_TYPE_WEBGL){this._root=new _ccsg.Node;var t=new _ccsg.MotionStreak;t.initWithFade(this._fadeTime,this._minSeg,this._stroke,this.node.color,this._texture),t.setFastMode(this._fastMode),this._root.addChild(t);var e=this.node._sgNode;e&&e.addChild(this._root,-10),this._motionStreak=t}else cc.warnID(5900)},onEnable:function(){this.node.on("position-changed",this._onNodePositionChanged,this)},onDisable:function(){this.node.off("position-changed",this._onNodePositionChanged,this)},_onNodePositionChanged:function(){if(this._motionStreak){var t=this.node,e=t.getNodeToWorldTransform(),i=e.tx-(t.width/2+t.anchorX*t.width),n=e.ty-(t.height/2+t.anchorY*t.height);this._root.setPosition(-i,-n),this._motionStreak.setPosition(i,n)}}});cc.MotionStreak=e.exports=n}),{"./CCSGMotionStreak":260,"./CCSGMotionStreakWebGLRenderCmd":261}],260:[(function(t,e,i){function n(t,e,i,n,s){if(!((s+=n)<=1)){var o;e*=.5;for(var a=s-1,c=n;c1)&&(T=!0),T&&(i[2*p]=x.x,i[2*p+1]=x.y,i[2*(p+1)]=v.x,i[2*(p+1)+1]=v.y)}}}function r(t,e,i,n,r,s,o,a){var c,h,l,u;return t===i&&e===n||r===o&&s===a?{isSuccess:!1,value:0}:(n-=e,s-=e,o-=t,a-=e,u=(r-=t)*(h=(i-=t)/(c=Math.sqrt(i*i+n*n)))+s*(l=n/c),s=s*h-r*l,r=u,u=o*h+a*l,a=a*h-o*l,o=u,s===a?{isSuccess:!1,value:0}:{isSuccess:!0,value:(o+(r-o)*a/(a-s))/c})}_ccsg.MotionStreak=_ccsg.Node.extend({texture:null,fastMode:!1,startingPositionInitialized:!1,_blendFunc:null,_stroke:0,_fadeDelta:0,_minSeg:0,_maxPoints:0,_nuPoints:0,_previousNuPoints:0,_pointVertexes:null,_pointState:null,_vertices:null,_colorPointer:null,_texCoords:null,_verticesBuffer:null,_colorPointerBuffer:null,_texCoordsBuffer:null,_className:"MotionStreak",ctor:function(){_ccsg.Node.prototype.ctor.call(this),this._positionR=cc.p(0,0),this._blendFunc=new cc.BlendFunc(cc.SRC_ALPHA,cc.ONE_MINUS_SRC_ALPHA),this.fastMode=!1,this.startingPositionInitialized=!1,this.texture=null,this._stroke=0,this._fadeDelta=0,this._minSeg=0,this._maxPoints=0,this._nuPoints=0,this._previousNuPoints=0,this._pointVertexes=null,this._pointState=null,this._vertices=null,this._colorPointer=null,this._texCoords=null,this._verticesBuffer=null,this._colorPointerBuffer=null,this._texCoordsBuffer=null},initWithFade:function(t,e,i,n,r){return this.anchorX=0,this.anchorY=0,this.ignoreAnchor=!0,this.startingPositionInitialized=!1,this.fastMode=!0,this._stroke=i,this.setMinSeg(e),this.setFadeTime(t),this._blendFunc.src=gl.SRC_ALPHA,this._blendFunc.dst=gl.ONE_MINUS_SRC_ALPHA,this.setTexture(r),this.color=n,this.scheduleUpdate(),!0},getTexture:function(){return this.texture},setTexture:function(t){this.texture!==t&&(this.texture=t)},getBlendFunc:function(){return this._blendFunc},setBlendFunc:function(t,e){void 0===e?this._blendFunc=t:(this._blendFunc.src=t,this._blendFunc.dst=e)},getOpacity:function(){return cc.logID(5901),0},setOpacity:function(t){cc.logID(5902)},setOpacityModifyRGB:function(t){},isOpacityModifyRGB:function(){return!1},getFadeTime:function(){return 1/this._fadeDelta},setFadeTime:function(t){this._fadeDelta=1/t;var e=2+(0|60*t);this._maxPoints=e,this._nuPoints=0,this._pointState=new Float32Array(e),this._pointVertexes=new Float32Array(2*e),this._vertices=new Float32Array(4*e),this._texCoords=new Float32Array(4*e),this._colorPointer=new Uint8Array(8*e),this._verticesBuffer=gl.createBuffer(),this._texCoordsBuffer=gl.createBuffer(),this._colorPointerBuffer=gl.createBuffer(),gl.bindBuffer(gl.ARRAY_BUFFER,this._verticesBuffer),gl.bufferData(gl.ARRAY_BUFFER,this._vertices,gl.DYNAMIC_DRAW),gl.bindBuffer(gl.ARRAY_BUFFER,this._texCoordsBuffer),gl.bufferData(gl.ARRAY_BUFFER,this._texCoords,gl.DYNAMIC_DRAW),gl.bindBuffer(gl.ARRAY_BUFFER,this._colorPointerBuffer),gl.bufferData(gl.ARRAY_BUFFER,this._colorPointer,gl.DYNAMIC_DRAW)},getMinSeg:function(){return this._minSeg},setMinSeg:function(t){this._minSeg=-1===t?this._stroke/5:t,this._minSeg*=this._minSeg},isFastMode:function(){return this.fastMode},setFastMode:function(t){this.fastMode=t},isStartingPositionInitialized:function(){return this.startingPositionInitialized},setStartingPositionInitialized:function(t){this.startingPositionInitialized=t},getStroke:function(){return this._stroke},setStroke:function(t){this._stroke=t},tintWithColor:function(t){this.color=t;for(var e=this._colorPointer,i=0,n=2*this._nuPoints;i0?(c[e]=c[r],h[2*e]=h[2*r],h[2*e+1]=h[2*r+1],s=2*r,l[2*(i=2*e)]=l[2*s],l[2*i+1]=l[2*s+1],l[2*(i+1)]=l[2*(s+1)],l[2*(i+1)+1]=l[2*(s+1)+1],s*=4,u[(i*=4)+0]=u[s+0],u[i+1]=u[s+1],u[i+2]=u[s+2],u[i+4]=u[s+4],u[i+5]=u[s+5],u[i+6]=u[s+6]):i=8*e;var _=255*c[e];u[i+3]=_,u[i+7]=_}var d=!0;if((a-=o)>=this._maxPoints)d=!1;else if(a>0){var f=cc.p(h[2*(a-1)],h[2*(a-1)+1]),m=cc.pDistanceSQ(f,this._positionR)0&&this.fastMode&&(a>1?n(h,this._stroke,this._vertices,a,1):n(h,this._stroke,this._vertices,0,2)),a++}if(this.fastMode||n(h,this._stroke,this._vertices,0,a),a&&this._previousNuPoints!==a){var x=1/a,C=this._texCoords;for(r=0;re;0<=e?++u:--u)t.push(this.data[this.pos++]);break;case"tRNS":switch(this.transparency={},this.colorType){case 3:if(this.transparency.indexed=this.read(e),(h=255-this.transparency.indexed.length)>0)for(_=0;0<=h?_h;0<=h?++_:--_)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(e)[0];break;case 2:this.transparency.rgb=this.read(e)}break;case"tEXt":o=(l=this.read(e)).indexOf(0),a=String.fromCharCode.apply(String,l.slice(0,o)),this.text[a]=String.fromCharCode.apply(String,l.slice(o+1));break;case"IEND":return s&&this.animation.frames.push(s),this.colors=function(){switch(this.colorType){case 0:case 3:case 4:return 1;case 2:case 6:return 3}}.call(this),this.hasAlphaChannel=4===(d=this.colorType)||6===d,i=this.colors+(this.hasAlphaChannel?1:0),this.pixelBitlength=this.bits*i,this.colorSpace=function(){switch(this.colors){case 1:return"DeviceGray";case 3:return"DeviceRGB"}}.call(this),void(Uint8Array!=Array&&(this.imgData=new Uint8Array(this.imgData)));default:this.pos+=e}if(this.pos+=4,this.pos>this.data.length)throw new Error(cc._getError(6017))}},read:function(t){var e,i;for(i=[],e=0;0<=t?et;0<=t?++e:--e)i.push(this.data[this.pos++]);return i},readUInt32:function(){return this.data[this.pos++]<<24|this.data[this.pos++]<<16|this.data[this.pos++]<<8|this.data[this.pos++]},readUInt16:function(){return this.data[this.pos++]<<8|this.data[this.pos++]},decodePixels:function(t){var e,i,r,s,o,a,c,h,l,u,_,d,f,m,p,g,y,v,x,C,T,A,b;if(null==t&&(t=this.imgData),0===t.length)return new Uint8Array(0);for(t=new n.Inflate(t,{index:0,verify:!1}).decompress(),g=(d=this.pixelBitlength/8)*this.width,f=new Uint8Array(g*this.height),a=t.length,p=0,m=0,i=0;m=this._totalParticles},setDisplayFrame:function(t){if(t){var e=t.getTexture();e&&(this._texture=e),this._sgNode.setDisplayFrame(t)}},setTextureWithRect:function(t,e){this._texture=t,this._sgNode.setTextureWithRect(t,e)},_applyFile:function(){var t=this._file;if(t){var e=this;cc.loader.load(t.nativeUrl,(function(i,n){if(i||!n)throw i||new Error(cc._getError(6029));if(e.isValid){var r=e._sgNode;r.particleCount=0;var s=r.isActive();r.initWithFile(t.nativeUrl),n.textureUuid?cc.loader.load({uuid:n.textureUuid,type:"uuid"},(function(t,i){t?cc.error(t):e.texture=i})):!n.textureImageData&&t.texture&&(r.texture=t.texture),n.emissionRate&&(e.emissionRate=n.emissionRate),r.setPosition(0,0),s||r.stopSystem(),e._applyAutoRemove(),e._custom&&e._applyCustoms()}}))}},_applyCustoms:function(){for(var t=this._sgNode,e=t.isActive(),i=0;i=this._totalParticles},updateQuadWithParticle:function(t,e){this._renderCmd.updateQuadWithParticle(t,e)},postStep:function(){this._renderCmd.postStep()},update:function(t){if(this._renderCmd.setDirtyFlag(_ccsg.Node._dirtyFlags.contentDirty),this._isActive&&this.emissionRate){var e=1/this.emissionRate;for(this.particleCounte;)this.addParticle(),this._emitCounter-=e;this._elapsed+=t,-1!==this.duration&&this.duration0){if(this.emitterMode===_ccsg.ParticleSystem.Mode.GRAVITY){var h=o,l=r,u=s;c.pos.x||c.pos.y?(cc.pIn(l,c.pos),cc.pNormalizeIn(l)):cc.pZeroIn(l),cc.pIn(u,l),cc.pMultIn(l,c.modeA.radialAccel);var _=u.x;u.x=-u.y,u.y=_,cc.pMultIn(u,c.modeA.tangentialAccel),cc.pIn(h,l),cc.pAddIn(h,u),cc.pAddIn(h,this.modeA.gravity),cc.pMultIn(h,t),cc.pAddIn(c.modeA.dir,h),cc.pIn(h,c.modeA.dir),cc.pMultIn(h,t),cc.pAddIn(c.pos,h)}else{var d=c.modeB;d.angle+=d.degreesPerSecond*t,d.radius+=d.deltaRadius*t,c.pos.x=-Math.cos(d.angle)*d.radius,c.pos.y=-Math.sin(d.angle)*d.radius}this._renderCmd._updateDeltaColor(c,t),c.size+=c.deltaSize*t,c.size=Math.max(0,c.size),c.rotation+=c.deltaRotation*t;var f=r;if(this.positionType===_ccsg.ParticleSystem.Type.FREE||this.positionType===_ccsg.ParticleSystem.Type.RELATIVE){var m=s,p=o;cc._pointApplyAffineTransformIn(n,i,m),cc._pointApplyAffineTransformIn(c.startPos,i,p),cc.pSubIn(m,p),cc.pIn(f,c.pos),cc.pSubIn(f,m)}else cc.pIn(f,c.pos);this._renderCmd.updateParticlePosition(c,f),++this._particleIdx}else{if(this._particleIdx!==this.particleCount-1){var g=a[this._particleIdx];a[this._particleIdx]=a[this.particleCount-1],a[this.particleCount-1]=g}if(--this.particleCount,0===this.particleCount&&this.autoRemoveOnFinish)return this.unscheduleUpdate(),this._parent.removeChild(this,!0),void(this._renderCmd.updateLocalBB&&this._renderCmd.updateLocalBB())}}this._renderCmd.updateLocalBB&&this._renderCmd.updateLocalBB()}this.postStep()},updateWithNoTime:function(){this.update(0)},_valueForKey:function(t,e){if(e){var i=e[t];return null!=i?i:""}return""},_updateBlendFunc:function(){var t=this._texture;if(t&&t instanceof cc.Texture2D){this._opacityModifyRGB=!1;var e=this._blendFunc;e.src===cc.macro.BLEND_SRC&&e.dst===cc.macro.BLEND_DST&&(t.hasPremultipliedAlpha()?this._opacityModifyRGB=!0:(e.src=cc.macro.SRC_ALPHA,e.dst=cc.macro.ONE_MINUS_SRC_ALPHA))}},clone:function(){var t=new _ccsg.ParticleSystem;if(t.initWithTotalParticles(this.getTotalParticles())){t.setAngle(this.getAngle()),t.setAngleVar(this.getAngleVar()),t.setDuration(this.getDuration());var e=this.getBlendFunc();if(t.setBlendFunc(e.src,e.dst),t.setStartColor(this.getStartColor()),t.setStartColorVar(this.getStartColorVar()),t.setEndColor(this.getEndColor()),t.setEndColorVar(this.getEndColorVar()),t.setStartSize(this.getStartSize()),t.setStartSizeVar(this.getStartSizeVar()),t.setEndSize(this.getEndSize()),t.setEndSizeVar(this.getEndSizeVar()),t.setPosition(cc.p(this.x,this.y)),t.setPosVar(cc.p(this.getPosVar().x,this.getPosVar().y)),t.setPositionType(this.getPositionType()),t.setStartSpin(this.getStartSpin()||0),t.setStartSpinVar(this.getStartSpinVar()||0),t.setEndSpin(this.getEndSpin()||0),t.setEndSpinVar(this.getEndSpinVar()||0),t.setEmitterMode(this.getEmitterMode()),this.getEmitterMode()===_ccsg.ParticleSystem.Mode.GRAVITY){var i=this.getGravity();t.setGravity(cc.p(i.x,i.y)),t.setSpeed(this.getSpeed()),t.setSpeedVar(this.getSpeedVar()),t.setRadialAccel(this.getRadialAccel()),t.setRadialAccelVar(this.getRadialAccelVar()),t.setTangentialAccel(this.getTangentialAccel()),t.setTangentialAccelVar(this.getTangentialAccelVar())}else this.getEmitterMode()===_ccsg.ParticleSystem.Mode.RADIUS&&(t.setStartRadius(this.getStartRadius()),t.setStartRadiusVar(this.getStartRadiusVar()),t.setEndRadius(this.getEndRadius()),t.setEndRadiusVar(this.getEndRadiusVar()),t.setRotatePerSecond(this.getRotatePerSecond()),t.setRotatePerSecondVar(this.getRotatePerSecondVar()));t.setLife(this.getLife()),t.setLifeVar(this.getLifeVar()),t.setEmissionRate(this.getEmissionRate()),t.setOpacityModifyRGB(this.isOpacityModifyRGB());var n=this.getTexture();if(n){var r=n.getContentSize();t.setTextureWithRect(n,cc.rect(0,0,r.width,r.height))}}return t},setDisplayFrame:function(t){if(t){var e=t.getOffset();0===e.x&&0===e.y||cc.logID(6015);var i=t.getTexture();this._texture!==i&&this.setTexture(i)}},setTextureWithRect:function(t,e){this._texture!==t&&(this._texture=t,this._updateBlendFunc()),this.initTexCoordsWithRect(e)},listenBackToForeground:function(t){}});var s=_ccsg.ParticleSystem.prototype;s.opacityModifyRGB,cc.defineGetterSetter(s,"opacityModifyRGB",s.isOpacityModifyRGB,s.setOpacityModifyRGB),s.active,cc.defineGetterSetter(s,"active",s.isActive),s.sourcePos,cc.defineGetterSetter(s,"sourcePos",s.getSourcePosition,s.setSourcePosition),s.posVar,cc.defineGetterSetter(s,"posVar",s.getPosVar,s.setPosVar),s.gravity,cc.defineGetterSetter(s,"gravity",s.getGravity,s.setGravity),s.speed,cc.defineGetterSetter(s,"speed",s.getSpeed,s.setSpeed),s.speedVar,cc.defineGetterSetter(s,"speedVar",s.getSpeedVar,s.setSpeedVar),s.tangentialAccel,cc.defineGetterSetter(s,"tangentialAccel",s.getTangentialAccel,s.setTangentialAccel),s.tangentialAccelVar,cc.defineGetterSetter(s,"tangentialAccelVar",s.getTangentialAccelVar,s.setTangentialAccelVar),s.radialAccel,cc.defineGetterSetter(s,"radialAccel",s.getRadialAccel,s.setRadialAccel),s.radialAccelVar,cc.defineGetterSetter(s,"radialAccelVar",s.getRadialAccelVar,s.setRadialAccelVar),s.rotationIsDir,cc.defineGetterSetter(s,"rotationIsDir",s.getRotationIsDir,s.setRotationIsDir),s.startRadius,cc.defineGetterSetter(s,"startRadius",s.getStartRadius,s.setStartRadius),s.startRadiusVar,cc.defineGetterSetter(s,"startRadiusVar",s.getStartRadiusVar,s.setStartRadiusVar),s.endRadius,cc.defineGetterSetter(s,"endRadius",s.getEndRadius,s.setEndRadius),s.endRadiusVar,cc.defineGetterSetter(s,"endRadiusVar",s.getEndRadiusVar,s.setEndRadiusVar),s.rotatePerS,cc.defineGetterSetter(s,"rotatePerS",s.getRotatePerSecond,s.setRotatePerSecond),s.rotatePerSVar,cc.defineGetterSetter(s,"rotatePerSVar",s.getRotatePerSecondVar,s.setRotatePerSecondVar),s.startColor,cc.defineGetterSetter(s,"startColor",s.getStartColor,s.setStartColor),s.startColorVar,cc.defineGetterSetter(s,"startColorVar",s.getStartColorVar,s.setStartColorVar),s.endColor,cc.defineGetterSetter(s,"endColor",s.getEndColor,s.setEndColor),s.endColorVar,cc.defineGetterSetter(s,"endColorVar",s.getEndColorVar,s.setEndColorVar),s.totalParticles,cc.defineGetterSetter(s,"totalParticles",s.getTotalParticles,s.setTotalParticles),s.texture,cc.defineGetterSetter(s,"texture",s.getTexture,s.setTexture),_ccsg.ParticleSystem.ModeA=function(t,e,i,n,r,s,o,a){this.gravity=t||cc.p(0,0),this.speed=e||0,this.speedVar=i||0,this.tangentialAccel=n||0,this.tangentialAccelVar=r||0,this.radialAccel=s||0,this.radialAccelVar=o||0,this.rotationIsDir=a||!1},_ccsg.ParticleSystem.ModeB=function(t,e,i,n,r,s){this.startRadius=t||0,this.startRadiusVar=e||0,this.endRadius=i||0,this.endRadiusVar=n||0,this.rotatePerSecond=r||0,this.rotatePerSecondVar=s||0},_ccsg.ParticleSystem.DURATION_INFINITY=-1,_ccsg.ParticleSystem.START_SIZE_EQUAL_TO_END_SIZE=-1,_ccsg.ParticleSystem.START_RADIUS_EQUAL_TO_END_RADIUS=-1,_ccsg.ParticleSystem.Mode=cc.Enum({GRAVITY:0,RADIUS:1}),_ccsg.ParticleSystem.Type=cc.Enum({FREE:0,RELATIVE:1,GROUPED:2})}),{"../compression/ZipUtils":28,"../core/platform/CCSAXParser.js":185,"./CCPNGReader":262,"./CCTIFFReader":268}],266:[(function(t,e,i){_ccsg.ParticleSystem.CanvasRenderCmd=function(t){this._rootCtor(t),this._needDraw=!0,this._pointRect=cc.rect(0,0,0,0),this._localRegion=new cc.Region,this._tintCache=null};var n=_ccsg.ParticleSystem.CanvasRenderCmd.prototype=Object.create(_ccsg.Node.CanvasRenderCmd.prototype);n.constructor=_ccsg.ParticleSystem.CanvasRenderCmd,n.updateQuadWithParticle=function(t,e){},n.updateParticlePosition=function(t,e){cc.pIn(t.drawPos,e)};var r=new cc.Region,s=new cc.Rect;n.updateLocalBB=function(){var t=this._localRegion,e=this._node._particles;t.setEmpty();for(var i=e.length-1;i>=0;--i){var n=e[i],o=n.drawPos,a=1.415*n.size;r.setTo(o.x-a,o.y-a,o.x+a,o.y+a),t.union(r)}s.x=t._minX,s.y=t._minY,s.width=t._maxX-t._minX,s.height=t._maxY-t._minY},n.getLocalBB=function(){return s},n.updateStatus=function(){this.originUpdateStatus(),this._updateCurrentRegions(),this._regionFlag=_ccsg.Node.CanvasRenderCmd.RegionStatus.DirtyDouble,this._dirtyFlag&=~_ccsg.Node._dirtyFlags.contentDirty},n.rendering=function(t,e,i){var n,r,s,o=t||cc._renderContext,a=o.getContext(),c=this._node,h=this._pointRect;o.setTransform(this._worldTransform,e,i),o.save(),c.isBlendAdditive()?a.globalCompositeOperation="lighter":a.globalCompositeOperation="source-over";var l=this._node.particleCount,u=this._node._particles;if(c._texture){if(!c._texture.loaded)return void o.restore();var _=c._texture.getHtmlElementObj();if(!_.width||!_.height)return void o.restore();var d=_;for(n=0;ne._allocatedParticles){var i=cc.V3F_C4B_T2F_Quad.BYTES_PER_ELEMENT;this._indices=new Uint16Array(6*t);var n=new ArrayBuffer(t*i),r=e._particles;r.length=0;var s=this._quads;s.length=0;for(var o=0;o>>8*(4-s)):r.push(n);else for(var o=0;o=8?-1!==["RATIONAL","SRATIONAL"].indexOf(e)?(r.push(this.getUint32(n+a)),r.push(this.getUint32(n+a+4))):cc.logID(8e3):r.push(this.getBytes(s,n+a))}return"ASCII"===e&&r.forEach((function(t,e,i){i[e]=String.fromCharCode(t)})),r},getBytes:function(t,e){if(t<=0)cc.logID(8001);else{if(t<=1)return this.getUint8(e);if(t<=2)return this.getUint16(e);if(t<=3)return this.getUint32(e)>>>8;if(t<=4)return this.getUint32(e);cc.logID(8002)}},getBits:function(t,e,i){i=i||0;var n,r,s=e+Math.floor(i/8),o=i+t,a=32-t;return o<=0?cc.logID(6023):o<=8?(n=24+i,r=this.getUint8(s)):o<=16?(n=16+i,r=this.getUint16(s)):o<=32?(n=i,r=this.getUint32(s)):cc.logID(6022),{bits:r<>>a,byteOffset:s+Math.floor(o/8),bitOffset:o%8}},parseFileDirectory:function(t){for(var e=this.getUint16(t),i=[],n=t+2,r=0;r=0&&D<=127?P=D+1:D>=-127&&D<=-1?O=1-D:T=!0}else{var B=this.getUint8(g+v);for(w=0;w0)for(var it=0;it"},_compileShader:function(t,e,i){if(!i||!t)return!1;i=(cc.GLProgram._isHighpSupported()?"precision highp float;\n":"precision mediump float;\n")+"uniform mat4 CC_PMatrix;\nuniform mat4 CC_MVMatrix;\nuniform mat4 CC_MVPMatrix;\nuniform vec4 CC_Time;\nuniform vec4 CC_SinTime;\nuniform vec4 CC_CosTime;\nuniform vec4 CC_Random01;\nuniform sampler2D CC_Texture0;\n//CC INCLUDES END\n"+i,this._glContext.shaderSource(t,i),this._glContext.compileShader(t);var n=this._glContext.getShaderParameter(t,this._glContext.COMPILE_STATUS);return n||(cc.logID(8100,this._glContext.getShaderSource(t)),e===this._glContext.VERTEX_SHADER?cc.log("cocos2d: \n"+this.vertexShaderLog()):cc.log("cocos2d: \n"+this.fragmentShaderLog())),!!n},ctor:function(t,e,i){this._uniforms={},this._hashForUniforms={},this._glContext=i||cc._renderContext,this._programObj=null,this._vertShader=null,this._fragShader=null,this._usesTime=!1,this._projectionUpdated=-1,t&&e&&this.init(t,e)},destroyProgram:function(){this._vertShader=null,this._fragShader=null,this._uniforms=null,this._hashForUniforms=null,this._glContext.deleteProgram(this._programObj)},initWithVertexShaderByteArray:function(t,e){var i=this._glContext;for(var n in this._programObj=i.createProgram(),this._projectionUpdated=-1,this._vertShader=null,this._fragShader=null,t&&(this._vertShader=i.createShader(i.VERTEX_SHADER),this._compileShader(this._vertShader,i.VERTEX_SHADER,t)||cc.logID(8101)),e&&(this._fragShader=i.createShader(i.FRAGMENT_SHADER),this._compileShader(this._fragShader,i.FRAGMENT_SHADER,e)||cc.logID(8102)),this._vertShader&&i.attachShader(this._programObj,this._vertShader),this._fragShader&&i.attachShader(this._programObj,this._fragShader),this._hashForUniforms)delete this._hashForUniforms[n];return!0},initWithString:function(t,e){return this.initWithVertexShaderByteArray(t,e)},initWithVertexShaderFilename:function(t,e){var i=cc.loader.getRes(t);if(!i)throw new Error(cc._getError(8106,t));var n=cc.loader.getRes(e);if(!n)throw new Error(cc._getError(8106,e));return this.initWithVertexShaderByteArray(i,n)},init:function(t,e){return this.initWithVertexShaderFilename(t,e)},addAttribute:function(t,e){this._glContext.bindAttribLocation(this._programObj,e,t)},link:function(){if(!this._programObj)return cc.logID(8103),!1;if((this._glContext.linkProgram(this._programObj),this._vertShader&&this._glContext.deleteShader(this._vertShader),this._fragShader&&this._glContext.deleteShader(this._fragShader),this._vertShader=null,this._fragShader=null,cc.game.config[cc.game.CONFIG_KEY.debugMode])&&!this._glContext.getProgramParameter(this._programObj,this._glContext.LINK_STATUS))return cc.logID(8104,this._glContext.getProgramInfoLog(this._programObj)),cc.gl.deleteProgram(this._programObj),this._programObj=null,!1;return!0},use:function(){cc.gl.useProgram(this._programObj)},updateUniforms:function(){this._uniforms[n.UNIFORM_PMATRIX]=this._glContext.getUniformLocation(this._programObj,n.UNIFORM_PMATRIX_S),this._uniforms[n.UNIFORM_MVMATRIX]=this._glContext.getUniformLocation(this._programObj,n.UNIFORM_MVMATRIX_S),this._uniforms[n.UNIFORM_MVPMATRIX]=this._glContext.getUniformLocation(this._programObj,n.UNIFORM_MVPMATRIX_S),this._uniforms[n.UNIFORM_TIME]=this._glContext.getUniformLocation(this._programObj,n.UNIFORM_TIME_S),this._uniforms[n.UNIFORM_SINTIME]=this._glContext.getUniformLocation(this._programObj,n.UNIFORM_SINTIME_S),this._uniforms[n.UNIFORM_COSTIME]=this._glContext.getUniformLocation(this._programObj,n.UNIFORM_COSTIME_S),this._usesTime=null!=this._uniforms[n.UNIFORM_TIME]||null!=this._uniforms[n.UNIFORM_SINTIME]||null!=this._uniforms[n.UNIFORM_COSTIME],this._uniforms[n.UNIFORM_RANDOM01]=this._glContext.getUniformLocation(this._programObj,n.UNIFORM_RANDOM01_S),this._uniforms[n.UNIFORM_SAMPLER]=this._glContext.getUniformLocation(this._programObj,n.UNIFORM_SAMPLER_S),this.use(),this.setUniformLocationWith1i(this._uniforms[n.UNIFORM_SAMPLER],0)},_addUniformLocation:function(t){var e=this._glContext.getUniformLocation(this._programObj,t);this._uniforms[t]=e},getUniformLocationForName:function(t){if(!t)throw new Error(cc._getError(8107));if(!this._programObj)throw new Error(cc._getError(8108));return this._uniforms[t]||this._glContext.getUniformLocation(this._programObj,t)},getUniformMVPMatrix:function(){return this._uniforms[n.UNIFORM_MVPMATRIX]},getUniformSampler:function(){return this._uniforms[n.UNIFORM_SAMPLER]},setUniformLocationWith1i:function(t,e){var i=this._glContext;if("string"==typeof t){if(this._updateUniformLocation(t,e)){var n=this.getUniformLocationForName(t);i.uniform1i(n,e)}}else i.uniform1i(t,e)},setUniformLocationWith2i:function(t,e,i){var n=this._glContext;if("string"==typeof t){if(this._updateUniformLocation(t,e,i)){var r=this.getUniformLocationForName(t);n.uniform2i(r,e,i)}}else n.uniform2i(t,e,i)},setUniformLocationWith3i:function(t,e,i,n){var r=this._glContext;if("string"==typeof t){if(this._updateUniformLocation(t,e,i,n)){var s=this.getUniformLocationForName(t);r.uniform3i(s,e,i,n)}}else r.uniform3i(t,e,i,n)},setUniformLocationWith4i:function(t,e,i,n,r){var s=this._glContext;if("string"==typeof t){if(this._updateUniformLocation(t,e,i,n,r)){var o=this.getUniformLocationForName(t);s.uniform4i(o,e,i,n,r)}}else s.uniform4i(t,e,i,n,r)},setUniformLocationWith2iv:function(t,e){var i="string"==typeof t?this.getUniformLocationForName(t):t;this._glContext.uniform2iv(i,e)},setUniformLocationWith3iv:function(t,e){var i="string"==typeof t?this.getUniformLocationForName(t):t;this._glContext.uniform3iv(i,e)},setUniformLocationWith4iv:function(t,e){var i="string"==typeof t?this.getUniformLocationForName(t):t;this._glContext.uniform4iv(i,e)},setUniformLocationI32:function(t,e){this.setUniformLocationWith1i(t,e)},setUniformLocationWith1f:function(t,e){var i=this._glContext;if("string"==typeof t){if(this._updateUniformLocation(t,e)){var n=this.getUniformLocationForName(t);i.uniform1f(n,e)}}else i.uniform1f(t,e)},setUniformLocationWith2f:function(t,e,i){var n=this._glContext;if("string"==typeof t){if(this._updateUniformLocation(t,e,i)){var r=this.getUniformLocationForName(t);n.uniform2f(r,e,i)}}else n.uniform2f(t,e,i)},setUniformLocationWith3f:function(t,e,i,n){var r=this._glContext;if("string"==typeof t){if(this._updateUniformLocation(t,e,i,n)){var s=this.getUniformLocationForName(t);r.uniform3f(s,e,i,n)}}else r.uniform3f(t,e,i,n)},setUniformLocationWith4f:function(t,e,i,n,r){var s=this._glContext;if("string"==typeof t){if(this._updateUniformLocation(t,e,i,n,r)){var o=this.getUniformLocationForName(t);s.uniform4f(o,e,i,n,r)}}else s.uniform4f(t,e,i,n,r)},setUniformLocationWith2fv:function(t,e){var i="string"==typeof t?this.getUniformLocationForName(t):t;this._glContext.uniform2fv(i,e)},setUniformLocationWith3fv:function(t,e){var i="string"==typeof t?this.getUniformLocationForName(t):t;this._glContext.uniform3fv(i,e)},setUniformLocationWith4fv:function(t,e){var i="string"==typeof t?this.getUniformLocationForName(t):t;this._glContext.uniform4fv(i,e)},setUniformLocationWithMatrix3fv:function(t,e){var i="string"==typeof t?this.getUniformLocationForName(t):t;this._glContext.uniformMatrix3fv(i,!1,e)},setUniformLocationWithMatrix4fv:function(t,e){var i="string"==typeof t?this.getUniformLocationForName(t):t;this._glContext.uniformMatrix4fv(i,!1,e)},setUniformLocationF32:function(t,e,i,n,r){"use strict";switch(arguments.length){case 0:case 1:return;case 2:this.setUniformLocationWith1f(t,e);break;case 3:this.setUniformLocationWith2f(t,e,i);break;case 4:this.setUniformLocationWith3f(t,e,i,n);break;case 5:this.setUniformLocationWith4f(t,e,i,n,r)}},setUniformsForBuiltins:function(){var t=new r.Matrix4,e=new r.Matrix4,i=new r.Matrix4;if(r.glGetMatrix(r.KM_GL_PROJECTION,t),r.glGetMatrix(r.KM_GL_MODELVIEW,e),r.mat4Multiply(i,t,e),this.setUniformLocationWithMatrix4fv(this._uniforms[n.UNIFORM_PMATRIX],t.mat,1),this.setUniformLocationWithMatrix4fv(this._uniforms[n.UNIFORM_MVMATRIX],e.mat,1),this.setUniformLocationWithMatrix4fv(this._uniforms[n.UNIFORM_MVPMATRIX],i.mat,1),this._usesTime){var s=cc.director,o=s.getTotalFrames()*s.getAnimationInterval();this.setUniformLocationWith4f(this._uniforms[n.UNIFORM_TIME],o/10,o,2*o,4*o),this.setUniformLocationWith4f(this._uniforms[n.UNIFORM_SINTIME],o/8,o/4,o/2,Math.sin(o)),this.setUniformLocationWith4f(this._uniforms[n.UNIFORM_COSTIME],o/8,o/4,o/2,Math.cos(o))}-1!==this._uniforms[n.UNIFORM_RANDOM01]&&this.setUniformLocationWith4f(this._uniforms[n.UNIFORM_RANDOM01],Math.random(),Math.random(),Math.random(),Math.random())},_setUniformsForBuiltinsForRenderer:function(t){if(t&&t._renderCmd){var e=new r.Matrix4,i=new r.Matrix4;if(r.glGetMatrix(r.KM_GL_PROJECTION,e),r.mat4Multiply(i,e,t._renderCmd._stackMatrix),this.setUniformLocationWithMatrix4fv(this._uniforms[n.UNIFORM_PMATRIX],e.mat,1),this.setUniformLocationWithMatrix4fv(this._uniforms[n.UNIFORM_MVMATRIX],t._renderCmd._stackMatrix.mat,1),this.setUniformLocationWithMatrix4fv(this._uniforms[n.UNIFORM_MVPMATRIX],i.mat,1),this._usesTime){var s=cc.director,o=s.getTotalFrames()*s.getAnimationInterval();this.setUniformLocationWith4f(this._uniforms[n.UNIFORM_TIME],o/10,o,2*o,4*o),this.setUniformLocationWith4f(this._uniforms[n.UNIFORM_SINTIME],o/8,o/4,o/2,Math.sin(o)),this.setUniformLocationWith4f(this._uniforms[n.UNIFORM_COSTIME],o/8,o/4,o/2,Math.cos(o))}-1!==this._uniforms[n.UNIFORM_RANDOM01]&&this.setUniformLocationWith4f(this._uniforms[n.UNIFORM_RANDOM01],Math.random(),Math.random(),Math.random(),Math.random())}},setUniformForModelViewProjectionMatrix:function(){this._glContext.uniformMatrix4fv(this._uniforms[n.UNIFORM_MVPMATRIX],!1,r.getMat4MultiplyValue(r.projection_matrix_stack.top,r.modelview_matrix_stack.top))},setUniformForModelViewProjectionMatrixWithMat4:function(t){r.mat4Multiply(t,r.projection_matrix_stack.top,r.modelview_matrix_stack.top),this._glContext.uniformMatrix4fv(this._uniforms[n.UNIFORM_MVPMATRIX],!1,t.mat)},setUniformForModelViewAndProjectionMatrixWithMat4:function(){this._glContext.uniformMatrix4fv(this._uniforms[n.UNIFORM_MVMATRIX],!1,r.modelview_matrix_stack.top.mat),this._glContext.uniformMatrix4fv(this._uniforms[n.UNIFORM_PMATRIX],!1,r.projection_matrix_stack.top.mat)},_setUniformForMVPMatrixWithMat4:function(t){if(!t)throw new Error(cc._getError(8109));this._glContext.uniformMatrix4fv(this._uniforms[n.UNIFORM_MVMATRIX],!1,t.mat),this._glContext.uniformMatrix4fv(this._uniforms[n.UNIFORM_PMATRIX],!1,r.projection_matrix_stack.top.mat)},_updateProjectionUniform:function(){var t=r.projection_matrix_stack;t.lastUpdated!==this._projectionUpdated&&(this._glContext.uniformMatrix4fv(this._uniforms[n.UNIFORM_PMATRIX],!1,t.top.mat),this._projectionUpdated=t.lastUpdated)},vertexShaderLog:function(){return this._glContext.getShaderInfoLog(this._vertShader)},getVertexShaderLog:function(){return this._glContext.getShaderInfoLog(this._vertShader)},getFragmentShaderLog:function(){return this._glContext.getShaderInfoLog(this._vertShader)},fragmentShaderLog:function(){return this._glContext.getShaderInfoLog(this._fragShader)},programLog:function(){return this._glContext.getProgramInfoLog(this._programObj)},getProgramLog:function(){return this._glContext.getProgramInfoLog(this._programObj)},reset:function(){for(var t in this._vertShader=null,this._fragShader=null,this._uniforms.length=0,this._glContext.deleteProgram(this._programObj),this._programObj=null,this._hashForUniforms)this._hashForUniforms[t].length=0,delete this._hashForUniforms[t]},getProgram:function(){return this._programObj},retain:function(){},release:function(){}}),cc.GLProgram._highpSupported=null,cc.GLProgram._isHighpSupported=function(){var t=cc._renderContext;if(t.getShaderPrecisionFormat&&null==cc.GLProgram._highpSupported){var e=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT);cc.GLProgram._highpSupported=0!==e.precision}return cc.GLProgram._highpSupported}}),{}],273:[(function(t,e,i){var n=cc.macro.ENABLE_GL_STATE_CACHE,r=0,s=0,o=null,a=0,c=0;n&&(r=16,s=-1,o=new Array(r),a=-1,c=-1),cc.gl={},cc.gl.invalidateStateCache=function(){if(cc.math.glFreeAll(),-1,n){s=-1;for(var t=0;te._bufferCapacity){var n=cc.V2F_C4B_T2F_Triangle.BYTES_PER_ELEMENT;if(e._bufferCapacity+=Math.max(e._bufferCapacity,t),null==i||0===i.length)e._buffer=[],e._trianglesArrayBuffer=new ArrayBuffer(n*e._bufferCapacity),e._trianglesReader=new Uint8Array(e._trianglesArrayBuffer);else{for(var r=[],s=new ArrayBuffer(n*e._bufferCapacity),o=0;o0,y=3*(3*d-2);this._ensureCapacity(y);var v,x,C,T=cc.V2F_C4B_T2F_Triangle.BYTES_PER_ELEMENT,A=this._trianglesArrayBuffer,b=this._buffer;for(o=0;o0){var i=this._worldTransform,n=this._matrix.mat;n[0]=i.a,n[4]=i.c,n[12]=i.tx,n[1]=i.b,n[5]=i.d,n[13]=i.ty,cc.gl.blendFunc(e._blendFunc.src,e._blendFunc.dst),this._shaderProgram.use(),this._shaderProgram._setUniformForMVPMatrixWithMat4(this._matrix),e._render()}}}),{}],280:[(function(t,e,i){_ccsg.TMXLayer=_ccsg.Node.extend({tiles:null,tileset:null,layerOrientation:null,properties:null,layerName:"",_texture:null,_textures:null,_texGrids:null,_spriteTiles:null,_layerSize:null,_mapTileSize:null,_opacity:255,_minGID:null,_maxGID:null,_vertexZvalue:null,_useAutomaticVertexZ:null,_reusedTile:null,_contentScaleFactor:null,_staggerAxis:null,_staggerIndex:null,_hexSideLength:0,_className:"TMXLayer",ctor:function(t,e,i){cc.SpriteBatchNode.prototype.ctor.call(this),this._layerSize=cc.size(0,0),this._mapTileSize=cc.size(0,0),this._spriteTiles={},this._staggerAxis=cc.TiledMap.StaggerAxis.STAGGERAXIS_Y,this._staggerIndex=cc.TiledMap.StaggerIndex.STAGGERINDEX_EVEN,void 0!==i&&this.initWithTilesetInfo(t,e,i)},_createRenderCmd:function(){return cc._renderType===cc.game.RENDER_TYPE_CANVAS?new _ccsg.TMXLayer.CanvasRenderCmd(this):new _ccsg.TMXLayer.WebGLRenderCmd(this)},_fillTextureGrids:function(t,e){var i=this._textures[e];if(i.loaded){t.imageSize.width&&t.imageSize.height||(t.imageSize.width=i.width,t.imageSize.height=i.height);for(var n=t._tileSize.width,r=t._tileSize.height,s=i.width,o=i.height,a=t.spacing,c=t.margin,h=Math.floor((s-2*c+a)/(n+a)),l=Math.floor((o-2*c+a)/(r+a))*h,u=t.firstGid,_=t.firstGid+l,d=this._texGrids,f=null,m=!!d[u],p=cc.macro.FIX_ARTIFACTS_BY_STRECHING_TEXEL_TMX?.5:0;u<_&&(m&&!d[u]&&(m=!1),m||!d[u]);++u)f={texId:e,x:0,y:0,width:n,height:r,t:0,l:0,r:0,b:0},t.rectForGID(u,f),f.x+=p,f.y+=p,f.width-=2*p,f.height-=2*p,f.t=f.y/o,f.l=f.x/s,f.r=(f.x+f.width)/s,f.b=(f.y+f.height)/o,d[u]=f}else i.once("load",(function(){this._fillTextureGrids(t,e)}),this)},initWithTilesetInfo:function(t,e,i){var n=e._layerSize;this.layerName=e.name,this.tiles=e._tiles,this.properties=e.properties,this._layerSize=n,this._minGID=e._minGID,this._maxGID=e._maxGID,this._opacity=e._opacity,this._staggerAxis=i.getStaggerAxis(),this._staggerIndex=i.getStaggerIndex(),this._hexSideLength=i.getHexSideLength(),this.tileset=t,this.layerOrientation=i.orientation,this._mapTileSize=i.getTileSize();var r=i._tilesets;if(r){var s,o,a,c=r.length;for(this._textures=new Array(c),this._texGrids=[],s=0;s0){for(this._reorderChildDirty&&this.sortAllChildren(),r=0;r=this._layerSize.width||e>=this._layerSize.height||i<0||e<0)throw new Error(cc._getError(7227));if(!this.tiles)return cc.logID(7204),null;var n=null,r=this.getTileGIDAt(i,e);if(0===r)return n;var s=Math.floor(i)+Math.floor(e)*this._layerSize.width;if(!(n=this._spriteTiles[s])){var o=this._texGrids[r],a=this._textures[o.texId];(n=new _ccsg.Sprite(a,o)).setPosition(this.getPositionAt(i,e));var c=this._vertexZForPos(i,e);n.setVertexZ(c),n.setAnchorPoint(0,0),n.setOpacity(this._opacity),this.addChild(n,c,s)}return n},getTileGIDAt:function(t,e){if(void 0===t)throw new Error(cc._getError(7228));var i=t;if(void 0===e&&(i=t.x,e=t.y),i>=this._layerSize.width||e>=this._layerSize.height||i<0||e<0)throw new Error(cc._getError(7229));if(!this.tiles)return cc.logID(7205),null;var n=Math.floor(i)+Math.floor(e)*this._layerSize.width;return(this.tiles[n]&cc.TiledMap.TileFlag.FLIPPED_MASK)>>>0},setTileGID:function(t,e,i,n){if(void 0===e)throw new Error(cc._getError(7230));var r;if(void 0===n&&e instanceof cc.Vec2?(r=e,n=i):r=cc.p(e,i),r.x=Math.floor(r.x),r.y=Math.floor(r.y),r.x>=this._layerSize.width||r.y>=this._layerSize.height||r.x<0||r.y<0)throw new Error(cc._getError(7231));if(this.tiles)if(0!==t&&t>>0;if(0===t)this.removeTileAt(r);else if(0===o)this._updateTileForGID(a,r);else{var c=r.x+r.y*this._layerSize.width,h=this.getChildByTag(c);if(h){var l=this._texGrids[t],u=this._textures[l.texId];h.setTexture(u),h.setTextureRect(l,!1),null!=n&&this._setupTileSprite(h,r,a),this.tiles[c]=a}else this._updateTileForGID(a,r)}}}else cc.logID(7206)},addChild:function(t,e,i){_ccsg.Node.prototype.addChild.call(this,t,e,i),void 0!==i&&(this._spriteTiles[i]=t,t._vertexZ=this._vertexZ+cc.renderer.assignedZStep*i/this.tiles.length)},removeChild:function(t,e){this._spriteTiles[t.tag]&&(this._spriteTiles[t.tag]=null),_ccsg.Node.prototype.removeChild.call(this,t,e)},getTileFlagsAt:function(t,e){if(!t)throw new Error(cc._getError(7232));if(void 0!==e&&(t=cc.p(t,e)),t.x>=this._layerSize.width||t.y>=this._layerSize.height||t.x<0||t.y<0)throw new Error(cc._getError(7233));if(!this.tiles)return cc.logID(7208),null;var i=Math.floor(t.x)+Math.floor(t.y)*this._layerSize.width;return(this.tiles[i]&cc.TiledMap.TileFlag.FLIPPED_ALL)>>>0},removeTileAt:function(t,e){if(!t)throw new Error(cc._getError(7234));if(void 0!==e&&(t=cc.p(t,e)),t.x>=this._layerSize.width||t.y>=this._layerSize.height||t.x<0||t.y<0)throw new Error(cc._getError(7235));if(this.tiles){if(0!==this.getTileGIDAt(t)){var i=Math.floor(t.x)+Math.floor(t.y)*this._layerSize.width;this.tiles[i]=0;var n=this._spriteTiles[i];n&&this.removeChild(n,!0)}}else cc.logID(7209)},getPositionAt:function(t,e){void 0!==e&&(t=cc.p(t,e)),t.x=Math.floor(t.x),t.y=Math.floor(t.y);var i=cc.p(0,0);switch(this.layerOrientation){case cc.TiledMap.Orientation.ORTHO:i=this._positionForOrthoAt(t);break;case cc.TiledMap.Orientation.ISO:i=this._positionForIsoAt(t);break;case cc.TiledMap.Orientation.HEX:i=this._positionForHexAt(t)}return i},_positionForIsoAt:function(t){return cc.p(this._mapTileSize.width/2*(this._layerSize.width+t.x-t.y-1),this._mapTileSize.height/2*(2*this._layerSize.height-t.x-t.y-2))},_positionForOrthoAt:function(t){return cc.p(t.x*this._mapTileSize.width,(this._layerSize.height-t.y-1)*this._mapTileSize.height)},_positionForHexAt:function(t){var e=cc.p(0,0),i=this.tileset.tileOffset,n=this._staggerIndex===cc.TiledMap.StaggerIndex.STAGGERINDEX_ODD?1:-1;switch(this._staggerAxis){case cc.TiledMap.StaggerAxis.STAGGERAXIS_Y:var r=0;t.y%2==1&&(r=this._mapTileSize.width/2*n),e=cc.p(t.x*this._mapTileSize.width+r+i.x,(this._layerSize.height-t.y-1)*(this._mapTileSize.height-(this._mapTileSize.height-this._hexSideLength)/2)-i.y);break;case cc.TiledMap.StaggerAxis.STAGGERAXIS_X:var s=0;t.x%2==1&&(s=this._mapTileSize.height/2*-n),e=cc.p(t.x*(this._mapTileSize.width-(this._mapTileSize.width-this._hexSideLength)/2)+i.x,(this._layerSize.height-t.y-1)*this._mapTileSize.height+s-i.y)}return e},_calculateLayerOffset:function(t){var e=cc.p(0,0);switch(this.layerOrientation){case cc.TiledMap.Orientation.ORTHO:e=cc.p(t.x*this._mapTileSize.width,-t.y*this._mapTileSize.height);break;case cc.TiledMap.Orientation.ISO:e=cc.p(this._mapTileSize.width/2*(t.x-t.y),this._mapTileSize.height/2*(-t.x-t.y));break;case cc.TiledMap.Orientation.HEX:if(this._staggerAxis===cc.TiledMap.StaggerAxis.STAGGERAXIS_Y){var i=this._staggerIndex===cc.TiledMap.StaggerIndex.STAGGERINDEX_EVEN?this._mapTileSize.width/2:0;e=cc.p(t.x*this._mapTileSize.width+i,-t.y*(this._mapTileSize.height-(this._mapTileSize.width-this._hexSideLength)/2))}else if(this._staggerAxis===cc.TiledMap.StaggerAxis.STAGGERAXIS_X){var n=this._staggerIndex===cc.TiledMap.StaggerIndex.STAGGERINDEX_ODD?this._mapTileSize.height/2:0;e=cc.p(t.x*(this._mapTileSize.width-(this._mapTileSize.width-this._hexSideLength)/2),-t.y*this._mapTileSize.height+n)}}return e},_updateTileForGID:function(t,e){if(this._texGrids[t]){var i=0|e.x+e.y*this._layerSize.width;i>>0){t.setAnchorPoint(.5,.5),t.setPosition(n.x+t.width/2,n.y+t.height/2);var r=(i&(cc.TiledMap.TileFlag.HORIZONTAL|cc.TiledMap.TileFlag.VERTICAL)>>>0)>>>0;r===cc.TiledMap.TileFlag.HORIZONTAL?t.setRotation(90):r===cc.TiledMap.TileFlag.VERTICAL?t.setRotation(270):r===(cc.TiledMap.TileFlag.VERTICAL|cc.TiledMap.TileFlag.HORIZONTAL)>>>0?(t.setRotation(90),t.setFlippedX(!0)):(t.setRotation(270),t.setFlippedX(!0))}else(i&cc.TiledMap.TileFlag.HORIZONTAL)>>>0&&t.setFlippedX(!0),(i&cc.TiledMap.TileFlag.VERTICAL)>>>0&&t.setFlippedY(!0)},_vertexZForPos:function(t,e){void 0===e&&(e=t.y,t=t.x);var i=0;if(this._useAutomaticVertexZ)switch(this.layerOrientation){case cc.TiledMap.Orientation.ISO:i=-(this._layerSize.width+this._layerSize.height-(t+e));break;case cc.TiledMap.Orientation.ORTHO:i=-(this._layerSize.height-e);break;case cc.TiledMap.Orientation.HEX:cc.logID(7210);break;default:cc.logID(7211)}else i=this._vertexZvalue;return i}})}),{}],281:[(function(t,e,i){t("../shape-nodes/CCDrawNode"),_ccsg.TMXObject=cc.Class({properties:{sgNode:null,offset:cc.p(0,0),gid:0,name:"",type:null,id:0,objectVisible:!0,objectSize:cc.size(0,0),objectRotation:0,_properties:null,_groupSize:cc.size(0,0)},initWithInfo:function(t,e,i,n){this.setProperties(t),this.setObjectName(t.name),this.id=t.id,this.gid=t.gid,this.type=t.type,this.offset=cc.p(t.x,t.y),this.objectSize=cc.size(t.width,t.height),this.objectVisible=t.visible,this.objectRotation=t.rotation,this._groupSize=i,this.type===cc.TiledMap.TMXObjectType.IMAGE?this.sgNode=new _ccsg.TMXObjectImage(this,e):this.sgNode=new _ccsg.TMXObjectShape(this,e,n)},getObjectName:function(){return this.name},getProperty:function(t){return this._properties[t]},getProperties:function(){return this._properties},setObjectName:function(t){this.name=t},setProperties:function(t){this._properties=t}}),_ccsg.TMXObjectImage=_ccsg.Sprite.extend({_container:null,ctor:function(t,e){_ccsg.Sprite.prototype.ctor.call(this),this._container=t,this.initWithMapInfo(e)},initWithMapInfo:function(t){if(!this._container.gid)return!1;for(var e,i=t.getTilesets(),n=i.length-1;n>=0;n--){var r=i[n];if((this._container.gid&cc.TiledMap.TileFlag.FLIPPED_MASK)>>>0>=r.firstGid){e=r;break}}if(!e)return!1;this.setVisible(this._container.objectVisible);var s=r.sourceImage;return s&&this._initWithTileset(s,e),this._initPosWithMapInfo(t),this.setRotation(this._container.objectRotation),(this._container.gid&cc.TiledMap.TileFlag.HORIZONTAL)>>>0&&this.setFlippedX(!0),(this._container.gid&cc.TiledMap.TileFlag.VERTICAL)>>>0&&this.setFlippedY(!0),!0},_initWithTileset:function(t,e){if(t.loaded){e.imageSize.width=t.width,e.imageSize.height=t.height;var i=e.rectForGID(this._container.gid);this.initWithTexture(t,i),this.setScaleX(this._container.objectSize.width/i.size.width),this.setScaleY(this._container.objectSize.height/i.size.height)}else t.once("load",(function(){this._initWithTileset(t,e)}),this)},_initPosWithMapInfo:function(t){switch(t.getOrientation()){case cc.TiledMap.Orientation.ORTHO:case cc.TiledMap.Orientation.HEX:this.setAnchorPoint(cc.p(0,0)),this.setPosition(this._container.offset.x,this._container._groupSize.height-this._container.offset.y);break;case cc.TiledMap.Orientation.ISO:this.setAnchorPoint(cc.p(.5,0));var e=cc.p(this._container.offset.x/t._tileSize.height,this._container.offset.y/t._tileSize.height),i=cc.p(t._tileSize.width/2*(t._mapSize.width+e.x-e.y),t._tileSize.height/2*(2*t._mapSize.height-e.x-e.y));this.setPosition(i)}}}),_ccsg.TMXObjectShape=cc.DrawNode.extend({_container:null,_color:cc.Color.WHITE,_mapOrientation:0,_mapInfo:null,ctor:function(t,e,i){cc.DrawNode.prototype.ctor.call(this),this.setLineWidth(1),this._container=t,this._color=i,this._mapInfo=e,this._mapOrientation=e.getOrientation(),this._initShape()},_initShape:function(){var t;if(cc.TiledMap.Orientation.ISO!==this._mapOrientation){var e=cc.p(0,this._container._groupSize.height);t=cc.p(e.x+this._container.offset.x,e.y-this._container.offset.y)}else t=this._getPosByOffset(cc.p(0,0));switch(this.setPosition(t),this.setRotation(this._container.objectRotation),this._container.type){case cc.TiledMap.TMXObjectType.RECT:this._drawRect();break;case cc.TiledMap.TMXObjectType.ELLIPSE:this._drawEllipse();break;case cc.TiledMap.TMXObjectType.POLYGON:this._drawPoly(t,!0);break;case cc.TiledMap.TMXObjectType.POLYLINE:this._drawPoly(t,!1)}this.setVisible(this._container.objectVisible)},_getPosByOffset:function(t){var e=this._mapInfo.getMapSize(),i=this._mapInfo.getTileSize(),n=cc.p((this._container.offset.x+t.x)/i.width*2,(this._container.offset.y+t.y)/i.height);return cc.p(i.width/2*(e.width+n.x-n.y),i.height/2*(2*e.height-n.x-n.y))},_drawRect:function(){if(cc.TiledMap.Orientation.ISO!==this._mapOrientation){var t=this._container.objectSize;t.equals(cc.Size.ZERO)?(t=cc.size(20,20),this.setAnchorPoint(cc.p(.5,.5))):this.setAnchorPoint(cc.p(0,1));var e=cc.p(0,0),i=cc.p(t.width,t.height);this.drawRect(e,i,null,this.getLineWidth(),this._color),this.setContentSize(t)}else{if(this._container.objectSize.equals(cc.Size.ZERO))return;var n=this._getPosByOffset(cc.p(0,0)),r=this._getPosByOffset(cc.p(this._container.objectSize.width,0)),s=this._getPosByOffset(cc.p(this._container.objectSize.width,this._container.objectSize.height)),o=this._getPosByOffset(cc.p(0,this._container.objectSize.height)),a=r.x-o.x,c=n.y-s.y;this.setContentSize(cc.size(a,c)),this.setAnchorPoint(cc.p((n.x-o.x)/a,1));var h=cc.p(o.x,s.y);n.subSelf(h),r.subSelf(h),s.subSelf(h),o.subSelf(h),this._container.objectSize.width>0&&(this.drawSegment(n,r,this.getLineWidth(),this._color),this.drawSegment(s,o,this.getLineWidth(),this._color)),this._container.objectSize.height>0&&(this.drawSegment(n,o,this.getLineWidth(),this._color),this.drawSegment(s,r,this.getLineWidth(),this._color))}},_drawEllipse:function(){var t=1,e=1,i=0,n=cc.p(0,0),r=null;if(cc.TiledMap.Orientation.ISO!==this._mapOrientation){var s=this._container.objectSize;s.equals(cc.Size.ZERO)?(s=cc.size(20,20),this.setAnchorPoint(cc.p(.5,.5))):this.setAnchorPoint(cc.p(0,1)),n=cc.p(s.width/2,s.height/2),s.width>s.height?(t=s.width/s.height,i=s.height/2):(e=s.height/s.width,i=s.width/2),r=this,this.setContentSize(s)}else{if(this._container.objectSize.equals(cc.Size.ZERO))return;var o=this._getPosByOffset(cc.p(0,0)),a=this._getPosByOffset(cc.p(this._container.objectSize.width,0)),c=this._getPosByOffset(cc.p(this._container.objectSize.width,this._container.objectSize.height)),h=this._getPosByOffset(cc.p(0,this._container.objectSize.height)),l=a.x-h.x,u=o.y-c.y;this.setContentSize(cc.size(l,u)),this.setAnchorPoint(cc.p((o.x-h.x)/l,1));var _=cc.p(h.x,c.y);o.subSelf(_),a.subSelf(_),c.subSelf(_),h.subSelf(_),this._container.objectSize.width>0&&(this.drawSegment(o,a,this.getLineWidth(),this._color),this.drawSegment(c,h,this.getLineWidth(),this._color)),this._container.objectSize.height>0&&(this.drawSegment(o,h,this.getLineWidth(),this._color),this.drawSegment(c,a,this.getLineWidth(),this._color)),(n=this._getPosByOffset(cc.p(this._container.objectSize.width/2,this._container.objectSize.height/2))).subSelf(_),(r=new cc.DrawNode).setLineWidth(this.getLineWidth()),r.setContentSize(cc.size(l,u)),r.setAnchorPoint(cc.p(.5,.5)),r.setPosition(n),this.addChild(r),this._container.objectSize.width>this._container.objectSize.height?(t=this._container.objectSize.width/this._container.objectSize.height,i=this._container.objectSize.height/2):(e=this._container.objectSize.height/this._container.objectSize.width,i=this._container.objectSize.width/2);var d=this._mapInfo.getTileSize(),f=Math.atan(d.width/d.height);i/=Math.sin(f),r.setRotationX(cc.radiansToDegrees(f)),r.setRotationY(90-cc.radiansToDegrees(f))}r.drawCircle(n,i,0,50,!1,this.getLineWidth(),this._color),r.setScaleX(t),r.setScaleY(e)},_drawPoly:function(t,e){for(var i,n=this._container.getProperties(),r=[],s=0,o=0,a=0,c=0,h=0,l=(i=e?n.points:n.polylinePoints).length;h=0;i--){var n=e[i];n&&(n instanceof _ccsg.TMXLayer||n instanceof _ccsg.TMXObjectGroup)&&this.removeChild(n)}var r=0,s=t.getAllChildren();if(s&&s.length>0)for(var o=0,a=s.length;o=0;r--){var s=n[r];if(s)for(var o=0;o>>0>=s.firstGid)return s}}return cc.logID(7215,t.name),null}});var n=_ccsg.TMXTiledMap.prototype;n.mapWidth,cc.defineGetterSetter(n,"mapWidth",n._getMapWidth,n._setMapWidth),n.mapHeight,cc.defineGetterSetter(n,"mapHeight",n._getMapHeight,n._setMapHeight),n.tileWidth,cc.defineGetterSetter(n,"tileWidth",n._getTileWidth,n._setTileWidth),n.tileHeight,cc.defineGetterSetter(n,"tileHeight",n._getTileHeight,n._setTileHeight)}),{"./CCSGTMXObject":281,"./CCTMXXMLParser":286}],284:[(function(t,e,i){var n=null,r=null,s=null,o=null,a=null;_ccsg.TMXLayer.CanvasRenderCmd=function(t){this._rootCtor(t),this._needDraw=!0,n||(n=cc.TiledMap.Orientation,r=cc.TiledMap.TileFlag,s=r.FLIPPED_MASK,o=cc.TiledMap.StaggerAxis,a=cc.TiledMap.StaggerIndex)};var c=_ccsg.TMXLayer.CanvasRenderCmd.prototype=Object.create(_ccsg.Node.CanvasRenderCmd.prototype);c.constructor=_ccsg.TMXLayer.CanvasRenderCmd,c.rendering=function(t,e,i){var c=this._node,h=c.layerOrientation,l=c.tiles,u=c._opacity/255;if(l&&!(u<=0)&&c.tileset){var _=c._mapTileSize.width,d=c._mapTileSize.height,f=c.tileset._tileSize.width/cc.director._contentScaleFactor,m=c.tileset._tileSize.height/cc.director._contentScaleFactor,p=f-_,g=m-d,y=cc.winSize.width,v=cc.winSize.height,x=c._layerSize.height,C=c._layerSize.width,T=c._texGrids,A=c._spriteTiles,b=this._worldTransform,S=c._position.x,E=c._position.y,w=b.a,I=b.b,R=b.c,P=b.d,O=S*w+E*R+b.tx,D=S*I+E*P+b.ty,B=t||cc._renderContext,L=B.getContext(),M=0,N=0,F=C,z=x;cc.macro.ENABLE_TILEDMAP_CULLING&&h===n.ORTHO&&(M=Math.floor(-(O-p*w)/(_*w)),N=Math.floor((D-g*P+d*x*P-v)/(d*P)),F=Math.ceil((y-O+p*w)/(_*w)),z=x-Math.floor(-(D+g*P)/(d*P)),M<0&&(M=0),N<0&&(N=0),F>C&&(F=C),z>x&&(z=x));var k,V,G,U,W,X,j,Y,H,q,J,Z,K,Q,$,tt,et,it,nt,rt=N*C,st=f,ot=m,at=f*w,ct=m*P,ht=!1,lt=!1;for(k in U=rt+M,A)if(k=U)break;if(B.setTransform(b,e,i),B.setGlobalAlpha(u),h===n.HEX){var ut=c._staggerIndex,_t=c._hexSideLength;$=c._staggerAxis,tt=c.tileset.tileOffset,et=ut===a.STAGGERINDEX_ODD?1:-1,it=$===o.STAGGERAXIS_X?(_-_t)/2:0,nt=$===o.STAGGERAXIS_Y?(d-_t)/2:0}for(V=N;V>>0])&&(j=c._textures[X.texId])&&j._image){switch(h){case n.ORTHO:q=G*_,J=-(x-V-1)*d;break;case n.ISO:q=_/2*(C+G-V-1),J=-d/2*(2*x-G-V-2);break;case n.HEX:q=G*(_-it)+($===o.STAGGERAXIS_Y&&V%2==1?_/2*et:0)+tt.x,J=-(x-V-1)*(d-nt)-($===o.STAGGERAXIS_X&&G%2==1?d/2*-et:0)+tt.y}if(Z=q+f,H=J-m,h===n.ISO){if((K=J*P-D)<-v-ct){G+=Math.floor(2*(-v-K)/ct)-1;continue}if((Q=O+Z*w)<-at){G+=Math.floor(2*-Q/at)-1;continue}if(O+q*w>y||H*P-D>0){G=F;continue}}W>r.DIAGONAL&&(ht=(W&r.HORIZONTAL)>>>0,lt=(W&r.VERTICAL)>>>0),ht&&(q=-Z,L.scale(-1,1)),lt&&(H=-J,L.scale(1,-1)),L.drawImage(j._image,X.x,X.y,X.width,X.height,q,H,st,ot),ht&&L.scale(-1,1),lt&&L.scale(1,-1),cc.g_NumberOfDraws++}rt+=C}for(k in A)k>U&&A[k]&&(Y=A[k]._renderCmd,0===A[k]._localZOrder&&Y.rendering&&A[k]._visible&&Y.rendering(t,e,i))}}}),{}],285:[(function(t,e,i){var n=null,r=null,s=null,o=null,a=null;function c(){cc.renderer.setDepthTest(!1)}_ccsg.TMXLayer.WebGLRenderCmd=function(t){this._rootCtor(t),this._needDraw=!0,this._vertices=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],this._color=new Uint32Array(1),this._shaderProgram=cc.shaderCache.programForKey(cc.macro.SHADER_SPRITE_POSITION_TEXTURECOLORALPHATEST);var e=90*Math.PI/180;this._sin90=Math.sin(e),this._cos90=Math.cos(e),e*=3,this._sin270=Math.sin(e),this._cos270=Math.cos(e),n||(n=cc.TiledMap.Orientation,r=cc.TiledMap.TileFlag,s=r.FLIPPED_MASK,o=cc.TiledMap.StaggerAxis,a=cc.TiledMap.StaggerIndex),this._disableDepthTestCmd=new cc.CustomRenderCmd(this,c)};var h=_ccsg.TMXLayer.WebGLRenderCmd.prototype=Object.create(_ccsg.Node.WebGLRenderCmd.prototype);h.constructor=_ccsg.TMXLayer.WebGLRenderCmd,h.uploadData=function(t,e,i){var c=this._node,h=c.layerOrientation,l=c.tiles,u=c._opacity/255;if(cc.renderer.setDepthTest(c.layerOrientation===n.ORTHO),!l||u<=0||!c.tileset)return 0;var _=c._mapTileSize.width,d=c._mapTileSize.height,f=c.tileset._tileSize.width/cc.director._contentScaleFactor,m=c.tileset._tileSize.height/cc.director._contentScaleFactor,p=f-_,g=m-d,y=cc.winSize.width,v=cc.winSize.height,x=c._layerSize.height,C=c._layerSize.width,T=c._texGrids,A=c._spriteTiles,b=this._worldTransform,S=b.a,E=b.b,w=b.c,I=b.d,R=b.tx,P=b.ty,O=c._position.x,D=c._position.y,B=O*S+D*w+R,L=O*E+D*I+P,M=f*S,N=m*I,F=c._opacity,z=this._displayedColor.r,k=this._displayedColor.g,V=this._displayedColor.b;if(c._opacityModifyRGB){var G=F/255;z*=G,k*=G,V*=G}this._color[0]=F<<24|V<<16|k<<8|z;var U,W=0,X=0,j=C,Y=x,H=S,q=I,J=B,Z=L,K=M,Q=N,$=cc.macro.ENABLE_TILEDMAP_CULLING,tt=this._vertices;if($&&(this._cameraFlag>0&&(H=(U=cc.affineTransformConcat(b,cc.Camera.main.viewMatrix)).a,q=U.d,J=O*H+D*U.c+U.tx,Z=O*U.b+D*q+U.ty,K=f*H,Q=m*q),h===n.ORTHO)){this._cameraFlag<=0&&(U=cc.affineTransformClone(b)),cc.affineTransformInvertOut(U,U);var et=cc.visibleRect;tt[0].x=et.topLeft.x*U.a+et.topLeft.y*U.c+U.tx,tt[0].y=et.topLeft.x*U.b+et.topLeft.y*U.d+U.ty,tt[1].x=et.bottomLeft.x*U.a+et.bottomLeft.y*U.c+U.tx,tt[1].y=et.bottomLeft.x*U.b+et.bottomLeft.y*U.d+U.ty,tt[2].x=et.topRight.x*U.a+et.topRight.y*U.c+U.tx,tt[2].y=et.topRight.x*U.b+et.topRight.y*U.d+U.ty,tt[3].x=et.bottomRight.x*U.a+et.bottomRight.y*U.c+U.tx,tt[3].y=et.bottomRight.x*U.b+et.bottomRight.y*U.d+U.ty;var it=Math.min(tt[0].x,tt[1].x,tt[2].x,tt[3].x),nt=Math.max(tt[0].x,tt[1].x,tt[2].x,tt[3].x),rt=Math.min(tt[0].y,tt[1].y,tt[2].y,tt[3].y),st=Math.max(tt[0].y,tt[1].y,tt[2].y,tt[3].y);W=Math.floor(it/_),X=x-Math.ceil(st/d),j=Math.ceil((nt+p)/_),Y=x-Math.floor((rt-g)/d),W<0&&(W=0),X<0&&(X=0),j>C&&(j=C),Y>x&&(Y=x)}var ot,at,ct,ht,lt,ut,_t,dt,ft,mt,pt,gt,yt,vt,xt,Ct,Tt,At=i,bt=X*C,St=S,Et=E,wt=w,It=I,Rt=Math.floor(R)+.5,Pt=Math.floor(P)+.5,Ot=!1,Dt=!1,Bt=!1;if(h===n.HEX){var Lt=c._staggerIndex,Mt=c._hexSideLength;yt=c._staggerAxis,vt=c.tileset.tileOffset,Tt=Lt===a.STAGGERINDEX_ODD?1:-1,xt=yt===o.STAGGERAXIS_X?(_-Mt)/2:0,Ct=yt===o.STAGGERAXIS_Y?(d-Mt)/2:0}for(ot=X;ott.length&&(cc.renderer._increaseBatchingSize((At-i)/6,cc.renderer.VertexType.QUAD),cc.renderer._batchRendering(),i=0,At=0),A[ct=bt+at])A[ct]._vertexZ=c._vertexZ+cc.renderer.assignedZStep*ct/l.length;else if(lt=T[((ht=c.tiles[ct])&s)>>>0]){switch(h){case n.ORTHO:dt=at*_,ft=(x-ot-1)*d,ct=c._vertexZ+cc.renderer.assignedZStep*ct/l.length;break;case n.ISO:dt=_/2*(C+at-ot-1),ft=d/2*(2*x-at-ot-2),ct=c._vertexZ+cc.renderer.assignedZStep*(c.height-ft)/c.height;break;case n.HEX:dt=at*(_-xt)+(yt===o.STAGGERAXIS_Y&&ot%2==1?_/2*Tt:0)+vt.x,ft=(x-ot-1)*(d-Ct)+(yt===o.STAGGERAXIS_X&&at%2==1?d/2*-Tt:0)-vt.y,ct=c._vertexZ+cc.renderer.assignedZStep*(c.height-ft)/c.height}if(mt=dt+f,_t=ft+m,$&&h===n.ISO){if((pt=Z+ft*q)>v+Q){at+=Math.floor(2*(pt-v)/Q)-1;continue}if((gt=J+mt*H)<-K){at+=Math.floor(2*-gt/K)-1;continue}if(J+dt*H>y||Z+_t*q<0){at=j;continue}}for(ht>r.DIAGONAL&&(Ot=!0,Dt=(ht&r.HORIZONTAL)>>>0,Bt=(ht&r.VERTICAL)>>>0),tt[0].x=dt*St+_t*wt+Rt,tt[0].y=dt*Et+_t*It+Pt,tt[1].x=dt*St+ft*wt+Rt,tt[1].y=dt*Et+ft*It+Pt,tt[2].x=mt*St+_t*wt+Rt,tt[2].y=mt*Et+_t*It+Pt,tt[3].x=mt*St+ft*wt+Rt,tt[3].y=mt*Et+ft*It+Pt,ut=0;ut<4;++ut){switch(t[At]=tt[ut].x,t[At+1]=tt[ut].y,t[At+2]=ct,e[At+3]=this._color[0],ut){case 0:t[At+4]=Dt?lt.r:lt.l,t[At+5]=Bt?lt.b:lt.t;break;case 1:t[At+4]=Dt?lt.r:lt.l,t[At+5]=Bt?lt.t:lt.b;break;case 2:t[At+4]=Dt?lt.l:lt.r,t[At+5]=Bt?lt.b:lt.t;break;case 3:t[At+4]=Dt?lt.l:lt.r,t[At+5]=Bt?lt.t:lt.b}At+=6}Ot&&(St=S,Et=E,wt=w,It=I,Rt=R,Pt=P,Dt=!1,Bt=!1,Ot=!1)}bt+=C}return(At-i)/6}}),{}],286:[(function(t,e,i){t("../core/platform/CCSAXParser"),t("../compression/ZipUtils");var n=t("../compression/zlib.min");function r(t){for(var e=[],i=t.getElementsByTagName("properties"),n=0;n0&&(f.type=cc.TiledMap.TMXObjectType.ELLIPSE);var x=d.getElementsByTagName("polygon");if(x&&x.length>0){f.type=cc.TiledMap.TMXObjectType.POLYGON;var C=x[0].getAttribute("points");C&&(f.points=this._parsePointsString(C))}var T=d.getElementsByTagName("polyline");if(T&&T.length>0){f.type=cc.TiledMap.TMXObjectType.POLYLINE;var A=T[0].getAttribute("points");A&&(f.polylinePoints=this._parsePointsString(A))}f.type||(f.type=cc.TiledMap.TMXObjectType.RECT),e._objects.push(f)}return e},_parsePointsString:function(t){if(!t)return null;for(var e=[],i=t.split(" "),n=0;n=0;i--){var n=e[i].getComponent(cc.TiledLayer);n&&(n.enabled=t)}},_moveLayersInSgNode:function(t){this._detachedChildren.length=0;for(var e=t.getChildren(),i=e.length-1;i>=0;i--){var n=e[i];if(n instanceof _ccsg.TMXLayer||n instanceof _ccsg.TMXObjectGroup){t.removeChild(n);var r=n.getLocalZOrder();this._detachedChildren.push({sgNode:n,zorder:r})}}},_removeLayerEntities:function(){for(var t=this.node.getChildren(),e=t.length-1;e>=0;e--){var i=t[e];if(i.isValid){var n=i.getComponent(cc.TiledLayer);n&&n._tryRemoveNode();var r=i.getComponent(cc.TiledObjectGroup);r&&r._tryRemoveNode()}}},_refreshLayerEntities:function(){var t,e,i=this.node.getChildren(),n=[],r=[],s=[];for(t=0;t=0;t--){var h=i[t],l=h.getComponent(cc.TiledLayer),u=h.getComponent(cc.TiledObjectGroup);if(l){var _=l.getLayerName();if(_||(_=h._name),a.indexOf(_)<0)l._tryRemoveNode();else{n.push(h);var d=this._sgNode.getLayer(_);l._replaceSgNode(d),l.enabled=!0}}else if(u){var f=u.getGroupName();if(f||(f=h._name),c.indexOf(f)<0)u._tryRemoveNode();else{r.push(h);var m=this._sgNode.getObjectGroup(f);u._replaceSgNode(m),u.enabled=m.isVisible()}}else s.push({child:h,index:h.getSiblingIndex()})}var p=n.map((function(t){return t.getComponent(cc.TiledLayer).getLayerName()}));for(t=0,e=a.length;t=0;t--){var P=w[t];if(t!==E.indexOf(P))this.node.getChildByName(P).setSiblingIndex(I[t].getLocalZOrder())}for(t=0,e=s.length;t0&&(c[o[h]]=a[h].text);t.initWithXML(e.tmxXmlStr,c,r)&&(this._detachedChildren.length=0,this._onMapLoaded())}else{for(var l=t.allLayers(),u=0,_=l.length;u<_;u++)t.removeChild(l[u]);for(var d=t.getObjectGroups(),f=0,m=d.length;f":0});dragonBones.ArmatureDisplay=cc.Class({name:"dragonBones.ArmatureDisplay",extends:cc._RendererUnderSG,editor:!1,properties:{_factory:{default:null,type:dragonBones.CCFactory,serializable:!1},dragonAsset:{default:null,type:dragonBones.DragonBonesAsset,notify:function(){this._parseDragonAsset(),this._refresh()},tooltip:!1},dragonAtlasAsset:{default:null,type:dragonBones.DragonBonesAtlasAsset,notify:function(){this._parseDragonAtlasAsset(),this._refreshSgNode()},tooltip:!1},_armatureName:"",armatureName:{get:function(){return this._armatureName},set:function(t){this._armatureName=t;var e=this.getAnimationNames(this._armatureName);(!this.animationName||e.indexOf(this.animationName)<0)&&(this.animationName=""),this._refresh()},visible:!1},_animationName:"",animationName:{get:function(){return this._animationName},set:function(t){this._animationName=t},visible:!1},_defaultArmatureIndex:{default:0,notify:function(){var t="";if(this.dragonAsset){var e;if(this.dragonAsset&&(e=this.dragonAsset.getArmatureEnum()),!e)return cc.errorID(7400,this.name);t=e[this._defaultArmatureIndex]}void 0!==t?this.armatureName=t:cc.errorID(7401,this.name)},type:n,visible:!0,editorOnly:!0,displayName:"Armature",tooltip:!1},_animationIndex:{default:0,notify:function(){var t;if(0!==this._animationIndex){if(this.dragonAsset&&(t=this.dragonAsset.getAnimsEnum(this.armatureName)),t){var e=t[this._animationIndex];void 0!==e?this.animationName=e:cc.errorID(7402,this.name)}}else this.animationName=""},type:r,visible:!0,editorOnly:!0,displayName:"Animation",tooltip:!1},timeScale:{default:1,notify:function(){this._sgNode&&(this._sgNode.animation().timeScale=this.timeScale)},tooltip:!1},playTimes:{default:-1,tooltip:!1},debugBones:{default:!1,notify:function(){this._sgNode&&this._sgNode.setDebugBones(this.debugBones)},editorOnly:!0,tooltip:!1}},ctor:function(){this._factory=dragonBones.CCFactory.getInstance()},__preload:function(){this._parseDragonAsset(),this._parseDragonAtlasAsset(),this._refresh()},_createSgNode:function(){return this.dragonAsset&&this.dragonAtlasAsset&&this.armatureName?this._factory.buildArmatureDisplay(this.armatureName,this.dragonAsset._dragonBonesData.name):null},_initSgNode:function(){var t=this._sgNode;t.animation().timeScale=this.timeScale,this.animationName&&this.playAnimation(this.animationName,this.playTimes)},_removeSgNode:function(){var t=this._sgNode;this._super(),t&&t.armature().dispose()},_parseDragonAsset:function(){this.dragonAsset&&this.dragonAsset.init(this._factory)},_parseDragonAtlasAsset:function(){this.dragonAtlasAsset&&this.dragonAtlasAsset.init(this._factory)},_refreshSgNode:function(){var t=null,e=null;this._sgNode&&(t=this._sgNode._bubblingListeners,e=this._sgNode._hasListenerCache,this.node._sizeProvider===this._sgNode&&(this.node._sizeProvider=null),this._removeSgNode(),this._sgNode=null);var i=this._sgNode=this._createSgNode();i&&(this.enabledInHierarchy||i.setVisible(!1),t&&(i._bubblingListeners=t,i._hasListenerCache=e),this._initSgNode(),this._appendSgNode(i),this._registSizeProvider())},_refresh:function(){this._refreshSgNode()},_updateAnimEnum:!1,_updateArmatureEnum:!1,playAnimation:function(t,e){return this._sgNode?(this.playTimes=void 0===e?-1:e,this.animationName=t,this._sgNode.animation().play(t,this.playTimes)):null},getArmatureNames:function(){var t=this.dragonAsset&&this.dragonAsset._dragonBonesData;return t&&t.armatureNames||[]},getAnimationNames:function(t){var e=[];if(this.dragonAsset&&this.dragonAsset._dragonBonesData){var i=this.dragonAsset._dragonBonesData.getArmature(t);if(i)for(var n in i.animations)i.animations.hasOwnProperty(n)&&e.push(n)}return e},addEventListener:function(t,e,i){this._sgNode&&this._sgNode.addEvent(t,e,i)},removeEventListener:function(t,e,i){this._sgNode&&this._sgNode.removeEvent(t,e,i)},buildArmature:function(t){return this._factory?this._factory.buildArmature(t):null},armature:function(){return this._sgNode?this._sgNode.armature():null}})}),{}],295:[(function(t,e,i){var n=t("../../cocos2d/core/event/event-target");t("../../cocos2d/shape-nodes/CCDrawNode"),dragonBones.CCArmatureDisplay=cc.Class({name:"dragonBones.CCArmatureDisplay",extends:_ccsg.Node,mixins:[n],ctor:function(){this._armature=null,this._debugDrawer=null},_onClear:function(){this._armature=null},_dispatchEvent:function(t){this.emit(t.type,t)},_debugDraw:function(){if(this._armature){this._debugDrawer||(this._debugDrawer=new cc.DrawNode,this.addChild(this._debugDrawer),this._debugDrawer.setDrawColor(cc.color(255,0,0,255)),this._debugDrawer.setLineWidth(1)),this._debugDrawer.clear();for(var t=this._armature.getBones(),e=0,i=t.length;e0?r.actions:h.armatureData.actions;if(l.length>0)for(var u=0,_=l.length;u<_;++u)h._bufferAction(l[u]);else h.animation.play()}c.armature=h.armatureData}s.push(h);break;default:s.push(null)}}return i._setDisplayList(s),i._rawDisplay.setLocalZOrder(r.zOrder),i},getTextureDisplay:function(t,e){var i=this._getTextureData(e,t);if(i){if(!i.texture){var n=i.parent.texture,r=cc.rect(i.region.x,i.region.y,i.region.width,i.region.height),s=cc.p(0,0),o=cc.size(i.region.width,i.region.height);i.texture=new cc.SpriteFrame,i.texture.setTexture(n,r,i.rotated,s,o)}return new cc.Scale9Sprite(i.texture)}return null}})}),{}],297:[(function(t,e,i){dragonBones.CCSlot=cc.Class({name:"dragonBones.CCSlot",extends:dragonBones.Slot,ctor:function(){this._renderDisplay=null},statics:{toString:function(){return"[class dragonBones.CCSlot]"}},_onClear:function(){dragonBones.Slot.prototype._onClear.call(this),this._renderDisplay=null},_onUpdateDisplay:function(){this._rawDisplay||(this._rawDisplay=new cc.Scale9Sprite),this._renderDisplay=this._display||this._rawDisplay},_initDisplay:function(t){},_addDisplay:function(){this._armature._display.addChild(this._renderDisplay)},_replaceDisplay:function(t){var e=this._armature._display,i=t;e.addChild(this._renderDisplay,i.getLocalZOrder()),e.removeChild(i)},_removeDisplay:function(){this._renderDisplay.removeFromParent()},_disposeDisplay:function(t){},_updateVisible:function(){this._renderDisplay.setVisible(this._parent.visible)},_updateZOrder:function(){this._renderDisplay._parent?this._renderDisplay.setLocalZOrder(this._zOrder):this._armature._display.addChild(this._renderDisplay,this._zOrder)},_updateBlendMode:function(){if(this._renderDisplay instanceof cc.Scale9Sprite)switch(this._blendMode){case 0:break;case 1:var t=this._renderDisplay._spriteFrame.getTexture();t&&t.hasPremultipliedAlpha()?this._renderDisplay.setBlendFunc(cc.BlendFunc.BlendFactor.ONE,cc.BlendFunc.BlendFactor.ONE):this._renderDisplay.setBlendFunc(cc.BlendFunc.BlendFactor.SRC_ALPHA,cc.BlendFunc.BlendFactor.ONE)}else if(this._childArmature)for(var e=this._childArmature.getSlots(),i=0,n=e.length;i=0){var t=this._displayIndexm&&(f.x=m),f.width-p&&(f.y=-p),f.height<-p&&(f.height=-p)}for(f.width-=f.x,f.height-=f.y,c=0,h=this._meshData.vertexIndices.length;c0,s=e.triangles.verts,o=cc.rect(999999,999999,-999999,-999999),a=0,c=0,h=0;if(this._meshData.skinned){var l=0;for(i=0,n=this._meshData.vertices.length;ic&&(o.x=c),o.width-h&&(o.y=-h),o.height<-h&&(o.height=-h)}}else if(r){var x=this._meshData.vertices;for(i=0,n=this._meshData.vertices.length;ic&&(o.x=c),o.width-h&&(o.y=-h),o.height<-h&&(o.height=-h)}o.width-=o.x,o.height-=o.y,e.rect=o;var C=t.getNodeToParentTransform();t.setContentSize(cc.size(o.width,o.height)),t.setMeshPolygonInfo(e),this._renderDisplay._renderCmd.setNodeToParentTransform(C)}},_updateTransform:function(){var t={a:this.globalTransformMatrix.a,b:-this.globalTransformMatrix.b,c:-this.globalTransformMatrix.c,d:this.globalTransformMatrix.d,tx:this.globalTransformMatrix.tx-(this.globalTransformMatrix.a*this._pivotX+this.globalTransformMatrix.c*this._pivotY),ty:-(this.globalTransformMatrix.ty-(this.globalTransformMatrix.b*this._pivotX+this.globalTransformMatrix.d*this._pivotY))};this._renderDisplay._renderCmd.setNodeToParentTransform(t)}})}),{}],298:[(function(t,e,i){dragonBones.CCTextureAtlasData=cc.Class({extends:dragonBones.TextureAtlasData,properties:{texture:{default:null,serializable:!1}},statics:{toString:function(){return"[class dragonBones.CCTextureAtlasData]"}},_onClear:function(){dragonBones.TextureAtlasData.prototype._onClear.call(this),this.texture=null},generateTextureData:function(){return dragonBones.BaseObject.borrowObject(dragonBones.CCTextureData)}}),dragonBones.CCTextureData=cc.Class({extends:dragonBones.TextureData,properties:{texture:{default:null,serializable:!1}},statics:{toString:function(){return"[class dragonBones.CCTextureData]"}},_onClear:function(){dragonBones.TextureData.prototype._onClear.call(this),this.texture=null}})}),{}],299:[(function(t,e,i){var n=cc.Class({name:"dragonBones.DragonBonesAsset",extends:cc.Asset,ctor:function(){this.reset()},properties:{_dragonBonesJson:"",dragonBonesJson:{get:function(){return this._dragonBonesJson},set:function(t){this._dragonBonesJson=t,this.reset()}}},statics:{preventDeferredLoadDependents:!0},createNode:!1,reset:function(){this._dragonBonesData=null},init:function(t){if(this._dragonBonesData){var e=t.getDragonBonesData(this._dragonBonesData.name);if(e){for(var i=0;i=0},t.addArmature=function(e){e&&t._armatures.indexOf(e)<0&&t._armatures.push(e)},t.removeArmature=function(e){if(e){var i=t._armatures.indexOf(e);i>=0&&t._armatures.splice(i,1)}},t.PI_D=2*Math.PI,t.PI_H=Math.PI/2,t.PI_Q=Math.PI/4,t.ANGLE_TO_RADIAN=Math.PI/180,t.RADIAN_TO_ANGLE=180/Math.PI,t.SECOND_TO_MILLISECOND=1e3,t.NO_TWEEN=100,t.VERSION="4.7.2",t.debug=!1,t.debugDraw=!1,t._armatures=[],t})();t.DragonBones=e})(n||(n={})),(function(t){var e=(function(){function t(){this.hashCode=t._hashCode++}return t._returnObject=function(e){var i=String(e.constructor),n=null==t._maxCountMap[i]?t._defaultMaxCount:t._maxCountMap[i],r=t._poolsMap[i]=t._poolsMap[i]||[];if(r.lengthi&&(r.length=i)}else for(var n in t._defaultMaxCount=i,t._poolsMap){var r;if(null!=t._maxCountMap[n])t._maxCountMap[n]=i,(r=t._poolsMap[n]).length>i&&(r.length=i)}},t.clearPool=function(e){if(void 0===e&&(e=null),e)(n=t._poolsMap[String(e)])&&n.length&&(n.length=0);else for(var i in t._poolsMap){var n;(n=t._poolsMap[i]).length=0}},t.borrowObject=function(e){var i=t._poolsMap[String(e)];if(i&&i.length)return i.pop();var n=new e;return n._onClear(),n},t.prototype.returnToPool=function(){this._onClear(),t._returnObject(this)},t._hashCode=0,t._defaultMaxCount=5e3,t._maxCountMap={},t._poolsMap={},t})();t.BaseObject=e})(n||(n={})),(function(t){var e=(function(){function t(t,e,i,n,r,s,o,a){void 0===t&&(t=1),void 0===e&&(e=1),void 0===i&&(i=1),void 0===n&&(n=1),void 0===r&&(r=0),void 0===s&&(s=0),void 0===o&&(o=0),void 0===a&&(a=0),this.alphaMultiplier=t,this.redMultiplier=e,this.greenMultiplier=i,this.blueMultiplier=n,this.alphaOffset=r,this.redOffset=s,this.greenOffset=o,this.blueOffset=a}return t.prototype.copyFrom=function(t){this.alphaMultiplier=t.alphaMultiplier,this.redMultiplier=t.redMultiplier,this.greenMultiplier=t.greenMultiplier,this.blueMultiplier=t.blueMultiplier,this.alphaOffset=t.alphaOffset,this.redOffset=t.redOffset,this.redOffset=t.redOffset,this.greenOffset=t.blueOffset},t.prototype.identity=function(){this.alphaMultiplier=this.redMultiplier=this.greenMultiplier=this.blueMultiplier=1,this.alphaOffset=this.redOffset=this.greenOffset=this.blueOffset=0},t})();t.ColorTransform=e})(n||(n={})),(function(t){var e=(function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=t,this.y=e}return t.prototype.copyFrom=function(t){this.x=t.x,this.y=t.y},t.prototype.clear=function(){this.x=this.y=0},t})();t.Point=e})(n||(n={})),(function(t){var e=(function(){function t(t,e,i,n,r,s){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=1),void 0===r&&(r=0),void 0===s&&(s=0),this.a=t,this.b=e,this.c=i,this.d=n,this.tx=r,this.ty=s}return t.prototype.toString=function(){return"[object dragonBones.Matrix] a:"+this.a+" b:"+this.b+" c:"+this.c+" d:"+this.d+" tx:"+this.tx+" ty:"+this.ty},t.prototype.copyFrom=function(t){this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty},t.prototype.identity=function(){this.a=this.d=1,this.b=this.c=0,this.tx=this.ty=0},t.prototype.concat=function(t){var e=this.a,i=this.b,n=this.c,r=this.d,s=this.tx,o=this.ty,a=t.a,c=t.b,h=t.c,l=t.d,u=t.tx,_=t.ty;this.a=e*a+i*h,this.b=e*c+i*l,this.c=n*a+r*h,this.d=n*c+r*l,this.tx=a*s+h*o+u,this.ty=l*o+c*s+_},t.prototype.invert=function(){var t=this.a,e=this.b,i=this.c,n=this.d,r=this.tx,s=this.ty,o=t*n-e*i;this.a=n/o,this.b=-e/o,this.c=-i/o,this.d=t/o,this.tx=(i*s-n*r)/o,this.ty=-(t*s-e*r)/o},t.prototype.transformPoint=function(t,e,i,n){void 0===n&&(n=!1),i.x=this.a*t+this.c*e,i.y=this.b*t+this.d*e,n||(i.x+=this.tx,i.y+=this.ty)},t})();t.Matrix=e})(n||(n={})),(function(t){var e=(function(){function t(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.x=t,this.y=e,this.width=i,this.height=n}return t.prototype.copyFrom=function(t){this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height},t.prototype.clear=function(){this.x=this.y=0,this.width=this.height=0},t})();t.Rectangle=e})(n||(n={})),(function(t){var e=(function(){function t(t,e,i,n,r,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=1),void 0===s&&(s=1),this.x=t,this.y=e,this.skewX=i,this.skewY=n,this.scaleX=r,this.scaleY=s}return t.normalizeRadian=function(t){return t=(t+Math.PI)%(2*Math.PI),t+=t>0?-Math.PI:Math.PI},t.prototype.toString=function(){return"[object dragonBones.Transform] x:"+this.x+" y:"+this.y+" skewX:"+180*this.skewX/Math.PI+" skewY:"+180*this.skewY/Math.PI+" scaleX:"+this.scaleX+" scaleY:"+this.scaleY},t.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.skewX=t.skewX,this.skewY=t.skewY,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this},t.prototype.identity=function(){return this.x=this.y=this.skewX=this.skewY=0,this.scaleX=this.scaleY=1,this},t.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this.skewX+=t.skewX,this.skewY+=t.skewY,this.scaleX*=t.scaleX,this.scaleY*=t.scaleY,this},t.prototype.minus=function(e){return this.x-=e.x,this.y-=e.y,this.skewX=t.normalizeRadian(this.skewX-e.skewX),this.skewY=t.normalizeRadian(this.skewY-e.skewY),this.scaleX/=e.scaleX,this.scaleY/=e.scaleY,this},t.prototype.fromMatrix=function(t){var e=.25*Math.PI,i=this.scaleX,n=this.scaleY;return this.x=t.tx,this.y=t.ty,this.skewX=Math.atan(-t.c/t.d),this.skewY=Math.atan(t.b/t.a),this.skewX!=this.skewX&&(this.skewX=0),this.skewY!=this.skewY&&(this.skewY=0),this.scaleY=this.skewX>-e&&this.skewX-e&&this.skewY=0&&this.scaleX<0&&(this.scaleX=-this.scaleX,this.skewY=this.skewY-Math.PI),n>=0&&this.scaleY<0&&(this.scaleY=-this.scaleY,this.skewX=this.skewX-Math.PI),this},t.prototype.toMatrix=function(t){return t.a=this.scaleX*Math.cos(this.skewY),t.b=this.scaleX*Math.sin(this.skewY),t.c=-this.scaleY*Math.sin(this.skewX),t.d=this.scaleY*Math.cos(this.skewX),t.tx=this.x,t.ty=this.y,this},Object.defineProperty(t.prototype,"rotation",{get:function(){return this.skewY},set:function(t){var e=t-this.skewY;this.skewX+=e,this.skewY+=e},enumerable:!0,configurable:!0}),t})();t.Transform=e})(n||(n={})),(function(t){var e=(function(t){function e(){t.call(this)}return r(e,t),e.prototype._onClear=function(){this._isCompleted=!1,this._currentPlayTimes=0,this._currentTime=-1,this._timeline=null,this._isReverse=!1,this._hasAsynchronyTimeline=!1,this._frameRate=0,this._keyFrameCount=0,this._frameCount=0,this._position=0,this._duration=0,this._animationDutation=0,this._timeScale=1,this._timeOffset=0,this._currentFrame=null,this._armature=null,this._animationState=null},e.prototype._onUpdateFrame=function(t){},e.prototype._onArriveAtFrame=function(t){},e.prototype._setCurrentTime=function(t){var e=0;if(1==this._keyFrameCount&&this!=this._animationState._timeline)this._isCompleted=this._animationState._fadeState>=0,e=1;else if(this._hasAsynchronyTimeline){var i=this._animationState.playTimes,n=i*this._duration;t*=this._timeScale,0!=this._timeOffset&&(t+=this._timeOffset*this._animationDutation),i>0&&(t>=n||t<=-n)?(this._isCompleted=!0,e=i,t=t<0?0:this._duration):(this._isCompleted=!1,t<0?(e=Math.floor(-t/this._duration),t=this._duration- -t%this._duration):(e=Math.floor(t/this._duration),t%=this._duration),i>0&&e>i&&(e=i)),t+=this._position}else this._isCompleted=this._animationState._timeline._isCompleted,e=this._animationState._timeline._currentPlayTimes;return this._currentTime!=t&&(this._isReverse=this._currentTime>t&&this._currentPlayTimes==e,this._currentTime=t,this._currentPlayTimes=e,this._animationState._onFadeInComplete&&(this._currentFrame=null),!0)},e.prototype.fadeIn=function(t,e,i,n){this._armature=t,this._animationState=e,this._timeline=i;var r=this==this._animationState._timeline;this._hasAsynchronyTimeline=r||this._animationState.animationData.hasAsynchronyTimeline,this._frameRate=this._armature.armatureData.frameRate,this._keyFrameCount=this._timeline.frames.length,this._frameCount=this._animationState.animationData.frameCount,this._position=this._animationState._position,this._duration=this._animationState._duration,this._animationDutation=this._animationState.animationData.duration,this._timeScale=r?1:1/this._timeline.scale,this._timeOffset=r?0:this._timeline.offset},e.prototype.fadeOut=function(){},e.prototype.update=function(t){if(!this._isCompleted&&this._setCurrentTime(t)){var e=this._keyFrameCount>1?Math.floor(this._currentTime*this._frameRate):0,i=this._timeline.frames[e];this._currentFrame!=i&&(this._currentFrame=i,this._onArriveAtFrame(!0)),this._onUpdateFrame(!0)}},e})(t.BaseObject);t.TimelineState=e;var i=(function(e){function i(){e.call(this)}return r(i,e),i._getEasingValue=function(t,e){if(t<=0)return 0;if(t>=1)return 1;var i=1;if(e>2)return t;if(e>1)i=.5*(1-Math.cos(t*Math.PI)),e-=1;else if(e>0)i=1-Math.pow(1-t,2);else if(e>=-1)e*=-1,i=Math.pow(t,2);else{if(!(e>=-2))return t;e*=-1,i=Math.acos(1-2*t)/Math.PI,e-=1}return(i-t)*e+t},i._getEasingCurveValue=function(t,e){if(t<=0)return 0;if(t>=1)return 1;var i=e.length+1,n=Math.floor(t*i),r=0==n?0:e[n-1];return r+((n==i-1?1:e[n])-r)*(t-n/i)},i.prototype._onClear=function(){e.prototype._onClear.call(this),this._tweenProgress=0,this._tweenEasing=t.DragonBones.NO_TWEEN,this._curve=null},i.prototype._onArriveAtFrame=function(e){this._tweenEasing=this._currentFrame.tweenEasing,this._curve=this._currentFrame.curve,(this._keyFrameCount<=1||this._currentFrame.next==this._timeline.frames[0]&&(this._tweenEasing!=t.DragonBones.NO_TWEEN||this._curve)&&this._animationState.playTimes>0&&this._animationState.currentPlayTimes==this._animationState.playTimes-1)&&(this._tweenEasing=t.DragonBones.NO_TWEEN,this._curve=null)},i.prototype._onUpdateFrame=function(e){this._tweenEasing!=t.DragonBones.NO_TWEEN?(this._tweenProgress=(this._currentTime-this._currentFrame.position+this._position)/this._currentFrame.duration,0!=this._tweenEasing&&(this._tweenProgress=i._getEasingValue(this._tweenProgress,this._tweenEasing))):this._curve?(this._tweenProgress=(this._currentTime-this._currentFrame.position+this._position)/this._currentFrame.duration,this._tweenProgress=i._getEasingCurveValue(this._tweenProgress,this._curve)):this._tweenProgress=0},i.prototype._updateExtensionKeyFrame=function(t,e,i){var n=0;if(t.type==e.type)for(var r=0,s=t.tweens.length;r0&&(n=2)}if(0==n){i.type!=t.type&&(n=1,i.type=t.type),i.tweens.length!=t.tweens.length&&(n=1,i.tweens.length=t.tweens.length),i.keys.length!=t.keys.length&&(n=1,i.keys.length=t.keys.length);for(r=0,s=t.keys.length;re.layer?-1:1},i.toString=function(){return"[class dragonBones.Animation]"},i.prototype._onClear=function(){for(var t in this._animations)delete this._animations[t];t=0;for(var e=this._animationStates.length;t0&&c._fadeProgress<=0?(c.returnToPool(),this._animationStates.length=0,this._animationStateDirty=!0,this._lastAnimationState=null):c._advanceTime(t,1,0);else if(e>1)for(var i=this._animationStates[0]._layer,n=1,r=0,s=1,o=0,a=0;o0&&c._fadeProgress<=0?(a++,c.returnToPool(),this._animationStateDirty=!0,this._lastAnimationState==c&&(this._lastAnimationState=o-a>=0?this._animationStates[o-a]:null)):(a>0&&(this._animationStates[o-a]=c),i!=c._layer&&(i=c._layer,r>=n?n=0:n-=r,r=0),c._advanceTime(t,n,s),c._weightResult>0&&(r+=c._weightResult,s++)),o==e-1&&a>0&&(this._animationStates.length-=a)}}},i.prototype.reset=function(){for(var t=0,e=this._animationStates.length;t0?0:this._time,f=this._duration>0?this._time:_.position,m=this._duration>0?this._duration:_.duration;this._lastAnimationState=t.BaseObject.borrowObject(t.AnimationState),this._lastAnimationState._layer=s,this._lastAnimationState._group=o,this._lastAnimationState.additiveBlending=c,this._lastAnimationState.displayControl=h,this._lastAnimationState._fadeIn(this._armature,_.animation||_,e,r,f,m,d,1/_.scale,n,u),this._animationStates.push(this._lastAnimationState),this._animationStateDirty=!0,this._time=0,this._duration=0,this._armature._cacheFrameIndex=-1,this._animationStates.length>1&&this._animationStates.sort(i._sortAnimationState);for(var p=this._armature.getSlots(),g=0,y=p.length;gr.duration-this._time&&(this._duration=r.duration-this._time)),this.fadeIn(t,0,i,0,null,4)},i.prototype.gotoAndPlayByFrame=function(t,e,i,n){void 0===e&&(e=0),void 0===i&&(i=-1),void 0===n&&(n=0);var r=this._animations[t];return r&&(this._time=r.duration*e/r.frameCount,this._duration<0?this._duration=0:this._duration>r.duration-this._time&&(this._duration=r.duration-this._time)),this.fadeIn(t,0,i,0,null,4)},i.prototype.gotoAndPlayByProgress=function(t,e,i,n){void 0===e&&(e=0),void 0===i&&(i=-1),void 0===n&&(n=0);var r=this._animations[t];return r&&(this._time=r.duration*(e>0?e:0),this._duration<0?this._duration=0:this._duration>r.duration-this._time&&(this._duration=r.duration-this._time)),this.fadeIn(t,0,i,0,null,4)},i.prototype.gotoAndStopByTime=function(t,e){void 0===e&&(e=0);var i=this.gotoAndPlayByTime(t,e,1);return i&&i.stop(),i},i.prototype.gotoAndStopByFrame=function(t,e){void 0===e&&(e=0);var i=this.gotoAndPlayByFrame(t,e,1);return i&&i.stop(),i},i.prototype.gotoAndStopByProgress=function(t,e){void 0===e&&(e=0);var i=this.gotoAndPlayByProgress(t,e,1);return i&&i.stop(),i},i.prototype.getState=function(t){for(var e=0,i=this._animationStates.length;e1?this._isPlaying&&!this.isCompleted:this._lastAnimationState?this._isPlaying&&this._lastAnimationState.isPlaying:this._isPlaying},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isCompleted",{get:function(){if(this._lastAnimationState){if(!this._lastAnimationState.isCompleted)return!1;for(var t=0,e=this._animationStates.length;t0&&(h.timeScale=h.totalTime/i),h},i.prototype.gotoAndStop=function(t,e){return void 0===e&&(e=0),this.gotoAndStopByTime(t,e)},Object.defineProperty(i.prototype,"animationList",{get:function(){return this._animationNames},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"animationDataList",{get:function(){for(var t=[],e=0,i=this._animationNames.length;e=this.fadeTotalTime?this._fadeState>0?0:1:this._fadeTime>0?this._fadeState>0?1-this._fadeTime/this.fadeTotalTime:this._fadeTime/this.fadeTotalTime:this._fadeState>0?1:0,this._fadeProgress!=i){this._fadeProgress=i;var n=this._armature._display;if(this._fadeTime<=e)if(this._fadeState>0){if(n.hasEvent(t.EventObject.FADE_OUT)){var r=t.BaseObject.borrowObject(t.EventObject);r.animationState=this,this._armature._bufferEvent(r,t.EventObject.FADE_OUT)}}else if(n.hasEvent(t.EventObject.FADE_IN)){var s=t.BaseObject.borrowObject(t.EventObject);s.animationState=this,this._armature._bufferEvent(s,t.EventObject.FADE_IN)}if(this._fadeTime>=this.fadeTotalTime)if(this._fadeState>0){if(n.hasEvent(t.EventObject.FADE_OUT_COMPLETE)){var o=t.BaseObject.borrowObject(t.EventObject);o.animationState=this,this._armature._bufferEvent(o,t.EventObject.FADE_OUT_COMPLETE)}}else if(this._onFadeInComplete=!0,this._isPausePlayhead=!1,this._fadeState=0,n.hasEvent(t.EventObject.FADE_IN_COMPLETE)){var a=t.BaseObject.borrowObject(t.EventObject);a.animationState=this,this._armature._bufferEvent(a,t.EventObject.FADE_IN_COMPLETE)}}},i.prototype._isDisabled=function(t){return!(this.displayControl&&(!t.displayController||t.displayController==this._name||t.displayController==this._group))},i.prototype._fadeIn=function(e,n,r,s,o,a,c,h,l,u){this._armature=e,this._animationData=n,this._name=r,this.actionEnabled=i.stateActionEnabled,this.playTimes=s,this.timeScale=h,this.fadeTotalTime=l,this._fadeState=-1,this._position=o,this._duration=a,this._time=c,this._isPausePlayhead=u,this.fadeTotalTime<=0&&(this._fadeProgress=.999999),this._timeline=t.BaseObject.borrowObject(t.AnimationTimelineState),this._timeline.fadeIn(this._armature,this,this._animationData,this._time),this._animationData.zOrderTimeline&&(this._zOrderTimeline=t.BaseObject.borrowObject(t.ZOrderTimelineState),this._zOrderTimeline.fadeIn(this._armature,this,this._animationData.zOrderTimeline,this._time)),this._updateTimelineStates()},i.prototype._updateFFDTimelineStates=function(){var e=this._time;this._animationData.hasAsynchronyTimeline||(e=this._timeline._currentTime);for(var i={},n=0,r=this._ffdTimelines.length;n=1&&0==i&&n>0,s=!0,o=!0,a=2*n;if(a=r?Math.floor(this._time*a)/a:this._time,this._timeline.update(a),this._animationData.hasAsynchronyTimeline||(a=this._timeline._currentTime),this._zOrderTimeline&&this._zOrderTimeline.update(a),r){var c=Math.floor(this._timeline._currentTime*n);if(this._armature._cacheFrameIndex==c)s=!1,o=!1;else{if(this._armature._cacheFrameIndex=c,this._armature._animation._animationStateDirty){this._armature._animation._animationStateDirty=!1;for(var h=0,l=this._boneTimelines.length;h=0&&this._fadeProgress>=1&&this._timeline._isCompleted&&this.fadeOut(this.autoFadeOutTime)},i.prototype.play=function(){this._isPlaying=!0},i.prototype.stop=function(){this._isPlaying=!1},i.prototype.fadeOut=function(t,e){if(void 0===e&&(e=!0),(t<0||t!=t)&&(t=0),this._isPausePlayhead=e,this._fadeState>0){if(t>t-this._fadeTime)return}else{this._fadeState=1,(t<=0||this._fadeProgress<=0)&&(this._fadeProgress=1e-6);for(var i=0,n=this._boneTimelines.length;i1e-6?t/this._fadeProgress:0,this._fadeTime=this.fadeTotalTime*(1-this._fadeProgress)},i.prototype.containsBoneMask=function(t){return!this._boneMask.length||this._boneMask.indexOf(t)>=0},i.prototype.addBoneMask=function(t,e){void 0===e&&(e=!0);var i=this._armature.getBone(t);if(i){if(this._boneMask.indexOf(t)<0&&this._animationData.getBoneTimeline(t)&&this._boneMask.push(t),e)for(var n=this._armature.getBones(),r=0,s=n.length;r=0&&this._boneMask.splice(i,1),e){var n=this._armature.getBone(t);if(n)for(var r=this._armature.getBones(),s=0,o=r.length;s=0&&n.contains(a)&&this._boneMask.splice(h,1)}}this._updateTimelineStates()},i.prototype.removeAllBoneMask=function(){this._boneMask.length=0,this._updateTimelineStates()},Object.defineProperty(i.prototype,"layer",{get:function(){return this._layer},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"group",{get:function(){return this._group},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"name",{get:function(){return this._name},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"animationData",{get:function(){return this._animationData},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isCompleted",{get:function(){return this._timeline._isCompleted},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isPlaying",{get:function(){return this._isPlaying&&!this._timeline._isCompleted},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"currentPlayTimes",{get:function(){return this._timeline._currentPlayTimes},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"totalTime",{get:function(){return this._duration},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"currentTime",{get:function(){return this._timeline._currentTime},set:function(t){(t<0||t!=t)&&(t=0);var e=this._timeline._currentPlayTimes-(this._timeline._isCompleted?1:0);if(t=t%this._duration+e*this._duration,this._time!=t){this._time=t,this._timeline.setCurrentTime(this._time),this._zOrderTimeline&&(this._zOrderTimeline._isCompleted=!1);for(var i=0,n=this._boneTimelines.length;i0){var s=this._keyFrameCount>1?Math.floor(this._currentTime*this._frameRate):0,o=this._timeline.frames[s];if(this._currentFrame!=o)if(this._keyFrameCount>1){var a=this._currentFrame;if(this._currentFrame=o,!a){var c=Math.floor(i*this._frameRate);a=this._timeline.frames[c],this._isReverse||(i<=a.position||n!=this._currentPlayTimes)&&(a=a.prev)}if(this._isReverse)for(;a!=o;)this._onCrossFrame(a),a=a.prev;else for(;a!=o;)a=a.next,this._onCrossFrame(a)}else this._currentFrame=o,this._onCrossFrame(this._currentFrame)}if(n!=this._currentPlayTimes){var h;if(r.hasEvent(t.EventObject.LOOP_COMPLETE))(h=t.BaseObject.borrowObject(t.EventObject)).animationState=this._animationState,this._armature._bufferEvent(h,t.EventObject.LOOP_COMPLETE);if(this._isCompleted&&r.hasEvent(t.EventObject.COMPLETE))(h=t.BaseObject.borrowObject(t.EventObject)).animationState=this._animationState,this._armature._bufferEvent(h,t.EventObject.COMPLETE);this._currentFrame=null}}},i.prototype.setCurrentTime=function(t){this._setCurrentTime(t),this._currentFrame=null},i})(t.TimelineState);t.AnimationTimelineState=e;var i=(function(t){function e(){t.call(this)}return r(e,t),e.toString=function(){return"[class dragonBones.ZOrderTimelineState]"},e.prototype._onArriveAtFrame=function(e){t.prototype._onArriveAtFrame.call(this,e),this._armature._sortZOrder(this._currentFrame.zOrder)},e})(t.TimelineState);t.ZOrderTimelineState=i;var n=(function(e){function i(){e.call(this),this._transform=new t.Transform,this._currentTransform=new t.Transform,this._durationTransform=new t.Transform}return r(i,e),i.toString=function(){return"[class dragonBones.BoneTimelineState]"},i.prototype._onClear=function(){e.prototype._onClear.call(this),this.bone=null,this._tweenTransform=0,this._tweenRotate=0,this._tweenScale=0,this._boneTransform=null,this._originalTransform=null,this._transform.identity(),this._currentTransform.identity(),this._durationTransform.identity()},i.prototype._onArriveAtFrame=function(i){if(e.prototype._onArriveAtFrame.call(this,i),this._currentTransform.copyFrom(this._currentFrame.transform),this._tweenTransform=1,this._tweenRotate=1,this._tweenScale=1,this._keyFrameCount>1&&(this._tweenEasing!=t.DragonBones.NO_TWEEN||this._curve)){var n=this._currentFrame.next.transform;this._durationTransform.x=n.x-this._currentTransform.x,this._durationTransform.y=n.y-this._currentTransform.y,0==this._durationTransform.x&&0==this._durationTransform.y||(this._tweenTransform=2);var r=this._currentFrame.tweenRotate;if(r==r){if(r)if(r>0?n.skewY>=this._currentTransform.skewY:n.skewY<=this._currentTransform.skewY){var s=r>0?r-1:r+1;this._durationTransform.skewX=n.skewX-this._currentTransform.skewX+t.DragonBones.PI_D*s,this._durationTransform.skewY=n.skewY-this._currentTransform.skewY+t.DragonBones.PI_D*s}else this._durationTransform.skewX=n.skewX-this._currentTransform.skewX+t.DragonBones.PI_D*r,this._durationTransform.skewY=n.skewY-this._currentTransform.skewY+t.DragonBones.PI_D*r;else this._durationTransform.skewX=t.Transform.normalizeRadian(n.skewX-this._currentTransform.skewX),this._durationTransform.skewY=t.Transform.normalizeRadian(n.skewY-this._currentTransform.skewY);0==this._durationTransform.skewX&&0==this._durationTransform.skewY||(this._tweenRotate=2)}else this._durationTransform.skewX=0,this._durationTransform.skewY=0;this._currentFrame.tweenScale?(this._durationTransform.scaleX=n.scaleX-this._currentTransform.scaleX,this._durationTransform.scaleY=n.scaleY-this._currentTransform.scaleY,0==this._durationTransform.scaleX&&0==this._durationTransform.scaleY||(this._tweenScale=2)):(this._durationTransform.scaleX=0,this._durationTransform.scaleY=0)}else this._durationTransform.x=0,this._durationTransform.y=0,this._durationTransform.skewX=0,this._durationTransform.skewY=0,this._durationTransform.scaleX=0,this._durationTransform.scaleY=0},i.prototype._onUpdateFrame=function(t){if(this._tweenTransform||this._tweenRotate||this._tweenScale){e.prototype._onUpdateFrame.call(this,t);var i=0;this._tweenTransform&&(1==this._tweenTransform?(this._tweenTransform=0,i=0):i=this._tweenProgress,this._animationState.additiveBlending?(this._transform.x=this._currentTransform.x+this._durationTransform.x*i,this._transform.y=this._currentTransform.y+this._durationTransform.y*i):(this._transform.x=this._originalTransform.x+this._currentTransform.x+this._durationTransform.x*i,this._transform.y=this._originalTransform.y+this._currentTransform.y+this._durationTransform.y*i)),this._tweenRotate&&(1==this._tweenRotate?(this._tweenRotate=0,i=0):i=this._tweenProgress,this._animationState.additiveBlending?(this._transform.skewX=this._currentTransform.skewX+this._durationTransform.skewX*i,this._transform.skewY=this._currentTransform.skewY+this._durationTransform.skewY*i):(this._transform.skewX=this._originalTransform.skewX+this._currentTransform.skewX+this._durationTransform.skewX*i,this._transform.skewY=this._originalTransform.skewY+this._currentTransform.skewY+this._durationTransform.skewY*i)),this._tweenScale&&(1==this._tweenScale?(this._tweenScale=0,i=0):i=this._tweenProgress,this._animationState.additiveBlending?(this._transform.scaleX=this._currentTransform.scaleX+this._durationTransform.scaleX*i,this._transform.scaleY=this._currentTransform.scaleY+this._durationTransform.scaleY*i):(this._transform.scaleX=this._originalTransform.scaleX*(this._currentTransform.scaleX+this._durationTransform.scaleX*i),this._transform.scaleY=this._originalTransform.scaleY*(this._currentTransform.scaleY+this._durationTransform.scaleY*i))),this.bone.invalidUpdate()}},i.prototype.fadeIn=function(t,i,n,r){e.prototype.fadeIn.call(this,t,i,n,r),this._originalTransform=this._timeline.originalTransform,this._boneTransform=this.bone._animationPose},i.prototype.fadeOut=function(){this._transform.skewX=t.Transform.normalizeRadian(this._transform.skewX),this._transform.skewY=t.Transform.normalizeRadian(this._transform.skewY)},i.prototype.update=function(t){e.prototype.update.call(this,t);var i=this._animationState._weightResult;i>0&&(0==this.bone._blendIndex?(this._boneTransform.x=this._transform.x*i,this._boneTransform.y=this._transform.y*i,this._boneTransform.skewX=this._transform.skewX*i,this._boneTransform.skewY=this._transform.skewY*i,this._boneTransform.scaleX=(this._transform.scaleX-1)*i+1,this._boneTransform.scaleY=(this._transform.scaleY-1)*i+1):(this._boneTransform.x+=this._transform.x*i,this._boneTransform.y+=this._transform.y*i,this._boneTransform.skewX+=this._transform.skewX*i,this._boneTransform.skewY+=this._transform.skewY*i,this._boneTransform.scaleX+=(this._transform.scaleX-1)*i,this._boneTransform.scaleY+=(this._transform.scaleY-1)*i),this.bone._blendIndex++,0!=this._animationState._fadeState&&this.bone.invalidUpdate())},i})(t.TweenTimelineState);t.BoneTimelineState=n;var s=(function(e){function i(){e.call(this),this._color=new t.ColorTransform,this._durationColor=new t.ColorTransform}return r(i,e),i.toString=function(){return"[class dragonBones.SlotTimelineState]"},i.prototype._onClear=function(){e.prototype._onClear.call(this),this.slot=null,this._colorDirty=!1,this._tweenColor=0,this._slotColor=null,this._color.identity(),this._durationColor.identity()},i.prototype._onArriveAtFrame=function(i){if(e.prototype._onArriveAtFrame.call(this,i),this._animationState._isDisabled(this.slot))return this._tweenEasing=t.DragonBones.NO_TWEEN,this._curve=null,void(this._tweenColor=0);this._animationState._fadeState>=0&&(this.slot._setDisplayIndex(this._currentFrame.displayIndex),this.slot._updateMeshData(!0)),this._tweenColor=0;var n=this._currentFrame.color;if(this._keyFrameCount>1&&(this._tweenEasing!=t.DragonBones.NO_TWEEN||this._curve)){var r=this._currentFrame.next,s=r.color;n!=s&&r.displayIndex>=0&&(this._durationColor.alphaMultiplier=s.alphaMultiplier-n.alphaMultiplier,this._durationColor.redMultiplier=s.redMultiplier-n.redMultiplier,this._durationColor.greenMultiplier=s.greenMultiplier-n.greenMultiplier,this._durationColor.blueMultiplier=s.blueMultiplier-n.blueMultiplier,this._durationColor.alphaOffset=s.alphaOffset-n.alphaOffset,this._durationColor.redOffset=s.redOffset-n.redOffset,this._durationColor.greenOffset=s.greenOffset-n.greenOffset,this._durationColor.blueOffset=s.blueOffset-n.blueOffset,0==this._durationColor.alphaMultiplier&&0==this._durationColor.redMultiplier&&0==this._durationColor.greenMultiplier&&0==this._durationColor.blueMultiplier&&0==this._durationColor.alphaOffset&&0==this._durationColor.redOffset&&0==this._durationColor.greenOffset&&0==this._durationColor.blueOffset||(this._tweenColor=2))}0==this._tweenColor&&(this._slotColor.alphaMultiplier==n.alphaMultiplier&&this._slotColor.redMultiplier==n.redMultiplier&&this._slotColor.greenMultiplier==n.greenMultiplier&&this._slotColor.blueMultiplier==n.blueMultiplier&&this._slotColor.alphaOffset==n.alphaOffset&&this._slotColor.redOffset==n.redOffset&&this._slotColor.greenOffset==n.greenOffset&&this._slotColor.blueOffset==n.blueOffset||(this._tweenColor=1))},i.prototype._onUpdateFrame=function(t){e.prototype._onUpdateFrame.call(this,t);var i=0;if(this._tweenColor){1==this._tweenColor?(this._tweenColor=0,i=0):i=this._tweenProgress;var n=this._currentFrame.color;this._color.alphaMultiplier=n.alphaMultiplier+this._durationColor.alphaMultiplier*i,this._color.redMultiplier=n.redMultiplier+this._durationColor.redMultiplier*i,this._color.greenMultiplier=n.greenMultiplier+this._durationColor.greenMultiplier*i,this._color.blueMultiplier=n.blueMultiplier+this._durationColor.blueMultiplier*i,this._color.alphaOffset=n.alphaOffset+this._durationColor.alphaOffset*i,this._color.redOffset=n.redOffset+this._durationColor.redOffset*i,this._color.greenOffset=n.greenOffset+this._durationColor.greenOffset*i,this._color.blueOffset=n.blueOffset+this._durationColor.blueOffset*i,this._colorDirty=!0}},i.prototype.fadeIn=function(t,i,n,r){e.prototype.fadeIn.call(this,t,i,n,r),this._slotColor=this.slot._colorTransform},i.prototype.fadeOut=function(){this._tweenColor=0},i.prototype.update=function(t){if((e.prototype.update.call(this,t),0!=this._tweenColor||this._colorDirty)&&this._animationState._weightResult>0)if(0!=this._animationState._fadeState){var i=Math.pow(this._animationState._fadeProgress,4);this._slotColor.alphaMultiplier+=(this._color.alphaMultiplier-this._slotColor.alphaMultiplier)*i,this._slotColor.redMultiplier+=(this._color.redMultiplier-this._slotColor.redMultiplier)*i,this._slotColor.greenMultiplier+=(this._color.greenMultiplier-this._slotColor.greenMultiplier)*i,this._slotColor.blueMultiplier+=(this._color.blueMultiplier-this._slotColor.blueMultiplier)*i,this._slotColor.alphaOffset+=(this._color.alphaOffset-this._slotColor.alphaOffset)*i,this._slotColor.redOffset+=(this._color.redOffset-this._slotColor.redOffset)*i,this._slotColor.greenOffset+=(this._color.greenOffset-this._slotColor.greenOffset)*i,this._slotColor.blueOffset+=(this._color.blueOffset-this._slotColor.blueOffset)*i,this.slot._colorDirty=!0}else this._colorDirty&&(this._colorDirty=!1,this._slotColor.alphaMultiplier=this._color.alphaMultiplier,this._slotColor.redMultiplier=this._color.redMultiplier,this._slotColor.greenMultiplier=this._color.greenMultiplier,this._slotColor.blueMultiplier=this._color.blueMultiplier,this._slotColor.alphaOffset=this._color.alphaOffset,this._slotColor.redOffset=this._color.redOffset,this._slotColor.greenOffset=this._color.greenOffset,this._slotColor.blueOffset=this._color.blueOffset,this.slot._colorDirty=!0)},i})(t.TweenTimelineState);t.SlotTimelineState=s;var o=(function(e){function i(){e.call(this),this._ffdVertices=[]}return r(i,e),i.toString=function(){return"[class dragonBones.FFDTimelineState]"},i.prototype._onClear=function(){e.prototype._onClear.call(this),this.slot=null,this._tweenFFD=0,this._slotFFDVertices=null,this._durationFFDFrame&&(this._durationFFDFrame.returnToPool(),this._durationFFDFrame=null),this._ffdVertices.length=0},i.prototype._onArriveAtFrame=function(i){if(e.prototype._onArriveAtFrame.call(this,i),this._tweenFFD=0,(this._tweenEasing!=t.DragonBones.NO_TWEEN||this._curve)&&(this._tweenFFD=this._updateExtensionKeyFrame(this._currentFrame,this._currentFrame.next,this._durationFFDFrame)),0==this._tweenFFD)for(var n=this._currentFrame.tweens,r=0,s=n.length;r0){if(0==this.slot._blendIndex)for(var n=0,r=this._ffdVertices.length;n0&&(this._animatebles[i-n]=s,this._animatebles[i]=null),s.advanceTime(e)):n++}if(n>0){for(r=this._animatebles.length;i=0},e.prototype.add=function(e){e&&this._animatebles.indexOf(e)<0&&(this._animatebles.push(e),t.DragonBones.debug&&e instanceof t.Armature&&t.DragonBones.addArmature(e))},e.prototype.remove=function(e){var i=this._animatebles.indexOf(e);i>=0&&(this._animatebles[i]=null,t.DragonBones.debug&&e instanceof t.Armature&&t.DragonBones.removeArmature(e))},e.prototype.clear=function(){for(var t=0,e=this._animatebles.length;te._zOrder?1:-1},i.prototype._onClear=function(){for(var t=0,e=this._bones.length;t=t&&(i=0),this._bones.indexOf(r)>=0||(r.parent&&this._bones.indexOf(r.parent)<0||r.ik&&this._bones.indexOf(r.ik)<0||(r.ik&&r.ikChain>0&&r.ikChainIndex==r.ikChain?this._bones.splice(this._bones.indexOf(r.parent)+1,0,r):this._bones.push(r),n++))}}},i.prototype._sortSlots=function(){this._slots.sort(i._onSortSlots)},i.prototype._doAction=function(t){switch(t.type){case 0:this._animation.play(t.data[0],t.data[1]);break;case 1:this._animation.stop(t.data[0]);break;case 2:this._animation.gotoAndPlayByTime(t.data[0],t.data[1],t.data[2]);break;case 3:this._animation.gotoAndStopByTime(t.data[0],t.data[1]);break;case 4:this._animation.fadeIn(t.data[0],t.data[1],t.data[2])}},i.prototype._addBoneToBoneList=function(t){this._bones.indexOf(t)<0&&(this._bonesDirty=!0,this._bones.push(t))},i.prototype._removeBoneFromBoneList=function(t){var e=this._bones.indexOf(t);e>=0&&this._bones.splice(e,1)},i.prototype._addSlotToSlotList=function(t){this._slots.indexOf(t)<0&&(this._slotsDirty=!0,this._slots.push(t))},i.prototype._removeSlotFromSlotList=function(t){var e=this._slots.indexOf(t);e>=0&&this._slots.splice(e,1)},i.prototype._sortZOrder=function(t){for(var e=this._armatureData.sortedSlots,i=t.length<1,n=0,r=e.length;n0){for(n=0,r=this._events.length;n0){for(n=0,r=this._actions.length;n0){if(!s&&!o){g=C;break}var T;s&&((T=c?s.y-e:s.x-t)<0&&(T=-T),(!g||Tl)&&(l=T,d=o.x,f=o.y,y=C,a&&(p=a.y)))}}return g&&s&&(s.x=u,s.y=_,a&&(a.x=m)),y&&o&&(o.x=d,o.y=f,a&&(a.y=p)),g},i.prototype.invalidUpdate=function(t,e){if(void 0===t&&(t=null),void 0===e&&(e=!1),t){var i=this.getBone(t);if(i&&(i.invalidUpdate(),e))for(var n=0,r=this._slots.length;n=0){var i=this._cacheFrames[e];this.globalTransformMatrix==i?this._transformDirty=0:i?(this._transformDirty=2,this.globalTransformMatrix=i):2==this._transformDirty||this._parent&&0!=this._parent._transformDirty||this._ik&&this.ikWeight>0&&0!=this._ik._transformDirty?(this._transformDirty=2,this.globalTransformMatrix=this._globalTransformMatrix):this.globalTransformMatrix!=this._globalTransformMatrix?(this._transformDirty=0,this._cacheFrames[e]=this.globalTransformMatrix):(this._transformDirty=2,this.globalTransformMatrix=this._globalTransformMatrix)}else(2==this._transformDirty||this._parent&&0!=this._parent._transformDirty||this._ik&&this.ikWeight>0&&0!=this._ik._transformDirty)&&(this._transformDirty=2,this.globalTransformMatrix=this._globalTransformMatrix);0!=this._transformDirty&&(2==this._transformDirty?(this._transformDirty=1,this.globalTransformMatrix==this._globalTransformMatrix&&(this.global.x=this.origin.x+this.offset.x+this._animationPose.x,this.global.y=this.origin.y+this.offset.y+this._animationPose.y,this.global.skewX=this.origin.skewX+this.offset.skewX+this._animationPose.skewX,this.global.skewY=this.origin.skewY+this.offset.skewY+this._animationPose.skewY,this.global.scaleX=this.origin.scaleX*this.offset.scaleX*this._animationPose.scaleX,this.global.scaleY=this.origin.scaleY*this.offset.scaleY*this._animationPose.scaleY,this._updateGlobalTransformMatrix(),this._ik&&this._ikChainIndex==this._ikChain&&this.ikWeight>0&&(this.inheritTranslation&&this._ikChain>0&&this._parent?this._computeIKB():this._computeIKA()),e>=0&&!this._cacheFrames[e]&&(this.globalTransformMatrix=t.BoneTimelineData.cacheFrame(this._cacheFrames,e,this._globalTransformMatrix)))):this._transformDirty=0)},i.prototype.invalidUpdate=function(){this._transformDirty=2},i.prototype.contains=function(t){if(t){if(t==this)return!1;for(var e=t;e!=this&&e;)e=e.parent;return e==this}return!1},i.prototype.getBones=function(){this._bones.length=0;for(var t=this._armature.getBones(),e=0,i=t.length;e=0&&this._displayIndex=0&&this._displayIndex0?s.actions:this._childArmature.armatureData.actions;if(o.length>0)for(var a=0,c=o.length;a=0){i=this._displayDataSet&&this._displayIndex=0&&this._cacheFrames){var i=this._cacheFrames[e];this.globalTransformMatrix==i?this._transformDirty=!1:i?(this._transformDirty=!0,this.globalTransformMatrix=i):this._transformDirty||0!=this._parent._transformDirty?(this._transformDirty=!0,this.globalTransformMatrix=this._globalTransformMatrix):this.globalTransformMatrix!=this._globalTransformMatrix?(this._transformDirty=!1,this._cacheFrames[e]=this.globalTransformMatrix):(this._transformDirty=!0,this.globalTransformMatrix=this._globalTransformMatrix)}else(this._transformDirty||0!=this._parent._transformDirty)&&(this._transformDirty=!0,this.globalTransformMatrix=this._globalTransformMatrix);this._transformDirty&&(this._transformDirty=!1,this.globalTransformMatrix==this._globalTransformMatrix&&(this._updateGlobalTransformMatrix(),e>=0&&this._cacheFrames&&!this._cacheFrames[e]&&(this.globalTransformMatrix=t.SlotTimelineData.cacheFrame(this._cacheFrames,e,this._globalTransformMatrix))),this._updateTransform())}},i.prototype._setDisplayList=function(e){if(e&&e.length>0){this._displayList.length!=e.length&&(this._displayList.length=e.length);for(var i=0,n=e.length;i0&&(this._displayList.length=0);return this._displayIndex>=0&&this._displayIndex0&&(1==l||2==l?o?(this.globalTransformMatrix.transformPoint(o.x,o.y,o),a&&(a.x=o.x,a.y=o.y)):a&&this.globalTransformMatrix.transformPoint(a.x,a.y,a):(o&&this.globalTransformMatrix.transformPoint(o.x,o.y,o),a&&this.globalTransformMatrix.transformPoint(a.x,a.y,a)),c&&(this.globalTransformMatrix.transformPoint(Math.cos(c.x),Math.sin(c.x),i._helpPoint,!0),c.x=Math.atan2(i._helpPoint.y,i._helpPoint.x),this.globalTransformMatrix.transformPoint(Math.cos(c.y),Math.sin(c.y),i._helpPoint,!0),c.y=Math.atan2(i._helpPoint.y,i._helpPoint.x))),l},i.prototype.invalidUpdate=function(){this._displayDirty=!0},Object.defineProperty(i.prototype,"displayData",{get:function(){return this._displayIndex<0||this._displayIndex>=this._displayDataSet.displays.length?null:this._displayDataSet.displays[this._displayIndex]},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"rawDisplay",{get:function(){return this._rawDisplay},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"meshDisplay",{get:function(){return this._meshDisplay},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"displayIndex",{get:function(){return this._displayIndex},set:function(t){this._setDisplayIndex(t)&&this._update(-1)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"displayList",{get:function(){return this._displayList.concat()},set:function(e){var i=this._displayList.concat(),n=[];this._setDisplayList(e)&&this._update(-1);for(var r=0,s=i.length;re.zOrder?1:-1},i.toString=function(){return"[class dragonBones.ArmatureData]"},i.prototype._onClear=function(){for(var t in this.bones)this.bones[t].returnToPool(),delete this.bones[t];for(var t in this.slots)this.slots[t].returnToPool(),delete this.slots[t];for(var t in this.skins)this.skins[t].returnToPool(),delete this.skins[t];for(var t in this.animations)this.animations[t].returnToPool(),delete this.animations[t];t=0;for(var e=this.actions.length;t=t&&(i=0),this._sortedBones.indexOf(r)>=0||(r.parent&&this._sortedBones.indexOf(r.parent)<0||r.ik&&this._sortedBones.indexOf(r.ik)<0||(r.ik&&r.chain>0&&r.chainIndex==r.chain?this._sortedBones.splice(this._sortedBones.indexOf(r.parent)+1,0,r):this._sortedBones.push(r),n++))}}},i.prototype._sortSlots=function(){this._sortedSlots.sort(i._onSortSlots)},i.prototype.cacheFrames=function(t){if(this.cacheFrameRate!=t)for(var e in this.cacheFrameRate=t,this.animations)this.animations[e].cacheFrames(this.cacheFrameRate)},i.prototype.addBone=function(t,e){if(!t||!t.name||this.bones[t.name])throw new Error;if(e){var i=this.getBone(e);i?t.parent=i:(this._bonesChildren[e]=this._bonesChildren[e]||[]).push(t)}var n=this._bonesChildren[t.name];if(n){for(var r=0,s=n.length;rr&&(o|=2),es&&(o|=8),o},e.segmentIntersectsRectangle=function(t,i,n,r,s,o,a,c,h,l,u){void 0===h&&(h=null),void 0===l&&(l=null),void 0===u&&(u=null);var _=t>s&&to&&is&&no&&r=0){var T=Math.sqrt(x),A=y-T,b=y+T,S=A<0?-1:A<=m?0:1,E=b<0?-1:b<=m?0:1,w=S*E;if(w<0)return-1;0==w&&(-1==S?(C=2,i=t+b*p,n=(e+b*g)/u,c&&(c.x=i,c.y=n),h&&(h.x=i,h.y=n),l&&(l.x=Math.atan2(n/v*_,i/v),l.y=l.x+Math.PI)):1==E?(C=1,t+=A*p,e=(e+A*g)/u,c&&(c.x=t,c.y=e),h&&(h.x=t,h.y=e),l&&(l.x=Math.atan2(e/v*_,t/v),l.y=l.x+Math.PI)):(C=3,c&&(c.x=t+A*p,c.y=(e+A*g)/u,l&&(l.x=Math.atan2(c.y/v*_,c.x/v))),h&&(h.x=t+b*p,h.y=(e+b*g)/u,l&&(l.y=Math.atan2(h.y/v*_,h.x/v)))))}return C},e.segmentIntersectsPolygon=function(t,e,i,n,r,s,o,a){void 0===s&&(s=null),void 0===o&&(o=null),void 0===a&&(a=null),t==i&&(t=i+.01),e==n&&(e=n+.01);for(var c=r.length,h=t-i,l=e-n,u=t*n-e*i,_=0,d=r[c-2],f=r[c-1],m=0,p=0,g=0,y=0,v=0,x=0,C=0;C=d&&I<=T||I>=T&&I<=d)&&(0==h||I>=t&&I<=i||I>=i&&I<=t)){var R=(u*S-l*E)/w;if((R>=f&&R<=A||R>=A&&R<=f)&&(0==l||R>=e&&R<=n||R>=n&&R<=e)){if(!o){g=I,y=R,v=I,x=R,_++,a&&(a.x=Math.atan2(A-f,T-d)-.5*Math.PI,a.y=a.x);break}var P=I-t;P<0&&(P=-P),0==_?(m=P,p=P,g=I,y=R,v=I,x=R,a&&(a.x=Math.atan2(A-f,T-d)-.5*Math.PI,a.y=a.x)):(Pp&&(p=P,v=I,x=R,a&&(a.y=Math.atan2(A-f,T-d)-.5*Math.PI))),_++}}d=T,f=A}return 1==_?(s&&(s.x=g,s.y=y),o&&(o.x=g,o.y=y),a&&(a.y=a.x+Math.PI)):_>1&&(_++,s&&(s.x=g,s.y=y),o&&(o.x=v,o.y=x)),_},e.prototype._onClear=function(){this.type=-1,this.x=0,this.y=0,this.width=0,this.height=0,this.vertices.length=0},e.prototype.containsPoint=function(t,e){var i=!1;if(2==this.type){if(t>=this.x&&t<=this.width&&e>=this.y&&e<=this.height)for(var n=0,r=this.vertices.length,s=r-2;n=e||o=e){var c=this.vertices[s],h=this.vertices[n];(e-a)*(c-h)/(o-a)+h=-l&&t<=l){var u=.5*this.height;e>=-u&&e<=u&&(1==this.type?(e*=l/u,i=Math.sqrt(t*t+e*e)<=l):i=!0)}}return i},e.prototype.intersectsSegment=function(t,i,n,r,s,o,a){void 0===s&&(s=null),void 0===o&&(o=null),void 0===a&&(a=null);var c=0;switch(this.type){case 0:var h=.5*this.width,l=.5*this.height;c=e.segmentIntersectsRectangle(t,i,n,r,-h,-l,h,l,s,o,a);break;case 1:c=e.segmentIntersectsEllipse(t,i,n,r,0,0,.5*this.width,.5*this.height,s,o,a);break;case 2:0!=e.segmentIntersectsRectangle(t,i,n,r,this.x,this.y,this.width,this.height,null,null)&&(c=e.segmentIntersectsPolygon(t,i,n,r,this.vertices,s,o,a))}return c},e})(t.BaseObject);t.BoundingBoxData=h})(n||(n={})),(function(t){var e=(function(t){function e(){t.call(this),this.armatures={},this._armatureNames=[]}return r(e,t),e.toString=function(){return"[class dragonBones.DragonBonesData]"},e.prototype._onClear=function(){for(var t in this.armatures)this.armatures[t].returnToPool(),delete this.armatures[t];this.autoSearch=!1,this.frameRate=0,this.name=null,this._armatureNames.length=0},e.prototype.getArmature=function(t){return this.armatures[t]},e.prototype.addArmature=function(t){if(!t||!t.name||this.armatures[t.name])throw new Error;this.armatures[t.name]=t,this._armatureNames.push(t.name),t.parent=this},Object.defineProperty(e.prototype,"armatureNames",{get:function(){return this._armatureNames},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this.returnToPool()},e})(t.BaseObject);t.DragonBonesData=e})(n||(n={})),(function(t){var e=(function(t){function e(){t.call(this),this.data=[]}return r(e,t),e.toString=function(){return"[class dragonBones.ActionData]"},e.prototype._onClear=function(){this.type=-1,this.bone=null,this.slot=null,this.data.length=0},e})(t.BaseObject);t.ActionData=e;var i=(function(t){function e(){t.call(this),this.ints=[],this.floats=[],this.strings=[]}return r(e,t),e.toString=function(){return"[class dragonBones.EventData]"},e.prototype._onClear=function(){this.type=-1,this.name=null,this.ints.length=0,this.floats.length=0,this.strings.length=0,this.bone=null,this.slot=null},e})(t.BaseObject);t.EventData=i;var n=(function(t){function e(){t.call(this)}return r(e,t),e.prototype._onClear=function(){this.position=0,this.duration=0,this.prev=null,this.next=null},e})(t.BaseObject);t.FrameData=n;var s=(function(e){function i(){e.call(this)}return r(i,e),i._getCurvePoint=function(t,e,i,n,r,s,o,a,c,h){var l=1-c,u=l*l,_=c*c,d=l*u,f=3*c*u,m=3*l*_,p=c*_;h.x=d*t+f*i+m*r+p*o,h.y=d*e+f*n+m*s+p*a},i.samplingEasingCurve=function(e,n){for(var r=e.length,s=new t.Point,o=-2,a=0,c=n.length;a=0&&o+6.01;){var C=(x+v)/2;i._getCurvePoint(u,_,d,f,m,p,g,y,C,s),h-s.x>0?v=C:x=C}n[a]=s.y}},i.prototype._onClear=function(){e.prototype._onClear.call(this),this.tweenEasing=0,this.curve=null},i})(n);t.TweenFrameData=s;var o=(function(t){function e(){t.call(this),this.actions=[],this.events=[]}return r(e,t),e.toString=function(){return"[class dragonBones.AnimationFrameData]"},e.prototype._onClear=function(){t.prototype._onClear.call(this);for(var e=0,i=this.actions.length;e=i.frames.length)r.copyFrom(i.frames[0].transform);else{var o=i.frames[s],a=0;o.tweenEasing!=t.DragonBones.NO_TWEEN?(a=(n-o.position)/o.duration,0!=o.tweenEasing&&(a=t.TweenTimelineState._getEasingValue(a,o.tweenEasing))):o.curve&&(a=(n-o.position)/o.duration,a=t.TweenTimelineState._getEasingCurveValue(a,o.curve));var c=o.next;r.x=c.transform.x-o.transform.x,r.y=c.transform.y-o.transform.y,r.skewX=t.Transform.normalizeRadian(c.transform.skewX-o.transform.skewX),r.skewY=t.Transform.normalizeRadian(c.transform.skewY-o.transform.skewY),r.scaleX=c.transform.scaleX-o.transform.scaleX,r.scaleY=c.transform.scaleY-o.transform.scaleY,r.x=o.transform.x+r.x*a,r.y=o.transform.y+r.y*a,r.skewX=o.transform.skewX+r.skewX*a,r.skewY=o.transform.skewY+r.skewY*a,r.scaleX=o.transform.scaleX+r.scaleX*a,r.scaleY=o.transform.scaleY+r.scaleY*a}r.add(i.originalTransform)},e.prototype._globalToLocal=function(t){for(var e=new Array,i=t.sortedBones.concat().reverse(),n=0,r=i.length;n=0||(e.push(_),h?(this._getTimelineFrameMatrix(a,h,_.position,this._helpTransformA),_.transform.add(this._helpTransformB),this._helpTransformA.toMatrix(this._helpMatrix),this._helpMatrix.invert(),this._helpMatrix.transformPoint(_.transform.x,_.transform.y,this._helpPoint),_.transform.x=this._helpPoint.x,_.transform.y=this._helpPoint.y,_.transform.rotation-=this._helpTransformA.rotation):_.transform.add(this._helpTransformB),_.transform.minus(s.transform),0==l?(c.originalTransform.copyFrom(_.transform),_.transform.identity()):_.transform.minus(c.originalTransform))}}}}},e.prototype._mergeFrameToAnimationTimeline=function(e,i,n){var r=Math.floor(e*this._armature.frameRate),s=this._animation.frames;if(0==s.length){var o=t.BaseObject.borrowObject(t.AnimationFrameData);if(o.position=0,this._animation.frameCount>1){s.length=this._animation.frameCount+1;var a=t.BaseObject.borrowObject(t.AnimationFrameData);a.position=this._animation.frameCount/this._armature.frameRate,s[0]=o,s[this._animation.frameCount]=a}}var c=null,h=s[r];if(!h||0!=r&&s[r-1]!=h.prev){(c=t.BaseObject.borrowObject(t.AnimationFrameData)).position=r/this._armature.frameRate,s[r]=c;for(var l=r+1,u=s.length;le?t[e]:i},i.prototype._parseArmature=function(e,n){var r=t.BaseObject.borrowObject(t.ArmatureData);if(r.name=i._getString(e,i.NAME,null),r.frameRate=i._getNumber(e,i.FRAME_RATE,this._data.frameRate)||this._data.frameRate,r.scale=n,i.TYPE in e&&"string"==typeof e[i.TYPE]?r.type=i._getArmatureType(e[i.TYPE]):r.type=i._getNumber(e,i.TYPE,0),this._armature=r,this._rawBones.length=0,i.AABB in e){var s=e[i.AABB];r.aabb.x=i._getNumber(s,i.X,0),r.aabb.y=i._getNumber(s,i.Y,0),r.aabb.width=i._getNumber(s,i.WIDTH,0),r.aabb.height=i._getNumber(s,i.HEIGHT,0)}if(i.BONE in e)for(var o=e[i.BONE],a=0,c=o.length;a0&&e.parent&&!e.parent.ik?(e.parent.ik=e.ik,e.parent.chainIndex=0,e.parent.chain=0,e.chainIndex=1):(e.chain=0,e.chainIndex=0))},i.prototype._parseSlot=function(e,n){var r=t.BaseObject.borrowObject(t.SlotData);return r.name=i._getString(e,i.NAME,null),r.parent=this._armature.getBone(i._getString(e,i.PARENT,null)),r.displayIndex=i._getNumber(e,i.DISPLAY_INDEX,0),r.zOrder=i._getNumber(e,i.Z,n),i.COLOR in e||i.COLOR_TRANSFORM in e?(r.color=t.SlotData.generateColor(),this._parseColorTransform(e[i.COLOR]||e[i.COLOR_TRANSFORM],r.color)):r.color=t.SlotData.DEFAULT_COLOR,i.BLEND_MODE in e&&"string"==typeof e[i.BLEND_MODE]?r.blendMode=i._getBlendMode(e[i.BLEND_MODE]):r.blendMode=i._getNumber(e,i.BLEND_MODE,0),(i.ACTIONS in e||i.DEFAULT_ACTIONS in e)&&this._parseActionData(e,r.actions,null,null),this._isOldData&&(i.COLOR_TRANSFORM in e?(r.color=t.SlotData.generateColor(),this._parseColorTransform(e[i.COLOR_TRANSFORM],r.color)):r.color=t.SlotData.DEFAULT_COLOR),r},i.prototype._parseSkin=function(e){var n=t.BaseObject.borrowObject(t.SkinData);if(n.name=i._getString(e,i.NAME,"__default")||"__default",i.SLOT in e){this._skin=n;for(var r=e[i.SLOT],s=0,o=0,a=r.length;on.width&&(n.width=c),hn.height&&(n.height=h))}}}return n},i.prototype._parseMesh=function(e){var n=t.BaseObject.borrowObject(t.MeshData),r=e[i.VERTICES],s=e[i.UVS],o=e[i.TRIANGLES],a=Math.floor(r.length/2),c=Math.floor(o.length/3),h=new Array(this._armature.sortedBones.length);if(n.skinned=i.WEIGHTS in e&&e[i.WEIGHTS].length>0,n.uvs.length=2*a,n.vertices.length=2*a,n.vertexIndices.length=3*c,n.skinned){if(n.boneIndices.length=a,n.weights.length=a,n.boneVertices.length=a,i.SLOT_POSE in e){var l=e[i.SLOT_POSE];n.slotPose.a=l[0],n.slotPose.b=l[1],n.slotPose.c=l[2],n.slotPose.d=l[3],n.slotPose.tx=l[4]*this._armature.scale,n.slotPose.ty=l[5]*this._armature.scale}if(i.BONE_POSE in e)for(var u=e[i.BONE_POSE],_=0,d=u.length;_0){var a=this._armature.sortedSlots.length,c=new Array(a-o.length/2);s.zOrder.length=a;for(var h=0;h0||h.length>0)&&this._mergeFrameToAnimationTimeline(s.position,c,h),s},i.prototype._parseSlotFrame=function(e,n,r){var s=t.BaseObject.borrowObject(t.SlotFrameData);if(s.displayIndex=i._getNumber(e,i.DISPLAY_INDEX,0),this._parseTweenFrame(e,s,n,r),i.COLOR in e||i.COLOR_TRANSFORM in e?(s.color=t.SlotFrameData.generateColor(),this._parseColorTransform(e[i.COLOR]||e[i.COLOR_TRANSFORM],s.color)):s.color=t.SlotFrameData.DEFAULT_COLOR,this._isOldData)i._getBoolean(e,i.HIDE,!1)&&(s.displayIndex=-1);else if(i.ACTION in e||i.ACTIONS in e){var o=this._timeline.slot,a=new Array;this._parseActionData(e,a,o.parent,o),this._mergeFrameToAnimationTimeline(s.position,a,null)}return s},i.prototype._parseFFDFrame=function(e,n,r){var s=this._timeline.display.mesh,o=t.BaseObject.borrowObject(t.ExtensionFrameData);o.type=i._getNumber(e,i.TYPE,0),this._parseTweenFrame(e,o,n,r);for(var a=e[i.VERTICES],c=i._getNumber(e,i.OFFSET,0),h=0,l=0,u=0,_=s.vertices.length;u<_;u+=2)if(!a||u=a.length?(h=0,l=0):(h=a[u-c]*this._armature.scale,l=a[u+1-c]*this._armature.scale),s.skinned){s.slotPose.transformPoint(h,l,this._helpPoint,!0),h=this._helpPoint.x,l=this._helpPoint.y;for(var d=s.boneIndices[u/2],f=0,m=d.length;f0?(i.TWEEN_EASING in e?n.tweenEasing=i._getNumber(e,i.TWEEN_EASING,t.DragonBones.NO_TWEEN):this._isOldData?n.tweenEasing=this._isAutoTween?this._animationTweenEasing:t.DragonBones.NO_TWEEN:n.tweenEasing=t.DragonBones.NO_TWEEN,this._isOldData&&1==this._animation.scale&&1==this._timeline.scale&&n.duration*this._armature.frameRate<2&&(n.tweenEasing=t.DragonBones.NO_TWEEN),s>0&&i.CURVE in e&&(n.curve=new Array(2*s-1),t.TweenFrameData.samplingEasingCurve(e[i.CURVE],n.curve))):(n.tweenEasing=t.DragonBones.NO_TWEEN,n.curve=null)},i.prototype._parseFrame=function(t,e,i,n){e.position=i/this._armature.frameRate,e.duration=n/this._armature.frameRate},i.prototype._parseTimeline=function(e,n,r){if(n.scale=i._getNumber(e,i.SCALE,1),n.offset=i._getNumber(e,i.OFFSET,0),i.FRAME in e){this._timeline=n;var s=e[i.FRAME];if(1==s.length)n.frames.length=1,n.frames[0]=r.call(this,s[0],0,i._getNumber(s[0],i.DURATION,1));else if(s.length>1){n.frames.length=this._animation.frameCount+1;for(var o=0,a=0,c=null,h=null,l=0,u=0,_=n.frames.length;l<_;++l){if(o+a<=l&&u0?n.scale=r:r=n.scale=i._getNumber(e,i.SCALE,n.scale),r=1/r,i.SUB_TEXTURE in e)for(var s=e[i.SUB_TEXTURE],o=0,a=s.length;o0&&u>0&&(h.frame=t.TextureData.generateRectangle(),h.frame.x=i._getNumber(c,i.FRAME_X,0)*r,h.frame.y=i._getNumber(c,i.FRAME_Y,0)*r,h.frame.width=l*r,h.frame.height=u*r),n.addTexture(h)}},i.getInstance=function(){return i._instance||(i._instance=new i),i._instance},i._instance=null,i})(t.DataParser);t.ObjectDataParser=e})(n||(n={})),(function(t){var e=(function(t){function e(){t.call(this),this.textures={}}return r(e,t),e.prototype._onClear=function(){for(var t in this.textures)this.textures[t].returnToPool(),delete this.textures[t];this.autoSearch=!1,this.scale=1,this.name=null,this.imagePath=null},e.prototype.addTexture=function(t){if(!t||!t.name||this.textures[t.name])throw new Error;this.textures[t.name]=t,t.parent=this},e.prototype.getTexture=function(t){return this.textures[t]},e})(t.BaseObject);t.TextureAtlasData=e;var i=(function(e){function i(){e.call(this),this.region=new t.Rectangle}return r(i,e),i.generateRectangle=function(){return new t.Rectangle},i.prototype._onClear=function(){this.rotated=!1,this.name=null,this.frame=null,this.parent=null,this.region.clear()},i})(t.BaseObject);t.TextureData=i})(n||(n={})),(function(t){var e=(function(){function e(i){void 0===i&&(i=null),this.autoSearch=!1,this._dataParser=null,this._dragonBonesDataMap={},this._textureAtlasDataMap={},this._dataParser=i,this._dataParser||(e._defaultParser||(e._defaultParser=new t.ObjectDataParser),this._dataParser=e._defaultParser)}return e.prototype._getTextureData=function(t,e){var i=this._textureAtlasDataMap[t];if(i)for(var n=0,r=i.length;n=0){var r=i.displayList;if(r.length<=n&&(r.length=n+1),i._replacedDisplayDataSet.length<=n&&(i._replacedDisplayDataSet.length=n+1),i._replacedDisplayDataSet[n]=e,1==e.type){var s=this.buildArmature(e.path,t.dataName,null,t.textureAtlasName);r[n]=s}else e.texture&&!t.textureAtlasName||(e.texture=this._getTextureData(t.textureAtlasName||t.dataName,e.path)),e.mesh||nt.length&&(cc.renderer._batchRendering(),m=!0),m&&(i=0);var p=null;if(r instanceof n.RegionAttachment)p=this._uploadRegionAttachmentData(r,s,u,t,e,i);else{if(!(r instanceof n.MeshAttachment))continue;this._uploadMeshAttachmentData(r,s,u,t,e,i)}this._node._debugSlots&&(_[o]=p),r instanceof n.RegionAttachment?cc.renderer._increaseBatchingSize(d,cc.renderer.VertexType.TRIANGLE):cc.renderer._increaseBatchingSize(d,cc.renderer.VertexType.CUSTOM,r.triangles),i+=6*d}}if(c._debugBones||c._debugSlots){cc.renderer._batchRendering();var g=this._worldTransform,y=this._matrix.mat;y[0]=g.a,y[4]=g.c,y[12]=g.tx,y[1]=g.b,y[5]=g.d,y[13]=g.ty,cc.math.glMatrixMode(cc.math.KM_GL_MODELVIEW),cc.current_stack.stack.push(cc.current_stack.top),cc.current_stack.top=this._matrix;var v=cc._drawingUtil;if(c._debugSlots&&_&&_.length>0)for(v.setDrawColor(0,0,255,255),v.setLineWidth(1),o=0,a=l.slots.length;o":0});sp.Skeleton=cc.Class({name:"sp.Skeleton",extends:cc._RendererUnderSG,editor:!1,properties:{_startListener:{default:null,serializable:!1},_endListener:{default:null,serializable:!1},_completeListener:{default:null,serializable:!1},_eventListener:{default:null,serializable:!1},_disposeListener:{default:null,serializable:!1},_interruptListener:{default:null,serializable:!1},_paused:!1,paused:{get:function(){return this._paused},set:function(t){this._paused=t,this._sgNode&&(t?this._sgNode.pause():this._sgNode.resume())},visible:!1},skeletonData:{default:null,type:sp.SkeletonData,notify:function(){this.defaultSkin="",this.defaultAnimation="",this._refresh()},tooltip:!1},defaultSkin:{default:"",visible:!1},defaultAnimation:{default:"",visible:!1},animation:{get:function(){var t=this.getCurrent(0);return t&&t.animation.name||""},set:function(t){this.defaultAnimation=t,t?this.setAnimation(0,t,this.loop):(this.clearTrack(0),this.setToSetupPose())},visible:!1},_defaultSkinIndex:{get:function(){if(this.skeletonData&&this.defaultSkin){var t=this.skeletonData.getSkinsEnum();if(t){var e=t[this.defaultSkin];if(void 0!==e)return e}}return 0},set:function(t){var e;if(this.skeletonData&&(e=this.skeletonData.getSkinsEnum()),!e)return cc.errorID("",this.name);var i=e[t];void 0!==i?this.defaultSkin=i:cc.errorID(7501,this.name)},type:n,visible:!0,displayName:"Default Skin",tooltip:!1},_animationIndex:{get:function(){var t=this.animation;if(this.skeletonData&&t){var e=this.skeletonData.getAnimsEnum();if(e){var i=e[t];if(void 0!==i)return i}}return 0},set:function(t){if(0!==t){var e;if(this.skeletonData&&(e=this.skeletonData.getAnimsEnum()),!e)return cc.errorID(7502,this.name);var i=e[t];void 0!==i?this.animation=i:cc.errorID(7503,this.name)}else this.animation=""},type:r,visible:!0,displayName:"Animation",tooltip:!1},loop:{default:!0,tooltip:!1},_premultipliedAlpha:!0,premultipliedAlpha:{get:function(){return this._premultipliedAlpha},set:function(t){this._premultipliedAlpha=t,this._sgNode&&this._sgNode.setPremultipliedAlpha(t)},tooltip:!1},timeScale:{default:1,notify:function(){this._sgNode&&this._sgNode.setTimeScale(this.timeScale)},tooltip:!1},debugSlots:{default:!1,notify:function(){this._sgNode&&this._sgNode.setDebugSlotsEnabled(this.debugSlots)},editorOnly:!0,tooltip:!1},debugBones:{default:!1,notify:function(){this._sgNode&&this._sgNode.setDebugBonesEnabled(this.debugBones)},editorOnly:!0,tooltip:!1}},__preload:function(){this.node.setContentSize(0,0),this._refresh()},_createSgNode:function(){var t=this.skeletonData;if(t){var e=t.getRuntimeData();if(e)try{return new sp._SGSkeletonAnimation(e,null,t.scale)}catch(t){cc._throw(t)}}return null},_initSgNode:function(){var t=this._sgNode;t.setTimeScale(this.timeScale);var e=this;if(t.onEnter=function(){_ccsg.Node.prototype.onEnter.call(this),e._paused&&this.pause()},this._startListener&&this.setStartListener(this._startListener),this._endListener&&this.setEndListener(this._endListener),this._completeListener&&this.setCompleteListener(this._completeListener),this._eventListener&&this.setEventListener(this._eventListener),this._interruptListener&&this.setInterruptListener(this._interruptListener),this._disposeListener&&this.setDisposeListener(this._disposeListener),this.defaultSkin)try{t.setSkin(this.defaultSkin)}catch(t){cc._throw(t)}t.setPremultipliedAlpha(this._premultipliedAlpha),this.animation=this.defaultAnimation},_getLocalBounds:!1,updateWorldTransform:function(){this._sgNode&&this._sgNode.updateWorldTransform()},setToSetupPose:function(){this._sgNode&&this._sgNode.setToSetupPose()},setBonesToSetupPose:function(){this._sgNode&&this._sgNode.setBonesToSetupPose()},setSlotsToSetupPose:function(){this._sgNode&&this._sgNode.setSlotsToSetupPose()},findBone:function(t){return this._sgNode?this._sgNode.findBone(t):null},findSlot:function(t){return this._sgNode?this._sgNode.findSlot(t):null},setSkin:function(t){return this._sgNode?this._sgNode.setSkin(t):null},getAttachment:function(t,e){return this._sgNode?this._sgNode.getAttachment(t,e):null},setAttachment:function(t,e){this._sgNode&&this._sgNode.setAttachment(t,e)},setSkeletonData:function(t,e){this._sgNode&&this._sgNode.setSkeletonData(t,e)},setAnimationStateData:function(t){if(this._sgNode)return this._sgNode.setAnimationStateData(t)},setMix:function(t,e,i){this._sgNode&&this._sgNode.setMix(t,e,i)},setAnimationListener:function(t,e){this._sgNode&&this._sgNode.setAnimationListener(t,e)},setAnimation:function(t,e,i){return this._sgNode?this._sgNode.setAnimation(t,e,i):null},_sample:function(){this._sgNode&&this._sgNode.update(0)},addAnimation:function(t,e,i,n){return this._sgNode?this._sgNode.addAnimation(t,e,i,n||0):null},findAnimation:function(t){return this._sgNode?this._sgNode.findAnimation(t):null},getCurrent:function(t){return this._sgNode?this._sgNode.getCurrent(t):null},clearTracks:function(){this._sgNode&&this._sgNode.clearTracks()},clearTrack:function(t){this._sgNode&&this._sgNode.clearTrack(t)},_updateAnimEnum:!1,_updateSkinEnum:!1,setStartListener:function(t){this._startListener=t,this._sgNode&&this._sgNode.setStartListener(t)},setInterruptListener:function(t){this._interruptListener=t,this._sgNode&&this._sgNode.setInterruptListener(t)},setEndListener:function(t){this._endListener=t,this._sgNode&&this._sgNode.setEndListener(t)},setDisposeListener:function(t){this._disposeListener=t,this._sgNode&&this._sgNode.setDisposeListener(t)},setCompleteListener:function(t){this._completeListener=t,this._sgNode&&this._sgNode.setCompleteListener(t)},setEventListener:function(t){this._eventListener=t,this._sgNode&&this._sgNode.setEventListener(t)},setTrackStartListener:function(t,e){this._sgNode&&this._sgNode.setTrackStartListener(t,e)},setTrackInterruptListener:function(t,e){this._sgNode&&this._sgNode.setTrackInterruptListener(t,e)},setTrackEndListener:function(t,e){this._sgNode&&this._sgNode.setTrackEndListener(t,e)},setTrackDisposeListener:function(t,e){this._sgNode&&this._sgNode.setTrackDisposeListener(t,e)},setTrackCompleteListener:function(t,e){this._sgNode&&this._sgNode.setTrackCompleteListener(t,e)},setTrackEventListener:function(t,e){this._sgNode&&this._sgNode.setTrackEventListener(t,e)},getState:function(){if(this._sgNode)return this._sgNode.getState()},_refresh:function(){this._sgNode&&(this.node._sizeProvider===this._sgNode&&(this.node._sizeProvider=null),this._removeSgNode(),this._sgNode=null);var t=this._sgNode=this._createSgNode();t&&(this.enabledInHierarchy||t.setVisible(!1),t.setContentSize(0,0),this._initSgNode(),this._appendSgNode(t),this._registSizeProvider())}})}),{}],309:[(function(t,e,i){var n=cc.Class({name:"sp.SkeletonData",extends:cc.Asset,ctor:function(){this.reset()},properties:{_skeletonJson:null,skeletonJson:{get:function(){return this._skeletonJson},set:function(t){this._skeletonJson=t,this.reset()}},_atlasText:"",atlasText:{get:function(){return this._atlasText},set:function(t){this._atlasText=t,this.reset()}},textures:{default:[],type:[cc.Texture2D]},textureNames:{default:[],type:[cc.String]},scale:1},statics:{preventDeferredLoadDependents:!0,preventPreloadNativeObject:!0},createNode:!1,reset:function(){this._skeletonCache=null,this._atlasCache=null},getRuntimeData:function(t){if(this._skeletonCache)return this._skeletonCache;if(!(this.textures&&this.textures.length>0&&this.textureNames&&this.textureNames.length>0))return t||cc.errorID(7507,this.name),null;var e=this._getAtlas(t);if(!e)return null;var i=new sp.spine.AtlasAttachmentLoader(e),n=new sp.spine.SkeletonJson(i);n.scale=this.scale;var r=this.skeletonJson;return this._skeletonCache=n.readSkeletonData(r),e.dispose(n),this._skeletonCache},getSkinsEnum:!1,getAnimsEnum:!1,_getTexture:function(t){for(var e=this.textureNames,i=0;i0&&(e%=this.duration));for(var c=this.timelines,h=0,l=c.length;h>>1;;){if(t[(s+1)*i]<=e?n=s+1:r=s,n==r)return(n+1)*i;s=n+r>>>1}},t.linearSearch=function(t,e,i){for(var n=0,r=t.length-i;n<=r;n+=i)if(t[n]>e)return n;return-1},t})();t.Animation=e,(function(t){t[t.rotate=0]="rotate",t[t.translate=1]="translate",t[t.scale=2]="scale",t[t.shear=3]="shear",t[t.attachment=4]="attachment",t[t.color=5]="color",t[t.deform=6]="deform",t[t.event=7]="event",t[t.drawOrder=8]="drawOrder",t[t.ikConstraint=9]="ikConstraint",t[t.transformConstraint=10]="transformConstraint",t[t.pathConstraintPosition=11]="pathConstraintPosition",t[t.pathConstraintSpacing=12]="pathConstraintSpacing",t[t.pathConstraintMix=13]="pathConstraintMix"})(t.TimelineType||(t.TimelineType={}));var i=t.TimelineType,n=(function(){function e(i){if(i<=0)throw new Error("frameCount must be > 0: "+i);this.curves=t.Utils.newFloatArray((i-1)*e.BEZIER_SIZE)}return e.prototype.getFrameCount=function(){return this.curves.length/e.BEZIER_SIZE+1},e.prototype.setLinear=function(t){this.curves[t*e.BEZIER_SIZE]=e.LINEAR},e.prototype.setStepped=function(t){this.curves[t*e.BEZIER_SIZE]=e.STEPPED},e.prototype.getCurveType=function(t){var i=t*e.BEZIER_SIZE;if(i==this.curves.length)return e.LINEAR;var n=this.curves[i];return n==e.LINEAR?e.LINEAR:n==e.STEPPED?e.STEPPED:e.BEZIER},e.prototype.setCurve=function(t,i,n,r,s){var o=.03*(2*-i+r),a=.03*(2*-n+s),c=.006*(3*(i-r)+1),h=.006*(3*(n-s)+1),l=2*o+c,u=2*a+h,_=.3*i+o+.16666667*c,d=.3*n+a+.16666667*h,f=t*e.BEZIER_SIZE,m=this.curves;m[f++]=e.BEZIER;for(var p=_,g=d,y=f+e.BEZIER_SIZE-1;f=n){var l=void 0,u=void 0;return s==c?(l=0,u=0):(l=r[s-2],u=r[s-1]),u+(r[s+1]-u)*(n-l)/(a-l)}var _=r[s-1];return _+(1-_)*(n-a)/(1-a)},e.LINEAR=0,e.STEPPED=1,e.BEZIER=2,e.BEZIER_SIZE=19,e})();t.CurveTimeline=n;var s=(function(n){function s(e){n.call(this,e),this.frames=t.Utils.newFloatArray(e<<1)}return r(s,n),s.prototype.getPropertyId=function(){return(i.rotate<<24)+this.boneIndex},s.prototype.setFrame=function(t,e,i){t<<=1,this.frames[t]=e,this.frames[t+s.ROTATION]=i},s.prototype.apply=function(t,i,n,r,o,a,c){var h=this.frames,l=t.bones[this.boneIndex];if(n=h[h.length-s.ENTRIES])if(a)l.rotation=l.data.rotation+h[h.length+s.PREV_ROTATION]*o;else{var u=l.data.rotation+h[h.length+s.PREV_ROTATION]-l.rotation;u-=360*(16384-(16384.499999999996-u/360|0)),l.rotation+=u*o}else{var _=e.binarySearch(h,n,s.ENTRIES),d=h[_+s.PREV_ROTATION],f=h[_],m=this.getCurvePercent((_>>1)-1,1-(n-f)/(h[_+s.PREV_TIME]-f)),p=h[_+s.ROTATION]-d;p=d+(p-=360*(16384-(16384.499999999996-p/360|0)))*m,a?(p-=360*(16384-(16384.499999999996-p/360|0)),l.rotation=l.data.rotation+p*o):(p=l.data.rotation+p-l.rotation,p-=360*(16384-(16384.499999999996-p/360|0)),l.rotation+=p*o)}},s.ENTRIES=2,s.PREV_TIME=-2,s.PREV_ROTATION=-1,s.ROTATION=1,s})(n);t.RotateTimeline=s;var o=(function(n){function s(e){n.call(this,e),this.frames=t.Utils.newFloatArray(e*s.ENTRIES)}return r(s,n),s.prototype.getPropertyId=function(){return(i.translate<<24)+this.boneIndex},s.prototype.setFrame=function(t,e,i,n){t*=s.ENTRIES,this.frames[t]=e,this.frames[t+s.X]=i,this.frames[t+s.Y]=n},s.prototype.apply=function(t,i,n,r,o,a,c){var h=this.frames,l=t.bones[this.boneIndex];if(n=h[h.length-s.ENTRIES])u=h[h.length+s.PREV_X],_=h[h.length+s.PREV_Y];else{var d=e.binarySearch(h,n,s.ENTRIES);u=h[d+s.PREV_X],_=h[d+s.PREV_Y];var f=h[d],m=this.getCurvePercent(d/s.ENTRIES-1,1-(n-f)/(h[d+s.PREV_TIME]-f));u+=(h[d+s.X]-u)*m,_+=(h[d+s.Y]-_)*m}a?(l.x=l.data.x+u*o,l.y=l.data.y+_*o):(l.x+=(l.data.x+u-l.x)*o,l.y+=(l.data.y+_-l.y)*o)}},s.ENTRIES=3,s.PREV_TIME=-3,s.PREV_X=-2,s.PREV_Y=-1,s.X=1,s.Y=2,s})(n);t.TranslateTimeline=o;var a=(function(n){function s(t){n.call(this,t)}return r(s,n),s.prototype.getPropertyId=function(){return(i.scale<<24)+this.boneIndex},s.prototype.apply=function(i,n,r,o,a,c,h){var l=this.frames,u=i.bones[this.boneIndex];if(r=l[l.length-s.ENTRIES])_=l[l.length+s.PREV_X]*u.data.scaleX,d=l[l.length+s.PREV_Y]*u.data.scaleY;else{var f=e.binarySearch(l,r,s.ENTRIES);_=l[f+s.PREV_X],d=l[f+s.PREV_Y];var m=l[f],p=this.getCurvePercent(f/s.ENTRIES-1,1-(r-m)/(l[f+s.PREV_TIME]-m));_=(_+(l[f+s.X]-_)*p)*u.data.scaleX,d=(d+(l[f+s.Y]-d)*p)*u.data.scaleY}if(1==a)u.scaleX=_,u.scaleY=d;else{var g=0,y=0;c?(g=u.data.scaleX,y=u.data.scaleY):(g=u.scaleX,y=u.scaleY),h?(_=Math.abs(_)*t.MathUtils.signum(g),d=Math.abs(d)*t.MathUtils.signum(y)):(g=Math.abs(g)*t.MathUtils.signum(_),y=Math.abs(y)*t.MathUtils.signum(d)),u.scaleX=g+(_-g)*a,u.scaleY=y+(d-y)*a}}},s})(o);t.ScaleTimeline=a;var c=(function(t){function n(e){t.call(this,e)}return r(n,t),n.prototype.getPropertyId=function(){return(i.shear<<24)+this.boneIndex},n.prototype.apply=function(t,i,r,s,o,a,c){var h=this.frames,l=t.bones[this.boneIndex];if(r=h[h.length-n.ENTRIES])u=h[h.length+n.PREV_X],_=h[h.length+n.PREV_Y];else{var d=e.binarySearch(h,r,n.ENTRIES);u=h[d+n.PREV_X],_=h[d+n.PREV_Y];var f=h[d],m=this.getCurvePercent(d/n.ENTRIES-1,1-(r-f)/(h[d+n.PREV_TIME]-f));u+=(h[d+n.X]-u)*m,_+=(h[d+n.Y]-_)*m}a?(l.shearX=l.data.shearX+u*o,l.shearY=l.data.shearY+_*o):(l.shearX+=(l.data.shearX+u-l.shearX)*o,l.shearY+=(l.data.shearY+_-l.shearY)*o)}},n})(o);t.ShearTimeline=c;var h=(function(n){function s(e){n.call(this,e),this.frames=t.Utils.newFloatArray(e*s.ENTRIES)}return r(s,n),s.prototype.getPropertyId=function(){return(i.color<<24)+this.slotIndex},s.prototype.setFrame=function(t,e,i,n,r,o){t*=s.ENTRIES,this.frames[t]=e,this.frames[t+s.R]=i,this.frames[t+s.G]=n,this.frames[t+s.B]=r,this.frames[t+s.A]=o},s.prototype.apply=function(t,i,n,r,o,a,c){var h=t.slots[this.slotIndex],l=this.frames;if(n=l[l.length-s.ENTRIES]){var m=l.length;u=l[m+s.PREV_R],_=l[m+s.PREV_G],d=l[m+s.PREV_B],f=l[m+s.PREV_A]}else{var p=e.binarySearch(l,n,s.ENTRIES);u=l[p+s.PREV_R],_=l[p+s.PREV_G],d=l[p+s.PREV_B],f=l[p+s.PREV_A];var g=l[p],y=this.getCurvePercent(p/s.ENTRIES-1,1-(n-g)/(l[p+s.PREV_TIME]-g));u+=(l[p+s.R]-u)*y,_+=(l[p+s.G]-_)*y,d+=(l[p+s.B]-d)*y,f+=(l[p+s.A]-f)*y}if(1==o)h.color.set(u,_,d,f);else{var v=h.color;a&&v.setFromColor(h.data.color),v.add((u-v.r)*o,(_-v.g)*o,(d-v.b)*o,(f-v.a)*o)}}},s.ENTRIES=5,s.PREV_TIME=-5,s.PREV_R=-4,s.PREV_G=-3,s.PREV_B=-2,s.PREV_A=-1,s.R=1,s.G=2,s.B=3,s.A=4,s})(n);t.ColorTimeline=h;var l=(function(){function n(e){this.frames=t.Utils.newFloatArray(e),this.attachmentNames=new Array(e)}return n.prototype.getPropertyId=function(){return(i.attachment<<24)+this.slotIndex},n.prototype.getFrameCount=function(){return this.frames.length},n.prototype.setFrame=function(t,e,i){this.frames[t]=e,this.attachmentNames[t]=i},n.prototype.apply=function(t,i,n,r,s,o,a){var c=t.slots[this.slotIndex];if(a&&o){var h=c.data.attachmentName;c.setAttachment(null==h?null:t.getAttachment(this.slotIndex,h))}else{var l=this.frames;if(n=l[l.length-1]?l.length-1:e.binarySearch(l,n,1)-1;var d=this.attachmentNames[_];t.slots[this.slotIndex].setAttachment(null==d?null:t.getAttachment(this.slotIndex,d))}}},n})();t.AttachmentTimeline=l;var u=(function(n){function s(e){n.call(this,e),this.frames=t.Utils.newFloatArray(e),this.frameVertices=new Array(e)}return r(s,n),s.prototype.getPropertyId=function(){return(i.deform<<24)+this.slotIndex},s.prototype.setFrame=function(t,e,i){this.frames[t]=e,this.frameVertices[t]=i},s.prototype.apply=function(i,n,r,s,o,a,c){var h=i.slots[this.slotIndex],l=h.getAttachment();if(l instanceof t.VertexAttachment&&l.applyDeform(this.attachment)){var u=this.frames,_=h.attachmentVertices;if(r=u[u.length-1]){var p=d[u.length-1];if(1==o)t.Utils.arrayCopy(p,0,m,0,f);else if(a){if(null==(E=l).bones)for(var g=E.vertices,y=0;yn)this.apply(t,i,Number.MAX_VALUE,r,s,o,a),i=-1;else if(i>=c[h-1])return;if(!(n0&&c[l-1]==u;)l--;for(;l=c[l];l++)r.push(this.events[l])}}},n})();t.EventTimeline=_;var d=(function(){function n(e){this.frames=t.Utils.newFloatArray(e),this.drawOrders=new Array(e)}return n.prototype.getPropertyId=function(){return i.drawOrder<<24},n.prototype.getFrameCount=function(){return this.frames.length},n.prototype.setFrame=function(t,e,i){this.frames[t]=e,this.drawOrders[t]=i},n.prototype.apply=function(i,n,r,s,o,a,c){var h=i.drawOrder,l=i.slots;if(c&&a)t.Utils.arrayCopy(i.slots,0,i.drawOrder,0,i.slots.length);else{var u=this.frames;if(r=u[u.length-1]?u.length-1:e.binarySearch(u,r)-1;var d=this.drawOrders[_];if(null==d)t.Utils.arrayCopy(l,0,h,0,l.length);else for(var f=0,m=d.length;f=h[h.length-s.ENTRIES])a?(l.mix=l.data.mix+(h[h.length+s.PREV_MIX]-l.data.mix)*o,l.bendDirection=c?l.data.bendDirection:h[h.length+s.PREV_BEND_DIRECTION]):(l.mix+=(h[h.length+s.PREV_MIX]-l.mix)*o,c||(l.bendDirection=h[h.length+s.PREV_BEND_DIRECTION]));else{var u=e.binarySearch(h,n,s.ENTRIES),_=h[u+s.PREV_MIX],d=h[u],f=this.getCurvePercent(u/s.ENTRIES-1,1-(n-d)/(h[u+s.PREV_TIME]-d));a?(l.mix=l.data.mix+(_+(h[u+s.MIX]-_)*f-l.data.mix)*o,l.bendDirection=c?l.data.bendDirection:h[u+s.PREV_BEND_DIRECTION]):(l.mix+=(_+(h[u+s.MIX]-_)*f-l.mix)*o,c||(l.bendDirection=h[u+s.PREV_BEND_DIRECTION]))}},s.ENTRIES=3,s.PREV_TIME=-3,s.PREV_MIX=-2,s.PREV_BEND_DIRECTION=-1,s.MIX=1,s.BEND_DIRECTION=2,s})(n);t.IkConstraintTimeline=f;var m=(function(n){function s(e){n.call(this,e),this.frames=t.Utils.newFloatArray(e*s.ENTRIES)}return r(s,n),s.prototype.getPropertyId=function(){return(i.transformConstraint<<24)+this.transformConstraintIndex},s.prototype.setFrame=function(t,e,i,n,r,o){t*=s.ENTRIES,this.frames[t]=e,this.frames[t+s.ROTATE]=i,this.frames[t+s.TRANSLATE]=n,this.frames[t+s.SCALE]=r,this.frames[t+s.SHEAR]=o},s.prototype.apply=function(t,i,n,r,o,a,c){var h=this.frames,l=t.transformConstraints[this.transformConstraintIndex];if(n=h[h.length-s.ENTRIES]){var p=h.length;_=h[p+s.PREV_ROTATE],d=h[p+s.PREV_TRANSLATE],f=h[p+s.PREV_SCALE],m=h[p+s.PREV_SHEAR]}else{var g=e.binarySearch(h,n,s.ENTRIES);_=h[g+s.PREV_ROTATE],d=h[g+s.PREV_TRANSLATE],f=h[g+s.PREV_SCALE],m=h[g+s.PREV_SHEAR];var y=h[g],v=this.getCurvePercent(g/s.ENTRIES-1,1-(n-y)/(h[g+s.PREV_TIME]-y));_+=(h[g+s.ROTATE]-_)*v,d+=(h[g+s.TRANSLATE]-d)*v,f+=(h[g+s.SCALE]-f)*v,m+=(h[g+s.SHEAR]-m)*v}if(a){u=l.data;l.rotateMix=u.rotateMix+(_-u.rotateMix)*o,l.translateMix=u.translateMix+(d-u.translateMix)*o,l.scaleMix=u.scaleMix+(f-u.scaleMix)*o,l.shearMix=u.shearMix+(m-u.shearMix)*o}else l.rotateMix+=(_-l.rotateMix)*o,l.translateMix+=(d-l.translateMix)*o,l.scaleMix+=(f-l.scaleMix)*o,l.shearMix+=(m-l.shearMix)*o}},s.ENTRIES=5,s.PREV_TIME=-5,s.PREV_ROTATE=-4,s.PREV_TRANSLATE=-3,s.PREV_SCALE=-2,s.PREV_SHEAR=-1,s.ROTATE=1,s.TRANSLATE=2,s.SCALE=3,s.SHEAR=4,s})(n);t.TransformConstraintTimeline=m;var p=(function(n){function s(e){n.call(this,e),this.frames=t.Utils.newFloatArray(e*s.ENTRIES)}return r(s,n),s.prototype.getPropertyId=function(){return(i.pathConstraintPosition<<24)+this.pathConstraintIndex},s.prototype.setFrame=function(t,e,i){t*=s.ENTRIES,this.frames[t]=e,this.frames[t+s.VALUE]=i},s.prototype.apply=function(t,i,n,r,o,a,c){var h=this.frames,l=t.pathConstraints[this.pathConstraintIndex];if(n=h[h.length-s.ENTRIES])u=h[h.length+s.PREV_VALUE];else{var _=e.binarySearch(h,n,s.ENTRIES);u=h[_+s.PREV_VALUE];var d=h[_],f=this.getCurvePercent(_/s.ENTRIES-1,1-(n-d)/(h[_+s.PREV_TIME]-d));u+=(h[_+s.VALUE]-u)*f}a?l.position=l.data.position+(u-l.data.position)*o:l.position+=(u-l.position)*o}},s.ENTRIES=2,s.PREV_TIME=-2,s.PREV_VALUE=-1,s.VALUE=1,s})(n);t.PathConstraintPositionTimeline=p;var g=(function(t){function n(e){t.call(this,e)}return r(n,t),n.prototype.getPropertyId=function(){return(i.pathConstraintSpacing<<24)+this.pathConstraintIndex},n.prototype.apply=function(t,i,r,s,o,a,c){var h=this.frames,l=t.pathConstraints[this.pathConstraintIndex];if(r=h[h.length-n.ENTRIES])u=h[h.length+n.PREV_VALUE];else{var _=e.binarySearch(h,r,n.ENTRIES);u=h[_+n.PREV_VALUE];var d=h[_],f=this.getCurvePercent(_/n.ENTRIES-1,1-(r-d)/(h[_+n.PREV_TIME]-d));u+=(h[_+n.VALUE]-u)*f}a?l.spacing=l.data.spacing+(u-l.data.spacing)*o:l.spacing+=(u-l.spacing)*o}},n})(p);t.PathConstraintSpacingTimeline=g;var y=(function(n){function s(e){n.call(this,e),this.frames=t.Utils.newFloatArray(e*s.ENTRIES)}return r(s,n),s.prototype.getPropertyId=function(){return(i.pathConstraintMix<<24)+this.pathConstraintIndex},s.prototype.setFrame=function(t,e,i,n){t*=s.ENTRIES,this.frames[t]=e,this.frames[t+s.ROTATE]=i,this.frames[t+s.TRANSLATE]=n},s.prototype.apply=function(t,i,n,r,o,a,c){var h=this.frames,l=t.pathConstraints[this.pathConstraintIndex];if(n=h[h.length-s.ENTRIES])u=h[h.length+s.PREV_ROTATE],_=h[h.length+s.PREV_TRANSLATE];else{var d=e.binarySearch(h,n,s.ENTRIES);u=h[d+s.PREV_ROTATE],_=h[d+s.PREV_TRANSLATE];var f=h[d],m=this.getCurvePercent(d/s.ENTRIES-1,1-(n-f)/(h[d+s.PREV_TIME]-f));u+=(h[d+s.ROTATE]-u)*m,_+=(h[d+s.TRANSLATE]-_)*m}a?(l.rotateMix=l.data.rotateMix+(u-l.data.rotateMix)*o,l.translateMix=l.data.translateMix+(_-l.data.translateMix)*o):(l.rotateMix+=(u-l.rotateMix)*o,l.translateMix+=(_-l.translateMix)*o)}},s.ENTRIES=3,s.PREV_TIME=-3,s.PREV_ROTATE=-2,s.PREV_TRANSLATE=-1,s.ROTATE=1,s.TRANSLATE=2,s})(n);t.PathConstraintMixTimeline=y})(n||(n={})),(function(t){var e=(function(){function e(e){this.tracks=new Array,this.events=new Array,this.listeners=new Array,this.queue=new n(this),this.propertyIDs=new t.IntSet,this.animationsChanged=!1,this.timeScale=1,this.trackEntryPool=new t.Pool(function(){return new i}),this.data=e}return e.prototype.update=function(t){t*=this.timeScale;for(var e=this.tracks,i=0,n=e.length;i0){if(r.delay-=s,r.delay>0)continue;s=-r.delay,r.delay=0}var o=r.next;if(null!=o){var a=r.trackLast-o.delay;if(a>=0){for(o.delay=0,o.trackTime=a+t*o.timeScale,r.trackTime+=s,this.setCurrent(i,o,!0);null!=o.mixingFrom;)o.mixTime+=s,o=o.mixingFrom;continue}}else if(r.trackLast>=r.trackEnd&&null==r.mixingFrom){e[i]=null,this.queue.end(r),this.disposeNext(r);continue}this.updateMixingFrom(r,t),r.trackTime+=s}}this.queue.drain()},e.prototype.updateMixingFrom=function(t,e){var i=t.mixingFrom;if(null!=i){if(this.updateMixingFrom(i,e),t.mixTime>=t.mixDuration&&null!=i.mixingFrom&&t.mixTime>0)return t.mixingFrom=null,void this.queue.end(i);i.animationLast=i.nextAnimationLast,i.trackLast=i.nextTrackLast,i.trackTime+=e*i.timeScale,t.mixTime+=e*i.timeScale}},e.prototype.apply=function(e){if(null==e)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();for(var i=this.events,n=this.tracks,r=0,s=n.length;r0)){var a=o.alpha;null!=o.mixingFrom?a*=this.applyMixingFrom(o,e):o.trackTime>=o.trackEnd&&(a=0);var c=o.animationLast,h=o.getAnimationTime(),l=o.animation.timelines.length,u=o.animation.timelines;if(1==a)for(var _=0;_1&&(r=1);var s=r0&&this.queueEvents(n,h),this.events.length=0,n.nextAnimationLast=h,n.nextTrackLast=n.trackTime,r},e.prototype.applyRotateTimeline=function(e,i,n,r,s,o,a,c){if(c&&(o[a]=0),1!=r){var h=e,l=h.frames,u=i.bones[h.boneIndex];if(n=l[l.length-t.RotateTimeline.ENTRIES])_=u.data.rotation+l[l.length+t.RotateTimeline.PREV_ROTATION];else{var d=t.Animation.binarySearch(l,n,t.RotateTimeline.ENTRIES),f=l[d+t.RotateTimeline.PREV_ROTATION],m=l[d],p=h.getCurvePercent((d>>1)-1,1-(n-m)/(l[d+t.RotateTimeline.PREV_TIME]-m));_=l[d+t.RotateTimeline.ROTATION]-f,_=f+(_-=360*(16384-(16384.499999999996-_/360|0)))*p+u.data.rotation,_-=360*(16384-(16384.499999999996-_/360|0))}var g=s?u.data.rotation:u.rotation,y=0,v=_-g;if(0==v)y=o[a];else{v-=360*(16384-(16384.499999999996-v/360|0));var x=0,C=0;c?(x=0,C=v):(x=o[a],C=o[a+1]);var T=v>0,A=x>=0;t.MathUtils.signum(C)!=t.MathUtils.signum(v)&&Math.abs(C)<=90&&(Math.abs(x)>180&&(x+=360*t.MathUtils.signum(x)),A=T),y=v+x-x%360,A!=T&&(y+=360*t.MathUtils.signum(x)),o[a]=y}o[a+1]=v,g+=y*r,u.rotation=g-360*(16384-(16384.499999999996-g/360|0))}}else e.apply(i,0,n,null,1,s,!1)},e.prototype.queueEvents=function(t,e){for(var i=t.animationStart,n=t.animationEnd,r=n-i,s=t.trackLast%r,o=this.events,a=0,c=o.length;an||this.queue.event(t,h)}for((t.loop?s>t.trackTime%r:e>=n&&t.animationLast=this.tracks.length)){var e=this.tracks[t];if(null!=e){this.queue.end(e),this.disposeNext(e);for(var i=e;;){var n=i.mixingFrom;if(null==n)break;this.queue.end(n),i.mixingFrom=null,i=n}this.tracks[e.trackIndex]=null,this.queue.drain()}}},e.prototype.setCurrent=function(t,e,i){var n=this.expandToIndex(t);this.tracks[t]=e,null!=n&&(i&&this.queue.interrupt(n),e.mixingFrom=n,e.mixTime=0,n.timelinesRotation.length=0,null!=n.mixingFrom&&n.mixDuration>0&&(e.mixAlpha*=Math.min(n.mixTime/n.mixDuration,1))),this.queue.start(e)},e.prototype.setAnimation=function(t,e,i){var n=this.data.skeletonData.findAnimation(e);if(null==n)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,n,i)},e.prototype.setAnimationWith=function(t,e,i){if(null==e)throw new Error("animation cannot be null.");var n=!0,r=this.expandToIndex(t);null!=r&&(-1==r.nextTrackLast?(this.tracks[t]=r.mixingFrom,this.queue.interrupt(r),this.queue.end(r),this.disposeNext(r),r=r.mixingFrom,n=!1):this.disposeNext(r));var s=this.trackEntry(t,e,i,r);return this.setCurrent(t,s,n),this.queue.drain(),s},e.prototype.addAnimation=function(t,e,i,n){var r=this.data.skeletonData.findAnimation(e);if(null==r)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,r,i,n)},e.prototype.addAnimationWith=function(t,e,i,n){if(null==e)throw new Error("animation cannot be null.");var r=this.expandToIndex(t);if(null!=r)for(;null!=r.next;)r=r.next;var s=this.trackEntry(t,e,i,r);if(null==r)this.setCurrent(t,s,!0),this.queue.drain();else if(r.next=s,n<=0){var o=r.animationEnd-r.animationStart;0!=o?n+=o*(1+(r.trackTime/o|0))-this.data.getMix(r.animation,e):n=0}return s.delay=n,s},e.prototype.setEmptyAnimation=function(t,i){var n=this.setAnimationWith(t,e.emptyAnimation,!1);return n.mixDuration=i,n.trackEnd=i,n},e.prototype.addEmptyAnimation=function(t,i,n){n<=0&&(n-=i);var r=this.addAnimationWith(t,e.emptyAnimation,!1,n);return r.mixDuration=i,r.trackEnd=i,r},e.prototype.setEmptyAnimations=function(t){this.queue.drainDisabled=!0;for(var e=0,i=this.tracks.length;e=this.tracks.length?null:this.tracks[t]},e.prototype.addListener=function(t){if(null==t)throw new Error("listener cannot be null.");this.listeners.push(t)},e.prototype.removeListener=function(t){var e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)},e.prototype.clearListeners=function(){this.listeners.length=0},e.prototype.clearListenerNotifications=function(){this.queue.clear()},e.emptyAnimation=new t.Animation("",[],0),e})();t.AnimationState=e;var i=(function(){function t(){this.timelinesFirst=new Array,this.timelinesRotation=new Array}return t.prototype.reset=function(){this.next=null,this.mixingFrom=null,this.animation=null,this.listener=null,this.timelinesFirst.length=0,this.timelinesRotation.length=0},t.prototype.getAnimationTime=function(){if(this.loop){var t=this.animationEnd-this.animationStart;return 0==t?this.animationStart:this.trackTime%t+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)},t.prototype.setAnimationLast=function(t){this.animationLast=t,this.nextAnimationLast=t},t.prototype.isComplete=function(){return this.trackTime>=this.animationEnd-this.animationStart},t.prototype.resetRotationDirections=function(){this.timelinesRotation.length=0},t})();t.TrackEntry=i;var n=(function(){function t(t){this.objects=[],this.drainDisabled=!1,this.animState=t}return t.prototype.start=function(t){this.objects.push(r.start),this.objects.push(t),this.animState.animationsChanged=!0},t.prototype.interrupt=function(t){this.objects.push(r.interrupt),this.objects.push(t)},t.prototype.end=function(t){this.objects.push(r.end),this.objects.push(t),this.animState.animationsChanged=!0},t.prototype.dispose=function(t){this.objects.push(r.dispose),this.objects.push(t)},t.prototype.complete=function(t){this.objects.push(r.complete),this.objects.push(t)},t.prototype.event=function(t,e){this.objects.push(r.event),this.objects.push(t),this.objects.push(e)},t.prototype.drain=function(){if(!this.drainDisabled){this.drainDisabled=!0;for(var t=this.objects,e=this.animState.listeners,i=0;i=200&&r.status<300?(n.assets[t]=r.responseText,e&&e(t,r.responseText)):(n.errors[t]="Couldn't load text "+t+": status "+r.status+", "+r.responseText,i&&i(t,"Couldn't load text "+t+": status "+r.status+", "+r.responseText)),n.toLoad--,n.loaded++)},r.open("GET",t,!0),r.send()},t.prototype.loadTexture=function(t,e,i){var n=this;void 0===e&&(e=null),void 0===i&&(i=null),t=this.pathPrefix+t,this.toLoad++;var r=new Image;r.crossOrigin="anonymous",r.src=t,r.onload=function(i){var s=n.textureLoader(r);n.assets[t]=s,n.toLoad--,n.loaded++,e&&e(t,r)},r.onerror=function(e){n.errors[t]="Couldn't load image "+t,n.toLoad--,n.loaded++,i&&i(t,"Couldn't load image "+t)}},t.prototype.get=function(t){return t=this.pathPrefix+t,this.assets[t]},t.prototype.remove=function(t){t=this.pathPrefix+t;var e=this.assets[t];e.dispose&&e.dispose(),this.assets[t]=null},t.prototype.removeAll=function(){for(var t in this.assets){var e=this.assets[t];e.dispose&&e.dispose()}this.assets={}},t.prototype.isLoadingComplete=function(){return 0==this.toLoad},t.prototype.getToLoad=function(){return this.toLoad},t.prototype.getLoaded=function(){return this.loaded},t.prototype.dispose=function(){this.removeAll()},t.prototype.hasErrors=function(){return Object.keys(this.errors).length>0},t.prototype.getErrors=function(){return this.errors},t})();t.AssetManager=e})(n||(n={})),(function(t){var e=(function(){function e(t){this.atlas=t}return e.prototype.newRegionAttachment=function(e,i,n){var r=this.atlas.findRegion(n);if(null==r)throw new Error("Region not found in atlas: "+n+" (region attachment: "+i+")");r.renderObject=r;var s=new t.RegionAttachment(i);return s.setRegion(r),s},e.prototype.newMeshAttachment=function(e,i,n){var r=this.atlas.findRegion(n);if(null==r)throw new Error("Region not found in atlas: "+n+" (mesh attachment: "+i+")");r.renderObject=r;var s=new t.MeshAttachment(i);return s.region=r,s},e.prototype.newBoundingBoxAttachment=function(e,i){return new t.BoundingBoxAttachment(i)},e.prototype.newPathAttachment=function(e,i){return new t.PathAttachment(i)},e})();t.AtlasAttachmentLoader=e})(n||(n={})),(function(t){var e=(function(){return function(t){if(null==t)throw new Error("name cannot be null.");this.name=t}})();t.Attachment=e;var i=(function(t){function e(e){t.call(this,e),this.worldVerticesLength=0}return r(e,t),e.prototype.computeWorldVertices=function(t,e){this.computeWorldVerticesWith(t,0,this.worldVerticesLength,e,0)},e.prototype.computeWorldVerticesWith=function(t,e,i,n,r){i+=r;var s=t.bone.skeleton,o=t.attachmentVertices,a=this.vertices,c=this.bones;if(null!=c){for(var h=0,l=0,u=0;u0&&(a=o);for(var v,x=(v=t.bone).worldX,C=v.worldY,T=v.a,A=v.b,b=v.c,S=v.d,E=e,w=r;w>1);null!=this.worldVertices&&this.worldVertices.length==n||(this.worldVertices=t.Utils.newFloatArray(n));var r=0,s=0,o=0,a=0;if(null==this.region?(r=s=0,o=a=1):(r=this.region.u,s=this.region.v,o=this.region.u2-r,a=this.region.v2-s),this.region.rotate)for(var c=0,h=6;c0&&(l=h);for(var f=(R=t.bone).worldX,m=R.worldY,p=R.a,g=R.b,y=R.c,v=R.d,x=0,C=0;x1e-4?(p=g*(T=Math.abs(m*y-p*g)/T),y=m*T,v=Math.atan2(g,m)*t.MathUtils.radDeg):(m=0,g=0,v=90-Math.atan2(y,p)*t.MathUtils.radDeg);var x=n+o-v,C=n+a-v+90;l=t.MathUtils.cosDeg(x)*r,u=t.MathUtils.cosDeg(C)*s,_=t.MathUtils.sinDeg(x)*r,d=t.MathUtils.sinDeg(C)*s;this.a=m*l-p*_,this.b=m*u-p*d,this.c=g*l+y*_,this.d=g*u+y*d;break;case t.TransformMode.NoScale:case t.TransformMode.NoScaleOrReflection:var T,A=t.MathUtils.cosDeg(n),b=t.MathUtils.sinDeg(n),S=m*A+p*b,E=g*A+y*b;(T=Math.sqrt(S*S+E*E))>1e-5&&(T=1/T),S*=T,E*=T,T=Math.sqrt(S*S+E*E);var w=Math.PI/2+Math.atan2(E,S),I=Math.cos(w)*T,R=Math.sin(w)*T;l=t.MathUtils.cosDeg(o)*r,u=t.MathUtils.cosDeg(90+a)*s,_=t.MathUtils.sinDeg(o)*r,d=t.MathUtils.sinDeg(90+a)*s;return this.a=S*l+I*_,this.b=S*u+I*d,this.c=E*l+R*_,this.d=E*u+R*d,void((this.data.transformMode!=t.TransformMode.NoScaleOrReflection?m*y-p*g<0:this.skeleton.flipX!=this.skeleton.flipY)&&(this.b=-this.b,this.d=-this.d))}this.skeleton.flipX&&(this.a=-this.a,this.b=-this.b),this.skeleton.flipY&&(this.c=-this.c,this.d=-this.d)},e.prototype.setToSetupPose=function(){var t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY},e.prototype.getWorldRotationX=function(){return Math.atan2(this.c,this.a)*t.MathUtils.radDeg},e.prototype.getWorldRotationY=function(){return Math.atan2(this.d,this.b)*t.MathUtils.radDeg},e.prototype.getWorldScaleX=function(){return Math.sqrt(this.a*this.a+this.c*this.c)},e.prototype.getWorldScaleY=function(){return Math.sqrt(this.b*this.b+this.d*this.d)},e.prototype.worldToLocalRotationX=function(){var e=this.parent;if(null==e)return this.arotation;var i=e.a,n=e.b,r=e.c,s=e.d,o=this.a,a=this.c;return Math.atan2(i*a-r*o,s*o-n*a)*t.MathUtils.radDeg},e.prototype.worldToLocalRotationY=function(){var e=this.parent;if(null==e)return this.arotation;var i=e.a,n=e.b,r=e.c,s=e.d,o=this.b,a=this.d;return Math.atan2(i*a-r*o,s*o-n*a)*t.MathUtils.radDeg},e.prototype.rotateWorld=function(e){var i=this.a,n=this.b,r=this.c,s=this.d,o=t.MathUtils.cosDeg(e),a=t.MathUtils.sinDeg(e);this.a=o*i-a*r,this.b=o*n-a*s,this.c=a*i+o*r,this.d=a*n+o*s,this.appliedValid=!1},e.prototype.updateAppliedTransform=function(){this.appliedValid=!0;var e=this.parent;if(null==e)return this.ax=this.worldX,this.ay=this.worldY,this.arotation=Math.atan2(this.c,this.a)*t.MathUtils.radDeg,this.ascaleX=Math.sqrt(this.a*this.a+this.c*this.c),this.ascaleY=Math.sqrt(this.b*this.b+this.d*this.d),this.ashearX=0,void(this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*t.MathUtils.radDeg);var i=e.a,n=e.b,r=e.c,s=e.d,o=1/(i*s-n*r),a=this.worldX-e.worldX,c=this.worldY-e.worldY;this.ax=a*s*o-c*n*o,this.ay=c*i*o-a*r*o;var h=o*s,l=o*i,u=o*n,_=o*r,d=h*this.a-u*this.c,f=h*this.b-u*this.d,m=l*this.c-_*this.a,p=l*this.d-_*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(d*d+m*m),this.ascaleX>1e-4){var g=d*p-f*m;this.ascaleY=g/this.ascaleX,this.ashearY=Math.atan2(d*f+m*p,g)*t.MathUtils.radDeg,this.arotation=Math.atan2(m,d)*t.MathUtils.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(f*f+p*p),this.ashearY=0,this.arotation=90-Math.atan2(p,f)*t.MathUtils.radDeg},e.prototype.worldToLocal=function(t){var e=this.a,i=this.b,n=this.c,r=this.d,s=1/(e*r-i*n),o=t.x-this.worldX,a=t.y-this.worldY;return t.x=o*r*s-a*i*s,t.y=a*e*s-o*n*s,t},e.prototype.localToWorld=function(t){var e=t.x,i=t.y;return t.x=e*this.a+i*this.b+this.worldX,t.y=e*this.c+i*this.d+this.worldY,t},e})();t.Bone=e})(n||(n={})),(function(t){var e=(function(){return function(t,e,n){if(this.x=0,this.y=0,this.rotation=0,this.scaleX=1,this.scaleY=1,this.shearX=0,this.shearY=0,this.transformMode=i.Normal,t<0)throw new Error("index must be >= 0.");if(null==e)throw new Error("name cannot be null.");this.index=t,this.name=e,this.parent=n}})();t.BoneData=e,(function(t){t[t.Normal=0]="Normal",t[t.OnlyTranslation=1]="OnlyTranslation",t[t.NoRotationOrReflection=2]="NoRotationOrReflection",t[t.NoScale=3]="NoScale",t[t.NoScaleOrReflection=4]="NoScaleOrReflection"})(t.TransformMode||(t.TransformMode={}));var i=t.TransformMode})(n||(n={})),(function(t){var e=(function(){return function(t,e){if(null==e)throw new Error("data cannot be null.");this.time=t,this.data=e}})();t.Event=e})(n||(n={})),(function(t){var e=(function(){return function(t){this.name=t}})();t.EventData=e})(n||(n={})),(function(t){var e=(function(){function e(t,e){if(this.mix=1,this.bendDirection=0,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.mix=t.mix,this.bendDirection=t.bendDirection,this.bones=new Array;for(var i=0;i180?u-=360:u<-180&&(u+=360),e.updateWorldTransformWith(e.ax,e.ay,e.arotation+u*r,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY)},e.prototype.apply2=function(e,i,n,r,s,o){if(0!=o){e.appliedValid||e.updateAppliedTransform(),i.appliedValid||i.updateAppliedTransform();var a=e.ax,c=e.ay,h=e.ascaleX,l=e.ascaleY,u=i.ascaleX,_=0,d=0,f=0;h<0?(h=-h,_=180,f=-1):(_=0,f=1),l<0&&(l=-l,f=-f),u<0?(u=-u,d=180):d=0;var m=i.ax,p=0,g=0,y=0,v=e.a,x=e.b,C=e.c,T=e.d,A=Math.abs(h-l)<=1e-4;A?(g=v*m+x*(p=i.ay)+e.worldX,y=C*m+T*p+e.worldY):(p=0,g=v*m+e.worldX,y=C*m+e.worldY);var b=e.parent;v=b.a,x=b.b,C=b.c;var S=1/(v*(T=b.d)-x*C),E=n-b.worldX,w=r-b.worldY,I=(E*T-w*x)*S-a,R=(w*v-E*C)*S-c,P=((E=g-b.worldX)*T-(w=y-b.worldY)*x)*S-a,O=(w*v-E*C)*S-c,D=Math.sqrt(P*P+O*O),B=i.data.length*u,L=0,M=0;t:if(A){var N=(I*I+R*R-D*D-(B*=h)*B)/(2*D*B);N<-1?N=-1:N>1&&(N=1),M=Math.acos(N)*s,v=D+B*N,x=B*Math.sin(M),L=Math.atan2(R*v-I*x,I*v+R*x)}else{var F=(v=h*B)*v,z=(x=l*B)*x,k=I*I+R*R,V=Math.atan2(R,I),G=-2*z*D,U=z-F;if((T=G*G-4*U*(C=z*D*D+F*k-F*z))>=0){var W=Math.sqrt(T);G<0&&(W=-W);var X=(W=-(G+W)/2)/U,j=C/W,Y=Math.abs(X)Q&&(K=0,Q=T,$=E),(T=(E=D-v)*E)Q&&(K=et,Q=T,$=E,tt=w),k<=(q+Q)/2?(L=V-Math.atan2(Z*s,J),M=H*s):(L=V-Math.atan2(tt*s,$),M=K*s)}var it=Math.atan2(p,m)*f,nt=e.arotation;(L=(L-it)*t.MathUtils.radDeg+_-nt)>180?L-=360:L<-180&&(L+=360),e.updateWorldTransformWith(a,c,nt+L*o,e.ascaleX,e.ascaleY,0,0),nt=i.arotation,(M=((M+it)*t.MathUtils.radDeg-i.ashearX)*f+d-nt)>180?M-=360:M<-180&&(M+=360),i.updateWorldTransformWith(m,p,nt+M*o,i.ascaleX,i.ascaleY,i.ashearX,i.ashearY)}else i.updateWorldTransform()},e})();t.IkConstraint=e})(n||(n={})),(function(t){var e=(function(){return function(t){this.order=0,this.bones=new Array,this.bendDirection=1,this.mix=1,this.name=t}})();t.IkConstraintData=e})(n||(n={})),(function(t){var e=(function(){function e(t,e){if(this.position=0,this.spacing=0,this.rotateMix=0,this.translateMix=0,this.spaces=new Array,this.positions=new Array,this.world=new Array,this.curves=new Array,this.lengths=new Array,this.segments=new Array,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(var i=0,n=t.bones.length;i0;if(n>0||r){var s=this.data,o=s.spacingMode,a=o==t.SpacingMode.Length,c=s.rotateMode,h=c==t.RotateMode.Tangent,l=c==t.RotateMode.ChainScale,u=this.bones.length,_=h?u:u+1,d=this.bones,f=t.Utils.setArraySize(this.spaces,_),m=null,p=this.spacing;if(l||a){l&&(m=t.Utils.setArraySize(this.lengths,u));for(var g=0,y=_-1;g0?t.MathUtils.degRad:-t.MathUtils.degRad;g=0;for(var w=3;gt.MathUtils.PI?F-=t.MathUtils.PI2:F<-t.MathUtils.PI&&(F+=t.MathUtils.PI2),F*=i,z=Math.cos(F),k=Math.sin(F),I.a=z*B-k*M,I.b=z*L-k*N,I.c=k*B+z*M,I.d=k*L+z*N}I.appliedValid=!1}}}},e.prototype.computeWorldPositions=function(i,n,r,s,o){var a=this.target,c=this.position,h=this.spaces,l=t.Utils.setArraySize(this.positions,3*n+2),u=null,_=i.closed,d=i.worldVerticesLength,f=d/6,m=e.NONE;if(!i.constantSpeed){var p=i.lengths,g=p[f-=_?1:2];if(s&&(c*=g),o)for(var y=0;yg){m!=e.AFTER&&(m=e.AFTER,i.computeWorldVerticesWith(a,d-6,4,u,0)),this.addAfterPosition(C-g,u,0,l,v);continue}}for(;;x++){var T=p[x];if(!(C>T)){if(0==x)C/=T;else C=(C-(J=p[x-1]))/(T-J);break}}x!=m&&(m=x,_&&x==f?(i.computeWorldVerticesWith(a,d-4,4,u,0),i.computeWorldVerticesWith(a,0,4,u,4)):i.computeWorldVerticesWith(a,6*x+2,8,u,0)),this.addCurvePosition(C,u[0],u[1],u[2],u[3],u[4],u[5],u[6],u[7],l,v,r||y>0&&0==j)}return l}_?(d+=2,u=t.Utils.setArraySize(this.world,d),i.computeWorldVerticesWith(a,2,d-4,u,0),i.computeWorldVerticesWith(a,0,2,u,d-4),u[d-2]=u[0],u[d-1]=u[1]):(f--,d-=4,u=t.Utils.setArraySize(this.world,d),i.computeWorldVerticesWith(a,2,d,u,0));for(var A=t.Utils.setArraySize(this.curves,f),b=0,S=u[0],E=u[1],w=0,I=0,R=0,P=0,O=0,D=0,B=0,L=0,M=0,N=0,F=0,z=0,k=0,V=0,G=(y=0,2);yb){this.addAfterPosition(C-b,u,d-4,l,v);continue}}for(;;x++){var Y=A[x];if(!(C>Y)){if(0==x)C/=Y;else C=(C-(J=A[x-1]))/(Y-J);break}}if(x!=m){m=x;var H=6*x;for(S=u[H],E=u[H+1],w=u[H+2],I=u[H+3],R=u[H+4],P=u[H+5],O=u[H+6],D=u[H+7],F=2*(B=.03*(S-2*w+R))+(M=.006*(3*(w-R)-S+O)),z=2*(L=.03*(E-2*I+P))+(N=.006*(3*(I-P)-E+D)),k=.3*(w-S)+B+.16666667*M,V=.3*(I-E)+L+.16666667*N,W=Math.sqrt(k*k+V*V),U[0]=W,H=1;H<8;H++)k+=F,V+=z,F+=M,z+=N,W+=Math.sqrt(k*k+V*V),U[H]=W;k+=F,V+=z,W+=Math.sqrt(k*k+V*V),U[8]=W,k+=F+M,V+=z+N,W+=Math.sqrt(k*k+V*V),U[9]=W,X=0}for(C*=W;;X++){var q=U[X];if(!(C>q)){var J;if(0==X)C/=q;else C=X+(C-(J=U[X-1]))/(q-J);break}}this.addCurvePosition(.1*C,S,E,w,I,R,P,O,D,l,v,r||y>0&&0==j)}return l},e.prototype.addBeforePosition=function(t,e,i,n,r){var s=e[i],o=e[i+1],a=e[i+2]-s,c=e[i+3]-o,h=Math.atan2(c,a);n[r]=s+t*Math.cos(h),n[r+1]=o+t*Math.sin(h),n[r+2]=h},e.prototype.addAfterPosition=function(t,e,i,n,r){var s=e[i+2],o=e[i+3],a=s-e[i],c=o-e[i+1],h=Math.atan2(c,a);n[r]=s+t*Math.cos(h),n[r+1]=o+t*Math.sin(h),n[r+2]=h},e.prototype.addCurvePosition=function(t,e,i,n,r,s,o,a,c,h,l,u){(0==t||isNaN(t))&&(t=1e-4);var _=t*t,d=_*t,f=1-t,m=f*f,p=m*f,g=f*t,y=3*g,v=f*y,x=y*t,C=e*p+n*v+s*x+a*d,T=i*p+r*v+o*x+c*d;h[l]=C,h[l+1]=T,u&&(h[l+2]=Math.atan2(T-(i*m+r*g*2+o*_),C-(e*m+n*g*2+s*_)))},e.prototype.getOrder=function(){return this.data.order},e.NONE=-1,e.BEFORE=-2,e.AFTER=-3,e})();t.PathConstraint=e})(n||(n={})),(function(t){var e=(function(){return function(t){this.order=0,this.bones=new Array,this.name=t}})();t.PathConstraintData=e,(function(t){t[t.Fixed=0]="Fixed",t[t.Percent=1]="Percent"})(t.PositionMode||(t.PositionMode={}));t.PositionMode;(function(t){t[t.Length=0]="Length",t[t.Fixed=1]="Fixed",t[t.Percent=2]="Percent"})(t.SpacingMode||(t.SpacingMode={}));t.SpacingMode;(function(t){t[t.Tangent=0]="Tangent",t[t.Chain=1]="Chain",t[t.ChainScale=2]="ChainScale"})(t.RotateMode||(t.RotateMode={}));t.RotateMode})(n||(n={})),(function(t){var e=(function(){function t(t){this.toLoad=new Array,this.assets={},this.clientId=t}return t.prototype.loaded=function(){var t=0;for(var e in this.assets)t++;return t},t})(),i=(function(){function t(t){void 0===t&&(t=""),this.clientAssets={},this.queuedAssets={},this.rawAssets={},this.errors={},this.pathPrefix=t}return t.prototype.queueAsset=function(t,i,n){var r=this.clientAssets[t];return null!==r&&void 0!==r||(r=new e(t),this.clientAssets[t]=r),null!==i&&(r.textureLoader=i),r.toLoad.push(n),this.queuedAssets[n]!==n&&(this.queuedAssets[n]=n,!0)},t.prototype.loadText=function(t,e){var i=this;if(e=this.pathPrefix+e,this.queueAsset(t,null,e)){var n=new XMLHttpRequest;n.onreadystatechange=function(){n.readyState==XMLHttpRequest.DONE&&(n.status>=200&&n.status<300?i.rawAssets[e]=n.responseText:i.errors[e]="Couldn't load text "+e+": status "+n.status+", "+n.responseText)},n.open("GET",e,!0),n.send()}},t.prototype.loadJson=function(t,e){var i=this;if(e=this.pathPrefix+e,this.queueAsset(t,null,e)){var n=new XMLHttpRequest;n.onreadystatechange=function(){n.readyState==XMLHttpRequest.DONE&&(n.status>=200&&n.status<300?i.rawAssets[e]=JSON.parse(n.responseText):i.errors[e]="Couldn't load text "+e+": status "+n.status+", "+n.responseText)},n.open("GET",e,!0),n.send()}},t.prototype.loadTexture=function(t,e,i){var n=this;if(i=this.pathPrefix+i,this.queueAsset(t,e,i)){var r=new Image;r.src=i,r.crossOrigin="anonymous",r.onload=function(t){n.rawAssets[i]=r},r.onerror=function(t){n.errors[i]="Couldn't load image "+i}}},t.prototype.get=function(t,e){e=this.pathPrefix+e;var i=this.clientAssets[t];return null===i||void 0===i||i.assets[e]},t.prototype.updateClientAssets=function(t){for(var e=0;e0},t.prototype.getErrors=function(){return this.errors},t})();t.SharedAssetManager=i})(n||(n={})),(function(t){var e=(function(){function e(e){if(this._updateCache=new Array,this.updateCacheReset=new Array,this.time=0,this.flipX=!1,this.flipY=!1,this.x=0,this.y=0,null==e)throw new Error("data cannot be null.");this.data=e,this.bones=new Array;for(var i=0;i1){var r=i[i.length-1];this._updateCache.indexOf(r)>-1||this.updateCacheReset.push(r)}this._updateCache.push(t),this.sortReset(n.children),i[i.length-1].sorted=!0},e.prototype.sortPathConstraint=function(e){var i=e.target,n=i.data.index,r=i.bone;null!=this.skin&&this.sortPathConstraintAttachment(this.skin,n,r),null!=this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,n,r);for(var s=0,o=this.data.skins.length;s=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY},e.prototype.aabbIntersectsSegment=function(t,e,i,n){var r=this.minX,s=this.minY,o=this.maxX,a=this.maxY;if(t<=r&&i<=r||e<=s&&n<=s||t>=o&&i>=o||e>=a&&n>=a)return!1;var c=(n-e)/(i-t),h=c*(r-t)+e;if(h>s&&hs&&hr&&lr&&lt.minX&&this.minYt.minY},e.prototype.containsPoint=function(t,e){for(var i=this.polygons,n=0,r=i.length;n=i||h=i){var l=n[a];l+(i-c)/(h-c)*(n[s]-l)=l&&v<=d||v>=d&&v<=l)&&(v>=e&&v<=n||v>=n&&v<=e)){var x=(h*g-c*m)/y;if((x>=u&&x<=f||x>=f&&x<=u)&&(x>=i&&x<=r||x>=r&&x<=i))return!0}l=d,u=f}return!1},e.prototype.getPolygon=function(t){if(null==t)throw new Error("boundingBox cannot be null.");var e=this.boundingBoxes.indexOf(t);return-1==e?null:this.polygons[e]},e.prototype.getWidth=function(){return this.maxX-this.minX},e.prototype.getHeight=function(){return this.maxY-this.minY},e})();t.SkeletonBounds=e})(n||(n={})),(function(t){var e=(function(){function t(){this.bones=new Array,this.slots=new Array,this.skins=new Array,this.events=new Array,this.animations=new Array,this.ikConstraints=new Array,this.transformConstraints=new Array,this.pathConstraints=new Array,this.fps=0}return t.prototype.findBone=function(t){if(null==t)throw new Error("boneName cannot be null.");for(var e=this.bones,i=0,n=e.length;i=0;_--)-1==U[_]&&(U[_]=X[--Y])}y.setFrame(u++,G.time,U)}s.push(y),o=Math.max(o,y.frames[y.getFrameCount()-1])}if(e.events){for(y=new t.EventTimeline(e.events.length),u=0,_=0;_=n.length&&(n.length=t+1),n[t]||(n[t]={}),n[t][e]=i},t.prototype.getAttachment=function(t,e){var i=this.attachments[t];return i?i[e]:null},t.prototype.attachAll=function(t,e){for(var i=0,n=0;n= 0.");if(null==i)throw new Error("name cannot be null.");if(null==n)throw new Error("boneData cannot be null.");this.index=e,this.name=i,this.boneData=n}})();t.SlotData=e})(n||(n={})),(function(t){var e=(function(){function t(t){this._image=t}return t.prototype.getImage=function(){return this._image},t.filterFromString=function(t){switch(t.toLowerCase()){case"nearest":return i.Nearest;case"linear":return i.Linear;case"mipmap":return i.MipMap;case"mipmapnearestnearest":return i.MipMapNearestNearest;case"mipmaplinearnearest":return i.MipMapLinearNearest;case"mipmapnearestlinear":return i.MipMapNearestLinear;case"mipmaplinearlinear":return i.MipMapLinearLinear;default:throw new Error("Unknown texture filter "+t)}},t.wrapFromString=function(t){switch(t.toLowerCase()){case"mirroredtepeat":return n.MirroredRepeat;case"clamptoedge":return n.ClampToEdge;case"repeat":return n.Repeat;default:throw new Error("Unknown texture wrap "+t)}},t})();t.Texture=e,(function(t){t[t.Nearest=9728]="Nearest",t[t.Linear=9729]="Linear",t[t.MipMap=9987]="MipMap",t[t.MipMapNearestNearest=9984]="MipMapNearestNearest",t[t.MipMapLinearNearest=9985]="MipMapLinearNearest",t[t.MipMapNearestLinear=9986]="MipMapNearestLinear",t[t.MipMapLinearLinear=9987]="MipMapLinearLinear"})(t.TextureFilter||(t.TextureFilter={}));var i=t.TextureFilter;(function(t){t[t.MirroredRepeat=33648]="MirroredRepeat",t[t.ClampToEdge=33071]="ClampToEdge",t[t.Repeat=10497]="Repeat"})(t.TextureWrap||(t.TextureWrap={}));var n=t.TextureWrap,r=(function(){return function(){this.u=0,this.v=0,this.u2=0,this.v2=0,this.width=0,this.height=0,this.rotate=!1,this.offsetX=0,this.offsetY=0,this.originalWidth=0,this.originalHeight=0}})();t.TextureRegion=r})(n||(n={})),(function(t){var e=(function(){function e(t,e){this.pages=new Array,this.regions=new Array,this.load(t,e)}return e.prototype.load=function(e,r){if(null==r)throw new Error("textureLoader cannot be null.");for(var o=new i(e),a=new Array(4),c=null;;){var h=o.readLine();if(null==h)break;if(0==(h=h.trim()).length)c=null;else if(c){var l=new s;l.name=h,l.page=c,l.rotate="true"==o.readValue(),o.readTuple(a);var u=parseInt(a[0]),_=parseInt(a[1]);o.readTuple(a);var d=parseInt(a[0]),f=parseInt(a[1]);l.u=u/c.width,l.v=_/c.height,l.rotate?(l.u2=(u+f)/c.width,l.v2=(_+d)/c.height):(l.u2=(u+d)/c.width,l.v2=(_+f)/c.height),l.x=u,l.y=_,l.width=Math.abs(d),l.height=Math.abs(f),4==o.readTuple(a)&&4==o.readTuple(a)&&o.readTuple(a),l.originalWidth=parseInt(a[0]),l.originalHeight=parseInt(a[1]),o.readTuple(a),l.offsetX=parseInt(a[0]),l.offsetY=parseInt(a[1]),l.index=parseInt(o.readValue()),l.texture=c.texture,this.regions.push(l)}else{(c=new n).name=h,2==o.readTuple(a)&&(c.width=parseInt(a[0]),c.height=parseInt(a[1]),o.readTuple(a)),o.readTuple(a),c.minFilter=t.Texture.filterFromString(a[0]),c.magFilter=t.Texture.filterFromString(a[1]);var m=o.readValue();c.uWrap=t.TextureWrap.ClampToEdge,c.vWrap=t.TextureWrap.ClampToEdge,"x"==m?c.uWrap=t.TextureWrap.Repeat:"y"==m?c.vWrap=t.TextureWrap.Repeat:"xy"==m&&(c.uWrap=c.vWrap=t.TextureWrap.Repeat),c.texture=r(h),c.texture.setFilters(c.minFilter,c.magFilter),c.texture.setWraps(c.uWrap,c.vWrap),c.width=c.texture.getImage().width,c.height=c.texture.getImage().height,this.pages.push(c)}}},e.prototype.findRegion=function(t){for(var e=0;e=this.lines.length?null:this.lines[this.index++]},t.prototype.readValue=function(){var t=this.readLine(),e=t.indexOf(":");if(-1==e)throw new Error("Invalid line: "+t);return t.substring(e+1).trim()},t.prototype.readTuple=function(t){var e=this.readLine(),i=e.indexOf(":");if(-1==i)throw new Error("Invalid line: "+e);for(var n=0,r=i+1;n<3;n++){var s=e.indexOf(",",r);if(-1==s)break;t[n]=e.substr(r,s-r).trim(),r=s+1}return t[n]=e.substring(r).trim(),n+1},t})(),n=(function(){return function(){}})();t.TextureAtlasPage=n;var s=(function(t){function e(){t.apply(this,arguments)}return r(e,t),e})(t.TextureRegion);t.TextureAtlasRegion=s})(n||(n={})),(function(t){var e=(function(){function e(e,i){if(this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=0,this.temp=new t.Vector2,null==e)throw new Error("data cannot be null.");if(null==i)throw new Error("skeleton cannot be null.");this.data=e,this.rotateMix=e.rotateMix,this.translateMix=e.translateMix,this.scaleMix=e.scaleMix,this.shearMix=e.shearMix,this.bones=new Array;for(var n=0;n0?t.MathUtils.degRad:-t.MathUtils.degRad,u=this.data.offsetRotation*l,_=this.data.offsetShearY*l,d=this.bones,f=0,m=d.length;ft.MathUtils.PI?w-=t.MathUtils.PI2:w<-t.MathUtils.PI&&(w+=t.MathUtils.PI2),w*=e;var T=Math.cos(w),A=Math.sin(w);p.a=T*y-A*x,p.b=T*v-A*C,p.c=A*y+T*x,p.d=A*v+T*C,g=!0}if(0!=i){var b=this.temp;s.localToWorld(b.set(this.data.offsetX,this.data.offsetY)),p.worldX+=(b.x-p.worldX)*i,p.worldY+=(b.y-p.worldY)*i,g=!0}if(n>0){var S=Math.sqrt(p.a*p.a+p.c*p.c),E=Math.sqrt(o*o+c*c);S>1e-5&&(S=(S+(E-S+this.data.offsetScaleX)*n)/S),p.a*=S,p.c*=S,S=Math.sqrt(p.b*p.b+p.d*p.d),E=Math.sqrt(a*a+h*h),S>1e-5&&(S=(S+(E-S+this.data.offsetScaleY)*n)/S),p.b*=S,p.d*=S,g=!0}if(r>0){v=p.b,C=p.d;var w,I=Math.atan2(C,v);(w=Math.atan2(h,a)-Math.atan2(c,o)-(I-Math.atan2(p.c,p.a)))>t.MathUtils.PI?w-=t.MathUtils.PI2:w<-t.MathUtils.PI&&(w+=t.MathUtils.PI2),w=I+(w+_)*r;S=Math.sqrt(v*v+C*C);p.b=Math.cos(w)*S,p.d=Math.sin(w)*S,g=!0}g&&(p.appliedValid=!1)}},e.prototype.getOrder=function(){return this.data.order},e})();t.TransformConstraint=e})(n||(n={})),(function(t){var e=(function(){return function(t){if(this.order=0,this.bones=new Array,this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=0,this.offsetRotation=0,this.offsetX=0,this.offsetY=0,this.offsetScaleX=0,this.offsetScaleY=0,this.offsetShearY=0,null==t)throw new Error("name cannot be null.");this.name=t}})();t.TransformConstraintData=e})(n||(n={})),(function(t){var e=(function(){function t(){this.array=new Array}return t.prototype.add=function(t){var e=this.contains(t);return this.array[0|t]=0|t,!e},t.prototype.contains=function(t){return void 0!=this.array[0|t]},t.prototype.remove=function(t){this.array[0|t]=void 0},t.prototype.clear=function(){this.array.length=0},t})();t.IntSet=e;var i=(function(){function t(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.r=t,this.g=e,this.b=i,this.a=n}return t.prototype.set=function(t,e,i,n){return this.r=t,this.g=e,this.b=i,this.a=n,this.clamp(),this},t.prototype.setFromColor=function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this},t.prototype.setFromString=function(t){return t="#"==t.charAt(0)?t.substr(1):t,this.r=parseInt(t.substr(0,2),16)/255,this.g=parseInt(t.substr(2,2),16)/255,this.b=parseInt(t.substr(4,2),16)/255,this.a=(8!=t.length?255:parseInt(t.substr(6,2),16))/255,this},t.prototype.add=function(t,e,i,n){return this.r+=t,this.g+=e,this.b+=i,this.a+=n,this.clamp(),this},t.prototype.clamp=function(){return this.r<0?this.r=0:this.r>1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this},t.WHITE=new t(1,1,1,1),t.RED=new t(1,0,0,1),t.GREEN=new t(0,1,0,1),t.BLUE=new t(0,0,1,1),t.MAGENTA=new t(1,0,1,1),t})();t.Color=i;var n=(function(){function t(){}return t.clamp=function(t,e,i){return ti?i:t},t.cosDeg=function(e){return Math.cos(e*t.degRad)},t.sinDeg=function(e){return Math.sin(e*t.degRad)},t.signum=function(t){return t>0?1:t<0?-1:0},t.toInt=function(t){return t>0?Math.floor(t):Math.ceil(t)},t.cbrt=function(t){var e=Math.pow(Math.abs(t),1/3);return t<0?-e:e},t.PI=3.1415927,t.PI2=2*t.PI,t.radiansToDegrees=180/t.PI,t.radDeg=t.radiansToDegrees,t.degreesToRadians=t.PI/180,t.degRad=t.degreesToRadians,t})();t.MathUtils=n;var r=(function(){function t(){}return t.arrayCopy=function(t,e,i,n,r){for(var s=e,o=n;s=i?e:t.setArraySize(e,i,n)},t.newArray=function(t,e){for(var i=new Array(t),n=0;n0?this.items.pop():this.instantiator()},t.prototype.free=function(t){t.reset&&t.reset(),this.items.push(t)},t.prototype.freeAll=function(t){for(var e=0;ethis.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)},t})();t.TimeKeeper=c})(n||(n={})),e.exports=n}),{}],312:[(function(t,e,i){(function(){"use strict";Function.prototype._extend=function(t){for(var e in this.prototype.parent=t,t.prototype)this.prototype[e]||(this.prototype[e]=t.prototype[e])},Function.prototype._implement=function(t){return this._extend(t)};var t=(function(){function t(t,e){this.name=t,this.parent=e,this.children={},this.startTime=0,this.elapsedTime=0,this.totalTime=0,this.running=!1,this.childrenCount=0}"undefined"==typeof performance&&(window.performance={now:function(){return+new Date}}),t.prototype={start:function(){this.startTime=performance.now(),this.running=!0},stop:function(t){if(this.running)for(var e in this.running=!1,this.elapsedTime+=performance.now()-this.startTime,t&&this.start(),this.children)this.children[e].stop()},reset:function(t){for(var e in t||(this.running=!0,this.totalTime+=this.elapsedTime,this.start()),this.elapsedTime=0,this.children)this.children[e].reset(!0)}};var e=[],i=new t("root");function n(t,e){if(t.name===e.parent)return t;for(var i in t.children){var r;if(r=n(t.children[i],e))return r}return null}return{create:function(i,n){if(!e)throw new Error("late profile creation not allowed");var r=new t(i,n||"root");return e.push(r),r},destroy:function(t){t.childrenCount--,delete t.children[t.name]},init:function(){for(;e.length;){var t=e.pop();(t.parentNode=n(i,t))?(t.parentNode.children[t.name]=t,t.parentNode.childrenCount++):e.unshift(t)}e=null},reset:function(){i.reset(!0)},profileRoot:i}})();function i(t){t||console.log("Assertion failed! Pls debug.")}var n=Number.MAX_VALUE,r=2.220446049250313e-16,s=Math.PI,o=2,a=8,c=.005,h=2/180*s,l=2*c,u=8/180*s,_=.5*s,d=_*_,f=2/180*s;function m(t,e,i){this.major=t,this.minor=e,this.revision=i}m.prototype={toString:function(){return this.major+"."+this.minor+"."+this.revision}};var p=new m(2,3,1);function g(t){return isFinite(t)&&!isNaN(t)}var y=Math.sqrt,v=Math.atan2,x=Math.sin,C=Math.cos,T=Math.floor,A=(Math.ceil,y),b=v;function S(t,e){void 0!==t?(this.x=t,this.y=e):this.x=this.y=0}function E(t,e,i){void 0!==t&&(this.x=t,this.y=e,this.z=i)}function w(t,e){this.ex=t?t.Clone():new S,this.ey=e?e.Clone():new S}function I(t,e,i){this.ex=t?t.Clone():new E,this.ey=e?e.Clone():new E,this.ez=i?i.Clone():new E}function R(t,e){void 0!==e?(this.s=t,this.c=e):void 0!==t&&this.Set(t)}function P(t,e){this.p=new S,this.q=new R,t&&(this.p.Assign(t),this.q.Assign(e))}function O(){this.localCenter=new S,this.c0=new S,this.c=new S}function D(t,e){return t.x*e.x+t.y*e.y}function B(t,e){return t.x*e.y-t.y*e.x}function L(t,e){return new S(e*t.y,-e*t.x)}function M(t,e){return new S(-t*e.y,t*e.x)}function N(t,e){return new S(t.ex.x*e.x+t.ey.x*e.y,t.ex.y*e.x+t.ey.y*e.y)}function F(t,e){return S.Subtract(t,e).Length()}function z(t,e){var i=S.Subtract(t,e);return D(i,i)}function k(t,e){return t.x*e.x+t.y*e.y+t.z*e.z}function V(t,e){return new E(t.y*e.z-t.z*e.y,t.z*e.x-t.x*e.z,t.x*e.y-t.y*e.x)}function G(t,e){return E.Add(E.Add(E.Multiply(e.x,t.ex),E.Multiply(e.y,t.ey)),E.Multiply(e.z,t.ez))}function U(t,e){return new S(t.ex.x*e.x+t.ey.x*e.y,t.ex.y*e.x+t.ey.y*e.y)}function W(t,e){var i=new R;return i.s=t.s*e.c+t.c*e.s,i.c=t.c*e.c-t.s*e.s,i}function X(t,e){var i=new R;return i.s=t.c*e.s-t.s*e.c,i.c=t.c*e.c+t.s*e.s,i}function j(t,e){return new S(t.c*e.x-t.s*e.y,t.s*e.x+t.c*e.y)}function Y(t,e){return new S(t.c*e.x+t.s*e.y,-t.s*e.x+t.c*e.y)}function H(t,e){return new S(t.q.c*e.x-t.q.s*e.y+t.p.x,t.q.s*e.x+t.q.c*e.y+t.p.y)}function q(t,e){var i=e.x-t.p.x,n=e.y-t.p.y;return new S(t.q.c*i+t.q.s*n,-t.q.s*i+t.q.c*n)}function J(t,e){var i=new P;i.q=X(t.q,e.q);var n=e.p.x-t.p.x,r=e.p.y-t.p.y;return i.p.x=t.q.c*n+t.q.s*r,i.p.y=-t.q.s*n+t.q.c*r,i}S.prototype={Clone:function(){return new S(this.x,this.y)},SetZero:function(){return this.x=0,this.y=0,this},Set:function(t,e){return this.x=t,this.y=e,this},Assign:function(t){return this.x=t.x,this.y=t.y,this},Negate:function(){var t=new S;return t.Set(-this.x,-this.y),t},get_i:function(t){switch(t){case 0:return this.x;case 1:return this.y}},set_i:function(t,e){switch(t){case 0:return this.x=e;case 1:return this.y=e}},Add:function(t){return this.x+=t.x,this.y+=t.y,this},Subtract:function(t){return this.x-=t.x,this.y-=t.y,this},Multiply:function(t){return this.x*=t,this.y*=t,this},Length:function(){return A(this.x*this.x+this.y*this.y)},LengthSquared:function(){return this.x*this.x+this.y*this.y},Normalize:function(){var t=this.Length();if(t0?j(i.q,l).Negate():j(i.q,l),!0)},ComputeAABB:function(t,e,i){var n=e.q.c*this.m_vertex1.x-e.q.s*this.m_vertex1.y+e.p.x,r=e.q.s*this.m_vertex1.x+e.q.c*this.m_vertex1.y+e.p.y,s=e.q.c*this.m_vertex2.x-e.q.s*this.m_vertex2.y+e.p.x,o=e.q.s*this.m_vertex2.x+e.q.c*this.m_vertex2.y+e.p.y,a=Q(n,s),c=Q(r,o),h=tt(n,s),l=tt(r,o);t.lowerBound.x=a-this.m_radius,t.lowerBound.y=c-this.m_radius,t.upperBound.x=h+this.m_radius,t.upperBound.y=l+this.m_radius},ComputeMass:function(t,e){t.mass=0,t.center=S.Multiply(.5,S.Add(this.m_vertex1,this.m_vertex2)),t.I=0},_serialize:function(t){var e=t||{};return this.parent.prototype._serialize.call(this,e),e.m_vertex1=this.m_vertex1._serialize(),e.m_vertex2=this.m_vertex2._serialize(),e.m_hasVertex0=this.m_hasVertex0,this.m_hasVertex0&&(e.m_vertex0=this.m_vertex0._serialize()),e.m_hasVertex3=this.m_hasVertex3,this.m_hasVertex3&&(e.m_vertex3=this.m_vertex3._serialize()),e},_deserialize:function(t){this.parent.prototype._deserialize.call(this,t),this.m_vertex1._deserialize(t.m_vertex1),this.m_vertex2._deserialize(t.m_vertex2),this.m_hasVertex0=t.m_hasVertex0,this.m_hasVertex0&&this.m_vertex0._deserialize(t.m_vertex0),this.m_hasVertex3=t.m_hasVertex3,this.m_hasVertex3&&this.m_vertex3._deserialize(t.m_vertex3)}},ht._extend(at),lt._tempEdge=new ht,lt.prototype={Clear:function(){this.m_vertices=null,this.m_count=0},CreateLoop:function(t,e){i(null==this.m_vertices&&0==this.m_count),i(e>=3);for(var n=1;nc*c);this.m_count=e+1,this.m_vertices=new Array(this.m_count);for(n=0;n=2);for(var n=1;nc*c)}this.m_count=e,this.m_vertices=new Array(e);for(n=0;n0?(t.m_vertex0=this.m_vertices[e-1],t.m_hasVertex0=!0):(t.m_vertex0=this.m_prevVertex,t.m_hasVertex0=this.m_hasPrevVertex),ef||m==f&&s[h].yx.LengthSquared()&&(v=_)}else v=_;if(++g,y=v,v==d)break}if(g<3)return i(!1),void this.SetAsBox(1,1);for(this.m_count=g,h=0;hr*r),this.m_normals[h]=L(b,1).Clone(),this.m_normals[h].Normalize()}this.m_centroid=ut.ComputeCentroid(this.m_vertices,g)}},SetAsBox:function(t,e,i,n){if(this.m_count=4,this.m_vertices[0]=new S(-t,-e),this.m_vertices[1]=new S(t,-e),this.m_vertices[2]=new S(t,e),this.m_vertices[3]=new S(-t,e),this.m_normals[0]=new S(0,-1),this.m_normals[1]=new S(1,0),this.m_normals[2]=new S(0,1),this.m_normals[3]=new S(-1,0),i){this.m_centroid.Assign(i);var r=new P;r.p=i,r.q.Set(n);for(var s=0;s0)return!1}return!0},RayCast:function(t,e,n,r){for(var s=Y(n.q,S.Subtract(e.p1,n.p)),o=Y(n.q,S.Subtract(e.p2,n.p)),a=S.Subtract(o,s),c=0,h=e.maxFraction,l=-1,u=0;u0&&_=0&&(t.fraction=c,t.normal=j(n.q,this.m_normals[l]),!0)},ComputeAABB:function(t,e,i){for(var n=e.q.c*this.m_vertices[0].x-e.q.s*this.m_vertices[0].y+e.p.x,r=e.q.s*this.m_vertices[0].x+e.q.c*this.m_vertices[0].y+e.p.y,s=n,o=r,a=1;a=3);for(var n=new S(0,0),s=0,o=0,a=new S(0,0),c=0;cr),n.Multiply(1/s),t.center=S.Add(n,a),t.I=e*o,t.I+=t.mass*(D(t.center,t.center)-D(n,n))},GetVertexCount:function(){return this.m_count},GetVertex:function(t){return i(0<=t&&t=3);for(var n=new S,s=0,o=new S(0,0),a=0;ar),n.Multiply(1/s),n},ut._extend(at),ft.prototype={CreateProxy:function(t,e){var i=this.m_tree.CreateProxy(t,e);return++this.m_proxyCount,this.BufferMove(i),i},DestroyProxy:function(t){this.UnBufferMove(t),--this.m_proxyCount,this.m_tree.DestroyProxy(t)},MoveProxy:function(t,e,i){this.m_tree.MoveProxy(t,e,i)&&this.BufferMove(t)},TouchProxy:function(t){this.BufferMove(t)},GetFatAABB:function(t){return this.m_tree.GetFatAABB(t)},GetUserData:function(t){return this.m_tree.GetUserData(t)},TestOverlap:function(t,e){return Yt(this.m_tree.GetFatAABB(t),this.m_tree.GetFatAABB(e))},GetProxyCount:function(){return this.m_proxyCount},UpdatePairs:function(t){this.m_pairCount=0,this.m_pairBuffer.length=0;for(var e=0;en&&(i=r,n=s)}return i},GetSupportVertex:function(t,e){return this.m_vertices[this.GetSupport(t,e)]},GetVertexCount:function(){return this.m_count},GetVertex:function(t){return i(0<=t&&t1){var u=t.metric,_=this.GetMetric();(_<.5*u||2*u<_||_0?(t.x=-1*n,t.y=1*e):(t.x=1*n,t.y=-1*e);break;default:i(!1),t.x=t.y=0}},GetClosestPoint:function(t){switch(this.m_count){case 1:t.x=this.m_v[0].w.x,t.y=this.m_v[0].w.y;break;case 2:t.x=this.m_v[0].a*this.m_v[0].w.x+this.m_v[1].a*this.m_v[1].w.x,t.y=this.m_v[0].a*this.m_v[0].w.y+this.m_v[1].a*this.m_v[1].w.y;break;case 3:t.x=t.y=0;break;default:i(!1),t.x=t.y=0}},GetWitnessPoints:function(t,e){switch(this.m_count){case 1:t.x=this.m_v[0].wA.x,t.y=this.m_v[0].wA.y,e.x=this.m_v[0].wB.x,e.y=this.m_v[0].wB.y;break;case 2:t.x=this.m_v[0].a*this.m_v[0].wA.x+this.m_v[1].a*this.m_v[1].wA.x,t.y=this.m_v[0].a*this.m_v[0].wA.y+this.m_v[1].a*this.m_v[1].wA.y,e.x=this.m_v[0].a*this.m_v[0].wB.x+this.m_v[1].a*this.m_v[1].wB.x,e.y=this.m_v[0].a*this.m_v[0].wB.y+this.m_v[1].a*this.m_v[1].wB.y;break;case 3:t.x=this.m_v[0].a*this.m_v[0].wA.x+this.m_v[1].a*this.m_v[1].wA.x+this.m_v[2].a*this.m_v[2].wA.x,t.y=this.m_v[0].a*this.m_v[0].wA.y+this.m_v[1].a*this.m_v[1].wA.y+this.m_v[2].a*this.m_v[2].wA.y,e.x=t.x,e.y=t.y;break;default:i(!1)}},GetMetric:function(){switch(this.m_count){case 1:return 0;case 2:return F(this.m_v[0].w,this.m_v[1].w);case 3:return(this.m_v[1].w.x-this.m_v[0].w.x)*(this.m_v[2].w.y-this.m_v[0].w.y)-(this.m_v[1].w.y-this.m_v[0].w.y)*(this.m_v[2].w.x-this.m_v[0].w.x);default:return i(!1),0}},Solve2:function(){var t=this.m_v[0].w,e=this.m_v[1].w,i=e.x-t.x,n=e.y-t.y,r=-(t.x*i+t.y*n);if(r<=0)return this.m_v[0].a=1,void(this.m_count=1);var s=e.x*i+e.y*n;if(s<=0)return this.m_v[1].a=1,this.m_count=1,void this.m_v[0].Assign(this.m_v[1]);var o=1/(s+r);this.m_v[0].a=s*o,this.m_v[1].a=r*o,this.m_count=2},Solve3:function(){var t=this.m_v[0].w,e=this.m_v[1].w,i=this.m_v[2].w,n=e.x-t.x,r=e.y-t.y,s=t.x*n+t.y*r,o=e.x*n+e.y*r,a=-s,c=i.x-t.x,h=i.y-t.y,l=t.x*c+t.y*h,u=i.x*c+i.y*h,_=-l,d=i.x-e.x,f=i.y-e.y,m=e.x*d+e.y*f,p=i.x*d+i.y*f,g=-m,y=n*h-r*c,v=y*(e.x*i.y-e.y*i.x),x=y*(i.x*t.y-i.y*t.x),C=y*(t.x*e.y-t.y*e.x);if(a<=0&&_<=0)return this.m_v[0].a=1,void(this.m_count=1);if(o>0&&a>0&&C<=0){var T=1/(o+a);return this.m_v[0].a=o*T,this.m_v[1].a=a*T,void(this.m_count=2)}if(u>0&&_>0&&x<=0){var A=1/(u+_);return this.m_v[0].a=u*A,this.m_v[2].a=_*A,this.m_count=2,void this.m_v[1].Assign(this.m_v[2])}if(o<=0&&g<=0)return this.m_v[1].a=1,this.m_count=1,void this.m_v[0].Assign(this.m_v[1]);if(u<=0&&p<=0)return this.m_v[2].a=1,this.m_count=1,void this.m_v[0].Assign(this.m_v[2]);if(p>0&&g>0&&v<=0){var b=1/(p+g);return this.m_v[1].a=p*b,this.m_v[2].a=g*b,this.m_count=2,void this.m_v[0].Assign(this.m_v[2])}var S=1/(v+x+C);this.m_v[0].a=v*S,this.m_v[1].a=x*S,this.m_v[2].a=C*S,this.m_count=3}};var Ct=new xt,Tt=new S,At=new S;function bt(t,e,n){++bt.b2_gjkCalls;var s=n.proxyA,o=n.proxyB,a=n.transformA,c=n.transformB;Ct.ReadCache(e,s,a,o,c);for(var h=Ct.m_v,l=[0,0,0],u=[0,0,0],_=0,d=0;d<20;){_=Ct.m_count;for(var f=0;f<_;++f)l[f]=h[f].indexA,u[f]=h[f].indexB;switch(Ct.m_count){case 1:break;case 2:Ct.Solve2();break;case 3:Ct.Solve3();break;default:i(!1)}if(3==Ct.m_count)break;if(Ct.GetClosestPoint(At),At.LengthSquared(),Ct.GetSearchDirection(At),At.LengthSquared()v+x&&t.distance>r)t.distance-=v+x,Tt.x=t.pointB.x-t.pointA.x,Tt.y=t.pointB.y-t.pointA.y,Tt.Normalize(),t.pointA.x+=v*Tt.x,t.pointA.y+=v*Tt.y,t.pointB.x-=x*Tt.x,t.pointB.y-=x*Tt.y;else{var C=.5*(t.pointA.x+t.pointB.x),T=.5*(t.pointA.y+t.pointB.y);t.pointA.x=C,t.pointA.y=T,t.pointB.x=C,t.pointB.y=T,t.distance=0}}}bt.b2_gjkCalls=0,bt.b2_gjkIters=0,bt.b2_gjkMaxIters=0;function St(){}function Et(){this.localPoint=new S,this.normalImpulse=0,this.tangentImpulse=0,this.id=new St}function wt(){this.points=new Array(o),this.localNormal=new S,this.localPoint=new S,this.type=0,this.pointCount=0}function It(){this.normal=new S,this.points=new Array(o),this.separations=new Array(o)}function Rt(){this.v=new S,this.id=new St}function Pt(){this.p1=new S,this.p2=new S,this.maxFraction=0}function Ot(){this.normal=new S,this.fraction=0}function Dt(){this.lowerBound=new S,this.upperBound=new S}function Bt(t,e,i,n,r){t.pointCount=0;var s=H(i,e.m_p),o=H(r,n.m_p),a=o.x-s.x,c=o.y-s.y,h=a*a+c*c,l=e.m_radius+n.m_radius;h>l*l||(t.type=wt.e_circles,t.localPoint.x=e.m_p.x,t.localPoint.y=e.m_p.y,t.localNormal.x=t.localNormal.y=0,t.pointCount=1,t.points[0]=new Et,t.points[0].localPoint.x=n.m_p.x,t.points[0].localPoint.y=n.m_p.y,t.points[0].id.Reset())}function Lt(t,e,i,s,o){t.pointCount=0;for(var a=q(i,H(o,s.m_p)),c=0,h=-n,l=e.m_radius+s.m_radius,u=e.m_count,_=e.m_vertices,d=e.m_normals,f=0;fl)return;m>h&&(h=m,c=f)}var p=c,g=p+1l*l)return;t.pointCount=1,t.type=wt.e_faceA,t.localNormal.x=a.x-y.x,t.localNormal.y=a.y-y.y,t.localNormal.Normalize(),t.localPoint.x=y.x,t.localPoint.y=y.y,t.points[0]=new Et,t.points[0].localPoint.x=s.m_p.x,t.points[0].localPoint.y=s.m_p.y,t.points[0].id.Reset()}else if(C<=0){if(z(a,v)>l*l)return;t.pointCount=1,t.type=wt.e_faceA,t.localNormal.x=a.x-v.x,t.localNormal.y=a.y-v.y,t.localNormal.Normalize(),t.localPoint.x=v.x,t.localPoint.y=v.y,t.points[0]=new Et,t.points[0].localPoint.x=s.m_p.x,t.points[0].localPoint.y=s.m_p.y,t.points[0].id.Reset()}else{var T=.5*(y.x+v.x),A=.5*(y.y+v.y);if((h=(a.x-T)*d[p].x+(a.y-A)*d[p].y)>l)return;t.pointCount=1,t.type=wt.e_faceA,t.localNormal.x=d[p].x,t.localNormal.y=d[p].y,t.localPoint.x=T,t.localPoint.y=A,t.points[0]=new Et,t.points[0].localPoint.x=s.m_p.x,t.points[0].localPoint.y=s.m_p.y,t.points[0].id.Reset()}}function Mt(t,e,i,r,s){for(var o=e.m_count,a=r.m_count,c=e.m_normals,h=e.m_vertices,l=r.m_vertices,u=J(s,i),_=0,d=-n,f=0;fd&&(d=v,_=f)}return t[0]=_,d}function Nt(t,e,r,s,o,a){var c=e.m_normals,h=o.m_count,l=o.m_vertices,u=o.m_normals;i(0<=s&&ss)){var l=[0],u=Mt(l,n,r,e,i);if(!(u>s)){var _,d,f,m,p=0,g=0;u>h+.1*c?(_=n,d=e,f=r,m=i,p=l[0],t.type=wt.e_faceB,g=1):(_=e,d=n,f=i,m=r,p=a[0],t.type=wt.e_faceA,g=0),Nt(Ft._local_incidentEdges,_,f,p,d,m);var y=_.m_count,v=_.m_vertices,x=p,C=p+1d*d)return;if(e.m_hasVertex0){var p=e.m_vertex0,g=a,y=g.x-p.x,v=g.y-p.y;if(y*(g.x-o.x)+v*(g.y-o.y)>0)return}return f.indexA=0,f.typeA=St.e_vertex,t.pointCount=1,t.type=wt.e_circles,t.localNormal.x=t.localNormal.y=0,t.localPoint.x=m.x,t.localPoint.y=m.y,t.points[0]=new Et,t.points[0].id.Assign(f),t.points[0].localPoint.x=r.m_p.x,void(t.points[0].localPoint.y=r.m_p.y)}if(u<=0){m=c;if((S=o.x-m.x)*S+(E=o.y-m.y)*E>d*d)return;if(e.m_hasVertex3){var x=e.m_vertex3,C=c,T=x.x-C.x,A=x.y-C.y;if(T*(o.x-C.x)+A*(o.y-C.y)>0)return}return f.indexA=1,f.typeA=St.e_vertex,t.pointCount=1,t.type=wt.e_circles,t.localNormal.x=t.localNormal.y=0,t.localPoint.x=m.x,t.localPoint.y=m.y,t.points[0]=new Et,t.points[0].id.Assign(f),t.points[0].localPoint.x=r.m_p.x,void(t.points[0].localPoint.y=r.m_p.y)}var b=h*h+l*l;i(b>0);var S,E,w=1/b*(u*a.x+_*c.x),I=1/b*(u*a.y+_*c.y);if(!((S=o.x-w)*S+(E=o.y-I)*E>d*d)){var R=-l,P=h;R*(o.x-a.x)+P*(o.y-a.y)<0&&(R=-R,P=-P),f.indexA=0,f.typeA=St.e_face,t.pointCount=1,t.type=wt.e_faceA,t.localNormal.x=R,t.localNormal.y=P,t.localNormal.Normalize(),t.localPoint.x=a.x,t.localPoint.y=a.y,t.points[0]=new Et,t.points[0].id.Assign(f),t.points[0].localPoint.x=r.m_p.x,t.points[0].localPoint.y=r.m_p.y}}function kt(){this.type=0,this.index=0,this.separation=0}function Vt(){this.vertices=new Array(a),this.normals=new Array(a),this.count=0}function Gt(){this.i1=0,this.i2=0,this.v1=new S,this.v2=new S,this.normal=new S,this.sideNormal1=new S,this.sideOffset1=0,this.sideNormal2=new S,this.sideOffset2=0}function Ut(){this.m_polygonB=new Vt,this.m_xf=new P,this.m_centroidB=new S,this.m_v0=new S,this.m_v1=new S,this.m_v2=new S,this.m_v3=new S,this.m_normal0=new S,this.m_normal1=new S,this.m_normal2=new S,this.m_normal=new S,this.m_type1=0,this.m_type2=0,this.m_lowerLimit=new S,this.m_upperLimit=new S,this.m_radius=0,this.m_front=!1}function Wt(t,e,i,n,r){Wt.collider.Collide(t,e,i,n,r)}function Xt(t,e,i,n,r,s){var o=0,a=i*e[0].v.x+n*e[0].v.y-r,c=i*e[1].v.x+n*e[1].v.y-r;if(a<=0&&(t[o++]=e[0]),c<=0&&(t[o++]=e[1]),a*c<0){var h=a/(a-c);t[o]=new Rt,t[o].v.x=e[0].v.x+h*(e[1].v.x-e[0].v.x),t[o].v.y=e[0].v.y+h*(e[1].v.y-e[0].v.y),t[o].id.indexA=s,t[o].id.indexB=e[0].id.indexB,t[o].id.typeA=St.e_vertex,t[o].id.typeB=St.e_face,++o}return o}function jt(t,e,i,n,s,o){return jt.input.proxyA.Set(t,e),jt.input.proxyB.Set(i,n),jt.input.transformA=s,jt.input.transformB=o,jt.input.useRadii=!0,jt.cache.count=0,bt(jt.output,jt.cache,jt.input),jt.output.distance<10*r}function Yt(t,e){return!(e.lowerBound.x-t.upperBound.x>0||e.lowerBound.y-t.upperBound.y>0||t.lowerBound.x-e.upperBound.x>0||t.lowerBound.y-e.upperBound.y>0)}St.prototype={indexA:0,indexB:0,typeA:0,typeB:0,Reset:function(){this.indexA=this.indexB=this.typeA=this.typeB=0},Get:function(){return this.indexA|this.indexB<<8|this.typeA<<16|this.typeB<<24},Assign:function(t){this.indexA=t.indexA,this.indexB=t.indexB,this.typeA=t.typeA,this.typeB=t.typeB}},St.e_vertex=0,St.e_face=1,Et.prototype={Clone:function(){var t=new Et;return t.localPoint.x=this.localPoint.x,t.localPoint.y=this.localPoint.y,t.normalImpulse=this.normalImpulse,t.tangentImpulse=this.tangentImpulse,t.id.Assign(this.id),t}},wt.prototype={Clone:function(){var t=new wt;t.pointCount=this.pointCount,t.type=this.type,t.localPoint.x=this.localPoint.x,t.localPoint.y=this.localPoint.y,t.localNormal.x=this.localNormal.x,t.localNormal.y=this.localNormal.y;for(var e=0;er*r&&(this.normal.x=c-o,this.normal.y=h-a,this.normal.Normalize());var _=o+i*this.normal.x,d=a+i*this.normal.y,f=c-s*this.normal.x,m=h-s*this.normal.y;this.points[0]=new S(.5*(_+f),.5*(d+m)),this.separations[0]=(f-_)*this.normal.x+(m-d)*this.normal.y;break;case wt.e_faceA:this.normal.x=e.q.c*t.localNormal.x-e.q.s*t.localNormal.y,this.normal.y=e.q.s*t.localNormal.x+e.q.c*t.localNormal.y;for(var p=e.q.c*t.localPoint.x-e.q.s*t.localPoint.y+e.p.x,g=e.q.s*t.localPoint.x+e.q.c*t.localPoint.y+e.p.y,y=0;y=0&&this.upperBound.y-this.lowerBound.y>=0&&this.lowerBound.IsValid()&&this.upperBound.IsValid()},GetCenter:function(){return new S(.5*(this.lowerBound.x+this.upperBound.x),.5*(this.lowerBound.y+this.upperBound.y))},GetExtents:function(){return new S(.5*(this.upperBound.x-this.lowerBound.x),.5*(this.upperBound.y-this.lowerBound.y))},GetPerimeter:function(){return 2*(this.upperBound.x-this.lowerBound.x+(this.upperBound.y-this.lowerBound.y))},Combine:function(t,e){e?(this.lowerBound.x=Q(t.lowerBound.x,e.lowerBound.x),this.lowerBound.y=Q(t.lowerBound.y,e.lowerBound.y),this.upperBound.x=tt(t.upperBound.x,e.upperBound.x),this.upperBound.y=tt(t.upperBound.y,e.upperBound.y)):(this.lowerBound.x=Q(this.lowerBound.x,t.lowerBound.x),this.lowerBound.y=Q(this.lowerBound.y,t.lowerBound.y),this.upperBound.x=tt(this.upperBound.x,t.upperBound.x),this.upperBound.y=tt(this.upperBound.y,t.upperBound.y))},Contains:function(t){return this.lowerBound.x<=t.lowerBound.x&&this.lowerBound.y<=t.lowerBound.y&&t.upperBound.x<=this.upperBound.x&&t.upperBound.y<=this.upperBound.y},RayCast:function(t,e){for(var i=-n,s=n,o=e.p1,a=S.Subtract(e.p2,e.p1),c=K(a),h=new S,l=0;l<2;++l)if(c.get_i(l)d){var m=d;d=_,_=m,f=1}if(_>i&&(h.x=h.y=0,h.set_i(l,f),i=_),i>(s=Q(s,d)))return!1}return!(i<0||e.maxFraction=0,h=this.m_normal0.x*(this.m_centroidB.x-this.m_v0.x)+this.m_normal0.y*(this.m_centroidB.y-this.m_v0.y)),a&&(Ut._temp_edge2.x=this.m_v3.x-this.m_v2.x,Ut._temp_edge2.y=this.m_v3.y-this.m_v2.y,Ut._temp_edge2.Normalize(),this.m_normal2.x=Ut._temp_edge2.y,this.m_normal2.y=-Ut._temp_edge2.x,d=Ut._temp_edge.x*Ut._temp_edge2.y-Ut._temp_edge.y*Ut._temp_edge2.x>0,u=this.m_normal2.x*(this.m_centroidB.x-this.m_v2.x)+this.m_normal2.y*(this.m_centroidB.y-this.m_v2.y)),s&&a?_&&d?(this.m_front=h>=0||c>=0||u>=0,this.m_front?(this.m_normal.x=this.m_normal1.x,this.m_normal.y=this.m_normal1.y,this.m_lowerLimit.x=this.m_normal0.x,this.m_lowerLimit.y=this.m_normal0.y,this.m_upperLimit.x=this.m_normal2.x,this.m_upperLimit.y=this.m_normal2.y):(this.m_normal.x=-this.m_normal1.x,this.m_normal.y=-this.m_normal1.y,this.m_lowerLimit.x=-this.m_normal1.x,this.m_lowerLimit.y=-this.m_normal1.y,this.m_upperLimit.x=-this.m_normal1.x,this.m_upperLimit.y=-this.m_normal1.y)):_?(this.m_front=h>=0||c>=0&&u>=0,this.m_front?(this.m_normal.x=this.m_normal1.x,this.m_normal.y=this.m_normal1.y,this.m_lowerLimit.x=this.m_normal0.x,this.m_lowerLimit.y=this.m_normal0.y,this.m_upperLimit.x=this.m_normal1.x,this.m_upperLimit.y=this.m_normal1.y):(this.m_normal.x=-this.m_normal1.x,this.m_normal.y=-this.m_normal1.y,this.m_lowerLimit.x=-this.m_normal2.x,this.m_lowerLimit.y=-this.m_normal2.y,this.m_upperLimit.x=-this.m_normal1.x,this.m_upperLimit.y=-this.m_normal1.y)):d?(this.m_front=u>=0||h>=0&&c>=0,this.m_front?(this.m_normal.x=this.m_normal1.x,this.m_normal.y=this.m_normal1.y,this.m_lowerLimit.x=this.m_normal1.x,this.m_lowerLimit.y=this.m_normal1.y,this.m_upperLimit.x=this.m_normal2.x,this.m_upperLimit.y=this.m_normal2.y):(this.m_normal.x=-this.m_normal1.x,this.m_normal.y=-this.m_normal1.y,this.m_lowerLimit.x=-this.m_normal1.x,this.m_lowerLimit.y=-this.m_normal1.y,this.m_upperLimit.x=-this.m_normal0.x,this.m_upperLimit.y=-this.m_normal0.y)):(this.m_front=h>=0&&c>=0&&u>=0,this.m_front?(this.m_normal.x=this.m_normal1.x,this.m_normal.y=this.m_normal1.y,this.m_lowerLimit.x=this.m_normal1.x,this.m_lowerLimit.y=this.m_normal1.y,this.m_upperLimit.x=this.m_normal1.x,this.m_upperLimit.y=this.m_normal1.y):(this.m_normal.x=-this.m_normal1.x,this.m_normal.y=-this.m_normal1.y,this.m_lowerLimit.x=-this.m_normal2.x,this.m_lowerLimit.y=-this.m_normal2.y,this.m_upperLimit.x=-this.m_normal0.x,this.m_upperLimit.y=-this.m_normal0.y)):s?_?(this.m_front=h>=0||c>=0,this.m_front?(this.m_normal.x=this.m_normal1.x,this.m_normal.y=this.m_normal1.y,this.m_lowerLimit.x=this.m_normal0.x,this.m_lowerLimit.y=this.m_normal0.y,this.m_upperLimit.x=-this.m_normal1.x,this.m_upperLimit.y=-this.m_normal1.y):(this.m_normal.x=-this.m_normal1.x,this.m_normal.y=-this.m_normal1.y,this.m_lowerLimit.x=this.m_normal1.x,this.m_lowerLimit.y=this.m_normal1.y,this.m_upperLimit.x=-this.m_normal1.x,this.m_upperLimit.y=-this.m_normal1.y)):(this.m_front=h>=0&&c>=0,this.m_front?(this.m_normal.x=this.m_normal1.x,this.m_normal.y=this.m_normal1.y,this.m_lowerLimit.x=this.m_normal1.x,this.m_lowerLimit.y=this.m_normal1.y,this.m_upperLimit.x=-this.m_normal1.x,this.m_upperLimit.y=-this.m_normal1.y):(this.m_normal.x=-this.m_normal1.x,this.m_normal.y=-this.m_normal1.y,this.m_lowerLimit.x=this.m_normal1.x,this.m_lowerLimit.y=this.m_normal1.y,this.m_upperLimit.x=-this.m_normal0.x,this.m_upperLimit.y=-this.m_normal0.y)):a?d?(this.m_front=c>=0||u>=0,this.m_front?(this.m_normal.x=this.m_normal1.x,this.m_normal.y=this.m_normal1.y,this.m_lowerLimit.x=-this.m_normal1.x,this.m_lowerLimit.y=-this.m_normal1.y,this.m_upperLimit.x=this.m_normal2.x,this.m_upperLimit.y=this.m_normal2.y):(this.m_normal.x=-this.m_normal1.x,this.m_normal.y=-this.m_normal1.y,this.m_lowerLimit.x=-this.m_normal1.x,this.m_lowerLimit.y=-this.m_normal1.y,this.m_upperLimit.x=this.m_normal1.x,this.m_upperLimit.y=this.m_normal1.y)):(this.m_front=c>=0&&u>=0,this.m_front?(this.m_normal.x=this.m_normal1.x,this.m_normal.y=this.m_normal1.y,this.m_lowerLimit.x=-this.m_normal1.x,this.m_lowerLimit.y=-this.m_normal1.y,this.m_upperLimit.x=this.m_normal1.x,this.m_upperLimit.y=this.m_normal1.y):(this.m_normal.x=-this.m_normal1.x,this.m_normal.y=-this.m_normal1.y,this.m_lowerLimit.x=-this.m_normal2.x,this.m_lowerLimit.y=-this.m_normal2.y,this.m_upperLimit.x=this.m_normal1.x,this.m_upperLimit.y=this.m_normal1.y)):(this.m_front=c>=0,this.m_front?(this.m_normal.x=this.m_normal1.x,this.m_normal.y=this.m_normal1.y,this.m_lowerLimit.x=-this.m_normal1.x,this.m_lowerLimit.y=-this.m_normal1.y,this.m_upperLimit.x=-this.m_normal1.x,this.m_upperLimit.y=-this.m_normal1.y):(this.m_normal.x=-this.m_normal1.x,this.m_normal.y=-this.m_normal1.y,this.m_lowerLimit.x=this.m_normal1.x,this.m_lowerLimit.y=this.m_normal1.y,this.m_upperLimit.x=this.m_normal1.x,this.m_upperLimit.y=this.m_normal1.y)),this.m_polygonB.count=n.m_count;for(var f=0;fthis.m_radius)){var p=this.ComputePolygonSeparation();if(!(p.type!=kt.e_unknown&&p.separation>this.m_radius)){var g=new kt;g=p.type==kt.e_unknown?m:p.separation>.98*m.separation+.001?p:m;var y=new Array(2),v=new Gt;if(g.type==kt.e_edgeA){t.type=wt.e_faceA;var x=0,C=this.m_normal.x*this.m_polygonB.normals[0].x+this.m_normal.y*this.m_polygonB.normals[0].y;for(f=1;fthis.m_radius)return t.type=kt.e_edgeB,t.index=n,t.separation=c,t;if(r*e+s*i>=0){if((r-this.m_upperLimit.x)*this.m_normal.x+(s-this.m_upperLimit.y)*this.m_normal.y<-h)continue}else if((r-this.m_lowerLimit.x)*this.m_normal.x+(s-this.m_lowerLimit.y)*this.m_normal.y<-h)continue;c>t.separation&&(t.type=kt.e_edgeB,t.index=n,t.separation=c)}return t}},Ut.e_isolated=0,Ut.e_concave=1,Ut.e_convex=2,Wt.collider=new Ut,jt.input=new gt,jt.cache=new pt,jt.output=new yt;var Ht=-1;function qt(){this.aabb=new Dt,this.userData=null,this.parent=0,this.child1=this.child2=this.height=0}function Jt(){this.m_root=Ht,this.m_nodeCapacity=16,this.m_nodeCount=0,this.m_nodes=new Array(this.m_nodeCapacity);for(var t=0;t0;){var n=i.pop();if(n!=Ht){var r=this.m_nodes[n];if(Yt(r.aabb,e))if(r.IsLeaf()){if(0==t.QueryCallback(n))return}else i.push(r.child1),i.push(r.child2)}}},RayCast:function(t,e){var n=e.p1,r=e.p2,s=S.Subtract(r,n);i(s.LengthSquared()>0),s.Normalize();var o=M(1,s),a=K(o),c=e.maxFraction,h=new Dt,l=S.Add(n,S.Multiply(c,S.Subtract(r,n)));h.lowerBound.Assign($(n,l)),h.upperBound.Assign(et(n,l));var u=[];for(u.push(this.m_root);u.length>0;){var _=u.pop();if(_!=Ht){var d=this.m_nodes[_];if(0!=Yt(d.aabb,h)){var f=d.aabb.GetCenter(),m=d.aabb.GetExtents();if(!(Z(D(o,S.Subtract(n,f)))-D(a,m)>0))if(d.IsLeaf()){var p=new Pt;p.p1.Assign(e.p1),p.p2.Assign(e.p2),p.maxFraction=c;var g=t.RayCastCallback(p,_);if(0==g)return;if(g>0){c=g;l=S.Add(n,S.Multiply(c,S.Subtract(r,n)));h.lowerBound.Assign($(n,l)),h.upperBound.Assign(et(n,l))}}else u.push(d.child1),u.push(d.child2)}}}},Validate:function(){this.ValidateStructure(this.m_root),this.ValidateMetrics(this.m_root);for(var t=0,e=this.m_freeList;e!=Ht;)i(0<=e&&e1;){var r=n,s=-1,o=-1;for(i=0;i1){var c=o.child1,h=o.child2,l=this.m_nodes[c],u=this.m_nodes[h];return i(0<=c&&cu.height?(o.child2=c,e.child2=h,u.parent=t,e.aabb.Combine(s.aabb,u.aabb),o.aabb.Combine(e.aabb,l.aabb),e.height=1+tt(s.height,u.height),o.height=1+tt(e.height,l.height)):(o.child2=h,e.child2=c,l.parent=t,e.aabb.Combine(s.aabb,l.aabb),o.aabb.Combine(e.aabb,u.aabb),e.height=1+tt(s.height,l.height),o.height=1+tt(e.height,u.height)),r}if(a<-1){var _=s.child1,d=s.child2,f=this.m_nodes[_],m=this.m_nodes[d];return i(0<=_&&_m.height?(s.child2=_,e.child1=d,m.parent=t,e.aabb.Combine(o.aabb,m.aabb),s.aabb.Combine(e.aabb,f.aabb),e.height=1+tt(o.height,m.height),s.height=1+tt(e.height,f.height)):(s.child2=d,e.child1=_,f.parent=t,e.aabb.Combine(o.aabb,f.aabb),s.aabb.Combine(e.aabb,m.aabb),e.height=1+tt(o.height,f.height),s.height=1+tt(e.height,m.height)),n}return t},ComputeHeight:function(t){void 0===t&&(t=this.m_root),i(0<=t&&tl);var u=0,_=0,d=new pt;d.count=0;var f=new gt;for(f.proxyA.Assign(e.proxyA),f.proxyB.Assign(e.proxyB),f.useRadii=!1;;){ie._temp_sweepA.GetTransform(f.transformA,u),ie._temp_sweepB.GetTransform(f.transformB,u);var m=new yt;if(bt(m,d,f),m.distance<=0){t.state=Kt.e_overlapped,t.t=0;break}if(m.distanceh+l){t.state=Kt.e_separated,t.t=s,g=!0;break}if(C>h-l){u=y;break}var T=p.Evaluate(x[0],x[1],u);if(Th?(b=E,T=w):(S=E,C=w),50==A)break}if(ie.b2_toiMaxRootIters=tt(ie.b2_toiMaxRootIters,A),++v==a)break}if(++_,++ie.b2_toiIters,g)break;if(20==_){t.state=Kt.e_failed,t.t=u;break}}ie.b2_toiMaxIters=tt(ie.b2_toiMaxIters,_),ee.stop(),ie.b2_toiMaxTime=tt(ie.b2_toiMaxTime,ee.elapsedTime),ie.b2_toiTime+=ee.elapsedTime}function ne(){this.type=re.b2_staticBody,this.position=new S(0,0),this.angle=0,this.linearVelocity=new S(0,0),this.angularVelocity=0,this.linearDamping=0,this.angularDamping=0,this.allowSleep=!0,this.awake=!0,this.fixedRotation=!1,this.bullet=!1,this.active=!0,this.userData=null,this.gravityScale=1,Object.seal(this)}function re(t,e){i(t.position.IsValid()),i(t.linearVelocity.IsValid()),i(g(t.angle)),i(g(t.angularVelocity)),i(g(t.angularDamping)&&t.angularDamping>=0),i(g(t.linearDamping)&&t.linearDamping>=0),this.m_islandIndex=0,this.m_flags=0,t.bullet&&(this.m_flags|=re.e_bulletFlag),t.fixedRotation&&(this.m_flags|=re.e_fixedRotationFlag),t.allowSleep&&(this.m_flags|=re.e_autoSleepFlag),t.awake&&(this.m_flags|=re.e_awakeFlag),t.active&&(this.m_flags|=re.e_activeFlag),this.m_world=e,this.m_xf=new P,this.m_xf.p.Assign(t.position),this.m_xf.q.Set(t.angle),this.m_sweep=new O,this.m_sweep.localCenter.SetZero(),this.m_sweep.c0.Assign(this.m_xf.p),this.m_sweep.c.Assign(this.m_xf.p),this.m_sweep.a0=t.angle,this.m_sweep.a=t.angle,this.m_sweep.alpha0=0,this.m_jointList=null,this.m_contactList=null,this.m_prev=null,this.m_next=null,this.m_linearVelocity=t.linearVelocity.Clone(),this.m_angularVelocity=t.angularVelocity,this.m_linearDamping=t.linearDamping,this.m_angularDamping=t.angularDamping,this.m_gravityScale=t.gravityScale,this.m_force=new S,this.m_torque=0,this.m_sleepTime=0,this.m_type=t.type,this.m_type==re.b2_dynamicBody?(this.m_mass=1,this.m_invMass=1):(this.m_mass=0,this.m_invMass=0),this.m_I=0,this.m_invI=0,this.m_userData=t.userData,this.m_fixtureList=null,this.m_fixtureCount=0}function se(){this.categoryBits=1,this.maskBits=65535,this.groupIndex=0}function oe(){this.shape=null,this.userData=null,this.friction=.2,this.restitution=0,this.density=0,this.isSensor=!1,this.filter=new se,Object.seal(this)}function ae(){this.aabb=new Dt,this.fixture=null,this.childIndex=0,this.proxyId=0}function ce(){this.m_userData=null,this.m_body=null,this.m_next=null,this.m_proxies=null,this.m_proxyCount=0,this.m_shape=null,this.m_density=0,this.m_filter=new se,this.m_isSensor=!1,this.m_friction=0,this.m_restitution=0}function he(){}function le(){}function ue(){this.normalImpulses=new Array(o),this.tangentImpulses=new Array(o),this.count=0}function _e(){}function de(){}function fe(){}function me(){this.dt=0,this.inv_dt=0,this.dtRatio=0,this.velocityIterations=0,this.positionIterations=0,this.warmStarting=!1}function pe(){this.c=new S,this.a=0}function ge(){this.v=new S,this.w=0}function ye(){this.step=new me,this.positions=null,this.velocities=null}ie._temp_sweepA=new O,ie._temp_sweepB=new O,ie.b2_toiTime=0,ie.b2_toiMaxTime=0,ie.b2_toiCalls=0,ie.b2_toiIters=0,ie.b2_toiMaxIters=0,ie.b2_toiRootIters=0,ie.b2_toiMaxRootIters=0,ne.prototype={_deserialize:function(t){this.type=t.type,this.position._deserialize(t.position),this.angle=t.angle,this.linearVelocity._deserialize(t.linearVelocity),this.angularVelocity=t.angularVelocity,this.linearDamping=t.linearDamping,this.angularDamping=t.angularDamping,this.allowSleep=t.allowSleep,this.awake=t.awake,this.fixedRotation=t.fixedRotation,this.bullet=t.bullet,this.active=t.active,this.gravityScale=t.gravityScale}},re.b2_staticBody=0,re.b2_kinematicBody=1,re.b2_dynamicBody=2,re.e_islandFlag=1,re.e_awakeFlag=2,re.e_autoSleepFlag=4,re.e_bulletFlag=8,re.e_fixedRotationFlag=16,re.e_activeFlag=32,re.e_toiFlag=64,re.m_local_oldCenter=new S,re.m_local_xf1=new P,re.prototype={CreateFixture:function(t,e){if(void 0!==e){var n=new oe;return n.shape=t,n.density=e,this.CreateFixture(n)}if(i(0==this.m_world.IsLocked()),1==this.m_world.IsLocked())return null;var r=new ce;if(r.Create(this,t),this.m_flags&re.e_activeFlag){var s=this.m_world.m_contactManager.m_broadPhase;r.CreateProxies(s,this.m_xf)}return r.m_next=this.m_fixtureList,this.m_fixtureList=r,++this.m_fixtureCount,r.m_body=this,r.m_density>0&&this.ResetMassData(),this.m_world.m_flags|=be.e_newFixture,r},DestroyFixture:function(t){if(i(0==this.m_world.IsLocked()),1!=this.m_world.IsLocked()){i(t.m_body==this),i(this.m_fixtureCount>0);for(var e=this.m_fixtureList,n=!1;null!=e;){if(e==t){this.m_fixtureList=e=t.m_next,n=!0;break}e=e.m_next}i(n);for(var r=this.m_contactList;r;){var s=r.contact;r=r.next;var o=s.GetFixtureA(),a=s.GetFixtureB();t!=o&&t!=a||this.m_world.m_contactManager.Destroy(s)}if(this.m_flags&re.e_activeFlag){var c=this.m_world.m_contactManager.m_broadPhase;t.DestroyProxies(c)}t.Destroy(),t.m_body=null,t.m_next=null,--this.m_fixtureCount,this.ResetMassData()}},SetTransform:function(t,e){if(i(0==this.m_world.IsLocked()),1!=this.m_world.IsLocked()){this.m_xf.q.Set(e),this.m_xf.p.Assign(t),this.m_sweep.c.Assign(H(this.m_xf,this.m_sweep.localCenter)),this.m_sweep.a=e,this.m_sweep.c0.Assign(this.m_sweep.c),this.m_sweep.a0=e;for(var n=this.m_world.m_contactManager.m_broadPhase,r=this.m_fixtureList;r;r=r.m_next)r.Synchronize(n,this.m_xf,this.m_xf)}},GetTransform:function(){return this.m_xf},GetPosition:function(){return this.m_xf.p},GetAngle:function(){return this.m_sweep.a},GetWorldCenter:function(){return this.m_sweep.c},GetLocalCenter:function(){return this.m_sweep.localCenter},SetLinearVelocity:function(t){this.m_type!=re.b2_staticBody&&(D(t,t)>0&&this.SetAwake(!0),this.m_linearVelocity=t)},GetLinearVelocity:function(){return this.m_linearVelocity},SetAngularVelocity:function(t){this.m_type!=re.b2_staticBody&&(t*t>0&&this.SetAwake(!0),this.m_angularVelocity=t)},GetAngularVelocity:function(){return this.m_angularVelocity},ApplyForce:function(t,e,i){this.m_type==re.b2_dynamicBody&&(i&&0==(this.m_flags&re.e_awakeFlag)&&this.SetAwake(!0),this.m_flags&re.e_awakeFlag&&(this.m_force.Add(t),this.m_torque+=B(S.Subtract(e,this.m_sweep.c),t)))},ApplyForceToCenter:function(t,e){this.m_type==re.b2_dynamicBody&&(e&&0==(this.m_flags&re.e_awakeFlag)&&this.SetAwake(!0),this.m_flags&re.e_awakeFlag&&this.m_force.Add(t))},ApplyTorque:function(t,e){this.m_type==re.b2_dynamicBody&&(e&&0==(this.m_flags&re.e_awakeFlag)&&this.SetAwake(!0),this.m_flags&re.e_awakeFlag&&(this.m_torque+=t))},ApplyLinearImpulse:function(t,e,i){this.m_type==re.b2_dynamicBody&&(i&&0==(this.m_flags&re.e_awakeFlag)&&this.SetAwake(!0),this.m_flags&re.e_awakeFlag&&(this.m_linearVelocity.Add(S.Multiply(this.m_invMass,t)),this.m_angularVelocity+=this.m_invI*B(S.Subtract(e,this.m_sweep.c),t)))},ApplyAngularImpulse:function(t,e){this.m_type==re.b2_dynamicBody&&(e&&0==(this.m_flags&re.e_awakeFlag)&&this.SetAwake(!0),this.m_flags&re.e_awakeFlag&&(this.m_angularVelocity+=this.m_invI*t))},GetMass:function(){return this.m_mass},GetInertia:function(){return this.m_I+this.m_mass*D(this.m_sweep.localCenter,this.m_sweep.localCenter)},GetMassData:function(t){t.mass=this.m_mass,t.I=this.m_I+this.m_mass*D(this.m_sweep.localCenter,this.m_sweep.localCenter),t.center=this.m_sweep.localCenter},SetMassData:function(t){i(0==this.m_world.IsLocked()),1!=this.m_world.IsLocked()&&this.m_type==re.b2_dynamicBody&&(this.m_invMass=0,this.m_I=0,this.m_invI=0,this.m_mass=t.mass,this.m_mass<=0&&(this.m_mass=1),this.m_invMass=1/this.m_mass,t.I>0&&0==(this.m_flags&re.e_fixedRotationFlag)&&(this.m_I=t.I-this.m_mass*D(t.center,t.center),i(this.m_I>0),this.m_invI=1/this.m_I),re.m_local_oldCenter.Assign(this.m_sweep.c),this.m_sweep.localCenter.Assign(t.center),this.m_sweep.c0.Assign(H(this.m_xf,this.m_sweep.localCenter)),this.m_sweep.c.Assign(this.m_sweep.c0),this.m_linearVelocity.Add(M(this.m_angularVelocity,S.Subtract(this.m_sweep.c,re.m_local_oldCenter))))},ResetMassData:function(){if(this.m_mass=0,this.m_invMass=0,this.m_I=0,this.m_invI=0,this.m_sweep.localCenter.SetZero(),this.m_type==re.b2_staticBody||this.m_type==re.b2_kinematicBody)return this.m_sweep.c0.Assign(this.m_xf.p),this.m_sweep.c.Assign(this.m_xf.p),void(this.m_sweep.a0=this.m_sweep.a);i(this.m_type==re.b2_dynamicBody);for(var t=new S(0,0),e=this.m_fixtureList;e;e=e.m_next)if(0!=e.m_density){var n=new ot;e.GetMassData(n),this.m_mass+=n.mass,t.Add(S.Multiply(n.mass,n.center)),this.m_I+=n.I}this.m_mass>0?(this.m_invMass=1/this.m_mass,t.Multiply(this.m_invMass)):(this.m_mass=1,this.m_invMass=1),this.m_I>0&&0==(this.m_flags&re.e_fixedRotationFlag)?(this.m_I-=this.m_mass*D(t,t),i(this.m_I>0),this.m_invI=1/this.m_I):(this.m_I=0,this.m_invI=0),re.m_local_oldCenter.Assign(this.m_sweep.c),this.m_sweep.localCenter.Assign(t),this.m_sweep.c0.Assign(H(this.m_xf,this.m_sweep.localCenter)),this.m_sweep.c.Assign(this.m_sweep.c0),this.m_linearVelocity.Add(M(this.m_angularVelocity,S.Subtract(this.m_sweep.c,re.m_local_oldCenter)))},GetWorldPoint:function(t){return H(this.m_xf,t)},GetWorldVector:function(t){return j(this.m_xf.q,t)},GetLocalPoint:function(t){return q(this.m_xf,t)},GetLocalVector:function(t){return Y(this.m_xf.q,t)},GetLinearVelocityFromWorldPoint:function(t){return S.Add(this.m_linearVelocity,M(this.m_angularVelocity,S.Subtract(t,this.m_sweep.c)))},GetLinearVelocityFromLocalPoint:function(t){return this.GetLinearVelocityFromWorldPoint(this.GetWorldPoint(t))},GetLinearDamping:function(){return this.m_linearDamping},SetLinearDamping:function(t){this.m_linearDamping=t},GetAngularDamping:function(){return this.m_angularDamping},SetAngularDamping:function(t){this.m_angularDamping=t},GetGravityScale:function(){return this.m_gravityScale},SetGravityScale:function(t){this.m_gravityScale=t},SetType:function(t){if(i(0==this.m_world.IsLocked()),1!=this.m_world.IsLocked()&&this.m_type!=t){this.m_type=t,this.ResetMassData(),this.m_type==re.b2_staticBody&&(this.m_linearVelocity.SetZero(),this.m_angularVelocity=0,this.m_sweep.a0=this.m_sweep.a,this.m_sweep.c0.Assign(this.m_sweep.c),this.SynchronizeFixtures()),this.SetAwake(!0),this.m_force.SetZero(),this.m_torque=0;for(var e=this.m_contactList;e;){var n=e;e=e.next,this.m_world.m_contactManager.Destroy(n.contact)}this.m_contactList=null;for(var r=this.m_world.m_contactManager.m_broadPhase,s=this.m_fixtureList;s;s=s.m_next)for(var o=s.m_proxyCount,a=0;a=0),this.m_density=t},GetDensity:function(){return this.m_density},GetFriction:function(){return this.m_friction},SetFriction:function(t){this.m_friction=t},GetRestitution:function(){return this.m_restitution},SetRestitution:function(t){this.m_restitution=t},GetAABB:function(t){return i(0<=t&&t0:0!=(i.maskBits&n.categoryBits)&&0!=(i.categoryBits&n.maskBits)}},_e.prototype={BeginContact:function(t){},EndContact:function(t){},PreSolve:function(t,e){},PostSolve:function(t,e){}},de.prototype={ReportFixture:function(t){return!1}},fe.prototype={ReportFixture:function(t,e,i,n){}};var ve=t.create("step"),xe=t.create("collide","step"),Ce=t.create("solve","step"),Te=t.create("solveTOI","step"),Ae=t.create("broadphase","step");function be(t){this.m_contactManager=new Ue,this.m_destructionListener=null,this.g_debugDraw=null,this.m_bodyList=null,this.m_jointList=null,this.m_bodyCount=0,this.m_jointCount=0,this.m_warmStarting=!0,this.m_continuousPhysics=!0,this.m_subStepping=!1,this.m_stepComplete=!0,this.m_allowSleep=!0,this.m_gravity=t,this.m_flags=be.e_clearForces,this.m_inv_dt0=0,this.p_step=new me,this.p_island=new Je}function Se(){this.broadPhase=null,this.callback=null}function Ee(){this.broadPhase=null,this.callback=null}function we(t,e){return A(t*e)}function Ie(t,e){return t>e?t:e}function Re(){this.fcn=null,this.primary=!1}function Pe(){this.other=null,this.contact=null,this.prev=null,this.next=null}function Oe(){this.m_nodeA=new Pe,this.m_nodeB=new Pe,this.m_manifold=new wt}function De(){this.parent.call(this)}Se.prototype={QueryCallback:function(t){var e=this.broadPhase.GetUserData(t);return this.callback.ReportFixture(e.fixture)}},Ee.prototype={RayCastCallback:function(t,e){var i=this.broadPhase.GetUserData(e),n=i.fixture,r=i.childIndex,s=new Ot;if(n.RayCast(s,t,r)){var o=s.fraction,a=S.Add(S.Multiply(1-o,t.p1),S.Multiply(o,t.p2));return this.callback.ReportFixture(n,a,s.normal,o)}return t.maxFraction}},be.m_local_sweep_backupA=new O,be.m_local_sweep_backupB=new O,be.m_local_sweep_backupC=new O,be.prototype={Destroy:function(){for(var t=this.m_bodyList;t;){for(var e=t.m_next,i=t.m_fixtureList;i;){var n=i.m_next;i.m_proxyCount=0,i.Destroy(),i=n}t=e}},SetDestructionListener:function(t){this.m_destructionListener=t},SetContactFilter:function(t){this.m_contactManager.m_contactFilter=t},SetContactListener:function(t){this.m_contactManager.m_contactListener=t},SetDebugDraw:function(t){this.g_debugDraw=t},CreateBody:function(t){if(i(0==this.IsLocked()),this.IsLocked())return null;var e=new re(t,this);return e.m_prev=null,e.m_next=this.m_bodyList,this.m_bodyList&&(this.m_bodyList.m_prev=e),this.m_bodyList=e,++this.m_bodyCount,e},DestroyBody:function(t){if(i(this.m_bodyCount>0),i(0==this.IsLocked()),!this.IsLocked()){for(var e=t.m_jointList;e;){var n=e;e=e.next,this.m_destructionListener&&this.m_destructionListener.SayGoodbyeJoint(n.joint),this.DestroyJoint(n.joint),t.m_jointList=e}t.m_jointList=null;for(var r=t.m_contactList;r;){var s=r;r=r.next,this.m_contactManager.Destroy(s.contact)}t.m_contactList=null;for(var o=t.m_fixtureList;o;){var a=o;o=o.m_next,this.m_destructionListener&&this.m_destructionListener.SayGoodbyeFixture(a),a.DestroyProxies(this.m_contactManager.m_broadPhase),a.Destroy(),t.m_fixtureList=o,t.m_fixtureCount-=1}t.m_fixtureList=null,t.m_fixtureCount=0,t.m_prev&&(t.m_prev.m_next=t.m_next),t.m_next&&(t.m_next.m_prev=t.m_prev),t==this.m_bodyList&&(this.m_bodyList=t.m_next),t.m_destroyed=!0,--this.m_bodyCount}},CreateJoint:function(t){if(i(0==this.IsLocked()),this.IsLocked())return null;var e=ii.Create(t);e.m_prev=null,e.m_next=this.m_jointList,this.m_jointList&&(this.m_jointList.m_prev=e),this.m_jointList=e,++this.m_jointCount,e.m_edgeA.joint=e,e.m_edgeA.other=e.m_bodyB,e.m_edgeA.prev=null,e.m_edgeA.next=e.m_bodyA.m_jointList,e.m_bodyA.m_jointList&&(e.m_bodyA.m_jointList.prev=e.m_edgeA),e.m_bodyA.m_jointList=e.m_edgeA,e.m_edgeB.joint=e,e.m_edgeB.other=e.m_bodyA,e.m_edgeB.prev=null,e.m_edgeB.next=e.m_bodyB.m_jointList,e.m_bodyB.m_jointList&&(e.m_bodyB.m_jointList.prev=e.m_edgeB),e.m_bodyB.m_jointList=e.m_edgeB;var n=t.bodyA,r=t.bodyB;if(0==t.collideConnected)for(var s=r.GetContactList();s;)s.other==n&&s.contact.FlagForFiltering(),s=s.next;return e},DestroyJoint:function(t){if(i(0==this.IsLocked()),!this.IsLocked()){var e=t.m_collideConnected;t.m_prev&&(t.m_prev.m_next=t.m_next),t.m_next&&(t.m_next.m_prev=t.m_prev),t==this.m_jointList&&(this.m_jointList=t.m_next);var n=t.m_bodyA,r=t.m_bodyB;if(n.SetAwake(!0),r.SetAwake(!0),t.m_edgeA.prev&&(t.m_edgeA.prev.next=t.m_edgeA.next),t.m_edgeA.next&&(t.m_edgeA.next.prev=t.m_edgeA.prev),t.m_edgeA==n.m_jointList&&(n.m_jointList=t.m_edgeA.next),t.m_edgeA.prev=null,t.m_edgeA.next=null,t.m_edgeB.prev&&(t.m_edgeB.prev.next=t.m_edgeB.next),t.m_edgeB.next&&(t.m_edgeB.next.prev=t.m_edgeB.prev),t.m_edgeB==r.m_jointList&&(r.m_jointList=t.m_edgeB.next),t.m_edgeB.prev=null,t.m_edgeB.next=null,ii.Destroy(t),i(this.m_jointCount>0),--this.m_jointCount,0==e)for(var s=r.GetContactList();s;)s.other==n&&s.contact.FlagForFiltering(),s=s.next}},Step:function(t,e,i){ve.start(),this.m_flags&be.e_newFixture&&(this.m_contactManager.FindNewContacts(),this.m_flags&=~be.e_newFixture),this.m_flags|=be.e_locked,this.p_step.dt=t,this.p_step.velocityIterations=e,this.p_step.positionIterations=i,this.p_step.inv_dt=t>0?1/t:0,this.p_step.dtRatio=this.m_inv_dt0*t,this.p_step.warmStarting=this.m_warmStarting,xe.start(),this.m_contactManager.Collide(),xe.stop(),this.m_stepComplete&&this.p_step.dt>0&&(Ce.start(),this.Solve(this.p_step),Ce.stop()),this.m_continuousPhysics&&this.p_step.dt>0&&(Te.start(),this.SolveTOI(this.p_step),Te.stop()),this.p_step.dt>0&&(this.m_inv_dt0=this.p_step.inv_dt),this.m_flags&be.e_clearForces&&this.ClearForces(),this.m_flags&=~be.e_locked,ve.stop()},ClearForces:function(){for(var t=this.m_bodyList;t;t=t.GetNext())t.m_force.x=t.m_force.y=0,t.m_torque=0},DrawDebugData:function(){if(null!=this.g_debugDraw){this.g_debugDraw.ClearDraw();var t=this.g_debugDraw.GetFlags();if(t&rt.e_shapeBit)for(var e=this.m_bodyList;e;e=e.GetNext())for(var i=e.GetTransform(),n=e.GetFixtureList();n;n=n.GetNext())0==e.IsActive()?this.DrawShape(n,i,new nt(.5,.5,.3)):e.GetType()==re.b2_staticBody?this.DrawShape(n,i,new nt(.5,.9,.5)):e.GetType()==re.b2_kinematicBody?this.DrawShape(n,i,new nt(.5,.5,.9)):0==e.IsAwake()?this.DrawShape(n,i,new nt(.6,.6,.6)):this.DrawShape(n,i,new nt(.9,.7,.7));if(t&rt.e_jointBit)for(var r=this.m_jointList;r;r=r.GetNext())this.DrawJoint(r);if(t&rt.e_pairBit)for(var s=new nt(.3,.9,.9),o=this.m_contactManager.m_contactList;o;o=o.GetNext()){var a=o.GetFixtureA(),c=o.GetFixtureB(),h=a.GetAABB(o.GetChildIndexA()).GetCenter(),l=c.GetAABB(o.GetChildIndexB()).GetCenter();this.g_debugDraw.DrawSegment(h,l,s)}if(t&rt.e_aabbBit){s=new nt(.9,.3,.9);var u=new nt(.3,.3,.9),_=this.m_contactManager.m_broadPhase;for(e=this.m_bodyList;e;e=e.GetNext())if(0!=e.IsActive())for(n=e.GetFixtureList();n;n=n.GetNext())for(var d=0;d0;){if(i(1==(e=o[--c]).IsActive()),this.p_island.AddBody(e),e.SetAwake(!0),e.GetType()!=re.b2_staticBody){for(var h=e.m_contactList;h;h=h.next){var l=h.contact;if(!(l.m_flags&Oe.e_islandFlag)&&(0!=l.IsEnabled()&&0!=l.IsTouching())){var u=l.m_fixtureA.m_isSensor,_=l.m_fixtureB.m_isSensor;if(!u&&!_)this.p_island.AddContact(l),l.m_flags|=Oe.e_islandFlag,(f=h.other).m_flags&re.e_islandFlag||(i(c8)){var a=1;if(n.m_flags&Oe.e_toiFlag)a=n.m_toi;else{var c=n.GetFixtureA(),h=n.GetFixtureB();if(c.IsSensor()||h.IsSensor())continue;var l=c.GetBody(),u=h.GetBody(),_=l.m_type,d=u.m_type;i(_==re.b2_dynamicBody||d==re.b2_dynamicBody);var f=l.IsAwake()&&_!=re.b2_staticBody,m=u.IsAwake()&&d!=re.b2_staticBody;if(0==f&&0==m)continue;var p=l.IsBullet()||_!=re.b2_dynamicBody,g=u.IsBullet()||d!=re.b2_dynamicBody;if(0==p&&0==g)continue;var y=l.m_sweep.alpha0;l.m_sweep.alpha00;for(var _=0;_0&&0==e.IsSensor()&&0==n.IsSensor()&&(e.GetBody().SetAwake(!0),n.GetBody().SetAwake(!0));var r=e.GetType(),s=n.GetType();i(0<=r&&s0),t.type){case wt.e_circles:var s=e.q.c*t.localPoint.x-e.q.s*t.localPoint.y+e.p.x,o=e.q.s*t.localPoint.x+e.q.c*t.localPoint.y+e.p.y,a=n.q.c*t.localPoints[0].x-n.q.s*t.localPoints[0].y+n.p.x,c=n.q.s*t.localPoints[0].x+n.q.c*t.localPoints[0].y+n.p.y;this.point.x=.5*(s+a),this.point.y=.5*(o+c),this.normal.x=a-s,this.normal.y=c-o;var h=this.normal.x,l=this.normal.y;this.normal.Normalize(),this.separation=h*this.normal.x+l*this.normal.y-t.radiusA-t.radiusB;break;case wt.e_faceA:this.normal.x=e.q.c*t.localNormal.x-e.q.s*t.localNormal.y,this.normal.y=e.q.s*t.localNormal.x+e.q.c*t.localNormal.y;var u=e.q.c*t.localPoint.x-e.q.s*t.localPoint.y+e.p.x,_=e.q.s*t.localPoint.x+e.q.c*t.localPoint.y+e.p.y,d=n.q.c*t.localPoints[r].x-n.q.s*t.localPoints[r].y+n.p.x,f=n.q.s*t.localPoints[r].x+n.q.c*t.localPoints[r].y+n.p.y;this.separation=(d-u)*this.normal.x+(f-_)*this.normal.y-t.radiusA-t.radiusB,this.point.x=d,this.point.y=f;break;case wt.e_faceB:this.normal.x=n.q.c*t.localNormal.x-n.q.s*t.localNormal.y,this.normal.y=n.q.s*t.localNormal.x+n.q.c*t.localNormal.y;u=n.q.c*t.localPoint.x-n.q.s*t.localPoint.y+n.p.x,_=n.q.s*t.localPoint.x+n.q.c*t.localPoint.y+n.p.y,d=e.q.c*t.localPoints[r].x-e.q.s*t.localPoints[r].y+e.p.x,f=e.q.s*t.localPoints[r].x+e.q.c*t.localPoints[r].y+e.p.y;this.separation=(d-u)*this.normal.x+(f-_)*this.normal.y-t.radiusA-t.radiusB,this.point.x=d,this.point.y=f,this.normal.x=-this.normal.x,this.normal.y=-this.normal.y}}},qe.cs_xfA=new P,qe.cs_xfB=new P,qe.temp_solver_manifold=new Ye,qe.prototype={Init:function(t){this.m_step=t.step,this.m_count=t.count,this.m_positionConstraints.length=this.m_count,this.m_velocityConstraints.length=this.m_count,this.m_positions=t.positions,this.m_velocities=t.velocities,this.m_contacts=t.contacts;for(var e=0;e0);var f=this.m_velocityConstraints[e]||new je;f.friction=n.m_friction,f.restitution=n.m_restitution,f.tangentSpeed=n.m_tangentSpeed,f.indexA=l.m_islandIndex,f.indexB=u.m_islandIndex,f.invMassA=l.m_invMass,f.invMassB=u.m_invMass,f.invIA=l.m_invI,f.invIB=u.m_invI,f.contactIndex=e,f.pointCount=d,f.K.SetZero(),f.normalMass.SetZero(),this.m_velocityConstraints[e]=f;var m=this.m_positionConstraints[e]||new Xe;m.indexA=l.m_islandIndex,m.indexB=u.m_islandIndex,m.invMassA=l.m_invMass,m.invMassB=u.m_invMass,m.localCenterA.x=l.m_sweep.localCenter.x,m.localCenterA.y=l.m_sweep.localCenter.y,m.localCenterB.x=u.m_sweep.localCenter.x,m.localCenterB.y=u.m_sweep.localCenter.y,m.invIA=l.m_invI,m.invIB=u.m_invI,m.localNormal.x=_.localNormal.x,m.localNormal.y=_.localNormal.y,m.localPoint.x=_.localPoint.x,m.localPoint.y=_.localPoint.y,m.pointCount=d,m.radiusA=c,m.radiusB=h,m.type=_.type,this.m_positionConstraints[e]=m;for(var p=0;p0),qe.cs_xfA.q.Set(p),qe.cs_xfB.q.Set(x),qe.cs_xfA.p.x=m.x-(qe.cs_xfA.q.c*d.x-qe.cs_xfA.q.s*d.y),qe.cs_xfA.p.y=m.y-(qe.cs_xfA.q.s*d.x+qe.cs_xfA.q.c*d.y),qe.cs_xfB.p.x=v.x-(qe.cs_xfB.q.c*f.x-qe.cs_xfB.q.s*f.y),qe.cs_xfB.p.y=v.y-(qe.cs_xfB.q.s*f.x+qe.cs_xfB.q.c*f.y);var A=new It;A.Initialize(o,qe.cs_xfA,r,qe.cs_xfB,s),e.normal.x=A.normal.x,e.normal.y=A.normal.y;for(var b=e.pointCount,S=0;S0?1/R:0;var P=1*e.normal.y,O=-1*e.normal.x,D=E.rA.x*O-E.rA.y*P,B=E.rB.x*O-E.rB.y*P,L=h+l+u*D*D+_*B*B;E.tangentMass=L>0?1/L:0,E.velocityBias=0;var M=e.normal.x*(C.x+-T*E.rB.y-g.x- -y*E.rA.y)+e.normal.y*(C.y+T*E.rB.x-g.y-y*E.rA.x);M<-1&&(E.velocityBias=-e.restitution*M)}if(2==e.pointCount){var N=e.points[0],F=e.points[1],z=N.rA.x*e.normal.y-N.rA.y*e.normal.x,k=N.rB.x*e.normal.y-N.rB.y*e.normal.x,V=F.rA.x*e.normal.y-F.rA.y*e.normal.x,G=F.rB.x*e.normal.y-F.rB.y*e.normal.x,U=h+l+u*z*z+_*k*k,W=h+l+u*V*V+_*G*G,X=h+l+u*z*V+_*k*G;U*U<1e3*(U*W-X*X)?(e.K.ex.x=U,e.K.ex.y=X,e.K.ey.x=X,e.K.ey.y=W,e.normalMass.Assign(e.K.GetInverse())):e.pointCount=1}}},WarmStart:function(){for(var t=0;t=0&&D>=0);var B=_.x+-d*R.rB.y-l.x- -u*R.rA.y,L=_.y+d*R.rB.x-l.y-u*R.rA.x,M=_.x+-d*P.rB.y-l.x- -u*P.rA.y,N=_.y+d*P.rB.x-l.y-u*P.rA.x,F=B*f.x+L*f.y,z=M*f.x+N*f.y,k=F-R.velocityBias,V=z-P.velocityBias;for(k-=e.K.ex.x*O+e.K.ey.x*D,V-=e.K.ex.y*O+e.K.ey.y*D;;){var G=-(e.normalMass.ex.x*k+e.normalMass.ey.x*V),U=-(e.normalMass.ex.y*k+e.normalMass.ey.y*V);if(G>=0&&U>=0){var W=G-O,X=U-D,j=W*f.x,Y=W*f.y,H=X*f.x,q=X*f.y;l.x-=s*(j+H),l.y-=s*(Y+q),u-=o*(R.rA.x*Y-R.rA.y*j+(P.rA.x*q-P.rA.y*H)),_.x+=a*(j+H),_.y+=a*(Y+q),d+=c*(R.rB.x*Y-R.rB.y*j+(P.rB.x*q-P.rB.y*H)),R.normalImpulse=G,P.normalImpulse=U;break}if(G=-R.normalMass*k,U=0,F=0,z=e.K.ex.y*G+V,G>=0&&z>=0){X=U-D,j=(W=G-O)*f.x,Y=W*f.y,H=X*f.x,q=X*f.y,l.x-=s*(j+H),l.y-=s*(Y+q),u-=o*(R.rA.x*Y-R.rA.y*j+(P.rA.x*q-P.rA.y*H)),_.x+=a*(j+H),_.y+=a*(Y+q),d+=c*(R.rB.x*Y-R.rB.y*j+(P.rB.x*q-P.rB.y*H)),R.normalImpulse=G,P.normalImpulse=U;break}if(G=0,U=-P.normalMass*V,F=e.K.ey.x*U+k,z=0,U>=0&&F>=0){X=U-D,j=(W=G-O)*f.x,Y=W*f.y,H=X*f.x,q=X*f.y,l.x-=s*(j+H),l.y-=s*(Y+q),u-=o*(R.rA.x*Y-R.rA.y*j+(P.rA.x*q-P.rA.y*H)),_.x+=a*(j+H),_.y+=a*(Y+q),d+=c*(R.rB.x*Y-R.rB.y*j+(P.rB.x*q-P.rB.y*H)),R.normalImpulse=G,P.normalImpulse=U;break}if(G=0,U=0,z=V,(F=k)>=0&&z>=0){X=U-D,j=(W=G-O)*f.x,Y=W*f.y,H=X*f.x,q=X*f.y,l.x-=s*(j+H),l.y-=s*(Y+q),u-=o*(R.rA.x*Y-R.rA.y*j+(P.rA.x*q-P.rA.y*H)),_.x+=a*(j+H),_.y+=a*(Y+q),d+=c*(R.rB.x*Y-R.rB.y*j+(P.rB.x*q-P.rB.y*H)),R.normalImpulse=G,P.normalImpulse=U;break}break}}this.m_velocities[n].w=u,this.m_velocities[r].w=d}},StoreImpulses:function(){for(var t=0;t0?-S/I:0,P=R*y.x,O=R*y.y;d.x-=o*P,d.y-=o*O,f-=a*(C*O-T*P),m.x+=l*P,m.y+=l*O,p+=u*(A*O-b*P)}this.m_positions[n].a=f,this.m_positions[r].a=p}return t>=-3*c},SolveTOIPositionConstraints:function(t,e){for(var i=0,n=0;n0?-E/R:0,O=S.Multiply(P,x);m.Subtract(S.Multiply(u,O)),p-=_*B(A,O),g.Add(S.Multiply(d,O)),y+=f*B(b,O)}this.m_positions[s].a=p,this.m_positions[o].a=y}return i>=-1.5*c}};var Ze=t.create("solve initialization","solve"),Ke=t.create("warm starting","solve initialization"),Qe=t.create("solve velocities","solve"),$e=t.create("solve positions","solve");function ti(){this.other=null,this.joint=null,this.prev=null,this.next=null}function ei(){this.type=ii.e_unknownJoint,this.userData=null,this.bodyA=null,this.bodyB=null,this.collideConnected=!1}function ii(t){i(t.bodyA!=t.bodyB),this.m_type=t.type,this.m_prev=null,this.m_next=null,this.m_bodyA=t.bodyA,this.m_bodyB=t.bodyB,this.m_index=0,this.m_collideConnected=t.collideConnected,this.m_islandFlag=!1,this.m_userData=t.userData,this.m_edgeA=new ti,this.m_edgeA.joint=null,this.m_edgeA.other=null,this.m_edgeA.prev=null,this.m_edgeA.next=null,this.m_edgeB=new ti,this.m_edgeB.joint=null,this.m_edgeB.other=null,this.m_edgeB.prev=null,this.m_edgeB.next=null}function ni(){this.parent.call(this),this.type=ii.e_revoluteJoint,this.localAnchorA=new S,this.localAnchorB=new S,this.referenceAngle=0,this.lowerAngle=0,this.upperAngle=0,this.maxMotorTorque=0,this.motorSpeed=0,this.enableLimit=!1,this.enableMotor=!1,Object.seal(this)}function ri(t){this.parent.call(this,t),this.m_localAnchorA=t.localAnchorA.Clone(),this.m_localAnchorB=t.localAnchorB.Clone(),this.m_referenceAngle=t.referenceAngle,this.m_impulse=new E,this.m_motorImpulse=0,this.m_lowerAngle=t.lowerAngle,this.m_upperAngle=t.upperAngle,this.m_maxMotorTorque=t.maxMotorTorque,this.m_motorSpeed=t.motorSpeed,this.m_enableLimit=t.enableLimit,this.m_enableMotor=t.enableMotor,this.m_limitState=ii.e_inactiveLimit,this.m_indexA=0,this.m_indexB=0,this.m_rA=new S,this.m_rB=new S,this.m_localCenterA=new S,this.m_localCenterB=new S,this.m_invMassA=0,this.m_invMassB=0,this.m_invIA=0,this.m_invIB=0,this.m_mass=new I,this.m_motorMass=0}function si(){this.parent.call(this),this.type=ii.e_mouseJoint,this.target=new S(0,0),this.maxForce=0,this.frequencyHz=5,this.dampingRatio=.7,Object.seal(this)}function oi(t){this.parent.call(this,t),i(t.target.IsValid()),i(g(t.maxForce)&&t.maxForce>=0),i(g(t.frequencyHz)&&t.frequencyHz>=0),i(g(t.dampingRatio)&&t.dampingRatio>=0),this.m_targetA=t.target.Clone(),this.m_localAnchorB=q(this.m_bodyB.GetTransform(),this.m_targetA),this.m_maxForce=t.maxForce,this.m_impulse=new S,this.m_frequencyHz=t.frequencyHz,this.m_dampingRatio=t.dampingRatio,this.m_beta=0,this.m_gamma=0,this.m_indexA=0,this.m_indexB=0,this.m_rB=new S,this.m_localCenterB=new S,this.m_invMassB=0,this.m_invIB=0,this.m_mass=new w,this.m_C=new S}function ai(){this.parent.call(this),this.type=ii.e_distanceJoint,this.localAnchorA=new S(0,0),this.localAnchorB=new S(0,0),this.length=1,this.frequencyHz=0,this.dampingRatio=0,Object.seal(this)}function ci(t){this.parent.call(this,t),this.m_localAnchorA=t.localAnchorA.Clone(),this.m_localAnchorB=t.localAnchorB.Clone(),this.m_length=t.length,this.m_frequencyHz=t.frequencyHz,this.m_dampingRatio=t.dampingRatio,this.m_impulse=0,this.m_gamma=0,this.m_bias=0,this.m_indexA=0,this.m_indexB=0,this.m_u=new S,this.m_rA=new S,this.m_rB=new S,this.m_localCenterA=new S,this.m_localCenterB=new S,this.m_invMassA=0,this.m_invMassB=0,this.m_invIA=0,this.m_invIB=0,this.m_mass=0}function hi(){this.parent.call(this),this.type=ii.e_prismaticJoint,this.localAnchorA=new S,this.localAnchorB=new S,this.localAxisA=new S(1,0),this.referenceAngle=0,this.enableLimit=!1,this.lowerTranslation=0,this.upperTranslation=0,this.enableMotor=!1,this.maxMotorForce=0,this.motorSpeed=0,Object.seal(this)}function li(t){this.parent.call(this,t),this.m_localAnchorA=t.localAnchorA.Clone(),this.m_localAnchorB=t.localAnchorB.Clone(),this.m_localXAxisA=t.localAxisA.Clone(),this.m_localXAxisA.Normalize(),this.m_localYAxisA=M(1,this.m_localXAxisA),this.m_referenceAngle=t.referenceAngle,this.m_impulse=new E,this.m_motorMass=0,this.m_motorImpulse=0,this.m_lowerTranslation=t.lowerTranslation,this.m_upperTranslation=t.upperTranslation,this.m_maxMotorForce=t.maxMotorForce,this.m_motorSpeed=t.motorSpeed,this.m_enableLimit=t.enableLimit,this.m_enableMotor=t.enableMotor,this.m_limitState=ii.e_inactiveLimit,this.m_axis=new S,this.m_perp=new S,this.m_indexA=0,this.m_indexB=0,this.m_localCenterA=new S,this.m_localCenterB=new S,this.m_invMassA=0,this.m_invMassB=0,this.m_invIA=0,this.m_invIB=0,this.m_s1=0,this.m_s2=0,this.m_a1=0,this.m_a2=0,this.m_K=new I,this.m_motorMass=0}function ui(){this.parent.call(this),this.type=ii.e_frictionJoint,this.localAnchorA=new S,this.localAnchorB=new S,this.maxForce=0,this.maxTorque=0,Object.seal(this)}function _i(t){this.parent.call(this,t),this.m_localAnchorA=t.localAnchorA.Clone(),this.m_localAnchorB=t.localAnchorB.Clone(),this.m_linearImpulse=new S,this.m_angularImpulse=0,this.m_maxForce=t.maxForce,this.m_maxTorque=t.maxTorque,this.m_indexA=0,this.m_indexB=0,this.m_rA=new S,this.m_rB=new S,this.m_localCenterA=new S,this.m_localCenterB=new S,this.m_invMassA=0,this.m_invMassB=0,this.m_invIA=0,this.m_invIB=0,this.m_linearMass=new w,this.m_angularMass=0}function di(){this.parent.call(this),this.type=ii.e_weldJoint,this.localAnchorA=new S(0,0),this.localAnchorB=new S(0,0),this.referenceAngle=0,this.frequencyHz=0,this.dampingRatio=0,Object.seal(this)}function fi(t){this.parent.call(this,t),this.m_bias=0,this.m_gamma=0,this.m_indexA=0,this.m_indexB=0,this.m_rA=new S,this.m_rB=new S,this.m_localCenterA=new S,this.m_localCenterB=new S,this.m_invMassA=0,this.m_invMassB=0,this.m_invIA=0,this.m_invIB=0,this.m_mass=new I,this.m_localAnchorA=t.localAnchorA.Clone(),this.m_localAnchorB=t.localAnchorB.Clone(),this.m_referenceAngle=t.referenceAngle,this.m_frequencyHz=t.frequencyHz,this.m_dampingRatio=t.dampingRatio,this.m_impulse=new E}function mi(){this.parent.call(this),this.type=ii.e_wheelJoint,this.localAnchorA=new S,this.localAnchorB=new S,this.localAxisA=new S(1,0),this.enableMotor=!1,this.maxMotorTorque=0,this.motorSpeed=0,this.frequencyHz=2,this.dampingRatio=.7,Object.seal(this)}function pi(t){this.parent.call(this,t),this.m_indexA=0,this.m_indexB=0,this.m_localCenterA=new S,this.m_localCenterB=new S,this.m_invMassA=0,this.m_invMassB=0,this.m_invIA=0,this.m_invIB=0,this.m_localAnchorA=t.localAnchorA.Clone(),this.m_localAnchorB=t.localAnchorB.Clone(),this.m_localXAxisA=t.localAxisA.Clone(),this.m_localYAxisA=M(1,this.m_localXAxisA),this.m_mass=0,this.m_impulse=0,this.m_motorMass=0,this.m_motorImpulse=0,this.m_springMass=0,this.m_springImpulse=0,this.m_maxMotorTorque=t.maxMotorTorque,this.m_motorSpeed=t.motorSpeed,this.m_enableMotor=t.enableMotor,this.m_frequencyHz=t.frequencyHz,this.m_dampingRatio=t.dampingRatio,this.m_bias=0,this.m_gamma=0,this.m_ax=new S,this.m_ay=new S,this.m_sAx=this.m_sBx=0,this.m_sAy=this.m_sBy=0}function gi(){this.parent.call(this),this.type=ii.e_gearJoint,this.joint1=null,this.joint2=null,this.ratio=1,Object.seal(this)}function yi(t){var e,n;this.parent.call(this,t),this.m_joint1=t.joint1,this.m_joint2=t.joint2,this.m_typeA=this.m_joint1.GetType(),this.m_typeB=this.m_joint2.GetType(),i(this.m_typeA==ii.e_revoluteJoint||this.m_typeA==ii.e_prismaticJoint),i(this.m_typeB==ii.e_revoluteJoint||this.m_typeB==ii.e_prismaticJoint),this.m_bodyC=this.m_joint1.GetBodyA(),this.m_bodyA=this.m_joint1.GetBodyB();var r=this.m_bodyA.m_xf,s=this.m_bodyA.m_sweep.a,o=this.m_bodyC.m_xf,a=this.m_bodyC.m_sweep.a;if(this.m_localAnchorA=new S,this.m_localAnchorB=new S,this.m_localAnchorC=new S,this.m_localAnchorD=new S,this.m_localAxisC=new S,this.m_localAxisD=new S,this.m_typeA==ii.e_revoluteJoint){var c=t.joint1;this.m_localAnchorC.Assign(c.m_localAnchorA),this.m_localAnchorA.Assign(c.m_localAnchorB),this.m_referenceAngleA=c.m_referenceAngle,this.m_localAxisC.SetZero(),e=s-a-this.m_referenceAngleA}else{var h=t.joint1;this.m_localAnchorC.Assign(h.m_localAnchorA),this.m_localAnchorA.Assign(h.m_localAnchorB),this.m_referenceAngleA=h.m_referenceAngle,this.m_localAxisC.Assign(h.m_localXAxisA);var l=this.m_localAnchorC,u=Y(o.q,S.Add(j(r.q,this.m_localAnchorA),S.Subtract(r.p,o.p)));e=D(S.Subtract(u,l),this.m_localAxisC)}this.m_bodyD=this.m_joint2.GetBodyA(),this.m_bodyB=this.m_joint2.GetBodyB();var _=this.m_bodyB.m_xf,d=this.m_bodyB.m_sweep.a,f=this.m_bodyD.m_xf,m=this.m_bodyD.m_sweep.a;if(this.m_typeB==ii.e_revoluteJoint){c=t.joint2;this.m_localAnchorD.Assign(c.m_localAnchorA),this.m_localAnchorB.Assign(c.m_localAnchorB),this.m_referenceAngleB=c.m_referenceAngle,this.m_localAxisD.SetZero(),n=d-m-this.m_referenceAngleB}else{h=t.joint2;this.m_localAnchorD.Assign(h.m_localAnchorA),this.m_localAnchorB.Assign(h.m_localAnchorB),this.m_referenceAngleB=h.m_referenceAngle,this.m_localAxisD.Assign(h.m_localXAxisA);var p=this.m_localAnchorD,g=Y(f.q,S.Add(j(_.q,this.m_localAnchorB),S.Subtract(_.p,f.p)));n=D(S.Subtract(g,p),this.m_localAxisD)}this.m_ratio=t.ratio,this.m_constant=e+this.m_ratio*n,this.m_impulse=0,this.m_indexA=this.m_indexB=this.m_indexC=this.m_indexD=0,this.m_lcA=new S,this.m_lcB=new S,this.m_lcC=new S,this.m_lcD=new S,this.m_mA=this.m_mB=this.m_mC=this.m_mD=0,this.m_iA=this.m_iB=this.m_iC=this.m_iD=0,this.m_JvAC=new S,this.m_JvBD=new S,this.m_JwA=this.m_JwB=this.m_JwC=this.m_JwD=0,this.m_mass=0}function vi(){this.parent.call(this),this.type=ii.e_motorJoint,this.linearOffset=new S,this.angularOffset=0,this.maxForce=1,this.maxTorque=1,this.correctionFactor=.3,Object.seal(this)}function xi(t){this.parent.call(this,t),this.m_linearOffset=t.linearOffset.Clone(),this.m_angularOffset=t.angularOffset,this.m_linearImpulse=new S,this.m_angularImpulse=0,this.m_maxForce=t.maxForce,this.m_maxTorque=t.maxTorque,this.m_correctionFactor=t.correctionFactor,this.m_indexA=0,this.m_indexB=0,this.m_rA=new S,this.m_rB=new S,this.m_localCenterA=new S,this.m_localCenterB=new S,this.m_linearError=new S,this.m_angularError=0,this.m_invMassA=0,this.m_invMassB=0,this.m_invIA=0,this.m_invIB=0,this.m_linearMass=new w,this.m_angularMass=0}Je._solverData=new ye,Je._solverDef=new He,Je._solver=new qe,Je.prototype={Clear:function(){this.m_bodyCount=0,this.m_contactCount=0,this.m_jointCount=0},Initialize:function(t,e,i,n){this.m_listener=n,this.m_bodyCapacity=t,this.m_contactCapacity=e,this.m_jointCapacity=i,this.m_bodyCount=0,this.m_contactCount=0,this.m_jointCount=0,this.m_bodies.length=t,this.m_contacts.length=e,this.m_joints.length=i,this.m_velocities.length=t,this.m_positions.length=t},Solve:function(t,e,i){Ze.start();for(var r=t.dt,s=0;s4){var y=2/A(g);u.x*=y,u.y*=y}var v=r*c;if(v*v>d)c*=y=_/Z(v);l.x+=r*u.x,l.y+=r*u.y,a+=r*c,this.m_positions[s].a=a,this.m_velocities[s].w=c}var x=!1;for(s=0;sw||D(o.m_linearVelocity,o.m_linearVelocity)>1e-4?(o.m_sleepTime=0,E=0):(o.m_sleepTime+=r,E=Q(E,o.m_sleepTime)))}if(E>=.5&&x)for(s=0;s4){var f=2/u.Length();h.Multiply(f)}var m=o*l;if(m*m>d)l*=f=_/Z(m);a.Add(S.Multiply(o,h)),c+=o*l,this.m_positions[r].a=c,this.m_velocities[r].w=l;var p=this.m_bodies[r];p.m_sweep.c.Assign(a),p.m_sweep.a=c,p.m_linearVelocity.Assign(h),p.m_angularVelocity=l,p.SynchronizeTransform()}this.Report(Je._solver.m_velocityConstraints)},AddBody:function(t){i(this.m_bodyCount0&&(this.m_motorMass=1/this.m_motorMass),(0==this.m_enableMotor||f)&&(this.m_motorImpulse=0),this.m_enableLimit&&0==f){var m=r-e-this.m_referenceAngle;Z(this.m_upperAngle-this.m_lowerAngle)<2*h?this.m_limitState=ii.e_equalLimits:m<=this.m_lowerAngle?(this.m_limitState!=ii.e_atLowerLimit&&(this.m_impulse.z=0),this.m_limitState=ii.e_atLowerLimit):m>=this.m_upperAngle?(this.m_limitState!=ii.e_atUpperLimit&&(this.m_impulse.z=0),this.m_limitState=ii.e_atUpperLimit):(this.m_limitState=ii.e_inactiveLimit,this.m_impulse.z=0)}else this.m_limitState=ii.e_inactiveLimit;if(t.step.warmStarting){this.m_impulse.Multiply(t.step.dtRatio),this.m_motorImpulse*=t.step.dtRatio;var p=new S(this.m_impulse.x,this.m_impulse.y);i.Subtract(S.Multiply(l,p)),n-=_*(B(this.m_rA,p)+this.m_motorImpulse+this.m_impulse.z),s.Add(S.Multiply(u,p)),o+=d*(B(this.m_rB,p)+this.m_motorImpulse+this.m_impulse.z)}else this.m_impulse.SetZero(),this.m_motorImpulse=0;t.velocities[this.m_indexA].v.Assign(i),t.velocities[this.m_indexA].w=n,t.velocities[this.m_indexB].v.Assign(s),t.velocities[this.m_indexB].w=o},SolveVelocityConstraints:function(t){var e=t.velocities[this.m_indexA].v.Clone(),i=t.velocities[this.m_indexA].w,n=t.velocities[this.m_indexB].v.Clone(),r=t.velocities[this.m_indexB].w,s=this.m_invMassA,o=this.m_invMassB,a=this.m_invIA,c=this.m_invIB,h=a+c==0;if(this.m_enableMotor&&this.m_limitState!=ii.e_equalLimits&&0==h){var l=r-i-this.m_motorSpeed,u=-this.m_motorMass*l,_=this.m_motorImpulse,d=t.step.dt*this.m_maxMotorTorque;this.m_motorImpulse=it(this.m_motorImpulse+u,-d,d),i-=a*(u=this.m_motorImpulse-_),r+=c*u}if(this.m_enableLimit&&this.m_limitState!=ii.e_inactiveLimit&&0==h){var f=S.Subtract(S.Subtract(S.Add(n,M(r,this.m_rB)),e),M(i,this.m_rA)),m=r-i;l=new E(f.x,f.y,m),u=this.m_mass.Solve33(l).Negate();if(this.m_limitState==ii.e_equalLimits)this.m_impulse.Add(u);else if(this.m_limitState==ii.e_atLowerLimit){if(this.m_impulse.z+u.z<0){var p=S.Add(f.Negate(),S.Multiply(this.m_impulse.z,new S(this.m_mass.ez.x,this.m_mass.ez.y))),g=this.m_mass.Solve22(p);u.x=g.x,u.y=g.y,u.z=-this.m_impulse.z,this.m_impulse.x+=g.x,this.m_impulse.y+=g.y,this.m_impulse.z=0}else this.m_impulse.Add(u)}else if(this.m_limitState==ii.e_atUpperLimit){if(this.m_impulse.z+u.z>0){p=S.Add(f.Negate(),S.Multiply(this.m_impulse.z,new S(this.m_mass.ez.x,this.m_mass.ez.y))),g=this.m_mass.Solve22(p);u.x=g.x,u.y=g.y,u.z=-this.m_impulse.z,this.m_impulse.x+=g.x,this.m_impulse.y+=g.y,this.m_impulse.z=0}else this.m_impulse.Add(u)}var y=new S(u.x,u.y);e.Subtract(S.Multiply(s,y)),i-=a*(B(this.m_rA,y)+u.z),n.Add(S.Multiply(o,y)),r+=c*(B(this.m_rB,y)+u.z)}else{l=S.Subtract(S.Subtract(S.Add(n,M(r,this.m_rB)),e),M(i,this.m_rA)),u=this.m_mass.Solve22(l.Negate());this.m_impulse.x+=u.x,this.m_impulse.y+=u.y,e.Subtract(S.Multiply(s,u)),i-=a*B(this.m_rA,u),n.Add(S.Multiply(o,u)),r+=c*B(this.m_rB,u)}t.velocities[this.m_indexA].v.Assign(e),t.velocities[this.m_indexA].w=i,t.velocities[this.m_indexB].v.Assign(n),t.velocities[this.m_indexB].w=r},SolvePositionConstraints:function(t){var e,i=t.positions[this.m_indexA].c.Clone(),n=t.positions[this.m_indexA].a,r=t.positions[this.m_indexB].c.Clone(),s=t.positions[this.m_indexB].a,o=new R(n),a=new R(s),l=0,_=this.m_invIA+this.m_invIB==0;if(this.m_enableLimit&&this.m_limitState!=ii.e_inactiveLimit&&0==_){var d=s-n-this.m_referenceAngle,f=0;if(this.m_limitState==ii.e_equalLimits){var m=it(d-this.m_lowerAngle,-u,u);f=-this.m_motorMass*m,l=Z(m)}else if(this.m_limitState==ii.e_atLowerLimit){l=-(m=d-this.m_lowerAngle),m=it(m+h,-u,0),f=-this.m_motorMass*m}else if(this.m_limitState==ii.e_atUpperLimit){l=m=d-this.m_upperAngle,m=it(m-h,0,u),f=-this.m_motorMass*m}n-=this.m_invIA*f,s+=this.m_invIB*f}o.Set(n),a.Set(s);var p=j(o,S.Subtract(this.m_localAnchorA,this.m_localCenterA)),g=j(a,S.Subtract(this.m_localAnchorB,this.m_localCenterB));e=(m=S.Subtract(S.Subtract(S.Add(r,g),i),p)).Length();var y=this.m_invMassA,v=this.m_invMassB,x=this.m_invIA,C=this.m_invIB,T=new w;T.ex.x=y+v+x*p.y*p.y+C*g.y*g.y,T.ex.y=-x*p.x*p.y-C*g.x*g.y,T.ey.x=T.ex.y,T.ey.y=y+v+x*p.x*p.x+C*g.x*g.x;var A=T.Solve(m).Negate();return i.Subtract(S.Multiply(y,A)),n-=x*B(p,A),r.Add(S.Multiply(v,A)),s+=C*B(g,A),t.positions[this.m_indexA].c.Assign(i),t.positions[this.m_indexA].a=n,t.positions[this.m_indexB].c.Assign(r),t.positions[this.m_indexB].a=s,e<=c&&l<=h},_serialize:function(t){var e=t||{};return this.parent.prototype._serialize.call(this,e),e.localAnchorA=this.m_localAnchorA._serialize(),e.localAnchorB=this.m_localAnchorB._serialize(),e.referenceAngle=this.m_referenceAngle,e.lowerAngle=this.m_lowerAngle,e.upperAngle=this.m_upperAngle,e.maxMotorTorque=this.m_maxMotorTorque,e.motorSpeed=this.m_motorSpeed,e.enableLimit=this.m_enableLimit,e.enableMotor=this.m_enableMotor,e}},ri._extend(ii),si._extend(ei),oi.prototype={GetAnchorA:function(){return this.m_targetA},GetAnchorB:function(){return this.m_bodyB.GetWorldPoint(this.m_localAnchorB)},GetReactionForce:function(t){return S.Multiply(t,this.m_impulse)},GetReactionTorque:function(t){return 0*t},SetTarget:function(t){0==this.m_bodyB.IsAwake()&&this.m_bodyB.SetAwake(!0),this.m_targetA.Assign(t)},GetTarget:function(){return this.m_targetA},SetMaxForce:function(t){this.m_maxForce=t},GetMaxForce:function(){return this.m_maxForce},SetFrequency:function(t){this.m_frequencyHz=t},GetFrequency:function(){return this.m_frequencyHz},SetDampingRatio:function(t){this.m_dampingRatio=t},GetDampingRatio:function(){return this.m_dampingRatio},ShiftOrigin:function(t){this.m_targetA.Subtract(t)},InitVelocityConstraints:function(t){this.m_indexB=this.m_bodyB.m_islandIndex,this.m_localCenterB.Assign(this.m_bodyB.m_sweep.localCenter),this.m_invMassB=this.m_bodyB.m_invMass,this.m_invIB=this.m_bodyB.m_invI;var e=t.positions[this.m_indexB].c.Clone(),n=t.positions[this.m_indexB].a,o=t.velocities[this.m_indexB].v.Clone(),a=t.velocities[this.m_indexB].w,c=new R(n),h=this.m_bodyB.GetMass(),l=2*s*this.m_frequencyHz,u=2*h*this.m_dampingRatio*l,_=h*(l*l),d=t.step.dt;i(u+d*_>r),this.m_gamma=d*(u+d*_),0!=this.m_gamma&&(this.m_gamma=1/this.m_gamma),this.m_beta=d*_*this.m_gamma,this.m_rB.Assign(j(c,S.Subtract(this.m_localAnchorB,this.m_localCenterB)));var f=new w;f.ex.x=this.m_invMassB+this.m_invIB*this.m_rB.y*this.m_rB.y+this.m_gamma,f.ex.y=-this.m_invIB*this.m_rB.x*this.m_rB.y,f.ey.x=f.ex.y,f.ey.y=this.m_invMassB+this.m_invIB*this.m_rB.x*this.m_rB.x+this.m_gamma,this.m_mass.Assign(f.GetInverse()),this.m_C.Assign(S.Subtract(S.Add(e,this.m_rB),this.m_targetA)),this.m_C.Multiply(this.m_beta),a*=.98,t.step.warmStarting?(this.m_impulse.Multiply(t.step.dtRatio),o.Add(S.Multiply(this.m_invMassB,this.m_impulse)),a+=this.m_invIB*B(this.m_rB,this.m_impulse)):this.m_impulse.SetZero(),t.velocities[this.m_indexB].v.Assign(o),t.velocities[this.m_indexB].w=a},SolveVelocityConstraints:function(t){var e=t.velocities[this.m_indexB].v.Clone(),i=t.velocities[this.m_indexB].w,n=S.Add(e,M(i,this.m_rB)),r=N(this.m_mass,S.Add(S.Add(n,this.m_C),S.Multiply(this.m_gamma,this.m_impulse)).Negate()),s=this.m_impulse.Clone();this.m_impulse.Add(r);var o=t.step.dt*this.m_maxForce;this.m_impulse.LengthSquared()>o*o&&this.m_impulse.Multiply(o/this.m_impulse.Length()),r.Assign(S.Subtract(this.m_impulse,s)),e.Add(S.Multiply(this.m_invMassB,r)),i+=this.m_invIB*B(this.m_rB,r),t.velocities[this.m_indexB].v.Assign(e),t.velocities[this.m_indexB].w=i},SolvePositionConstraints:function(t){return!0}},oi._extend(ii),ai.prototype={Initialize:function(t,e,i,n){this.bodyA=t,this.bodyB=e,this.localAnchorA=this.bodyA.GetLocalPoint(i),this.localAnchorB=this.bodyB.GetLocalPoint(n);var r=S.Subtract(n,i);this.length=r.Length()},_deserialize:function(t,e,i){this.parent.prototype._deserialize.call(this,t,e,i),this.localAnchorA._deserialize(t.localAnchorA),this.localAnchorB._deserialize(t.localAnchorB),this.length=t.length,this.frequencyHz=t.frequencyHz,this.dampingRatio=t.dampingRatio}},ai._extend(ei),ci.prototype={GetAnchorA:function(){return this.m_bodyA.GetWorldPoint(this.m_localAnchorA)},GetAnchorB:function(){return this.m_bodyB.GetWorldPoint(this.m_localAnchorB)},GetReactionForce:function(t){return S.Multiply(t*this.m_impulse,this.m_u)},GetReactionTorque:function(t){return 0},GetLocalAnchorA:function(){return this.m_localAnchorA},GetLocalAnchorB:function(){return this.m_localAnchorB},SetLength:function(t){this.m_length=t},GetLength:function(){return this.m_length},SetFrequency:function(t){this.m_frequencyHz=t},GetFrequency:function(){return this.m_frequencyHz},SetDampingRatio:function(t){this.m_dampingRatio=t},GetDampingRatio:function(){return this.m_dampingRatio},InitVelocityConstraints:function(t){this.m_indexA=this.m_bodyA.m_islandIndex,this.m_indexB=this.m_bodyB.m_islandIndex,this.m_localCenterA.Assign(this.m_bodyA.m_sweep.localCenter),this.m_localCenterB.Assign(this.m_bodyB.m_sweep.localCenter),this.m_invMassA=this.m_bodyA.m_invMass,this.m_invMassB=this.m_bodyB.m_invMass,this.m_invIA=this.m_bodyA.m_invI,this.m_invIB=this.m_bodyB.m_invI;var e=t.positions[this.m_indexA].c.Clone(),i=t.positions[this.m_indexA].a,n=t.velocities[this.m_indexA].v.Clone(),r=t.velocities[this.m_indexA].w,o=t.positions[this.m_indexB].c.Clone(),a=t.positions[this.m_indexB].a,h=t.velocities[this.m_indexB].v.Clone(),l=t.velocities[this.m_indexB].w,u=new R(i),_=new R(a);this.m_rA=j(u,S.Subtract(this.m_localAnchorA,this.m_localCenterA)),this.m_rB=j(_,S.Subtract(this.m_localAnchorB,this.m_localCenterB)),this.m_u=S.Subtract(S.Subtract(S.Add(o,this.m_rB),e),this.m_rA);var d=this.m_u.Length();d>c?this.m_u.Multiply(1/d):this.m_u.Set(0,0);var f=B(this.m_rA,this.m_u),m=B(this.m_rB,this.m_u),p=this.m_invMassA+this.m_invIA*f*f+this.m_invMassB+this.m_invIB*m*m;if(this.m_mass=0!=p?1/p:0,this.m_frequencyHz>0){var g=d-this.m_length,y=2*s*this.m_frequencyHz,v=2*this.m_mass*this.m_dampingRatio*y,x=this.m_mass*y*y,C=t.step.dt;this.m_gamma=C*(v+C*x),this.m_gamma=0!=this.m_gamma?1/this.m_gamma:0,this.m_bias=g*C*x*this.m_gamma,p+=this.m_gamma,this.m_mass=0!=p?1/p:0}else this.m_gamma=0,this.m_bias=0;if(t.step.warmStarting){this.m_impulse*=t.step.dtRatio;var T=S.Multiply(this.m_impulse,this.m_u);n.Subtract(S.Multiply(this.m_invMassA,T)),r-=this.m_invIA*B(this.m_rA,T),h.Add(S.Multiply(this.m_invMassB,T)),l+=this.m_invIB*B(this.m_rB,T)}else this.m_impulse=0;t.velocities[this.m_indexA].v.Assign(n),t.velocities[this.m_indexA].w=r,t.velocities[this.m_indexB].v.Assign(h),t.velocities[this.m_indexB].w=l},SolveVelocityConstraints:function(t){var e=t.velocities[this.m_indexA].v.Clone(),i=t.velocities[this.m_indexA].w,n=t.velocities[this.m_indexB].v.Clone(),r=t.velocities[this.m_indexB].w,s=S.Add(e,M(i,this.m_rA)),o=S.Add(n,M(r,this.m_rB)),a=D(this.m_u,S.Subtract(o,s)),c=-this.m_mass*(a+this.m_bias+this.m_gamma*this.m_impulse);this.m_impulse+=c;var h=S.Multiply(c,this.m_u);e.Subtract(S.Multiply(this.m_invMassA,h)),i-=this.m_invIA*B(this.m_rA,h),n.Add(S.Multiply(this.m_invMassB,h)),r+=this.m_invIB*B(this.m_rB,h),t.velocities[this.m_indexA].v.Assign(e),t.velocities[this.m_indexA].w=i,t.velocities[this.m_indexB].v.Assign(n),t.velocities[this.m_indexB].w=r},SolvePositionConstraints:function(t){if(this.m_frequencyHz>0)return!0;var e=t.positions[this.m_indexA].c.Clone(),i=t.positions[this.m_indexA].a,n=t.positions[this.m_indexB].c.Clone(),r=t.positions[this.m_indexB].a,s=new R(i),o=new R(r),a=j(s,S.Subtract(this.m_localAnchorA,this.m_localCenterA)),h=j(o,S.Subtract(this.m_localAnchorB,this.m_localCenterB)),l=S.Subtract(S.Subtract(S.Add(n,h),e),a),u=l.Normalize()-this.m_length;u=it(u,-.2,.2);var _=-this.m_mass*u,d=S.Multiply(_,l);return e.Subtract(S.Multiply(this.m_invMassA,d)),i-=this.m_invIA*B(a,d),n.Add(S.Multiply(this.m_invMassB,d)),r+=this.m_invIB*B(h,d),t.positions[this.m_indexA].c.Assign(e),t.positions[this.m_indexA].a=i,t.positions[this.m_indexB].c.Assign(n),t.positions[this.m_indexB].a=r,Z(u)0&&(this.m_motorMass=1/this.m_motorMass),this.m_perp=j(l,this.m_localYAxisA),this.m_s1=B(S.Add(f,_),this.m_perp),this.m_s2=B(d,this.m_perp);var v=m+p+g*this.m_s1*this.m_s1+y*this.m_s2*this.m_s2,x=g*this.m_s1+y*this.m_s2,C=g*this.m_s1*this.m_a1+y*this.m_s2*this.m_a2,T=g+y;0==T&&(T=1);var A=g*this.m_a1+y*this.m_a2,b=m+p+g*this.m_a1*this.m_a1+y*this.m_a2*this.m_a2;if(this.m_K.ex.Set(v,x,C),this.m_K.ey.Set(x,T,A),this.m_K.ez.Set(C,A,b),this.m_enableLimit){var E=D(this.m_axis,f);Z(this.m_upperTranslation-this.m_lowerTranslation)<2*c?this.m_limitState=ii.e_equalLimits:E<=this.m_lowerTranslation?this.m_limitState!=ii.e_atLowerLimit&&(this.m_limitState=ii.e_atLowerLimit,this.m_impulse.z=0):E>=this.m_upperTranslation?this.m_limitState!=ii.e_atUpperLimit&&(this.m_limitState=ii.e_atUpperLimit,this.m_impulse.z=0):(this.m_limitState=ii.e_inactiveLimit,this.m_impulse.z=0)}else this.m_limitState=ii.e_inactiveLimit,this.m_impulse.z=0;if(0==this.m_enableMotor&&(this.m_motorImpulse=0),t.step.warmStarting){this.m_impulse.Multiply(t.step.dtRatio),this.m_motorImpulse*=t.step.dtRatio;var w=S.Add(S.Multiply(this.m_impulse.x,this.m_perp),S.Multiply(this.m_motorImpulse+this.m_impulse.z,this.m_axis)),I=this.m_impulse.x*this.m_s1+this.m_impulse.y+(this.m_motorImpulse+this.m_impulse.z)*this.m_a1,P=this.m_impulse.x*this.m_s2+this.m_impulse.y+(this.m_motorImpulse+this.m_impulse.z)*this.m_a2;n.Subtract(S.Multiply(m,w)),r-=g*I,a.Add(S.Multiply(p,w)),h+=y*P}else this.m_impulse.SetZero(),this.m_motorImpulse=0;t.velocities[this.m_indexA].v.Assign(n),t.velocities[this.m_indexA].w=r,t.velocities[this.m_indexB].v.Assign(a),t.velocities[this.m_indexB].w=h},SolveVelocityConstraints:function(t){var e=t.velocities[this.m_indexA].v.Clone(),i=t.velocities[this.m_indexA].w,n=t.velocities[this.m_indexB].v.Clone(),r=t.velocities[this.m_indexB].w,s=this.m_invMassA,o=this.m_invMassB,a=this.m_invIA,c=this.m_invIB;if(this.m_enableMotor&&this.m_limitState!=ii.e_equalLimits){var h=D(this.m_axis,S.Subtract(n,e))+this.m_a2*r-this.m_a1*i,l=this.m_motorMass*(this.m_motorSpeed-h),u=this.m_motorImpulse,_=t.step.dt*this.m_maxMotorForce;this.m_motorImpulse=it(this.m_motorImpulse+l,-_,_),l=this.m_motorImpulse-u;var d=S.Multiply(l,this.m_axis),f=l*this.m_a1,m=l*this.m_a2;e.Subtract(S.Multiply(s,d)),i-=a*f,n.Add(S.Multiply(o,d)),r+=c*m}var p=new S;if(p.x=D(this.m_perp,S.Subtract(n,e))+this.m_s2*r-this.m_s1*i,p.y=r-i,this.m_enableLimit&&this.m_limitState!=ii.e_inactiveLimit){var g;g=D(this.m_axis,S.Subtract(n,e))+this.m_a2*r-this.m_a1*i;h=new E(p.x,p.y,g);var y=this.m_impulse.Clone(),v=this.m_K.Solve33(h.Negate());this.m_impulse.Add(v),this.m_limitState==ii.e_atLowerLimit?this.m_impulse.z=tt(this.m_impulse.z,0):this.m_limitState==ii.e_atUpperLimit&&(this.m_impulse.z=Q(this.m_impulse.z,0));var x=S.Subtract(p.Negate(),S.Multiply(this.m_impulse.z-y.z,new S(this.m_K.ez.x,this.m_K.ez.y))),C=S.Add(this.m_K.Solve22(x),new S(y.x,y.y));this.m_impulse.x=C.x,this.m_impulse.y=C.y,v=E.Subtract(this.m_impulse,y);d=S.Add(S.Multiply(v.x,this.m_perp),S.Multiply(v.z,this.m_axis)),f=v.x*this.m_s1+v.y+v.z*this.m_a1,m=v.x*this.m_s2+v.y+v.z*this.m_a2;e.Subtract(S.Multiply(s,d)),i-=a*f,n.Add(S.Multiply(o,d)),r+=c*m}else{v=this.m_K.Solve22(p.Negate());this.m_impulse.x+=v.x,this.m_impulse.y+=v.y;d=S.Multiply(v.x,this.m_perp),f=v.x*this.m_s1+v.y,m=v.x*this.m_s2+v.y;e.Subtract(S.Multiply(s,d)),i-=a*f,n.Add(S.Multiply(o,d)),r+=c*m}t.velocities[this.m_indexA].v.Assign(e),t.velocities[this.m_indexA].w=i,t.velocities[this.m_indexB].v.Assign(n),t.velocities[this.m_indexB].w=r},SolvePositionConstraints:function(t){var e=t.positions[this.m_indexA].c.Clone(),i=t.positions[this.m_indexA].a,n=t.positions[this.m_indexB].c.Clone(),r=t.positions[this.m_indexB].a,s=new R(i),o=new R(r),a=this.m_invMassA,l=this.m_invMassB,u=this.m_invIA,_=this.m_invIB,d=j(s,S.Subtract(this.m_localAnchorA,this.m_localCenterA)),f=j(o,S.Subtract(this.m_localAnchorB,this.m_localCenterB)),m=S.Subtract(S.Subtract(S.Add(n,f),e),d),p=j(s,this.m_localXAxisA),g=B(S.Add(m,d),p),y=B(f,p),v=j(s,this.m_localYAxisA),x=B(S.Add(m,d),v),C=B(f,v),T=new E,A=new S;A.x=D(v,m),A.y=r-i-this.m_referenceAngle;var b=Z(A.x),P=Z(A.y),O=!1,L=0;if(this.m_enableLimit){var M=D(p,m);Z(this.m_upperTranslation-this.m_lowerTranslation)<2*c?(L=it(M,-.2,.2),b=tt(b,Z(M)),O=!0):M<=this.m_lowerTranslation?(L=it(M-this.m_lowerTranslation+c,-.2,0),b=tt(b,this.m_lowerTranslation-M),O=!0):M>=this.m_upperTranslation&&(L=it(M-this.m_upperTranslation-c,0,.2),b=tt(b,M-this.m_upperTranslation),O=!0)}if(O){var N=a+l+u*x*x+_*C*C,F=u*x+_*C,z=u*x*g+_*C*y;0==(U=u+_)&&(U=1);var k=u*g+_*y,V=a+l+u*g*g+_*y*y;(W=new I).ex.Set(N,F,z),W.ey.Set(F,U,k),W.ez.Set(z,k,V);var G=new E;G.x=A.x,G.y=A.y,G.z=L,T=W.Solve33(G.Negate())}else{var U,W;N=a+l+u*x*x+_*C*C,F=u*x+_*C;0==(U=u+_)&&(U=1),(W=new w).ex.Set(N,F),W.ey.Set(F,U);var X=W.Solve(A.Negate());T.x=X.x,T.y=X.y,T.z=0}var Y=S.Add(S.Multiply(T.x,v),S.Multiply(T.z,p)),H=T.x*x+T.y+T.z*g,q=T.x*C+T.y+T.z*y;return e.Subtract(S.Multiply(a,Y)),i-=u*H,n.Add(S.Multiply(l,Y)),r+=_*q,t.positions[this.m_indexA].c.Assign(e),t.positions[this.m_indexA].a=i,t.positions[this.m_indexB].c.Assign(n),t.positions[this.m_indexB].a=r,b<=c&&P<=h},_serialize:function(t){var e=t||{};return this.parent.prototype._serialize.call(this,e),e.localAnchorA=this.m_localAnchorA._serialize(),e.localAnchorB=this.m_localAnchorB._serialize(),e.localAxisA=this.m_localXAxisA._serialize(),e.referenceAngle=this.m_referenceAngle,e.enableLimit=this.m_enableLimit,e.lowerTranslation=this.m_lowerTranslation,e.upperTranslation=this.m_upperTranslation,e.enableMotor=this.m_enableMotor,e.maxMotorForce=this.m_maxMotorForce,e.motorSpeed=this.m_motorSpeed,e}},li._extend(ii),ui.prototype={Initialize:function(t,e,i){this.bodyA=t,this.bodyB=e,this.localAnchorA.Assign(this.bodyA.GetLocalPoint(i)),this.localAnchorB.Assign(this.bodyB.GetLocalPoint(i))},_deserialize:function(t,e,i){this.parent.prototype._deserialize.call(this,t,e,i),this.localAnchorA._deserialize(t.localAnchorA),this.localAnchorB._deserialize(t.localAnchorB),this.maxForce=t.maxForce,this.maxTorque=t.maxTorque}},ui._extend(ei),_i.prototype={GetAnchorA:function(){return this.m_bodyA.GetWorldPoint(this.m_localAnchorA)},GetAnchorB:function(){return this.m_bodyB.GetWorldPoint(this.m_localAnchorB)},GetReactionForce:function(t){return S.Multiply(t,this.m_linearImpulse)},GetReactionTorque:function(t){return t*this.m_angularImpulse},GetLocalAnchorA:function(){return this.m_localAnchorA},GetLocalAnchorB:function(){return this.m_localAnchorB},SetMaxForce:function(t){i(g(t)&&t>=0),this.m_maxForce=t},GetMaxForce:function(){return this.m_maxForce},SetMaxTorque:function(t){i(g(t)&&t>=0),this.m_maxTorque=t},GetMaxTorque:function(){return this.m_maxTorque},InitVelocityConstraints:function(t){this.m_indexA=this.m_bodyA.m_islandIndex,this.m_indexB=this.m_bodyB.m_islandIndex,this.m_localCenterA.Assign(this.m_bodyA.m_sweep.localCenter),this.m_localCenterB.Assign(this.m_bodyB.m_sweep.localCenter),this.m_invMassA=this.m_bodyA.m_invMass,this.m_invMassB=this.m_bodyB.m_invMass,this.m_invIA=this.m_bodyA.m_invI,this.m_invIB=this.m_bodyB.m_invI;var e=t.positions[this.m_indexA].a,i=t.velocities[this.m_indexA].v.Clone(),n=t.velocities[this.m_indexA].w,r=t.positions[this.m_indexB].a,s=t.velocities[this.m_indexB].v.Clone(),o=t.velocities[this.m_indexB].w,a=new R(e),c=new R(r);this.m_rA=j(a,S.Subtract(this.m_localAnchorA,this.m_localCenterA)),this.m_rB=j(c,S.Subtract(this.m_localAnchorB,this.m_localCenterB));var h=this.m_invMassA,l=this.m_invMassB,u=this.m_invIA,_=this.m_invIB,d=new w;if(d.ex.x=h+l+u*this.m_rA.y*this.m_rA.y+_*this.m_rB.y*this.m_rB.y,d.ex.y=-u*this.m_rA.x*this.m_rA.y-_*this.m_rB.x*this.m_rB.y,d.ey.x=d.ex.y,d.ey.y=h+l+u*this.m_rA.x*this.m_rA.x+_*this.m_rB.x*this.m_rB.x,this.m_linearMass=d.GetInverse(),this.m_angularMass=u+_,this.m_angularMass>0&&(this.m_angularMass=1/this.m_angularMass),t.step.warmStarting){this.m_linearImpulse.Multiply(t.step.dtRatio),this.m_angularImpulse*=t.step.dtRatio;var f=new S(this.m_linearImpulse.x,this.m_linearImpulse.y);i.Subtract(S.Multiply(h,f)),n-=u*(B(this.m_rA,f)+this.m_angularImpulse),s.Add(S.Multiply(l,f)),o+=_*(B(this.m_rB,f)+this.m_angularImpulse)}else this.m_linearImpulse.SetZero(),this.m_angularImpulse=0;t.velocities[this.m_indexA].v.Assign(i),t.velocities[this.m_indexA].w=n,t.velocities[this.m_indexB].v.Assign(s),t.velocities[this.m_indexB].w=o},SolveVelocityConstraints:function(t){var e=t.velocities[this.m_indexA].v.Clone(),i=t.velocities[this.m_indexA].w,n=t.velocities[this.m_indexB].v.Clone(),r=t.velocities[this.m_indexB].w,s=this.m_invMassA,o=this.m_invMassB,a=this.m_invIA,c=this.m_invIB,h=t.step.dt,l=r-i,u=-this.m_angularMass*l,_=this.m_angularImpulse,d=h*this.m_maxTorque;this.m_angularImpulse=it(this.m_angularImpulse+u,-d,d),i-=a*(u=this.m_angularImpulse-_),r+=c*u;l=S.Add(n,S.Subtract(M(r,this.m_rB),S.Subtract(e,M(i,this.m_rA)))),u=N(this.m_linearMass,l).Negate(),_=this.m_linearImpulse.Clone();this.m_linearImpulse.Add(u);d=h*this.m_maxForce;this.m_linearImpulse.LengthSquared()>d*d&&(this.m_linearImpulse.Normalize(),this.m_linearImpulse.Multiply(d)),u=S.Subtract(this.m_linearImpulse,_),e.Subtract(S.Multiply(s,u)),i-=a*B(this.m_rA,u),n.Add(S.Multiply(o,u)),r+=c*B(this.m_rB,u),t.velocities[this.m_indexA].v.Assign(e),t.velocities[this.m_indexA].w=i,t.velocities[this.m_indexB].v.Assign(n),t.velocities[this.m_indexB].w=r},SolvePositionConstraints:function(t){return!0},_serialize:function(t){var e=t||{};return this.parent.prototype._serialize.call(this,e),e.localAnchorA=this.m_localAnchorA._serialize(),e.localAnchorB=this.m_localAnchorB._serialize(),e.maxForce=this.m_maxForce,e.maxTorque=this.m_maxTorque,e}},_i._extend(ii),di.prototype={Initialize:function(t,e,i){this.bodyA=t,this.bodyB=e,this.localAnchorA.Assign(this.bodyA.GetLocalPoint(i)),this.localAnchorB.Assign(this.bodyB.GetLocalPoint(i)),this.referenceAngle=this.bodyB.GetAngle()-this.bodyA.GetAngle()},_deserialize:function(t,e,i){this.parent.prototype._deserialize.call(this,t,e,i),this.localAnchorA._deserialize(t.localAnchorA),this.localAnchorB._deserialize(t.localAnchorB),this.referenceAngle=t.referenceAngle,this.frequencyHz=t.frequencyHz,this.dampingRatio=t.dampingRatio}},di._extend(ei),fi.prototype={GetAnchorA:function(){return this.m_bodyA.GetWorldPoint(this.m_localAnchorA)},GetAnchorB:function(){return this.m_bodyB.GetWorldPoint(this.m_localAnchorB)},GetReactionForce:function(t){var e=new S(this.m_impulse.x,this.m_impulse.y);return S.Multiply(t,e)},GetReactionTorque:function(t){return t*this.m_impulse.z},GetLocalAnchorA:function(){return this.m_localAnchorA},GetLocalAnchorB:function(){return this.m_localAnchorB},GetReferenceAngle:function(){return this.m_referenceAngle},SetFrequency:function(t){this.m_frequencyHz=t},GetFrequency:function(){return this.m_frequencyHz},SetDampingRatio:function(t){this.m_dampingRatio=t},GetDampingRatio:function(){return this.m_dampingRatio},InitVelocityConstraints:function(t){this.m_indexA=this.m_bodyA.m_islandIndex,this.m_indexB=this.m_bodyB.m_islandIndex,this.m_localCenterA.Assign(this.m_bodyA.m_sweep.localCenter),this.m_localCenterB.Assign(this.m_bodyB.m_sweep.localCenter),this.m_invMassA=this.m_bodyA.m_invMass,this.m_invMassB=this.m_bodyB.m_invMass,this.m_invIA=this.m_bodyA.m_invI,this.m_invIB=this.m_bodyB.m_invI;var e=t.positions[this.m_indexA].a,i=t.velocities[this.m_indexA].v.Clone(),n=t.velocities[this.m_indexA].w,r=t.positions[this.m_indexB].a,o=t.velocities[this.m_indexB].v.Clone(),a=t.velocities[this.m_indexB].w,c=new R(e),h=new R(r);this.m_rA.Assign(j(c,S.Subtract(this.m_localAnchorA,this.m_localCenterA))),this.m_rB.Assign(j(h,S.Subtract(this.m_localAnchorB,this.m_localCenterB)));var l=this.m_invMassA,u=this.m_invMassB,_=this.m_invIA,d=this.m_invIB,f=new I;if(f.ex.x=l+u+this.m_rA.y*this.m_rA.y*_+this.m_rB.y*this.m_rB.y*d,f.ey.x=-this.m_rA.y*this.m_rA.x*_-this.m_rB.y*this.m_rB.x*d,f.ez.x=-this.m_rA.y*_-this.m_rB.y*d,f.ex.y=f.ey.x,f.ey.y=l+u+this.m_rA.x*this.m_rA.x*_+this.m_rB.x*this.m_rB.x*d,f.ez.y=this.m_rA.x*_+this.m_rB.x*d,f.ex.z=f.ez.x,f.ey.z=f.ez.y,f.ez.z=_+d,this.m_frequencyHz>0){f.GetInverse22(this.m_mass);var m=_+d,p=m>0?1/m:0,g=r-e-this.m_referenceAngle,y=2*s*this.m_frequencyHz,v=2*p*this.m_dampingRatio*y,x=p*y*y,C=t.step.dt;this.m_gamma=C*(v+C*x),this.m_gamma=0!=this.m_gamma?1/this.m_gamma:0,this.m_bias=g*C*x*this.m_gamma,m+=this.m_gamma,this.m_mass.ez.z=0!=m?1/m:0}else 0==f.ez.z?(f.GetInverse22(this.m_mass),this.m_gamma=0,this.m_bias=0):(f.GetSymInverse33(this.m_mass),this.m_gamma=0,this.m_bias=0);if(t.step.warmStarting){this.m_impulse.Multiply(t.step.dtRatio);var T=new S(this.m_impulse.x,this.m_impulse.y);i.Subtract(S.Multiply(l,T)),n-=_*(B(this.m_rA,T)+this.m_impulse.z),o.Add(S.Multiply(u,T)),a+=d*(B(this.m_rB,T)+this.m_impulse.z)}else this.m_impulse.SetZero();t.velocities[this.m_indexA].v.Assign(i),t.velocities[this.m_indexA].w=n,t.velocities[this.m_indexB].v.Assign(o),t.velocities[this.m_indexB].w=a},SolveVelocityConstraints:function(t){var e=t.velocities[this.m_indexA].v.Clone(),i=t.velocities[this.m_indexA].w,n=t.velocities[this.m_indexB].v.Clone(),r=t.velocities[this.m_indexB].w,s=this.m_invMassA,o=this.m_invMassB,a=this.m_invIA,c=this.m_invIB;if(this.m_frequencyHz>0){var h=r-i,l=-this.m_mass.ez.z*(h+this.m_bias+this.m_gamma*this.m_impulse.z);this.m_impulse.z+=l,i-=a*l,r+=c*l;var u=S.Subtract(S.Subtract(S.Add(n,M(r,this.m_rB)),e),M(i,this.m_rA)),_=U(this.m_mass,u).Negate();this.m_impulse.x+=_.x,this.m_impulse.y+=_.y;var d=_.Clone();e.Subtract(S.Multiply(s,d)),i-=a*B(this.m_rA,d),n.Add(S.Multiply(o,d)),r+=c*B(this.m_rB,d)}else{h=r-i;var f=new E((u=S.Subtract(S.Subtract(S.Add(n,M(r,this.m_rB)),e),M(i,this.m_rA))).x,u.y,h),m=G(this.m_mass,f).Negate();this.m_impulse.Add(m);d=new S(m.x,m.y);e.Subtract(S.Multiply(s,d)),i-=a*(B(this.m_rA,d)+m.z),n.Add(S.Multiply(o,d)),r+=c*(B(this.m_rB,d)+m.z)}t.velocities[this.m_indexA].v.Assign(e),t.velocities[this.m_indexA].w=i,t.velocities[this.m_indexB].v.Assign(n),t.velocities[this.m_indexB].w=r},SolvePositionConstraints:function(t){var e,i,n=t.positions[this.m_indexA].c.Clone(),r=t.positions[this.m_indexA].a,s=t.positions[this.m_indexB].c.Clone(),o=t.positions[this.m_indexB].a,a=new R(r),l=new R(o),u=this.m_invMassA,_=this.m_invMassB,d=this.m_invIA,f=this.m_invIB,m=j(a,S.Subtract(this.m_localAnchorA,this.m_localCenterA)),p=j(l,S.Subtract(this.m_localAnchorB,this.m_localCenterB)),g=new I;if(g.ex.x=u+_+m.y*m.y*d+p.y*p.y*f,g.ey.x=-m.y*m.x*d-p.y*p.x*f,g.ez.x=-m.y*d-p.y*f,g.ex.y=g.ey.x,g.ey.y=u+_+m.x*m.x*d+p.x*p.x*f,g.ez.y=m.x*d+p.x*f,g.ex.z=g.ez.x,g.ey.z=g.ez.y,g.ez.z=d+f,this.m_frequencyHz>0){e=(v=S.Subtract(S.Subtract(S.Add(s,p),n),m)).Length(),i=0;var y=g.Solve22(v).Negate();n.Subtract(S.Multiply(u,y)),r-=d*B(m,y),s.Add(S.Multiply(_,y)),o+=f*B(p,y)}else{var v=S.Subtract(S.Subtract(S.Add(s,p),n),m),x=o-r-this.m_referenceAngle;e=v.Length(),i=Z(x);var C,T=new E(v.x,v.y,x);if(g.ez.z>0)C=g.Solve33(T).Invert();else{var A=g.Solve22(v).Invert();C=new E(A.x,A.y,0)}y=new S(C.x,C.y);n.Subtract(S.Multiply(u,y)),r-=d*(B(m,y)+C.z),s.Add(S.Multiply(_,y)),o+=f*(B(p,y)+C.z)}return t.positions[this.m_indexA].c.Assign(n),t.positions[this.m_indexA].a=r,t.positions[this.m_indexB].c.Assign(s),t.positions[this.m_indexB].a=o,e<=c&&i<=h},_serialize:function(t){var e=t||{};return this.parent.prototype._serialize.call(this,e),e.localAnchorA=this.m_localAnchorA._serialize(),e.localAnchorB=this.m_localAnchorB._serialize(),e.referenceAngle=this.m_referenceAngle,e.frequencyHz=this.m_frequencyHz,e.dampingRatio=this.m_dampingRatio,e}},fi._extend(ii),mi.prototype={Initialize:function(t,e,i,n){this.bodyA=t,this.bodyB=e,this.localAnchorA.Assign(this.bodyA.GetLocalPoint(i)),this.localAnchorB.Assign(this.bodyB.GetLocalPoint(i)),this.localAxisA.Assign(this.bodyA.GetLocalVector(n))},_deserialize:function(t,e,i){this.parent.prototype._deserialize.call(this,t,e,i),this.localAnchorA._deserialize(t.localAnchorA),this.localAnchorB._deserialize(t.localAnchorB),this.localAxisA._deserialize(t.localAxisA),this.enableMotor=t.enableMotor,this.maxMotorTorque=t.maxMotorTorque,this.motorSpeed=t.motorSpeed,this.frequencyHz=t.frequencyHz,this.dampingRatio=t.dampingRatio}},mi._extend(ei),pi.prototype={GetAnchorA:function(){return this.m_bodyA.GetWorldPoint(this.m_localAnchorA)},GetAnchorB:function(){return this.m_bodyB.GetWorldPoint(this.m_localAnchorB)},GetReactionForce:function(t){return S.Multiply(t,S.Add(S.Multiply(this.m_impulse,this.m_ay),S.Multiply(this.m_springImpulse,this.m_ax)))},GetReactionTorque:function(t){return t*this.m_motorImpulse},GetLocalAnchorA:function(){return this.m_localAnchorA},GetLocalAnchorB:function(){return this.m_localAnchorB},GetLocalAxisA:function(){return this.m_localXAxisA},GetJointTranslation:function(){var t=this.m_bodyA,e=this.m_bodyB,i=t.GetWorldPoint(this.m_localAnchorA),n=e.GetWorldPoint(this.m_localAnchorB);return D(S.Subtract(n,i),t.GetWorldVector(this.m_localXAxisA))},GetJointSpeed:function(){var t=this.m_bodyA.m_angularVelocity;return this.m_bodyB.m_angularVelocity-t},IsMotorEnabled:function(){return this.m_enableMotor},EnableMotor:function(t){this.m_bodyA.SetAwake(!0),this.m_bodyB.SetAwake(!0),this.m_enableMotor=t},SetMotorSpeed:function(t){this.m_bodyA.SetAwake(!0),this.m_bodyB.SetAwake(!0),this.m_motorSpeed=t},GetMotorSpeed:function(){return this.m_motorSpeed},SetMaxMotorTorque:function(t){this.m_bodyA.SetAwake(!0),this.m_bodyB.SetAwake(!0),this.m_maxMotorTorque=t},GetMaxMotorTorque:function(){return this.m_maxMotorTorque},GetMotorTorque:function(t){return t*this.m_motorImpulse},SetSpringFrequencyHz:function(t){this.m_frequencyHz=t},GetSpringFrequencyHz:function(){return this.m_frequencyHz},SetSpringDampingRatio:function(t){this.m_dampingRatio=t},GetSpringDampingRatio:function(){return this.m_dampingRatio},InitVelocityConstraints:function(t){this.m_indexA=this.m_bodyA.m_islandIndex,this.m_indexB=this.m_bodyB.m_islandIndex,this.m_localCenterA.Assign(this.m_bodyA.m_sweep.localCenter),this.m_localCenterB.Assign(this.m_bodyB.m_sweep.localCenter),this.m_invMassA=this.m_bodyA.m_invMass,this.m_invMassB=this.m_bodyB.m_invMass,this.m_invIA=this.m_bodyA.m_invI,this.m_invIB=this.m_bodyB.m_invI;var e=this.m_invMassA,i=this.m_invMassB,n=this.m_invIA,r=this.m_invIB,o=t.positions[this.m_indexA].c.Clone(),a=t.positions[this.m_indexA].a,c=t.velocities[this.m_indexA].v.Clone(),h=t.velocities[this.m_indexA].w,l=t.positions[this.m_indexB].c.Clone(),u=t.positions[this.m_indexB].a,_=t.velocities[this.m_indexB].v.Clone(),d=t.velocities[this.m_indexB].w,f=new R(a),m=new R(u),p=j(f,S.Subtract(this.m_localAnchorA,this.m_localCenterA)),g=j(m,S.Subtract(this.m_localAnchorB,this.m_localCenterB)),y=S.Subtract(S.Subtract(S.Add(l,g),o),p);if(this.m_ay.Assign(j(f,this.m_localYAxisA)),this.m_sAy=B(S.Add(y,p),this.m_ay),this.m_sBy=B(g,this.m_ay),this.m_mass=e+i+n*this.m_sAy*this.m_sAy+r*this.m_sBy*this.m_sBy,this.m_mass>0&&(this.m_mass=1/this.m_mass),this.m_springMass=0,this.m_bias=0,this.m_gamma=0,this.m_frequencyHz>0){this.m_ax.Assign(j(f,this.m_localXAxisA)),this.m_sAx=B(S.Add(y,p),this.m_ax),this.m_sBx=B(g,this.m_ax);var v=e+i+n*this.m_sAx*this.m_sAx+r*this.m_sBx*this.m_sBx;if(v>0){this.m_springMass=1/v;var x=D(y,this.m_ax),C=2*s*this.m_frequencyHz,T=(y=2*this.m_springMass*this.m_dampingRatio*C,this.m_springMass*C*C),A=t.step.dt;this.m_gamma=A*(y+A*T),this.m_gamma>0&&(this.m_gamma=1/this.m_gamma),this.m_bias=x*A*T*this.m_gamma,this.m_springMass=v+this.m_gamma,this.m_springMass>0&&(this.m_springMass=1/this.m_springMass)}}else this.m_springImpulse=0;if(this.m_enableMotor?(this.m_motorMass=n+r,this.m_motorMass>0&&(this.m_motorMass=1/this.m_motorMass)):(this.m_motorMass=0,this.m_motorImpulse=0),t.step.warmStarting){this.m_impulse*=t.step.dtRatio,this.m_springImpulse*=t.step.dtRatio,this.m_motorImpulse*=t.step.dtRatio;var b=S.Add(S.Multiply(this.m_impulse,this.m_ay),S.Multiply(this.m_springImpulse,this.m_ax)),E=this.m_impulse*this.m_sAy+this.m_springImpulse*this.m_sAx+this.m_motorImpulse,w=this.m_impulse*this.m_sBy+this.m_springImpulse*this.m_sBx+this.m_motorImpulse;c.Subtract(S.Multiply(this.m_invMassA,b)),h-=this.m_invIA*E,_.Add(S.Multiply(this.m_invMassB,b)),d+=this.m_invIB*w}else this.m_impulse=0,this.m_springImpulse=0,this.m_motorImpulse=0;t.velocities[this.m_indexA].v.Assign(c),t.velocities[this.m_indexA].w=h,t.velocities[this.m_indexB].v.Assign(_),t.velocities[this.m_indexB].w=d},SolveVelocityConstraints:function(t){var e=this.m_invMassA,i=this.m_invMassB,n=this.m_invIA,r=this.m_invIB,s=t.velocities[this.m_indexA].v.Clone(),o=t.velocities[this.m_indexA].w,a=t.velocities[this.m_indexB].v.Clone(),c=t.velocities[this.m_indexB].w,h=D(this.m_ax,S.Subtract(a,s))+this.m_sBx*c-this.m_sAx*o,l=-this.m_springMass*(h+this.m_bias+this.m_gamma*this.m_springImpulse);this.m_springImpulse+=l;var u=S.Multiply(l,this.m_ax),_=l*this.m_sAx,d=l*this.m_sBx;s.Subtract(S.Multiply(e,u)),o-=n*_,a.Add(S.Multiply(i,u));h=(c+=r*d)-o-this.m_motorSpeed,l=-this.m_motorMass*h;var f=this.m_motorImpulse,m=t.step.dt*this.m_maxMotorTorque;this.m_motorImpulse=it(this.m_motorImpulse+l,-m,m),o-=n*(l=this.m_motorImpulse-f),c+=r*l;h=D(this.m_ay,S.Subtract(a,s))+this.m_sBy*c-this.m_sAy*o,l=-this.m_mass*h;this.m_impulse+=l;u=S.Multiply(l,this.m_ay),_=l*this.m_sAy,d=l*this.m_sBy;s.Subtract(S.Multiply(e,u)),o-=n*_,a.Add(S.Multiply(i,u)),c+=r*d,t.velocities[this.m_indexA].v.Assign(s),t.velocities[this.m_indexA].w=o,t.velocities[this.m_indexB].v.Assign(a),t.velocities[this.m_indexB].w=c},SolvePositionConstraints:function(t){var e,i=t.positions[this.m_indexA].c.Clone(),n=t.positions[this.m_indexA].a,r=t.positions[this.m_indexB].c.Clone(),s=t.positions[this.m_indexB].a,o=new R(n),a=new R(s),h=j(o,S.Subtract(this.m_localAnchorA,this.m_localCenterA)),l=j(a,S.Subtract(this.m_localAnchorB,this.m_localCenterB)),u=S.Add(S.Subtract(r,i),S.Subtract(l,h)),_=j(o,this.m_localYAxisA),d=B(S.Add(u,h),_),f=B(l,_),m=D(u,_),p=this.m_invMassA+this.m_invMassB+this.m_invIA*this.m_sAy*this.m_sAy+this.m_invIB*this.m_sBy*this.m_sBy;e=0!=p?-m/p:0;var g=S.Multiply(e,_),y=e*d,v=e*f;return i.Subtract(S.Multiply(this.m_invMassA,g)),n-=this.m_invIA*y,r.Add(S.Multiply(this.m_invMassB,g)),s+=this.m_invIB*v,t.positions[this.m_indexA].c.Assign(i),t.positions[this.m_indexA].a=n,t.positions[this.m_indexB].c.Assign(r),t.positions[this.m_indexB].a=s,Z(m)<=c},_serialize:function(t){var e=t||{};return this.parent.prototype._serialize.call(this,e),e.localAnchorA=this.m_localAnchorA._serialize(),e.localAnchorB=this.m_localAnchorB._serialize(),e.localAxisA=this.m_localAxisA._serialize(),e.enableMotor=this.m_enableMotor,e.maxMotorTorque=this.m_maxMotorTorque,e.motorSpeed=this.m_motorSpeed,e.frequencyHz=this.m_frequencyHz,e.dampingRatio=this.m_dampingRatio,e}},pi._extend(ii),gi.prototype={_deserialize:function(t,e,i){this.parent.prototype._deserialize.call(this,t,e,i),this.joint1=t.joint1,this.joint2=t.joint2,this.ratio=t.ratio}},gi._extend(ei),yi.prototype={GetAnchorA:function(){return this.m_bodyA.GetWorldPoint(this.m_localAnchorA)},GetAnchorB:function(){return this.m_bodyB.GetWorldPoint(this.m_localAnchorB)},GetReactionForce:function(t){var e=S.Multiply(this.m_impulse,this.m_JvAC);return S.Multiply(t,e)},GetReactionTorque:function(t){return t*(this.m_impulse*this.m_JwA)},GetJoint1:function(){return this.m_joint1},GetJoint2:function(){return this.m_joint2},SetRatio:function(t){i(g(t)),this.m_ratio=t},GetRatio:function(){return this.m_ratio},InitVelocityConstraints:function(t){this.m_indexA=this.m_bodyA.m_islandIndex,this.m_indexB=this.m_bodyB.m_islandIndex,this.m_indexC=this.m_bodyC.m_islandIndex,this.m_indexD=this.m_bodyD.m_islandIndex,this.m_lcA.Assign(this.m_bodyA.m_sweep.localCenter),this.m_lcB.Assign(this.m_bodyB.m_sweep.localCenter),this.m_lcC.Assign(this.m_bodyC.m_sweep.localCenter),this.m_lcD.Assign(this.m_bodyD.m_sweep.localCenter),this.m_mA=this.m_bodyA.m_invMass,this.m_mB=this.m_bodyB.m_invMass,this.m_mC=this.m_bodyC.m_invMass,this.m_mD=this.m_bodyD.m_invMass,this.m_iA=this.m_bodyA.m_invI,this.m_iB=this.m_bodyB.m_invI,this.m_iC=this.m_bodyC.m_invI,this.m_iD=this.m_bodyD.m_invI;var e=t.positions[this.m_indexA].a,i=t.velocities[this.m_indexA].v.Clone(),n=t.velocities[this.m_indexA].w,r=t.positions[this.m_indexB].a,s=t.velocities[this.m_indexB].v.Clone(),o=t.velocities[this.m_indexB].w,a=t.positions[this.m_indexC].a,c=t.velocities[this.m_indexC].v.Clone(),h=t.velocities[this.m_indexC].w,l=t.positions[this.m_indexD].a,u=t.velocities[this.m_indexD].v.Clone(),_=t.velocities[this.m_indexD].w,d=new R(e),f=new R(r),m=new R(a),p=new R(l);if(this.m_mass=0,this.m_typeA==ii.e_revoluteJoint)this.m_JvAC.SetZero(),this.m_JwA=1,this.m_JwC=1,this.m_mass+=this.m_iA+this.m_iC;else{var g=j(m,this.m_localAxisC),y=j(m,S.Subtract(this.m_localAnchorC,this.m_lcC)),v=j(d,S.Subtract(this.m_localAnchorA,this.m_lcA));this.m_JvAC.Assign(g),this.m_JwC=B(y,g),this.m_JwA=B(v,g),this.m_mass+=this.m_mC+this.m_mA+this.m_iC*this.m_JwC*this.m_JwC+this.m_iA*this.m_JwA*this.m_JwA}if(this.m_typeB==ii.e_revoluteJoint)this.m_JvBD.SetZero(),this.m_JwB=this.m_ratio,this.m_JwD=this.m_ratio,this.m_mass+=this.m_ratio*this.m_ratio*(this.m_iB+this.m_iD);else{g=j(p,this.m_localAxisD);var x=j(p,S.Subtract(this.m_localAnchorD,this.m_lcD)),C=j(f,S.Subtract(this.m_localAnchorB,this.m_lcB));this.m_JvBD.Assign(S.Multiply(this.m_ratio,g)),this.m_JwD=this.m_ratio*B(x,g),this.m_JwB=this.m_ratio*B(C,g),this.m_mass+=this.m_ratio*this.m_ratio*(this.m_mD+this.m_mB)+this.m_iD*this.m_JwD*this.m_JwD+this.m_iB*this.m_JwB*this.m_JwB}this.m_mass=this.m_mass>0?1/this.m_mass:0,t.step.warmStarting?(i.Add(S.Multiply(this.m_mA*this.m_impulse,this.m_JvAC)),n+=this.m_iA*this.m_impulse*this.m_JwA,s.Add(S.Multiply(this.m_mB*this.m_impulse,this.m_JvBD)),o+=this.m_iB*this.m_impulse*this.m_JwB,c.Subtract(S.Multiply(this.m_mC*this.m_impulse,this.m_JvAC)),h-=this.m_iC*this.m_impulse*this.m_JwC,u.Subtract(S.Multiply(this.m_mD*this.m_impulse,this.m_JvBD)),_-=this.m_iD*this.m_impulse*this.m_JwD):this.m_impulse=0,t.velocities[this.m_indexA].v.Assign(i),t.velocities[this.m_indexA].w=n,t.velocities[this.m_indexB].v.Assign(s),t.velocities[this.m_indexB].w=o,t.velocities[this.m_indexC].v.Assign(c),t.velocities[this.m_indexC].w=h,t.velocities[this.m_indexD].v.Assign(u),t.velocities[this.m_indexD].w=_},SolveVelocityConstraints:function(t){var e=t.velocities[this.m_indexA].v.Clone(),i=t.velocities[this.m_indexA].w,n=t.velocities[this.m_indexB].v.Clone(),r=t.velocities[this.m_indexB].w,s=t.velocities[this.m_indexC].v.Clone(),o=t.velocities[this.m_indexC].w,a=t.velocities[this.m_indexD].v.Clone(),c=t.velocities[this.m_indexD].w,h=D(this.m_JvAC,S.Subtract(e,s))+D(this.m_JvBD,S.Subtract(n,a));h+=this.m_JwA*i-this.m_JwC*o+(this.m_JwB*r-this.m_JwD*c);var l=-this.m_mass*h;this.m_impulse+=l,e.Add(S.Multiply(this.m_mA*l,this.m_JvAC)),i+=this.m_iA*l*this.m_JwA,n.Add(S.Multiply(this.m_mB*l,this.m_JvBD)),r+=this.m_iB*l*this.m_JwB,s.Subtract(S.Multiply(this.m_mC*l,this.m_JvAC)),o-=this.m_iC*l*this.m_JwC,a.Subtract(S.Multiply(this.m_mD*l,this.m_JvBD)),c-=this.m_iD*l*this.m_JwD,t.velocities[this.m_indexA].v.Assign(e),t.velocities[this.m_indexA].w=i,t.velocities[this.m_indexB].v.Assign(n),t.velocities[this.m_indexB].w=r,t.velocities[this.m_indexC].v.Assign(s),t.velocities[this.m_indexC].w=o,t.velocities[this.m_indexD].v.Assign(a),t.velocities[this.m_indexD].w=c},SolvePositionConstraints:function(t){var e,i,n,r,s,o,a=t.positions[this.m_indexA].c.Clone(),h=t.positions[this.m_indexA].a,l=t.positions[this.m_indexB].c.Clone(),u=t.positions[this.m_indexB].a,_=t.positions[this.m_indexC].c.Clone(),d=t.positions[this.m_indexC].a,f=t.positions[this.m_indexD].c.Clone(),m=t.positions[this.m_indexD].a,p=new R(h),g=new R(u),y=new R(d),v=new R(m),x=new S,C=new S,T=0;if(this.m_typeA==ii.e_revoluteJoint)x.SetZero(),n=1,s=1,T+=this.m_iA+this.m_iC,e=h-d-this.m_referenceAngleA;else{var A=j(y,this.m_localAxisC),b=j(y,S.Subtract(this.m_localAnchorC,this.m_lcC)),E=j(p,S.Subtract(this.m_localAnchorA,this.m_lcA));x.Assign(A),s=B(b,A),n=B(E,A),T+=this.m_mC+this.m_mA+this.m_iC*s*s+this.m_iA*n*n;var w=S.Subtract(this.m_localAnchorC,this.m_lcC),I=Y(y,S.Add(E,S.Subtract(a,_)));e=D(S.Subtract(I,w),this.m_localAxisC)}if(this.m_typeB==ii.e_revoluteJoint)C.SetZero(),r=this.m_ratio,o=this.m_ratio,T+=this.m_ratio*this.m_ratio*(this.m_iB+this.m_iD),i=u-m-this.m_referenceAngleB;else{A=j(v,this.m_localAxisD);var P=j(v,S.Subtract(this.m_localAnchorD,this.m_lcD)),O=j(g,S.Subtract(this.m_localAnchorB,this.m_lcB));C.Assign(S.Multiply(this.m_ratio,A)),o=this.m_ratio*B(P,A),r=this.m_ratio*B(O,A),T+=this.m_ratio*this.m_ratio*(this.m_mD+this.m_mB)+this.m_iD*o*o+this.m_iB*r*r;var L=S.Subtract(this.m_localAnchorD,this.m_lcD),M=Y(v,S.Add(O,S.Subtract(l,f)));i=D(S.Subtract(M,L),this.m_localAxisD)}var N=e+this.m_ratio*i-this.m_constant,F=0;return T>0&&(F=-N/T),a.Add(S.Multiply(this.m_mA,S.Multiply(F,x))),h+=this.m_iA*F*n,l.Add(S.Multiply(this.m_mB,S.Multiply(F,C))),u+=this.m_iB*F*r,_.Subtract(S.Multiply(this.m_mC,S.Multiply(F,x))),d-=this.m_iC*F*s,f.Subtract(S.Multiply(this.m_mD,S.Multiply(F,C))),m-=this.m_iD*F*o,t.positions[this.m_indexA].c.Assign(a),t.positions[this.m_indexA].a=h,t.positions[this.m_indexB].c.Assign(l),t.positions[this.m_indexB].a=u,t.positions[this.m_indexC].c.Assign(_),t.positions[this.m_indexC].a=d,t.positions[this.m_indexD].c.Assign(f),t.positions[this.m_indexD].a=m,0=0),this.m_maxForce=t},GetMaxForce:function(){return this.m_maxForce},SetMaxTorque:function(t){i(g(t)&&t>=0),this.m_maxTorque=t},GetMaxTorque:function(){return this.m_maxTorque},SetCorrectionFactor:function(t){i(g(t)&&0<=t&&t<=1),this.m_correctionFactor=t},GetCorrectionFactor:function(){return this.m_correctionFactor},InitVelocityConstraints:function(t){this.m_indexA=this.m_bodyA.m_islandIndex,this.m_indexB=this.m_bodyB.m_islandIndex,this.m_localCenterA.Assign(this.m_bodyA.m_sweep.localCenter),this.m_localCenterB.Assign(this.m_bodyB.m_sweep.localCenter),this.m_invMassA=this.m_bodyA.m_invMass,this.m_invMassB=this.m_bodyB.m_invMass,this.m_invIA=this.m_bodyA.m_invI,this.m_invIB=this.m_bodyB.m_invI;var e=t.positions[this.m_indexA].c.Clone(),i=t.positions[this.m_indexA].a,n=t.velocities[this.m_indexA].v.Clone(),r=t.velocities[this.m_indexA].w,s=t.positions[this.m_indexB].c.Clone(),o=t.positions[this.m_indexB].a,a=t.velocities[this.m_indexB].v.Clone(),c=t.velocities[this.m_indexB].w,h=new R(i),l=new R(o);this.m_rA.Assign(j(h,this.m_localCenterA.Negate())),this.m_rB.Assign(j(l,this.m_localCenterB.Negate()));var u=this.m_invMassA,_=this.m_invMassB,d=this.m_invIA,f=this.m_invIB,m=new w;if(m.ex.x=u+_+d*this.m_rA.y*this.m_rA.y+f*this.m_rB.y*this.m_rB.y,m.ex.y=-d*this.m_rA.x*this.m_rA.y-f*this.m_rB.x*this.m_rB.y,m.ey.x=m.ex.y,m.ey.y=u+_+d*this.m_rA.x*this.m_rA.x+f*this.m_rB.x*this.m_rB.x,this.m_linearMass.Assign(m.GetInverse()),this.m_angularMass=d+f,this.m_angularMass>0&&(this.m_angularMass=1/this.m_angularMass),this.m_linearError.x=s.x+this.m_rB.x-e.x-this.m_rA.x-(h.c*this.m_linearOffset.x-h.s*this.m_linearOffset.y),this.m_linearError.y=s.y+this.m_rB.y-e.y-this.m_rA.y-(h.s*this.m_linearOffset.x+h.c*this.m_linearOffset.y),this.m_angularError=o-i-this.m_angularOffset,t.step.warmStarting){this.m_linearImpulse.Multiply(t.step.dtRatio),this.m_angularImpulse*=t.step.dtRatio;var p=new S(this.m_linearImpulse.x,this.m_linearImpulse.y);n.Subtract(S.Multiply(u,p)),r-=d*(B(this.m_rA,p)+this.m_angularImpulse),a.Add(S.Multiply(_,p)),c+=f*(B(this.m_rB,p)+this.m_angularImpulse)}else this.m_linearImpulse.SetZero(),this.m_angularImpulse=0;t.velocities[this.m_indexA].v.Assign(n),t.velocities[this.m_indexA].w=r,t.velocities[this.m_indexB].v.Assign(a),t.velocities[this.m_indexB].w=c},SolveVelocityConstraints:function(t){var e=t.velocities[this.m_indexA].v.Clone(),i=t.velocities[this.m_indexA].w,n=t.velocities[this.m_indexB].v.Clone(),r=t.velocities[this.m_indexB].w,s=this.m_invMassA,o=this.m_invMassB,a=this.m_invIA,c=this.m_invIB,h=t.step.dt,l=t.step.inv_dt,u=r-i+l*this.m_correctionFactor*this.m_angularError,_=-this.m_angularMass*u,d=this.m_angularImpulse,f=h*this.m_maxTorque;this.m_angularImpulse=it(this.m_angularImpulse+_,-f,f),i-=a*(_=this.m_angularImpulse-d),r+=c*_;u=new S(n.x+-r*this.m_rB.x-e.x- -i*this.m_rA.x+l*this.m_correctionFactor*this.m_linearError.x,n.y+r*this.m_rB.y-e.y-i*this.m_rA.y+l*this.m_correctionFactor*this.m_linearError.y),_=N(this.m_linearMass,u).Negate(),d=this.m_linearImpulse.Clone();this.m_linearImpulse.Add(_);f=h*this.m_maxForce;this.m_linearImpulse.LengthSquared()>f*f&&(this.m_linearImpulse.Normalize(),this.m_linearImpulse.Multiply(f)),_.Assign(S.Subtract(this.m_linearImpulse,d)),e.Subtract(S.Multiply(s,_)),i-=a*B(this.m_rA,_),n.Add(S.Multiply(o,_)),r+=c*B(this.m_rB,_),t.velocities[this.m_indexA].v.Assign(e),t.velocities[this.m_indexA].w=i,t.velocities[this.m_indexB].v.Assign(n),t.velocities[this.m_indexB].w=r},SolvePositionConstraints:function(t){return!0},_serialize:function(t){var e=t||{};return this.parent.prototype._serialize.call(this,e),e.linearOffset=this.m_linearOffset._serialize(),e.angularOffset=this.m_angularOffset,e.maxForce=this.m_maxForce,e.maxTorque=this.m_maxTorque,e.correctionFactor=this.m_correctionFactor,e}},xi._extend(ii);function Ci(){this.parent.call(this),this.type=ii.e_pulleyJoint,this.groundAnchorA=new S(-1,1),this.groundAnchorB=new S(1,1),this.localAnchorA=new S(-1,0),this.localAnchorB=new S(1,0),this.lengthA=0,this.lengthB=0,this.ratio=1,this.collideConnected=!0,Object.seal(this)}function Ti(t){this.parent.call(this,t),this.m_indexA=0,this.m_indexB=0,this.m_uA=new S,this.m_uB=new S,this.m_rA=new S,this.m_rB=new S,this.m_localCenterA=new S,this.m_localCenterB=new S,this.m_invMassA=0,this.m_invMassB=0,this.m_invIA=0,this.m_invIB=0,this.m_mass=0,this.m_groundAnchorA=t.groundAnchorA.Clone(),this.m_groundAnchorB=t.groundAnchorB.Clone(),this.m_localAnchorA=t.localAnchorA.Clone(),this.m_localAnchorB=t.localAnchorB.Clone(),this.m_lengthA=t.lengthA,this.m_lengthB=t.lengthB,i(0!=t.ratio),this.m_ratio=t.ratio,this.m_constant=t.lengthA+this.m_ratio*t.lengthB,this.m_impulse=0}function Ai(){this.parent.call(this),this.type=ii.e_ropeJoint,this.localAnchorA=new S(-1,0),this.localAnchorB=new S(1,0),this.maxLength=0,Object.seal(this)}function bi(t){this.parent.call(this,t),this.m_localAnchorA=t.localAnchorA.Clone(),this.m_localAnchorB=t.localAnchorB.Clone(),this.m_maxLength=t.maxLength,this.m_mass=0,this.m_impulse=0,this.m_state=ii.e_inactiveLimit,this.m_length=0,this.m_indexA=0,this.m_indexB=0,this.m_u=new S,this.m_rA=new S,this.m_rB=new S,this.m_localCenterA=new S,this.m_localCenterB=new S,this.m_invMassA=0,this.m_invMassB=0,this.m_invIA=0,this.m_invIB=0}Ci.prototype={Initialize:function(t,e,n,s,o,a,c){this.bodyA=t,this.bodyB=e,this.groundAnchorA.Assign(n),this.groundAnchorB.Assign(s),this.localAnchorA.Assign(this.bodyA.GetLocalPoint(o)),this.localAnchorB.Assign(this.bodyB.GetLocalPoint(a));var h=S.Subtract(o,n);this.lengthA=h.Length();var l=S.Subtract(a,s);this.lengthB=l.Length(),this.ratio=c,i(this.ratio>r)},_deserialize:function(t,e,i){this.parent.prototype._deserialize.call(this,t,e,i),this.groundAnchorA._deserialize(t.groundAnchorA),this.groundAnchorB._deserialize(t.groundAnchorB),this.localAnchorA._deserialize(t.localAnchorA),this.localAnchorB._deserialize(t.localAnchorB),this.lengthA=t.lengthA,this.lengthB=t.lengthB,this.ratio=t.ratio}},Ci._extend(ei),Ti.prototype={GetAnchorA:function(){return this.m_bodyA.GetWorldPoint(this.m_localAnchorA)},GetAnchorB:function(){return this.m_bodyB.GetWorldPoint(this.m_localAnchorB)},GetReactionForce:function(t){var e=S.Multiply(this.m_impulse,this.m_uB);return S.Multiply(t,e)},GetReactionTorque:function(t){return 0},GetGroundAnchorA:function(){return this.m_groundAnchorA},GetGroundAnchorB:function(){return this.m_groundAnchorB},GetLengthA:function(){return this.m_lengthA},GetLengthB:function(){return this.m_lengthB},GetRatio:function(){return this.m_ratio},GetCurrentLengthA:function(){var t=this.m_bodyA.GetWorldPoint(this.m_localAnchorA),e=this.m_groundAnchorA;return S.Subtract(t,e).Length()},GetCurrentLengthB:function(){var t=this.m_bodyB.GetWorldPoint(this.m_localAnchorB),e=this.m_groundAnchorB;return S.Subtract(t,e).Length()},ShiftOrigin:function(t){this.m_groundAnchorA.Subtract(t),this.m_groundAnchorB.Subtract(t)},InitVelocityConstraints:function(t){this.m_indexA=this.m_bodyA.m_islandIndex,this.m_indexB=this.m_bodyB.m_islandIndex,this.m_localCenterA.Assign(this.m_bodyA.m_sweep.localCenter),this.m_localCenterB.Assign(this.m_bodyB.m_sweep.localCenter),this.m_invMassA=this.m_bodyA.m_invMass,this.m_invMassB=this.m_bodyB.m_invMass,this.m_invIA=this.m_bodyA.m_invI,this.m_invIB=this.m_bodyB.m_invI;var e=t.positions[this.m_indexA].c.Clone(),i=t.positions[this.m_indexA].a,n=t.velocities[this.m_indexA].v.Clone(),r=t.velocities[this.m_indexA].w,s=t.positions[this.m_indexB].c.Clone(),o=t.positions[this.m_indexB].a,a=t.velocities[this.m_indexB].v.Clone(),h=t.velocities[this.m_indexB].w,l=new R(i),u=new R(o);this.m_rA.Assign(j(l,S.Subtract(this.m_localAnchorA,this.m_localCenterA))),this.m_rB.Assign(j(u,S.Subtract(this.m_localAnchorB,this.m_localCenterB))),this.m_uA.Assign(S.Add(e,S.Subtract(this.m_rA,this.m_groundAnchorA))),this.m_uB.Assign(S.Add(s,S.Subtract(this.m_rB,this.m_groundAnchorB)));var _=this.m_uA.Length(),d=this.m_uB.Length();_>10*c?this.m_uA.Multiply(1/_):this.m_uA.SetZero(),d>10*c?this.m_uB.Multiply(1/d):this.m_uB.SetZero();var f=B(this.m_rA,this.m_uA),m=B(this.m_rB,this.m_uB),p=this.m_invMassA+this.m_invIA*f*f,g=this.m_invMassB+this.m_invIB*m*m;if(this.m_mass=p+this.m_ratio*this.m_ratio*g,this.m_mass>0&&(this.m_mass=1/this.m_mass),t.step.warmStarting){this.m_impulse*=t.step.dtRatio;var y=S.Multiply(-this.m_impulse,this.m_uA),v=S.Multiply(-this.m_ratio*this.m_impulse,this.m_uB);n.Add(S.Multiply(this.m_invMassA,y)),r+=this.m_invIA*B(this.m_rA,y),a.Add(S.Multiply(this.m_invMassB,v)),h+=this.m_invIB*B(this.m_rB,v)}else this.m_impulse=0;t.velocities[this.m_indexA].v.Assign(n),t.velocities[this.m_indexA].w=r,t.velocities[this.m_indexB].v.Assign(a),t.velocities[this.m_indexB].w=h},SolveVelocityConstraints:function(t){var e=t.velocities[this.m_indexA].v.Clone(),i=t.velocities[this.m_indexA].w,n=t.velocities[this.m_indexB].v.Clone(),r=t.velocities[this.m_indexB].w,s=S.Add(e,M(i,this.m_rA)),o=S.Add(n,M(r,this.m_rB)),a=-D(this.m_uA,s)-this.m_ratio*D(this.m_uB,o),c=-this.m_mass*a;this.m_impulse+=c;var h=S.Multiply(-c,this.m_uA),l=S.Multiply(-this.m_ratio,S.Multiply(c,this.m_uB));e.Add(S.Multiply(this.m_invMassA,h)),i+=this.m_invIA*B(this.m_rA,h),n.Add(S.Multiply(this.m_invMassB,l)),r+=this.m_invIB*B(this.m_rB,l),t.velocities[this.m_indexA].v.Assign(e),t.velocities[this.m_indexA].w=i,t.velocities[this.m_indexB].v.Assign(n),t.velocities[this.m_indexB].w=r},SolvePositionConstraints:function(t){var e=t.positions[this.m_indexA].c.Clone(),i=t.positions[this.m_indexA].a,n=t.positions[this.m_indexB].c.Clone(),r=t.positions[this.m_indexB].a,s=new R(i),o=new R(r),a=j(s,S.Subtract(this.m_localAnchorA,this.m_localCenterA)),h=j(o,S.Subtract(this.m_localAnchorB,this.m_localCenterB)),l=S.Add(e,S.Subtract(a,this.m_groundAnchorA)),u=S.Add(n,S.Subtract(h,this.m_groundAnchorB)),_=l.Length(),d=u.Length();_>10*c?l.Multiply(1/_):l.SetZero(),d>10*c?u.Multiply(1/d):u.SetZero();var f=B(a,l),m=B(h,u),p=this.m_invMassA+this.m_invIA*f*f,g=this.m_invMassB+this.m_invIB*m*m,y=p+this.m_ratio*this.m_ratio*g;y>0&&(y=1/y);var v=this.m_constant-_-this.m_ratio*d,x=Z(v),C=-y*v,T=S.Multiply(-C,l),A=S.Multiply(-this.m_ratio,S.Multiply(C,u));return e.Add(S.Multiply(this.m_invMassA,T)),i+=this.m_invIA*B(a,T),n.Add(S.Multiply(this.m_invMassB,A)),r+=this.m_invIB*B(h,A),t.positions[this.m_indexA].c.Assign(e),t.positions[this.m_indexA].a=i,t.positions[this.m_indexB].c.Assign(n),t.positions[this.m_indexB].a=r,x0?ii.e_atUpperLimit:ii.e_inactiveLimit,!(this.m_length>c))return this.m_u.SetZero(),this.m_mass=0,void(this.m_impulse=0);this.m_u.Multiply(1/this.m_length);var d=B(this.m_rA,this.m_u),f=B(this.m_rB,this.m_u),m=this.m_invMassA+this.m_invIA*d*d+this.m_invMassB+this.m_invIB*f*f;if(this.m_mass=0!=m?1/m:0,t.step.warmStarting){this.m_impulse*=t.step.dtRatio;var p=S.Multiply(this.m_impulse,this.m_u);n.Subtract(S.Multiply(this.m_invMassA,p)),r-=this.m_invIA*B(this.m_rA,p),a.Add(S.Multiply(this.m_invMassB,p)),h+=this.m_invIB*B(this.m_rB,p)}else this.m_impulse=0;t.velocities[this.m_indexA].v.Assign(n),t.velocities[this.m_indexA].w=r,t.velocities[this.m_indexB].v.Assign(a),t.velocities[this.m_indexB].w=h},SolveVelocityConstraints:function(t){var e=t.velocities[this.m_indexA].v.Clone(),i=t.velocities[this.m_indexA].w,n=t.velocities[this.m_indexB].v.Clone(),r=t.velocities[this.m_indexB].w,s=S.Add(e,M(i,this.m_rA)),o=S.Add(n,M(r,this.m_rB)),a=this.m_length-this.m_maxLength,c=D(this.m_u,S.Subtract(o,s));a<0&&(c+=t.step.inv_dt*a);var h=-this.m_mass*c,l=this.m_impulse;this.m_impulse=Q(0,this.m_impulse+h),h=this.m_impulse-l;var u=S.Multiply(h,this.m_u);e.Subtract(S.Multiply(this.m_invMassA,u)),i-=this.m_invIA*B(this.m_rA,u),n.Add(S.Multiply(this.m_invMassB,u)),r+=this.m_invIB*B(this.m_rB,u),t.velocities[this.m_indexA].v.Assign(e),t.velocities[this.m_indexA].w=i,t.velocities[this.m_indexB].v.Assign(n),t.velocities[this.m_indexB].w=r},SolvePositionConstraints:function(t){var e=t.positions[this.m_indexA].c.Clone(),i=t.positions[this.m_indexA].a,n=t.positions[this.m_indexB].c.Clone(),r=t.positions[this.m_indexB].a,s=new R(i),o=new R(r),a=j(s,S.Subtract(this.m_localAnchorA,this.m_localCenterA)),h=j(o,S.Subtract(this.m_localAnchorB,this.m_localCenterB)),l=S.Subtract(S.Subtract(S.Add(n,h),e),a),u=l.Normalize(),_=u-this.m_maxLength;_=it(_,0,.2);var d=-this.m_mass*_,f=S.Multiply(d,l);return e.Subtract(S.Multiply(this.m_invMassA,f)),i-=this.m_invIA*B(a,f),n.Add(S.Multiply(this.m_invMassB,f)),r+=this.m_invIB*B(h,f),t.positions[this.m_indexA].c.Assign(e),t.positions[this.m_indexA].a=i,t.positions[this.m_indexB].c.Assign(n),t.positions[this.m_indexB].a=r,u-this.m_maxLength=3),this.m_count=t.count,this.m_ps=new Array(this.m_count),this.m_p0s=new Array(this.m_count),this.m_vs=new Array(this.m_count),this.m_ims=new Array(this.m_count);for(var e=0;e0?1/n:0}var r=this.m_count-1,s=this.m_count-2;this.m_Ls=new Array(r),this.m_as=new Array(s);for(e=0;e0&&this.m_vs[n].Add(S.Multiply(t,this.m_gravity)),this.m_vs[n].Multiply(i),this.m_ps[n].Add(S.Multiply(t,this.m_vs[n]));for(n=0;ns;)T=(m-=2*s)-this.m_as[e];for(;T<-s;)T=(m+=2*s)-this.m_as[e];var A=-this.m_k3*C*T;i.Add(S.Multiply(o*A,y)),n.Add(S.Multiply(a*A,v)),r.Add(S.Multiply(c*A,x))}}}}};var wi={serialize:function(t){var e,i,n,r,s,o=[];for(n=t.GetBodyList();n;n=n.GetNext())for(r=n.GetFixtureList();r;r=r.GetNext())s=r.GetShape(),r.__temp_shape_id=o.length,o.push(s._serialize());var a=[];for(n=t.GetBodyList();n;n=n.GetNext())for(n.__temp_fixture_ids=[],r=n.GetFixtureList();r;r=r.GetNext())(i=r._serialize()).shape=r.__temp_shape_id,delete r.__temp_shape_id,n.__temp_fixture_ids.push(a.length),a.push(i);var c=[];for(n=t.GetBodyList();n;n=n.GetNext()){for((i=n._serialize()).fixtures=[],e=0;e>1,t|=t>>2,t|=t>>4,t|=t>>8,1+(t|=t>>16)}},{trimmed:"Abs_v2",name:"b2Abs_v2",def:K},{trimmed:"Abs_m22",name:"b2Abs_m22",def:function(t){return new w(K(t.ex),K(t.ey))}},{trimmed:"IsPowerOfTwo",name:"b2IsPowerOfTwo",def:function(t){return t>0&&0==(t&t-1)}},{trimmed:"RandomFloat",name:"b2RandomFloat",def:function(t,e){var i=Math.random();return i=void 0!==t?(e-t)*i+t:2*i-1}},{trimmed:"Timer",name:"b2Timer",def:st},{trimmed:"Color",name:"b2Color",def:nt},{trimmed:"Draw",name:"b2Draw",def:rt},{trimmed:"ContactID",name:"b2ContactID",def:St},{trimmed:"ManifoldPoint",name:"b2ManifoldPoint",def:Et},{trimmed:"Manifold",name:"b2Manifold",def:wt},{trimmed:"WorldManifold",name:"b2WorldManifold",def:It},{trimmed:"GetPointStates",name:"b2GetPointStates",def:function(t,e,i,n){for(var r=0;rthis._max&&(this._max=this._current);var s=Math.round((1-this._current/this._max)*r);this._ctx.globalAlpha=1,this._ctx.drawImage(this._canvas,i,0,n-i,r,0,0,n-i,r),e?(this._ctx.fillStyle="#444",this._ctx.fillRect(n-i,0,i,r),this._ctx.fillStyle="#b70000",this._ctx.fillRect(n-i,s,i,r-s),this._ctx.globalAlpha=.5,this._ctx.fillStyle="#fff",this._ctx.fillRect(n-i,s,i,i)):(this._ctx.fillStyle="#444",this._ctx.fillRect(n-i,0,i,r),this._ctx.fillStyle=this._color,this._ctx.fillRect(n-i,s,i,r-s),this._ctx.globalAlpha=.5,this._ctx.fillStyle="#fff",this._ctx.fillRect(n-i,s,i,i))},e})(e),r=Math.round(window.devicePixelRatio||1),s=(function(t){function e(e,i){t.call(this,e,i),this._threshold=0,this._canvas2=document.createElement("canvas"),this._ctx2=this._canvas2.getContext("2d")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.init=function(e,i){t.prototype.init.call(this,e,i);var n=e*r,s=i*r;this._canvas2.width=n,this._canvas2.height=s,this._canvas2.style.width=e+"px",this._canvas2.style.height=i+"px",this._ctx2.globalAlpha=1,this._ctx2.fillStyle="#444",this._ctx2.fillRect(0,0,n,s)},e.prototype.draw=function(t,e){var i=this._canvas.width,n=this._canvas.height;if(this._ctx.globalAlpha=1,this._ctx2.globalAlpha=1,t>this._threshold){var s=n*((t-t%n)/n+1),o=this._threshold;this._threshold=s;var a=o/s;this._ctx2.drawImage(this._canvas,0,0),this._ctx.fillStyle="#444",this._ctx.fillRect(0,0,i,n),this._ctx.drawImage(this._canvas2,r,0,i-r,n,0,Math.round((1-a)*n),i-r,n)}else this._ctx.drawImage(this._canvas,r,0,i-r,n,0,0,i-r,n);var c=Math.round(n*(1-t/this._threshold));e?(this._ctx.fillStyle="#444",this._ctx.fillRect(i-r,0,r,n),this._ctx.fillStyle="#b70000",this._ctx.fillRect(i-r,c,r,n-c),this._ctx.globalAlpha=.5,this._ctx.fillStyle="#fff",this._ctx.fillRect(i-r,c,r,r)):(this._ctx.fillStyle="#444",this._ctx.fillRect(i-r,0,r,n),this._ctx.fillStyle=this._color,this._ctx.fillRect(i-r,c,r,n-c),this._ctx.globalAlpha=.5,this._ctx.fillStyle="#fff",this._ctx.fillRect(i-r,c,r,r))},e})(e),o=Math.round(window.devicePixelRatio||1),a=(function(t){function e(e,i,n,r){t.call(this,e,i),this._min=n,this._max=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.draw=function(t,e){var i=this._canvas.width,n=this._canvas.height,r=(t-this._min)/(this._max-this._min),s=Math.round((1-r)*n);this._ctx.globalAlpha=1,this._ctx.drawImage(this._canvas,o,0,i-o,n,0,0,i-o,n),e?(this._ctx.fillStyle="#444",this._ctx.fillRect(i-o,0,o,n),this._ctx.fillStyle="#b70000",this._ctx.fillRect(i-o,s,o,n-s),this._ctx.globalAlpha=.5,this._ctx.fillStyle="#fff",this._ctx.fillRect(i-o,s,o,o)):(this._ctx.fillStyle="#444",this._ctx.fillRect(i-o,0,o,n),this._ctx.fillStyle=this._color,this._ctx.fillRect(i-o,s,o,n-s),this._ctx.globalAlpha=.5,this._ctx.fillStyle="#fff",this._ctx.fillRect(i-o,s,o,o))},e})(e),c=Math.round(window.devicePixelRatio||1),h=function(t,e){this._colors=e,this._canvas=document.createElement("canvas"),this._ctx=this._canvas.getContext("2d"),this._canvas.className="pstats-canvas",t.appendChild(this._canvas)};h.prototype.init=function(t,e,i){var n=t*c,r=e*c;this._canvas.width=n,this._canvas.height=r*i,this._canvas.style.width=t+"px",this._canvas.style.height=e*i+"px",this._ctx.globalAlpha=1,this._ctx.fillStyle="#444",this._ctx.fillRect(0,0,n,r*i)},h.prototype.draw=function(t){var e=this,i=this._canvas.width,n=this._canvas.height;this._ctx.globalAlpha=1,this._ctx.drawImage(this._canvas,c,0,i-c,n,0,0,i-c,n);for(var r=0,s=0;s=this._opts.average&&(this._averageValue=this._accumValue/this._accumSamples,this._accumValue=0,this._accumStart=e,this._accumSamples=0)}},u.value.get=function(){return this._value},u.value.set=function(t){this._value=t},l.prototype.sample=function(){this._average(this._value)},l.prototype.human=function(){var t=this._opts.average?this._averageValue:this._value;return Math.round(100*t)/100},l.prototype.alarm=function(){return this._opts.below&&this._valuethis._opts.over},Object.defineProperties(l.prototype,u);var _=(function(t){function e(e,i){t.call(this,e,i),this._time=window.performance.now()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.start=function(){this._time=window.performance.now()},e.prototype.end=function(){this._value=window.performance.now()-this._time,this._average(this._value)},e.prototype.tick=function(){this.end(),this.start()},e.prototype.frame=function(){var t=window.performance.now(),e=t-this._time;this._total++,e>(this._opts.average||1e3)&&(this._value=1e3*this._total/e,this._total=0,this._time=t,this._average(this._value))},e})(l),d=Math.log(1024),f=["Bytes","KB","MB","GB","TB"];var m=(function(t){function e(e,i,n){t.call(this,i,n),this._stats=e,this._start=0,0===n.extension.indexOf("memory.")&&(this._field=n.extension.substring(7))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.snapshot=function(){this._value=this._stats[this._field]},e.prototype.start=function(){this._start=this._stats[this._field]},e.prototype.end=function(){this._value=this._stats[this._field]-this._start},e.prototype.human=function(){return (function(t){var e=Math.floor(Math.log(t)/d);return 0===t?"n/a":Math.round(100*t/Math.pow(1024,e))/100+" "+f[e]})(t.prototype.human.call(this))},e})(l),p=function(){0===window.performance.memory.totalJSHeapSize&&console.warn("totalJSHeapSize === 0, performance.memory is only available in Chrome."),this._used=0,this._total=0,this._lastUsed=0},g={alarm:{},used:{},total:{}};p.prototype.tick=function(){this._lastUsed=this._used,this._used=window.performance.memory.usedJSHeapSize,this._total=window.performance.memory.totalJSHeapSize},g.alarm.get=function(){return this._used-this._lastUsed<0},g.used.get=function(){return window.performance.memory.usedJSHeapSize},g.total.get=function(){return this._total},p.prototype.counter=function(t,e){return new m(this,t,e)},Object.defineProperties(p.prototype,g);var y={memory:p},v=document.createElement("style");v.type="text/css",v.textContent="\n .pstats {\n position: fixed;\n z-index: 9999;\n\n padding: 5px;\n width: 250px;\n right: 5px;\n bottom: 5px;\n\n font-size: 10px;\n font-family: 'Roboto Condensed', tahoma, sans-serif;\n overflow: hidden;\n user-select: none;\n cursor: default;\n\n background: #222;\n border-radius: 3px;\n }\n\n .pstats-container {\n display: block;\n position: relative;\n color: #888;\n white-space: nowrap;\n }\n\n .pstats-item {\n position: absolute;\n width: 250px;\n height: 12px;\n left: 0px;\n }\n\n .pstats-label {\n position: absolute;\n width: 150px;\n height: 12px;\n text-align: left;\n transition: background 0.3s;\n }\n\n .pstats-label.alarm {\n color: #ccc;\n background: #800;\n\n transition: background 0s;\n }\n\n .pstats-counter-id {\n position: absolute;\n width: 90px;\n left: 0px;\n }\n\n .pstats-counter-value {\n position: absolute;\n width: 60px;\n left: 90px;\n text-align: right;\n }\n\n .pstats-canvas {\n display: block;\n position: absolute;\n right: 0px;\n top: 1px;\n }\n\n .pstats-fraction {\n position: absolute;\n width: 250px;\n left: 0px;\n }\n\n .pstats-legend {\n position: absolute;\n width: 150px;\n\n text-align: right;\n }\n\n .pstats-legend > span {\n position: absolute;\n right: 0px;\n }\n",document.head.appendChild(v);var x=function(t,e){var i=this;if(e=e||{},this._showGraph=void 0===e.showGraph||e._showGraph,this._values=e.values||{},this._fractions=e.fractions||[],this._id2counter={},this._id2item={},this._name2extStats={},e.css){var r=document.createElement("style");r.type="text/css",r.textContent=e.css,document.head.appendChild(r)}if(e.extensions)for(var o=0;o0),o.valueText.nodeValue=s,t._showGraph&&o.graph.draw(n.value,r)}}if(this._showGraph)for(var a=0;a0?1:-1}),Number.isInteger||(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),!console.time){var n=window.performance||Date,r=Object.create(null);console.time=function(t){r[t]=n.now()},console.timeEnd=function(t){var e=r[t],i=n.now()-e;console.log(t+": "+i+"ms")}}}),{}],317:[(function(t,e,i){String.prototype.startsWith||(String.prototype.startsWith=function(t,e){return e=e||0,this.lastIndexOf(t,e)===e}),String.prototype.endsWith||(String.prototype.endsWith=function(t,e){(void 0===e||e>this.length)&&(e=this.length),e-=t.length;var i=this.indexOf(t,e);return-1!==i&&i===e})}),{}],318:[(function(t,e,i){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])};window.__extends=function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},window.__assign=Object.assign||function(t){for(var e,i=1,n=arguments.length;i=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},window.__param=function(t,e){return function(i,n){e(i,n,t)}},window.__metadata=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},window.__awaiter=function(t,e,i,n){return new(i||(i=Promise))(function(r,s){function o(t){try{c(n.next(t))}catch(t){s(t)}}function a(t){try{c(n.throw(t))}catch(t){s(t)}}function c(t){t.done?r(t.value):new i(function(e){e(t.value)}).then(o,a)}c((n=n.apply(t,e||[])).next())})},window.__generator=function(t,e){var i,n,r,s,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return (function(s){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,n&&(r=n[2&s[0]?"return":s[0]?"throw":"next"])&&!(r=r.call(n,s[1])).done)return r;switch(n=0,r&&(s=[0,r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,n=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(r=(r=o.trys).length>0&&r[r.length-1])&&(6===s[0]||2===s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}}},window.__read=function(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var n,r,s=i.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(n=s.next()).done;)o.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return o},window.__spread=function(){for(var t=[],e=0;e1||a(t,e)})})}function a(t,e){try{(function(t){t.value instanceof __await?Promise.resolve(t.value.v).then(c,h):l(s[0][2],t)})(r[t](e))}catch(t){l(s[0][3],t)}}function c(t){a("next",t)}function h(t){a("throw",t)}function l(t,e){t(e),s.shift(),s.length&&a(s[0][0],s[0][1])}},window.__asyncDelegator=function(t){var e,i;return e={},n("next"),n("throw",(function(t){throw t})),n("return"),e[Symbol.iterator]=function(){return this},e;function n(n,r){t[n]&&(e[n]=function(e){return(i=!i)?{value:__await(t[n](e)),done:"return"===n}:r?r(e):e})}},window.__asyncValues=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator];return e?e.call(t):"function"==typeof __values?__values(t):t[Symbol.iterator]()}}),{}],319:[(function(t,e,i){var n="undefined"==typeof window?global:window;function r(t,e){void 0===n[t]&&(n[t]=e)}function s(t){return"object"==typeof n[t]}r("CC_TEST",s("tap")||s("QUnit")),r("CC_EDITOR",s("Editor")&&s("process")&&"electron"in process.versions),r("CC_PREVIEW",!0),r("CC_DEV",!0),r("CC_DEBUG",!0),r("CC_JSB",s("jsb")),r("CC_BUILD",!1),r("CC_WECHATGAME",s("wx")&&wx.getSystemInfoSync),r("CC_QQPLAY",s("bk")),r("CC_SUPPORT_JIT",!0);n.CocosEngine=cc.ENGINE_VERSION="1.10.1"}),{}]},{},[314]); \ No newline at end of file diff --git a/ui/web-mobile/index.html b/ui/web-mobile/index.html new file mode 100644 index 0000000000000000000000000000000000000000..182eddc00a4746bfd062216f0e5c94c1dd6b1c31 --- /dev/null +++ b/ui/web-mobile/index.html @@ -0,0 +1,54 @@ + + + + + + Cocos Creator | Style2Paints + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + + + diff --git a/ui/web-mobile/main.b0633.js b/ui/web-mobile/main.b0633.js new file mode 100644 index 0000000000000000000000000000000000000000..b529fc77ded9cc99eb09712010af89940d49fd01 --- /dev/null +++ b/ui/web-mobile/main.b0633.js @@ -0,0 +1,239 @@ +(function () { + + function boot () { + + var settings = window._CCSettings; + window._CCSettings = undefined; + + if ( !settings.debug ) { + var uuids = settings.uuids; + + var rawAssets = settings.rawAssets; + var assetTypes = settings.assetTypes; + var realRawAssets = settings.rawAssets = {}; + for (var mount in rawAssets) { + var entries = rawAssets[mount]; + var realEntries = realRawAssets[mount] = {}; + for (var id in entries) { + var entry = entries[id]; + var type = entry[1]; + // retrieve minified raw asset + if (typeof type === 'number') { + entry[1] = assetTypes[type]; + } + // retrieve uuid + realEntries[uuids[id] || id] = entry; + } + } + + var scenes = settings.scenes; + for (var i = 0; i < scenes.length; ++i) { + var scene = scenes[i]; + if (typeof scene.uuid === 'number') { + scene.uuid = uuids[scene.uuid]; + } + } + + var packedAssets = settings.packedAssets; + for (var packId in packedAssets) { + var packedIds = packedAssets[packId]; + for (var j = 0; j < packedIds.length; ++j) { + if (typeof packedIds[j] === 'number') { + packedIds[j] = uuids[packedIds[j]]; + } + } + } + } + + // init engine + var canvas; + + if (cc.sys.isBrowser) { + canvas = document.getElementById('GameCanvas'); + } + + if (false) { + var ORIENTATIONS = { + 'portrait': 1, + 'landscape left': 2, + 'landscape right': 3 + }; + BK.Director.screenMode = ORIENTATIONS[settings.orientation]; + initAdapter(); + } + + function setLoadingDisplay () { + // Loading splash scene + var splash = document.getElementById('splash'); + var progressBar = splash.querySelector('.progress-bar span'); + cc.loader.onProgress = function (completedCount, totalCount, item) { + var percent = 100 * completedCount / totalCount; + if (progressBar) { + progressBar.style.width = percent.toFixed(2) + '%'; + } + }; + splash.style.display = 'block'; + progressBar.style.width = '0%'; + + cc.director.once(cc.Director.EVENT_AFTER_SCENE_LAUNCH, function () { + splash.style.display = 'none'; + }); + } + + var onStart = function () { + cc.loader.downloader._subpackages = settings.subpackages; + + if (false) { + BK.Script.loadlib(); + } + + cc.view.resizeWithBrowserSize(true); + + if (!false && !false) { + if (cc.sys.isBrowser) { + setLoadingDisplay(); + } + + if (cc.sys.isMobile) { + if (settings.orientation === 'landscape') { + cc.view.setOrientation(cc.macro.ORIENTATION_LANDSCAPE); + } + else if (settings.orientation === 'portrait') { + cc.view.setOrientation(cc.macro.ORIENTATION_PORTRAIT); + } + cc.view.enableAutoFullScreen([ + cc.sys.BROWSER_TYPE_BAIDU, + cc.sys.BROWSER_TYPE_WECHAT, + cc.sys.BROWSER_TYPE_MOBILE_QQ, + cc.sys.BROWSER_TYPE_MIUI, + ].indexOf(cc.sys.browserType) < 0); + } + + // Limit downloading max concurrent task to 2, + // more tasks simultaneously may cause performance draw back on some android system / browsers. + // You can adjust the number based on your own test result, you have to set it before any loading process to take effect. + if (cc.sys.isBrowser && cc.sys.os === cc.sys.OS_ANDROID) { + cc.macro.DOWNLOAD_MAX_CONCURRENT = 2; + } + } + + // init assets + cc.AssetLibrary.init({ + libraryPath: 'res/import', + rawAssetsBase: 'res/raw-', + rawAssets: settings.rawAssets, + packedAssets: settings.packedAssets, + md5AssetsMap: settings.md5AssetsMap + }); + + if (false) { + cc.Pipeline.Downloader.PackDownloader._doPreload("WECHAT_SUBDOMAIN", settings.WECHAT_SUBDOMAIN_DATA); + } + + var launchScene = settings.launchScene; + + // load scene + cc.director.loadScene(launchScene, null, + function () { + if (cc.sys.isBrowser) { + // show canvas + canvas.style.visibility = ''; + var div = document.getElementById('GameDiv'); + if (div) { + div.style.backgroundImage = ''; + } + } + cc.loader.onProgress = null; + console.log('Success to load scene: ' + launchScene); + } + ); + }; + + // jsList + var jsList = settings.jsList; + + if (!false) { + var bundledScript = settings.debug ? 'src/project.dev.js' : 'src/project.3cc6d.js'; + if (jsList) { + jsList = jsList.map(function (x) { + return 'src/' + x; + }); + jsList.push(bundledScript); + } + else { + jsList = [bundledScript]; + } + } + + // anysdk scripts + if (cc.sys.isNative && cc.sys.isMobile) { + jsList = jsList.concat(['src/anysdk/jsb_anysdk.js', 'src/anysdk/jsb_anysdk_constants.js']); + } + + var option = { + //width: width, + //height: height, + id: 'GameCanvas', + scenes: settings.scenes, + debugMode: settings.debug ? cc.DebugMode.INFO : cc.DebugMode.ERROR, + showFPS: (!false && !false) && settings.debug, + frameRate: 60, + jsList: jsList, + groupList: settings.groupList, + collisionMatrix: settings.collisionMatrix, + renderMode: 1 + } + + cc.game.run(option, onStart); + } + + if (false) { + BK.Script.loadlib('GameRes://libs/qqplay-adapter.js'); + BK.Script.loadlib('GameRes://src/settings.js'); + BK.Script.loadlib(); + BK.Script.loadlib('GameRes://libs/qqplay-downloader.js'); + qqPlayDownloader.REMOTE_SERVER_ROOT = ""; + var prevPipe = cc.loader.md5Pipe || cc.loader.assetLoader; + cc.loader.insertPipeAfter(prevPipe, qqPlayDownloader); + // + boot(); + return; + } + + if (false) { + require(window._CCSettings.debug ? 'cocos2d-js.js' : 'cocos2d-js-min.335ee.js'); + require('./libs/weapp-adapter/engine/index.js'); + var prevPipe = cc.loader.md5Pipe || cc.loader.assetLoader; + cc.loader.insertPipeAfter(prevPipe, wxDownloader); + boot(); + return; + } + + if (window.jsb) { + require('src/settings.b2ff5.js'); + require('src/jsb_polyfill.js'); + boot(); + return; + } + + if (window.document) { + var splash = document.getElementById('splash'); + splash.style.display = 'block'; + + var cocos2d = document.createElement('script'); + cocos2d.async = true; + cocos2d.src = window._CCSettings.debug ? 'cocos2d-js.js' : 'cocos2d-js-min.335ee.js'; + + var engineLoaded = function () { + document.body.removeChild(cocos2d); + cocos2d.removeEventListener('load', engineLoaded, false); + if (typeof VConsole !== 'undefined') { + window.vConsole = new VConsole(); + } + boot(); + }; + cocos2d.addEventListener('load', engineLoaded, false); + document.body.appendChild(cocos2d); + } + +})(); diff --git a/ui/web-mobile/res/import/00/0079bdaa-ee19-4c8f-b197-8a0839015e60.87146.json b/ui/web-mobile/res/import/00/0079bdaa-ee19-4c8f-b197-8a0839015e60.87146.json new file mode 100644 index 0000000000000000000000000000000000000000..2072d397d746e5b9d45eec86799eea1275446edf --- /dev/null +++ b/ui/web-mobile/res/import/00/0079bdaa-ee19-4c8f-b197-8a0839015e60.87146.json @@ -0,0 +1 @@ +{"__type__":"cc.Texture2D","content":"0"} \ No newline at end of file diff --git a/ui/web-mobile/res/import/0e/0e39b7083.524e9.json b/ui/web-mobile/res/import/0e/0e39b7083.524e9.json new file mode 100644 index 0000000000000000000000000000000000000000..5129f9b659c641af3e05cbc0241c439b0d928859 --- /dev/null +++ b/ui/web-mobile/res/import/0e/0e39b7083.524e9.json @@ -0,0 +1 @@ +[{"__type__":"cc.SpriteFrame","content":{"name":"sun","texture":"eaEJTBfGVMP6tI4b09l/xC","rect":[0,0,135,135],"offset":[0,0],"originalSize":[135,135]}},{"__type__":"cc.SpriteFrame","content":{"name":"twitte","texture":"e60pPrifdEzquK0N9LCE/t","rect":[0,0,128,128],"offset":[0,0],"originalSize":[128,128]}},{"__type__":"cc.SpriteFrame","content":{"name":"default_radio_button_on","texture":"9dYAAftfRHJqYpJlnj3tC4","rect":[0,0,32,32],"offset":[0,0],"originalSize":[32,32]}},{"__type__":"cc.SpriteFrame","content":{"name":"github","texture":"64iVI/DaVLt4Vf7oiaAWmu","rect":[0,1,128,126],"offset":[0,0],"originalSize":[128,128]}},{"__type__":"cc.SpriteFrame","content":{"name":"folder","texture":"b2KMvAVjxLxKX0TR89NNkA","rect":[13,0,102,128],"offset":[0,0],"originalSize":[128,128]}},{"__type__":"cc.SpriteFrame","content":{"name":"default_btn_disabled","texture":"71VhFCTINJM6/Ky3oX9nBT","rect":[0,0,40,40],"offset":[0,0],"originalSize":[40,40],"capInsets":[15,7,15,9]}},{"__type__":"cc.SpriteFrame","content":{"name":"filled-circle","texture":"eeEF+K/mxAOZFch5MFpVtF","rect":[0,0,128,128],"offset":[0,0],"originalSize":[128,128]}},[{"__type__":"cc.SceneAsset","_name":"helloworld","scene":{"__id__":1},"asyncLoadAssets":null},{"__type__":"cc.Scene","_name":"New Node","_children":[{"__id__":2},{"__id__":210}],"_anchorPoint":{"__type__":"cc.Vec2"},"autoReleaseAssets":false},{"__type__":"cc.Node","_name":"Canvas","_parent":{"__id__":1},"_children":[{"__id__":3}],"_components":[{"__type__":"cc.Canvas","node":{"__id__":2},"_designResolution":{"__type__":"cc.Size","width":3000,"height":1440}},{"__type__":"a55dcSJ4f1CEaD9OSsdYeLl","node":{"__id__":2},"sketchNode":{"__id__":16},"alphaSketchNode":{"__id__":18},"hintNode":{"__id__":21},"bghintNode":{"__id__":20},"girdNode":{"__id__":19},"previewNode":{"__id__":17},"labelNode":{"__id__":34},"pendingNode":{"__id__":71},"fileBtnNode":{"__id__":26},"real_fileBtnNode":{"__id__":202},"aiBtnNode":{"__id__":31},"magicBtnNode":{"__id__":32},"leftNode":{"__id__":4},"confirmNode":{"__id__":195},"c9Node":{"__id__":184},"logoNode":{"__id__":9},"cpNode":{"__id__":197},"cpNode2":{"__id__":198},"lightNode":{"__id__":72},"processingNode":{"__id__":180},"V4_toggle":{"__id__":175},"c1BtnNode":{"__id__":185},"c2BtnNode":{"__id__":186},"c3BtnNode":{"__id__":187},"c4BtnNode":{"__id__":188},"c5BtnNode":{"__id__":189},"c6BtnNode":{"__id__":190},"c7BtnNode":{"__id__":191},"c8BtnNode":{"__id__":192},"c9BtnNode":{"__id__":193},"claNode":{"__id__":194}}],"_id":"a286bbGknJLZpRpxROV6M94","_color":{"__type__":"cc.Color","r":252,"g":252,"b":252},"_contentSize":{"__type__":"cc.Size","width":3000,"height":1440},"_position":{"__type__":"cc.Vec2","x":1500,"y":720}},{"__type__":"cc.Node","_name":"bg","_parent":{"__id__":2},"_children":[{"__id__":4},{"__id__":23},{"__id__":40},{"__id__":131},{"__id__":195}],"_components":[{"__type__":"cc.Sprite","node":{"__id__":3},"_spriteFrame":{"__uuid__":"6erFCVsFpOfI/2jYl2ny9K"},"_sizeMode":0},{"__type__":"cc.Widget","node":{"__id__":3},"alignMode":2,"_target":{"__id__":2},"_alignFlags":45,"_originalWidth":15,"_originalHeight":18}],"_color":{"__type__":"cc.Color"},"_contentSize":{"__type__":"cc.Size","width":3000,"height":1440}},{"__type__":"cc.Node","_name":"left","_parent":{"__id__":3},"_children":[{"__id__":5},{"__id__":6},{"__id__":16},{"__id__":22}],"_components":[{"__type__":"cc.Sprite","node":{"__id__":4},"_spriteFrame":{"__uuid__":"a2MjXRFdtLlYQ5ouAFv/+R"},"_sizeMode":0},{"__type__":"cc.Widget","node":{"__id__":4},"alignMode":2,"_target":{"__id__":3},"_alignFlags":45,"_left":300,"_right":300,"_originalWidth":100,"_originalHeight":100},{"__type__":"6591e257m1DWrS+H2/IDVmm","node":{"__id__":4}}],"_color":{"__type__":"cc.Color","r":24,"g":24,"b":24},"_contentSize":{"__type__":"cc.Size","width":2400,"height":1440}},{"__type__":"cc.Node","_name":"big_logo","_parent":{"__id__":4},"_components":[{"__type__":"cc.Sprite","node":{"__id__":5},"_spriteFrame":{"__uuid__":"33OMyX85RBaboj6DH6pUR4"},"_sizeMode":0}],"_contentSize":{"__type__":"cc.Size","width":1024,"height":1024},"_position":{"__type__":"cc.Vec2","x":-105,"y":94}},{"__type__":"cc.Node","_name":"logo","_parent":{"__id__":4},"_children":[{"__id__":7},{"__id__":8},{"__id__":9}],"_components":[{"__type__":"cc.Label","node":{"__id__":6},"_useOriginalSize":false,"_actualFontSize":86,"_fontSize":86,"_lineHeight":86,"_N$string":"Style2Paints","_N$horizontalAlign":1,"_N$verticalAlign":1},{"__type__":"cc.Widget","node":{"__id__":6},"alignMode":2,"_target":{"__id__":4},"_alignFlags":18,"_verticalCenter":322,"_horizontalCenter":667}],"_contentSize":{"__type__":"cc.Size","width":478,"height":86},"_position":{"__type__":"cc.Vec2","x":667,"y":322}},{"__type__":"cc.Node","_name":"ver","_parent":{"__id__":6},"_components":[{"__type__":"cc.Label","node":{"__id__":7},"_useOriginalSize":false,"_actualFontSize":48,"_fontSize":48,"_lineHeight":60,"_N$string":"V 2023.04.22 00:00\n4.6.0.0","_N$verticalAlign":1}],"_anchorPoint":{"__type__":"cc.Vec2","x":0.5,"y":1},"_contentSize":{"__type__":"cc.Size","width":419,"height":120},"_position":{"__type__":"cc.Vec2","x":-21,"y":-59}},{"__type__":"cc.Node","_name":"la","_parent":{"__id__":6},"_components":[{"__type__":"cc.Label","node":{"__id__":8},"_useOriginalSize":false,"_actualFontSize":42,"_fontSize":42,"_lineHeight":42,"_N$string":"","_N$horizontalAlign":1,"_N$verticalAlign":1}],"_contentSize":{"__type__":"cc.Size","height":42},"_position":{"__type__":"cc.Vec2","y":-405}},{"__type__":"cc.Node","_name":"ins","_parent":{"__id__":6},"_children":[{"__id__":10},{"__id__":12},{"__id__":14}],"_position":{"__type__":"cc.Vec2","x":-38,"y":-246}},{"__type__":"cc.Node","_name":"btn","_parent":{"__id__":9},"_children":[{"__id__":11}],"_components":[{"__type__":"cc.Sprite","node":{"__id__":10},"_spriteFrame":{"__uuid__":"a2MjXRFdtLlYQ5ouAFv/+R"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":10},"transition":1,"hoverColor":{"__type__":"cc.Color","r":65,"g":67,"b":133},"clickEvents":[{"__type__":"cc.ClickEvent","target":{"__id__":2},"component":"controller","handler":"on_logo_en"}],"_N$normalColor":{"__type__":"cc.Color","r":70,"g":70,"b":70},"_N$target":{"__id__":10}}],"_color":{"__type__":"cc.Color","r":70,"g":70,"b":70},"_contentSize":{"__type__":"cc.Size","width":400,"height":100}},{"__type__":"cc.Node","_name":"la","_parent":{"__id__":10},"_components":[{"__type__":"cc.Label","node":{"__id__":11},"_useOriginalSize":false,"_actualFontSize":42,"_fontSize":42,"_lineHeight":42,"_N$string":"Instruction","_N$horizontalAlign":1,"_N$verticalAlign":1}],"_contentSize":{"__type__":"cc.Size","width":194,"height":42}},{"__type__":"cc.Node","_name":"btn","_parent":{"__id__":9},"_children":[{"__id__":13}],"_components":[{"__type__":"cc.Sprite","node":{"__id__":12},"_spriteFrame":{"__uuid__":"a2MjXRFdtLlYQ5ouAFv/+R"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":12},"transition":1,"hoverColor":{"__type__":"cc.Color","r":65,"g":67,"b":133},"clickEvents":[{"__type__":"cc.ClickEvent","target":{"__id__":2},"component":"controller","handler":"on_logo_ja"}],"_N$normalColor":{"__type__":"cc.Color","r":70,"g":70,"b":70},"_N$target":{"__id__":12}}],"_color":{"__type__":"cc.Color","r":70,"g":70,"b":70},"_contentSize":{"__type__":"cc.Size","width":400,"height":100},"_position":{"__type__":"cc.Vec2","y":-125}},{"__type__":"cc.Node","_name":"la","_parent":{"__id__":12},"_components":[{"__type__":"cc.Label","node":{"__id__":13},"_useOriginalSize":false,"_actualFontSize":42,"_fontSize":42,"_lineHeight":42,"_N$string":"チュートリアル","_N$horizontalAlign":1,"_N$verticalAlign":1}],"_contentSize":{"__type__":"cc.Size","width":294,"height":42}},{"__type__":"cc.Node","_name":"btn","_parent":{"__id__":9},"_children":[{"__id__":15}],"_components":[{"__type__":"cc.Sprite","node":{"__id__":14},"_spriteFrame":{"__uuid__":"a2MjXRFdtLlYQ5ouAFv/+R"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":14},"transition":1,"hoverColor":{"__type__":"cc.Color","r":65,"g":67,"b":133},"clickEvents":[{"__type__":"cc.ClickEvent","target":{"__id__":2},"component":"controller","handler":"on_logo_zh"}],"_N$normalColor":{"__type__":"cc.Color","r":70,"g":70,"b":70},"_N$target":{"__id__":14}}],"_color":{"__type__":"cc.Color","r":70,"g":70,"b":70},"_contentSize":{"__type__":"cc.Size","width":400,"height":100},"_position":{"__type__":"cc.Vec2","y":-250}},{"__type__":"cc.Node","_name":"la","_parent":{"__id__":14},"_components":[{"__type__":"cc.Label","node":{"__id__":15},"_useOriginalSize":false,"_actualFontSize":42,"_fontSize":42,"_lineHeight":42,"_N$string":"中文教程","_N$horizontalAlign":1,"_N$verticalAlign":1}],"_contentSize":{"__type__":"cc.Size","width":168,"height":42}},{"__type__":"cc.Node","_name":"center","_parent":{"__id__":4},"_children":[{"__id__":17},{"__id__":18},{"__id__":19},{"__id__":20},{"__id__":21}],"_components":[{"__type__":"cc.Sprite","node":{"__id__":16},"_spriteFrame":{"__uuid__":"43+q/0K7tHg7DFdkHh5wdp"},"_sizeMode":0},{"__type__":"16ac9dXjiBLKrkojVzbW1dk","node":{"__id__":16}}],"_position":{"__type__":"cc.Vec2","x":-2.2737367544323206e-13,"y":-2.2737367544323206e-13}},{"__type__":"cc.Node","_name":"darken","_parent":{"__id__":16},"_components":[{"__type__":"cc.Sprite","node":{"__id__":17},"_spriteFrame":{"__uuid__":"d2USs4NLxG8IHzH3SpIWwA"},"_sizeMode":0},{"__type__":"cc.Widget","node":{"__id__":17},"alignMode":2,"_target":{"__id__":16},"_alignFlags":45,"_originalWidth":100,"_originalHeight":100}]},{"__type__":"cc.Node","_name":"alpha_sketch","_parent":{"__id__":16},"_components":[{"__type__":"cc.Sprite","node":{"__id__":18},"_spriteFrame":{"__uuid__":"d2USs4NLxG8IHzH3SpIWwA"},"_sizeMode":0},{"__type__":"cc.Widget","node":{"__id__":18},"alignMode":2,"_target":{"__id__":16},"_alignFlags":45,"_originalWidth":100,"_originalHeight":100}]},{"__type__":"cc.Node","_name":"gird_hints","_parent":{"__id__":16},"_components":[{"__type__":"cc.Sprite","node":{"__id__":19},"_sizeMode":0},{"__type__":"cc.Widget","node":{"__id__":19},"alignMode":2,"_target":{"__id__":16},"_alignFlags":45,"_originalWidth":40,"_originalHeight":36}]},{"__type__":"cc.Node","_name":"bg_hints","_parent":{"__id__":16},"_components":[{"__type__":"cc.Sprite","node":{"__id__":20},"_sizeMode":0},{"__type__":"cc.Widget","node":{"__id__":20},"alignMode":2,"_target":{"__id__":16},"_alignFlags":45,"_originalWidth":40,"_originalHeight":36}]},{"__type__":"cc.Node","_name":"hints","_parent":{"__id__":16},"_components":[{"__type__":"cc.Sprite","node":{"__id__":21}},{"__type__":"cc.Widget","node":{"__id__":21},"alignMode":2,"_target":{"__id__":16},"_alignFlags":45,"_originalWidth":40,"_originalHeight":36}]},{"__type__":"cc.Node","_name":"eraser_mask","_parent":{"__id__":4},"_components":[{"__type__":"cc.Sprite","node":{"__id__":22},"_spriteFrame":{"__uuid__":"a2MjXRFdtLlYQ5ouAFv/+R"},"_sizeMode":0},{"__type__":"d389dAkX0JBZruQtEeVulcE","node":{"__id__":22}}],"_opacity":240,"_color":{"__type__":"cc.Color","r":127,"g":127,"b":127},"_contentSize":{"__type__":"cc.Size","width":100,"height":100},"_position":{"__type__":"cc.Vec2","x":150}},{"__type__":"cc.Node","_name":"right","_parent":{"__id__":3},"_children":[{"__id__":24},{"__id__":26},{"__id__":27},{"__id__":28},{"__id__":31},{"__id__":32},{"__id__":33},{"__id__":34},{"__id__":71},{"__id__":72}],"_components":[{"__type__":"cc.Sprite","node":{"__id__":23},"_spriteFrame":{"__uuid__":"6erFCVsFpOfI/2jYl2ny9K"},"_sizeMode":0},{"__type__":"cc.Widget","node":{"__id__":23},"alignMode":2,"_target":{"__id__":3},"_alignFlags":37,"_originalHeight":18}],"_color":{"__type__":"cc.Color","r":80,"g":80,"b":80},"_contentSize":{"__type__":"cc.Size","width":300,"height":1440},"_position":{"__type__":"cc.Vec2","x":1350}},{"__type__":"cc.Node","_name":"right_all","_parent":{"__id__":23},"_children":[{"__id__":25}],"_components":[{"__type__":"cc.Sprite","node":{"__id__":24},"_spriteFrame":{"__uuid__":"6erFCVsFpOfI/2jYl2ny9K"},"_sizeMode":0},{"__type__":"cc.Widget","node":{"__id__":24},"alignMode":2,"_target":{"__id__":23},"_alignFlags":45,"_bottom":362,"_originalWidth":300,"_originalHeight":1078},{"__type__":"292e9Clf/5EoYjj7Il6urD/","node":{"__id__":24},"dropNode":{"__id__":25}}],"_contentSize":{"__type__":"cc.Size","width":300,"height":1078},"_position":{"__type__":"cc.Vec2","y":181}},{"__type__":"cc.Node","_name":"dropper","_parent":{"__id__":24},"_components":[{"__type__":"cc.Sprite","node":{"__id__":25},"_spriteFrame":{"__uuid__":"93A3mAWIRJPqSL2jznn6+j"},"_sizeMode":0,"_isTrimmedMode":false},{"__type__":"cc.Button","node":{"__id__":25},"_N$target":{"__id__":25}}],"_contentSize":{"__type__":"cc.Size","width":48,"height":48},"_position":{"__type__":"cc.Vec2","x":122,"y":268}},{"__type__":"cc.Node","_name":"folder","_parent":{"__id__":23},"_components":[{"__type__":"cc.Sprite","node":{"__id__":26},"_spriteFrame":{"__uuid__":"28PhFLWBlNi7ZOiy6wWfs1"},"_sizeMode":0,"_isTrimmedMode":false},{"__type__":"cc.Button","node":{"__id__":26},"transition":1,"hoverColor":{"__type__":"cc.Color","g":255},"clickEvents":[{"__type__":"cc.ClickEvent","target":{"__id__":2},"component":"controller","handler":"on_file"}],"_N$normalColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"_N$target":{"__id__":26}}],"_contentSize":{"__type__":"cc.Size","width":80,"height":80},"_position":{"__type__":"cc.Vec2","x":-61.1,"y":-511.6}},{"__type__":"cc.Node","_name":"help","_parent":{"__id__":23},"_components":[{"__type__":"cc.Sprite","node":{"__id__":27},"_spriteFrame":{"__uuid__":"d1MP9xGktN+oMvtBxdLhgq"},"_sizeMode":0,"_isTrimmedMode":false},{"__type__":"cc.Button","node":{"__id__":27},"transition":1,"hoverColor":{"__type__":"cc.Color","g":255},"clickEvents":[{"__type__":"cc.ClickEvent","target":{"__id__":2},"component":"controller","handler":"on_logo"}],"_N$target":{"__id__":27}}],"_color":{"__type__":"cc.Color","r":214,"g":214,"b":214},"_contentSize":{"__type__":"cc.Size","width":52,"height":52},"_position":{"__type__":"cc.Vec2","x":-116,"y":-690}},{"__type__":"cc.Node","_name":"bns","_parent":{"__id__":23},"_children":[{"__id__":29},{"__id__":30}],"_position":{"__type__":"cc.Vec2","x":120,"y":-690}},{"__type__":"cc.Node","_name":"twitter","_parent":{"__id__":28},"_components":[{"__type__":"cc.Sprite","node":{"__id__":29},"_spriteFrame":{"__uuid__":"10L7rqO+5OtoYe7G9tTmg1"},"_sizeMode":0,"_isTrimmedMode":false},{"__type__":"cc.Button","node":{"__id__":29},"transition":1,"hoverColor":{"__type__":"cc.Color","g":255},"clickEvents":[{"__type__":"cc.ClickEvent","target":{"__id__":2},"component":"controller","handler":"on_twitter"}],"_N$target":{"__id__":29}}],"_color":{"__type__":"cc.Color","r":214,"g":214,"b":214},"_contentSize":{"__type__":"cc.Size","width":52,"height":52},"_position":{"__type__":"cc.Vec2","x":-59.5}},{"__type__":"cc.Node","_name":"github","_parent":{"__id__":28},"_components":[{"__type__":"cc.Sprite","node":{"__id__":30},"_spriteFrame":{"__uuid__":"1emZAFMAJDpYid8LTfEewW"},"_sizeMode":0,"_isTrimmedMode":false},{"__type__":"cc.Button","node":{"__id__":30},"transition":1,"hoverColor":{"__type__":"cc.Color","g":255},"clickEvents":[{"__type__":"cc.ClickEvent","target":{"__id__":2},"component":"controller","handler":"on_github"}],"_N$target":{"__id__":30}}],"_color":{"__type__":"cc.Color","r":214,"g":214,"b":214},"_contentSize":{"__type__":"cc.Size","width":52,"height":52}},{"__type__":"cc.Node","_name":"ai","_parent":{"__id__":23},"_components":[{"__type__":"cc.Sprite","node":{"__id__":31},"_spriteFrame":{"__uuid__":"55/pLEAd1KgqMC+Zu5+CM8"},"_sizeMode":0,"_isTrimmedMode":false},{"__type__":"cc.Button","node":{"__id__":31},"transition":1,"hoverColor":{"__type__":"cc.Color","g":255},"clickEvents":[{"__type__":"cc.ClickEvent","target":{"__id__":2},"component":"controller","handler":"on_ai"}],"_N$normalColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"_N$target":{"__id__":31}}],"_contentSize":{"__type__":"cc.Size","width":80,"height":80},"_position":{"__type__":"cc.Vec2","x":61.2,"y":-511.6}},{"__type__":"cc.Node","_name":"magic","_parent":{"__id__":23},"_components":[{"__type__":"cc.Sprite","node":{"__id__":32},"_spriteFrame":{"__uuid__":"f0tpaN389NEYuM7aul/b8S"},"_sizeMode":0,"_isTrimmedMode":false},{"__type__":"cc.Button","node":{"__id__":32},"transition":1,"hoverColor":{"__type__":"cc.Color","g":255},"clickEvents":[{"__type__":"cc.ClickEvent","target":{"__id__":2},"component":"controller","handler":"on_magic"}],"_N$normalColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"_N$target":{"__id__":32}}],"_contentSize":{"__type__":"cc.Size","width":80,"height":80},"_position":{"__type__":"cc.Vec2","x":3,"y":-422}},{"__type__":"cc.Node","_name":"logo","_parent":{"__id__":23},"_components":[{"__type__":"cc.Label","node":{"__id__":33},"_useOriginalSize":false,"_N$string":"Style2Paints","_N$horizontalAlign":2,"_N$verticalAlign":2},{"__type__":"cc.Widget","node":{"__id__":33},"alignMode":2,"_target":{"__id__":23},"_alignFlags":36,"_bottom":64.10000000000002}],"_color":{"__type__":"cc.Color","r":124,"g":124,"b":124},"_anchorPoint":{"__type__":"cc.Vec2","x":1},"_contentSize":{"__type__":"cc.Size","width":222,"height":40},"_position":{"__type__":"cc.Vec2","x":150,"y":-655.9}},{"__type__":"cc.Node","_name":"stat","_parent":{"__id__":23},"_components":[{"__id__":35},{"__type__":"cc.Widget","node":{"__id__":34},"alignMode":2,"_target":{"__id__":23},"_alignFlags":36,"_bottom":104.89999999999998},{"__type__":"61dcdov4D1Nc6gCTDSTIWPe","node":{"__id__":34},"lab":{"__id__":35},"lab2":{"__id__":36},"prof":{"__id__":70},"prob":{"__id__":38}}],"_color":{"__type__":"cc.Color","g":160},"_anchorPoint":{"__type__":"cc.Vec2","x":1},"_contentSize":{"__type__":"cc.Size","width":208,"height":40},"_position":{"__type__":"cc.Vec2","x":150,"y":-615.1}},{"__type__":"cc.Label","node":{"__id__":34},"_useOriginalSize":false,"_actualFontSize":30,"_fontSize":30,"_N$string":"finished (100%)","_N$horizontalAlign":2,"_N$verticalAlign":2},{"__type__":"cc.Label","node":{"__id__":37},"_useOriginalSize":false,"_actualFontSize":30,"_fontSize":30,"_N$string":"finished (100%)","_N$horizontalAlign":2,"_N$verticalAlign":2},{"__type__":"cc.Node","_name":"stat","_parent":{"__id__":38},"_components":[{"__id__":36}],"_color":{"__type__":"cc.Color"},"_anchorPoint":{"__type__":"cc.Vec2","y":0.5},"_contentSize":{"__type__":"cc.Size","width":208,"height":40},"_position":{"__type__":"cc.Vec2","x":12,"y":2}},{"__type__":"cc.Node","_name":"prob","_parent":{"__id__":39},"_children":[{"__id__":70},{"__id__":37}],"_components":[{"__type__":"cc.Sprite","node":{"__id__":38},"_spriteFrame":{"__uuid__":"a2MjXRFdtLlYQ5ouAFv/+R"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":38},"_N$target":{"__id__":38}}],"_color":{"__type__":"cc.Color"},"_anchorPoint":{"__type__":"cc.Vec2","y":0.5},"_contentSize":{"__type__":"cc.Size","width":902,"height":52},"_position":{"__type__":"cc.Vec2","x":-451,"y":100}},{"__type__":"cc.Node","_name":"skills","_parent":{"__id__":40},"_children":[{"__id__":48},{"__id__":50},{"__id__":52},{"__id__":54},{"__id__":56},{"__id__":58},{"__id__":60},{"__id__":62},{"__id__":64},{"__id__":66},{"__id__":67},{"__id__":69},{"__id__":38}],"_components":[{"__type__":"cc.Sprite","node":{"__id__":39},"_spriteFrame":{"__uuid__":"6erFCVsFpOfI/2jYl2ny9K"},"_sizeMode":0},{"__type__":"cc.Widget","node":{"__id__":39},"alignMode":2,"_target":{"__id__":40},"_alignFlags":4,"_bottom":42},{"__type__":"9f420tBdblH772q0XTCwvMY","node":{"__id__":39},"c0":{"__id__":49},"c1":{"__id__":51},"c2":{"__id__":53},"c3":{"__id__":55},"c4":{"__id__":57},"c5":{"__id__":59},"c6":{"__id__":61},"c7":{"__id__":63},"c8":{"__id__":65},"kuang":{"__id__":68}}],"_color":{"__type__":"cc.Color","r":127,"g":127,"b":127},"_contentSize":{"__type__":"cc.Size","width":910,"height":110},"_position":{"__type__":"cc.Vec2","y":-623}},{"__type__":"cc.Node","_name":"left_2","_parent":{"__id__":3},"_children":[{"__id__":41},{"__id__":42},{"__id__":43},{"__id__":44},{"__id__":39},{"__id__":45},{"__id__":46},{"__id__":47}],"_components":[{"__type__":"cc.Widget","node":{"__id__":40},"alignMode":2,"_target":{"__id__":3},"_alignFlags":45,"_left":510,"_right":300},{"__type__":"ff80e/rKS5NvaF8zKm4aA06","node":{"__id__":40},"btn_show":{"__id__":43},"btn_hide":{"__id__":44},"btn_a":{"__id__":41},"btn_b":{"__id__":42}}],"_contentSize":{"__type__":"cc.Size","width":2190,"height":1440},"_position":{"__type__":"cc.Vec2","x":105}},{"__type__":"cc.Node","_name":"uploadh","_parent":{"__id__":40},"_active":false,"_components":[{"__type__":"cc.Sprite","node":{"__id__":41},"_spriteFrame":{"__uuid__":"f7dd/+nptHoIqUFepAEcrB"},"_sizeMode":0},{"__type__":"cc.Widget","node":{"__id__":41},"_wasAlignOnce":null,"isAlignOnce":null,"_target":{"__id__":40},"_alignFlags":33,"_right":24,"_top":24},{"__type__":"cc.Button","node":{"__id__":41},"transition":1,"pressedColor":{"__type__":"cc.Color","r":204,"g":204,"b":204},"hoverColor":{"__type__":"cc.Color","g":255},"clickEvents":[{"__type__":"cc.ClickEvent","target":{"__id__":2},"component":"controller","handler":"on_upload_hints"}],"_N$normalColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"_N$target":{"__id__":41}}],"_contentSize":{"__type__":"cc.Size","width":48,"height":48},"_position":{"__type__":"cc.Vec2","x":1152,"y":672}},{"__type__":"cc.Node","_name":"downloadh","_parent":{"__id__":40},"_active":false,"_components":[{"__type__":"cc.Sprite","node":{"__id__":42},"_spriteFrame":{"__uuid__":"47UdQy3DhCMJFip3T7mkbm"},"_sizeMode":0},{"__type__":"cc.Widget","node":{"__id__":42},"_wasAlignOnce":null,"isAlignOnce":null,"_target":{"__id__":40},"_alignFlags":33,"_right":96,"_top":24},{"__type__":"cc.Button","node":{"__id__":42},"transition":1,"pressedColor":{"__type__":"cc.Color","r":204,"g":204,"b":204},"hoverColor":{"__type__":"cc.Color","g":255},"clickEvents":[{"__type__":"cc.ClickEvent","target":{"__id__":2},"component":"controller","handler":"on_download_hints"}],"_N$normalColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"_N$target":{"__id__":42}}],"_contentSize":{"__type__":"cc.Size","width":48,"height":48},"_position":{"__type__":"cc.Vec2","x":1230,"y":672}},{"__type__":"cc.Node","_name":"left","_parent":{"__id__":40},"_components":[{"__type__":"cc.Sprite","node":{"__id__":43},"_spriteFrame":{"__uuid__":"73lcvDzLBNWIH2ElsQuEBW"},"_sizeMode":0,"_isTrimmedMode":false},{"__type__":"cc.Widget","node":{"__id__":43},"alignMode":2,"_target":{"__id__":40},"_alignFlags":33,"_right":8,"_top":8},{"__type__":"cc.Button","node":{"__id__":43},"transition":1,"pressedColor":{"__type__":"cc.Color","r":204,"g":204,"b":204},"hoverColor":{"__type__":"cc.Color","g":255},"clickEvents":[{"__type__":"cc.ClickEvent","target":{"__id__":40},"component":"shiftlr","handler":"show"}],"_N$normalColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"_N$target":{"__id__":43}}],"_contentSize":{"__type__":"cc.Size","width":24,"height":24},"_position":{"__type__":"cc.Vec2","x":1075,"y":700}},{"__type__":"cc.Node","_name":"right","_parent":{"__id__":40},"_active":false,"_components":[{"__type__":"cc.Sprite","node":{"__id__":44},"_spriteFrame":{"__uuid__":"51VxMzvpxNt5Eude2ZcZ+H"},"_sizeMode":0,"_isTrimmedMode":false},{"__type__":"cc.Widget","node":{"__id__":44},"_wasAlignOnce":null,"isAlignOnce":null,"_target":{"__id__":40},"_alignFlags":33,"_right":164,"_top":32},{"__type__":"cc.Button","node":{"__id__":44},"transition":1,"pressedColor":{"__type__":"cc.Color","r":204,"g":204,"b":204},"hoverColor":{"__type__":"cc.Color","g":255},"clickEvents":[{"__type__":"cc.ClickEvent","target":{"__id__":40},"component":"shiftlr","handler":"hide"}],"_N$normalColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"_N$target":{"__id__":44}}],"_contentSize":{"__type__":"cc.Size","width":32,"height":32},"_position":{"__type__":"cc.Vec2","x":1170,"y":672}},{"__type__":"cc.Node","_name":"light_open","_parent":{"__id__":40},"_components":[{"__type__":"cc.Sprite","node":{"__id__":45},"_spriteFrame":{"__uuid__":"08MeXCe1dMHYedNdkzS63A"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":45},"transition":1,"pressedColor":{"__type__":"cc.Color","r":204,"g":204,"b":204},"hoverColor":{"__type__":"cc.Color","g":255},"clickEvents":[{"__type__":"cc.ClickEvent","target":{"__id__":2},"component":"controller","handler":"show_light"}],"_N$normalColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"_N$target":{"__id__":45}},{"__type__":"cc.Widget","node":{"__id__":45},"alignMode":2,"_target":{"__id__":40},"_alignFlags":16,"_horizontalCenter":96}],"_contentSize":{"__type__":"cc.Size","width":48,"height":48},"_position":{"__type__":"cc.Vec2","x":96,"y":756}},{"__type__":"cc.Node","_name":"light_close","_parent":{"__id__":40},"_components":[{"__type__":"cc.Sprite","node":{"__id__":46},"_spriteFrame":{"__uuid__":"39MpUyhd1KO5lqkP4gRjGL"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":46},"transition":1,"pressedColor":{"__type__":"cc.Color","r":204,"g":204,"b":204},"hoverColor":{"__type__":"cc.Color","g":255},"clickEvents":[{"__type__":"cc.ClickEvent","target":{"__id__":2},"component":"controller","handler":"hide_light"}],"_N$normalColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"_N$target":{"__id__":46}},{"__type__":"cc.Widget","node":{"__id__":46},"alignMode":2,"_target":{"__id__":40},"_alignFlags":16}],"_contentSize":{"__type__":"cc.Size","width":48,"height":48},"_position":{"__type__":"cc.Vec2","y":756}},{"__type__":"cc.Node","_name":"gird_open","_parent":{"__id__":40},"_components":[{"__type__":"cc.Sprite","node":{"__id__":47},"_spriteFrame":{"__uuid__":"fbP12mE1ZDtJzoZK4U6lSU"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":47},"transition":1,"pressedColor":{"__type__":"cc.Color","r":204,"g":204,"b":204},"hoverColor":{"__type__":"cc.Color","g":255},"clickEvents":[{"__type__":"cc.ClickEvent","target":{"__id__":2},"component":"controller","handler":"to_gird"}],"_N$normalColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"_N$target":{"__id__":47}},{"__type__":"cc.Widget","node":{"__id__":47},"alignMode":2,"_target":{"__id__":40},"_alignFlags":16,"_horizontalCenter":-96}],"_contentSize":{"__type__":"cc.Size","width":48,"height":48},"_position":{"__type__":"cc.Vec2","x":-96,"y":756}},{"__type__":"cc.Node","_name":"c1","_parent":{"__id__":39},"_components":[{"__id__":49},{"__type__":"cc.Button","node":{"__id__":48},"clickEvents":[{"__type__":"cc.ClickEvent","target":{"__id__":39},"component":"mc","handler":"set_0"}],"_N$target":{"__id__":48}}],"_color":{"__type__":"cc.Color","g":255,"b":235},"_contentSize":{"__type__":"cc.Size","width":100,"height":100},"_position":{"__type__":"cc.Vec2","x":-400}},{"__type__":"cc.Sprite","node":{"__id__":48},"_spriteFrame":{"__uuid__":"a2MjXRFdtLlYQ5ouAFv/+R"},"_sizeMode":0},{"__type__":"cc.Node","_name":"c2","_parent":{"__id__":39},"_components":[{"__id__":51},{"__type__":"cc.Button","node":{"__id__":50},"clickEvents":[{"__type__":"cc.ClickEvent","target":{"__id__":39},"component":"mc","handler":"set_1"}],"_N$target":{"__id__":50}}],"_color":{"__type__":"cc.Color","r":255,"g":119,"b":119},"_contentSize":{"__type__":"cc.Size","width":100,"height":100},"_position":{"__type__":"cc.Vec2","x":-300}},{"__type__":"cc.Sprite","node":{"__id__":50},"_spriteFrame":{"__uuid__":"a2MjXRFdtLlYQ5ouAFv/+R"},"_sizeMode":0},{"__type__":"cc.Node","_name":"c3","_parent":{"__id__":39},"_components":[{"__id__":53},{"__type__":"cc.Button","node":{"__id__":52},"clickEvents":[{"__type__":"cc.ClickEvent","target":{"__id__":39},"component":"mc","handler":"set_2"}],"_N$target":{"__id__":52}}],"_color":{"__type__":"cc.Color","r":99,"g":180,"b":255},"_contentSize":{"__type__":"cc.Size","width":100,"height":100},"_position":{"__type__":"cc.Vec2","x":-200}},{"__type__":"cc.Sprite","node":{"__id__":52},"_spriteFrame":{"__uuid__":"a2MjXRFdtLlYQ5ouAFv/+R"},"_sizeMode":0},{"__type__":"cc.Node","_name":"c4","_parent":{"__id__":39},"_components":[{"__id__":55},{"__type__":"cc.Button","node":{"__id__":54},"clickEvents":[{"__type__":"cc.ClickEvent","target":{"__id__":39},"component":"mc","handler":"set_3"}],"_N$target":{"__id__":54}}],"_color":{"__type__":"cc.Color","r":92,"b":255},"_contentSize":{"__type__":"cc.Size","width":100,"height":100},"_position":{"__type__":"cc.Vec2","x":-100}},{"__type__":"cc.Sprite","node":{"__id__":54},"_spriteFrame":{"__uuid__":"a2MjXRFdtLlYQ5ouAFv/+R"},"_sizeMode":0},{"__type__":"cc.Node","_name":"c5","_parent":{"__id__":39},"_components":[{"__id__":57},{"__type__":"cc.Button","node":{"__id__":56},"clickEvents":[{"__type__":"cc.ClickEvent","target":{"__id__":39},"component":"mc","handler":"set_4"}],"_N$target":{"__id__":56}}],"_contentSize":{"__type__":"cc.Size","width":100,"height":100}},{"__type__":"cc.Sprite","node":{"__id__":56},"_spriteFrame":{"__uuid__":"a2MjXRFdtLlYQ5ouAFv/+R"},"_sizeMode":0},{"__type__":"cc.Node","_name":"c6","_parent":{"__id__":39},"_components":[{"__id__":59},{"__type__":"cc.Button","node":{"__id__":58},"clickEvents":[{"__type__":"cc.ClickEvent","target":{"__id__":39},"component":"mc","handler":"set_5"}],"_N$target":{"__id__":58}}],"_contentSize":{"__type__":"cc.Size","width":64,"height":64},"_position":{"__type__":"cc.Vec2","x":100}},{"__type__":"cc.Sprite","node":{"__id__":58},"_spriteFrame":{"__uuid__":"b4Vu5hV55HcIAV2L1fo5H8"},"_sizeMode":0},{"__type__":"cc.Node","_name":"c7","_parent":{"__id__":39},"_components":[{"__id__":61},{"__type__":"cc.Button","node":{"__id__":60},"clickEvents":[{"__type__":"cc.ClickEvent","target":{"__id__":39},"component":"mc","handler":"set_6"}],"_N$target":{"__id__":60}}],"_contentSize":{"__type__":"cc.Size","width":64,"height":64},"_position":{"__type__":"cc.Vec2","x":200}},{"__type__":"cc.Sprite","node":{"__id__":60},"_spriteFrame":{"__uuid__":"e4G5S883RM47WPxkyuPCQ0"},"_sizeMode":0},{"__type__":"cc.Node","_name":"c8","_parent":{"__id__":39},"_components":[{"__id__":63},{"__type__":"cc.Button","node":{"__id__":62},"clickEvents":[{"__type__":"cc.ClickEvent","target":{"__id__":39},"component":"mc","handler":"set_7"}],"_N$target":{"__id__":62}}],"_contentSize":{"__type__":"cc.Size","width":64,"height":64},"_position":{"__type__":"cc.Vec2","x":300}},{"__type__":"cc.Sprite","node":{"__id__":62},"_spriteFrame":{"__uuid__":"65McWXN3tCy6LVKe64BuuS"},"_sizeMode":0},{"__type__":"cc.Node","_name":"c9","_parent":{"__id__":39},"_components":[{"__id__":65},{"__type__":"cc.Button","node":{"__id__":64},"clickEvents":[{"__type__":"cc.ClickEvent","target":{"__id__":39},"component":"mc","handler":"set_8"}],"_N$target":{"__id__":64}}],"_contentSize":{"__type__":"cc.Size","width":64,"height":64},"_position":{"__type__":"cc.Vec2","x":400}},{"__type__":"cc.Sprite","node":{"__id__":64},"_spriteFrame":{"__uuid__":"61jjCOw0ZBWLRWB/98eufd"},"_sizeMode":0},{"__type__":"cc.Node","_name":"skills_cover","_parent":{"__id__":39},"_components":[{"__type__":"cc.Sprite","node":{"__id__":66},"_spriteFrame":{"__uuid__":"cd/TmhtM9J66HH9njOEZ+H"},"_sizeMode":0}],"_opacity":180,"_contentSize":{"__type__":"cc.Size","width":910,"height":110}},{"__type__":"cc.Node","_name":"skilled","_parent":{"__id__":39},"_components":[{"__id__":68}],"_opacity":180,"_contentSize":{"__type__":"cc.Size","width":120,"height":120},"_position":{"__type__":"cc.Vec2","x":400}},{"__type__":"cc.Sprite","node":{"__id__":67},"_spriteFrame":{"__uuid__":"bd4f8weJ9FMqiEvMV+sn+n"},"_sizeMode":0},{"__type__":"cc.Node","_name":"refresh","_parent":{"__id__":39},"_components":[{"__type__":"cc.Sprite","node":{"__id__":69},"_spriteFrame":{"__uuid__":"75qd14DUdM8bm+GF3SMYaT"},"_sizeMode":0,"_isTrimmedMode":false},{"__type__":"cc.Button","node":{"__id__":69},"transition":1,"hoverColor":{"__type__":"cc.Color","r":61,"g":255},"clickEvents":[{"__type__":"cc.ClickEvent","target":{"__id__":39},"component":"mc","handler":"refresh"}],"_N$normalColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"_N$target":{"__id__":69}}],"_contentSize":{"__type__":"cc.Size","width":64,"height":64},"_position":{"__type__":"cc.Vec2","x":495.3,"y":-22.3}},{"__type__":"cc.Node","_name":"prof","_parent":{"__id__":38},"_components":[{"__type__":"cc.Sprite","node":{"__id__":70},"_spriteFrame":{"__uuid__":"a2MjXRFdtLlYQ5ouAFv/+R"},"_sizeMode":0}],"_anchorPoint":{"__type__":"cc.Vec2","y":0.5},"_contentSize":{"__type__":"cc.Size","width":900,"height":40},"_position":{"__type__":"cc.Vec2","x":1}},{"__type__":"cc.Node","_name":"stat2","_parent":{"__id__":23},"_active":false,"_components":[{"__type__":"cc.Label","node":{"__id__":71},"_useOriginalSize":false,"_actualFontSize":30,"_fontSize":30,"_N$string":"(calculating)","_N$horizontalAlign":2,"_N$verticalAlign":2},{"__type__":"cc.Widget","node":{"__id__":71},"_wasAlignOnce":null,"isAlignOnce":null,"_target":{"__id__":23},"_alignFlags":36,"_bottom":90}],"_color":{"__type__":"cc.Color","r":207,"g":183},"_anchorPoint":{"__type__":"cc.Vec2","x":1},"_contentSize":{"__type__":"cc.Size","width":162,"height":40},"_position":{"__type__":"cc.Vec2","x":150,"y":-630}},{"__type__":"cc.Node","_name":"light_pan","_parent":{"__id__":23},"_children":[{"__id__":73},{"__id__":92},{"__id__":98},{"__id__":124}],"_components":[{"__type__":"cc.Sprite","node":{"__id__":72},"_spriteFrame":{"__uuid__":"a2MjXRFdtLlYQ5ouAFv/+R"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":72},"_N$target":{"__id__":72}},{"__type__":"90b3at5d8FPDJEjfZXvwb7o","node":{"__id__":72},"light_R_slider":{"__id__":81},"light_G_slider":{"__id__":86},"light_B_slider":{"__id__":91},"light_H_slider":{"__id__":130},"light_TT_slider":{"__id__":104},"light_TF_slider":{"__id__":114},"light_FT_slider":{"__id__":109},"light_FF_slider":{"__id__":119},"bgs":{"__id__":98},"colors":{"__id__":73},"color_tog":{"__id__":97}},{"__type__":"cc.RigidBody","node":{"__id__":72}}],"_color":{"__type__":"cc.Color","r":80,"g":80,"b":80},"_contentSize":{"__type__":"cc.Size","width":300,"height":1078},"_position":{"__type__":"cc.Vec2","y":181}},{"__type__":"cc.Node","_name":"colors","_parent":{"__id__":72},"_children":[{"__id__":74},{"__id__":75},{"__id__":76},{"__id__":77},{"__id__":82},{"__id__":87}],"_position":{"__type__":"cc.Vec2","y":340}},{"__type__":"cc.Node","_name":"sun","_parent":{"__id__":73},"_components":[{"__type__":"cc.Sprite","node":{"__id__":74},"_spriteFrame":{"__uuid__":"08MeXCe1dMHYedNdkzS63A"},"_sizeMode":0}],"_contentSize":{"__type__":"cc.Size","width":64,"height":64},"_position":{"__type__":"cc.Vec2","x":-80,"y":-199}},{"__type__":"cc.Node","_name":"sun","_parent":{"__id__":73},"_components":[{"__type__":"cc.Sprite","node":{"__id__":75},"_spriteFrame":{"__uuid__":"08MeXCe1dMHYedNdkzS63A"},"_sizeMode":0}],"_contentSize":{"__type__":"cc.Size","width":64,"height":64},"_position":{"__type__":"cc.Vec2","y":-199}},{"__type__":"cc.Node","_name":"sun","_parent":{"__id__":73},"_components":[{"__type__":"cc.Sprite","node":{"__id__":76},"_spriteFrame":{"__uuid__":"08MeXCe1dMHYedNdkzS63A"},"_sizeMode":0}],"_contentSize":{"__type__":"cc.Size","width":64,"height":64},"_position":{"__type__":"cc.Vec2","x":80,"y":-199}},{"__type__":"cc.Node","_name":"slider","_parent":{"__id__":73},"_children":[{"__id__":78},{"__id__":79}],"_components":[{"__id__":81}],"_contentSize":{"__type__":"cc.Size","width":300,"height":20},"_rotationX":270,"_rotationY":270,"_position":{"__type__":"cc.Vec2","x":-80}},{"__type__":"cc.Node","_name":"Background","_parent":{"__id__":77},"_components":[{"__type__":"cc.Sprite","node":{"__id__":78},"_spriteFrame":{"__uuid__":"a2MjXRFdtLlYQ5ouAFv/+R"},"_sizeMode":0}],"_color":{"__type__":"cc.Color","r":255},"_contentSize":{"__type__":"cc.Size","width":300,"height":20}},{"__type__":"cc.Node","_name":"Handle","_parent":{"__id__":77},"_components":[{"__type__":"cc.Sprite","node":{"__id__":79},"_spriteFrame":{"__uuid__":"f0BIwQ8D5Ml7nTNQbh1YlS"},"_type":1,"_sizeMode":0},{"__id__":80}],"_contentSize":{"__type__":"cc.Size","width":20,"height":40},"_position":{"__type__":"cc.Vec2","x":150}},{"__type__":"cc.Button","node":{"__id__":79},"transition":2,"pressedColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"zoomScale":0.1,"_N$enableAutoGrayEffect":true,"_N$normalColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"_N$disabledColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"_N$normalSprite":{"__uuid__":"f0BIwQ8D5Ml7nTNQbh1YlS"},"_N$pressedSprite":{"__uuid__":"e97GVMl6JHh5Ml5qEDdSGa"},"pressedSprite":{"__uuid__":"e97GVMl6JHh5Ml5qEDdSGa"},"_N$hoverSprite":{"__uuid__":"e97GVMl6JHh5Ml5qEDdSGa"},"hoverSprite":{"__uuid__":"e97GVMl6JHh5Ml5qEDdSGa"},"_N$disabledSprite":{"__uuid__":"29FYIk+N1GYaeWH/q1NxQO"},"_N$target":{"__id__":79}},{"__type__":"cc.Slider","node":{"__id__":77},"slideEvents":[{"__type__":"cc.ClickEvent","target":{"__id__":72},"component":"lighter","handler":"reflush"}],"_N$handle":{"__id__":80},"_N$progress":1},{"__type__":"cc.Node","_name":"slider","_parent":{"__id__":73},"_children":[{"__id__":83},{"__id__":84}],"_components":[{"__id__":86}],"_contentSize":{"__type__":"cc.Size","width":300,"height":20},"_rotationX":270,"_rotationY":270},{"__type__":"cc.Node","_name":"Background","_parent":{"__id__":82},"_components":[{"__type__":"cc.Sprite","node":{"__id__":83},"_spriteFrame":{"__uuid__":"a2MjXRFdtLlYQ5ouAFv/+R"},"_sizeMode":0}],"_color":{"__type__":"cc.Color","g":255},"_contentSize":{"__type__":"cc.Size","width":300,"height":20}},{"__type__":"cc.Node","_name":"Handle","_parent":{"__id__":82},"_components":[{"__type__":"cc.Sprite","node":{"__id__":84},"_spriteFrame":{"__uuid__":"f0BIwQ8D5Ml7nTNQbh1YlS"},"_type":1,"_sizeMode":0},{"__id__":85}],"_contentSize":{"__type__":"cc.Size","width":20,"height":40},"_position":{"__type__":"cc.Vec2","x":150,"y":-1.1368683772161603e-13}},{"__type__":"cc.Button","node":{"__id__":84},"transition":2,"pressedColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"zoomScale":0.1,"_N$enableAutoGrayEffect":true,"_N$normalColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"_N$disabledColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"_N$normalSprite":{"__uuid__":"f0BIwQ8D5Ml7nTNQbh1YlS"},"_N$pressedSprite":{"__uuid__":"e97GVMl6JHh5Ml5qEDdSGa"},"pressedSprite":{"__uuid__":"e97GVMl6JHh5Ml5qEDdSGa"},"_N$hoverSprite":{"__uuid__":"e97GVMl6JHh5Ml5qEDdSGa"},"hoverSprite":{"__uuid__":"e97GVMl6JHh5Ml5qEDdSGa"},"_N$disabledSprite":{"__uuid__":"29FYIk+N1GYaeWH/q1NxQO"},"_N$target":{"__id__":84}},{"__type__":"cc.Slider","node":{"__id__":82},"slideEvents":[{"__type__":"cc.ClickEvent","target":{"__id__":72},"component":"lighter","handler":"reflush"}],"_N$handle":{"__id__":85},"_N$progress":1},{"__type__":"cc.Node","_name":"slider","_parent":{"__id__":73},"_children":[{"__id__":88},{"__id__":89}],"_components":[{"__id__":91}],"_contentSize":{"__type__":"cc.Size","width":300,"height":20},"_rotationX":270,"_rotationY":270,"_position":{"__type__":"cc.Vec2","x":80}},{"__type__":"cc.Node","_name":"Background","_parent":{"__id__":87},"_components":[{"__type__":"cc.Sprite","node":{"__id__":88},"_spriteFrame":{"__uuid__":"a2MjXRFdtLlYQ5ouAFv/+R"},"_sizeMode":0}],"_color":{"__type__":"cc.Color","b":255},"_contentSize":{"__type__":"cc.Size","width":300,"height":20}},{"__type__":"cc.Node","_name":"Handle","_parent":{"__id__":87},"_components":[{"__type__":"cc.Sprite","node":{"__id__":89},"_spriteFrame":{"__uuid__":"f0BIwQ8D5Ml7nTNQbh1YlS"},"_type":1,"_sizeMode":0},{"__id__":90}],"_contentSize":{"__type__":"cc.Size","width":20,"height":40},"_position":{"__type__":"cc.Vec2","x":150,"y":-1.1368683772161603e-13}},{"__type__":"cc.Button","node":{"__id__":89},"transition":2,"pressedColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"zoomScale":0.1,"_N$enableAutoGrayEffect":true,"_N$normalColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"_N$disabledColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"_N$normalSprite":{"__uuid__":"f0BIwQ8D5Ml7nTNQbh1YlS"},"_N$pressedSprite":{"__uuid__":"e97GVMl6JHh5Ml5qEDdSGa"},"pressedSprite":{"__uuid__":"e97GVMl6JHh5Ml5qEDdSGa"},"_N$hoverSprite":{"__uuid__":"e97GVMl6JHh5Ml5qEDdSGa"},"hoverSprite":{"__uuid__":"e97GVMl6JHh5Ml5qEDdSGa"},"_N$disabledSprite":{"__uuid__":"29FYIk+N1GYaeWH/q1NxQO"},"_N$target":{"__id__":89}},{"__type__":"cc.Slider","node":{"__id__":87},"slideEvents":[{"__type__":"cc.ClickEvent","target":{"__id__":72},"component":"lighter","handler":"reflush"}],"_N$handle":{"__id__":90},"_N$progress":1},{"__type__":"cc.Node","_name":"toggle1","_parent":{"__id__":72},"_children":[{"__id__":93},{"__id__":94},{"__id__":95}],"_components":[{"__id__":97}],"_anchorPoint":{"__type__":"cc.Vec2","y":0.5},"_contentSize":{"__type__":"cc.Size","width":150,"height":28},"_position":{"__type__":"cc.Vec2","x":-52,"y":64}},{"__type__":"cc.Node","_name":"label","_parent":{"__id__":92},"_components":[{"__type__":"cc.Label","node":{"__id__":93},"_useOriginalSize":false,"_N$string":"RGB","_N$horizontalAlign":1,"_N$verticalAlign":1}],"_contentSize":{"__type__":"cc.Size","width":87,"height":40},"_position":{"__type__":"cc.Vec2","x":74.2}},{"__type__":"cc.Node","_name":"Background","_parent":{"__id__":92},"_components":[{"__type__":"cc.Sprite","node":{"__id__":94},"_spriteFrame":{"__uuid__":"68J8oyAQdFUrqy37MXmbtE"}}],"_contentSize":{"__type__":"cc.Size","width":28,"height":28}},{"__type__":"cc.Node","_name":"checkmark","_parent":{"__id__":92},"_components":[{"__id__":96}],"_contentSize":{"__type__":"cc.Size","width":28,"height":28}},{"__type__":"cc.Sprite","node":{"__id__":95},"_spriteFrame":{"__uuid__":"90AErWL21A4ZPvtxQ3XG8G"},"_sizeMode":2,"_isTrimmedMode":false},{"__type__":"cc.Toggle","node":{"__id__":92},"transition":3,"_N$target":{"__id__":94},"checkMark":{"__id__":96},"checkEvents":[{"__type__":"cc.ClickEvent","target":{"__id__":72},"component":"lighter","handler":"on_shift"}]},{"__type__":"cc.Node","_name":"dec1","_parent":{"__id__":72},"_children":[{"__id__":99},{"__id__":120},{"__id__":121},{"__id__":122},{"__id__":123}],"_components":[{"__type__":"cc.Sprite","node":{"__id__":98},"_spriteFrame":{"__uuid__":"a2MjXRFdtLlYQ5ouAFv/+R"},"_sizeMode":0}],"_contentSize":{"__type__":"cc.Size","width":180,"height":180},"_position":{"__type__":"cc.Vec2","y":-150}},{"__type__":"cc.Node","_name":"toggleContainer","_parent":{"__id__":98},"_children":[{"__id__":100},{"__id__":105},{"__id__":110},{"__id__":115}],"_components":[{"__type__":"cc.ToggleContainer","node":{"__id__":99}}],"_contentSize":{"__type__":"cc.Size","width":180,"height":180}},{"__type__":"cc.Node","_name":"toggle1","_parent":{"__id__":99},"_children":[{"__id__":101},{"__id__":102}],"_components":[{"__id__":104}],"_contentSize":{"__type__":"cc.Size","width":41,"height":28},"_position":{"__type__":"cc.Vec2","x":-60,"y":60}},{"__type__":"cc.Node","_name":"Background","_parent":{"__id__":100},"_components":[{"__type__":"cc.Sprite","node":{"__id__":101},"_spriteFrame":{"__uuid__":"e7q6FL+VZEgLJUjVeDLic/"}}],"_contentSize":{"__type__":"cc.Size","width":28,"height":30}},{"__type__":"cc.Node","_name":"checkmark","_parent":{"__id__":100},"_components":[{"__id__":103}],"_contentSize":{"__type__":"cc.Size","width":32,"height":32}},{"__type__":"cc.Sprite","node":{"__id__":102},"_spriteFrame":{"__uuid__":"1aMvx28L1PZpgPVpKcDKCz"},"_sizeMode":2,"_isTrimmedMode":false},{"__type__":"cc.Toggle","node":{"__id__":100},"transition":3,"_N$target":{"__id__":100},"checkMark":{"__id__":103},"checkEvents":[{"__type__":"cc.ClickEvent","target":{"__id__":72},"component":"lighter","handler":"light_direction_0"}]},{"__type__":"cc.Node","_name":"toggle2","_parent":{"__id__":99},"_children":[{"__id__":106},{"__id__":107}],"_components":[{"__id__":109}],"_contentSize":{"__type__":"cc.Size","width":42,"height":28},"_position":{"__type__":"cc.Vec2","x":60,"y":60}},{"__type__":"cc.Node","_name":"Background","_parent":{"__id__":105},"_components":[{"__type__":"cc.Sprite","node":{"__id__":106},"_spriteFrame":{"__uuid__":"e7q6FL+VZEgLJUjVeDLic/"}}],"_contentSize":{"__type__":"cc.Size","width":28,"height":30}},{"__type__":"cc.Node","_name":"checkmark","_parent":{"__id__":105},"_active":false,"_components":[{"__id__":108}],"_contentSize":{"__type__":"cc.Size","width":32,"height":32}},{"__type__":"cc.Sprite","node":{"__id__":107},"_spriteFrame":{"__uuid__":"1aMvx28L1PZpgPVpKcDKCz"},"_sizeMode":2,"_isTrimmedMode":false},{"__type__":"cc.Toggle","node":{"__id__":105},"transition":3,"_N$target":{"__id__":105},"checkMark":{"__id__":108},"checkEvents":[{"__type__":"cc.ClickEvent","target":{"__id__":72},"component":"lighter","handler":"light_direction_1"}],"_N$isChecked":false},{"__type__":"cc.Node","_name":"toggle3","_parent":{"__id__":99},"_children":[{"__id__":111},{"__id__":112}],"_components":[{"__id__":114}],"_contentSize":{"__type__":"cc.Size","width":37,"height":28},"_position":{"__type__":"cc.Vec2","x":-60,"y":-60}},{"__type__":"cc.Node","_name":"Background","_parent":{"__id__":110},"_components":[{"__type__":"cc.Sprite","node":{"__id__":111},"_spriteFrame":{"__uuid__":"e7q6FL+VZEgLJUjVeDLic/"}}],"_contentSize":{"__type__":"cc.Size","width":28,"height":30}},{"__type__":"cc.Node","_name":"checkmark","_parent":{"__id__":110},"_active":false,"_components":[{"__id__":113}],"_contentSize":{"__type__":"cc.Size","width":32,"height":32}},{"__type__":"cc.Sprite","node":{"__id__":112},"_spriteFrame":{"__uuid__":"1aMvx28L1PZpgPVpKcDKCz"},"_sizeMode":2,"_isTrimmedMode":false},{"__type__":"cc.Toggle","node":{"__id__":110},"transition":3,"_N$target":{"__id__":110},"checkMark":{"__id__":113},"checkEvents":[{"__type__":"cc.ClickEvent","target":{"__id__":72},"component":"lighter","handler":"light_direction_2"}],"_N$isChecked":false},{"__type__":"cc.Node","_name":"toggle4","_parent":{"__id__":99},"_children":[{"__id__":116},{"__id__":117}],"_components":[{"__id__":119}],"_contentSize":{"__type__":"cc.Size","width":37,"height":28},"_position":{"__type__":"cc.Vec2","x":60,"y":-60}},{"__type__":"cc.Node","_name":"Background","_parent":{"__id__":115},"_components":[{"__type__":"cc.Sprite","node":{"__id__":116},"_spriteFrame":{"__uuid__":"e7q6FL+VZEgLJUjVeDLic/"}}],"_contentSize":{"__type__":"cc.Size","width":28,"height":30}},{"__type__":"cc.Node","_name":"checkmark","_parent":{"__id__":115},"_active":false,"_components":[{"__id__":118}],"_contentSize":{"__type__":"cc.Size","width":32,"height":32}},{"__type__":"cc.Sprite","node":{"__id__":117},"_spriteFrame":{"__uuid__":"1aMvx28L1PZpgPVpKcDKCz"},"_sizeMode":2,"_isTrimmedMode":false},{"__type__":"cc.Toggle","node":{"__id__":115},"transition":3,"_N$target":{"__id__":115},"checkMark":{"__id__":118},"checkEvents":[{"__type__":"cc.ClickEvent","target":{"__id__":72},"component":"lighter","handler":"light_direction_3"}],"_N$isChecked":false},{"__type__":"cc.Node","_name":"sun","_parent":{"__id__":98},"_components":[{"__type__":"cc.Sprite","node":{"__id__":120},"_spriteFrame":{"__uuid__":"08MeXCe1dMHYedNdkzS63A"},"_sizeMode":0}],"_contentSize":{"__type__":"cc.Size","width":64,"height":64},"_position":{"__type__":"cc.Vec2","x":-110,"y":110}},{"__type__":"cc.Node","_name":"sun","_parent":{"__id__":98},"_components":[{"__type__":"cc.Sprite","node":{"__id__":121},"_spriteFrame":{"__uuid__":"08MeXCe1dMHYedNdkzS63A"},"_sizeMode":0}],"_contentSize":{"__type__":"cc.Size","width":64,"height":64},"_position":{"__type__":"cc.Vec2","x":110,"y":110}},{"__type__":"cc.Node","_name":"sun","_parent":{"__id__":98},"_components":[{"__type__":"cc.Sprite","node":{"__id__":122},"_spriteFrame":{"__uuid__":"08MeXCe1dMHYedNdkzS63A"},"_sizeMode":0}],"_contentSize":{"__type__":"cc.Size","width":64,"height":64},"_position":{"__type__":"cc.Vec2","x":-110,"y":-110}},{"__type__":"cc.Node","_name":"sun","_parent":{"__id__":98},"_components":[{"__type__":"cc.Sprite","node":{"__id__":123},"_spriteFrame":{"__uuid__":"08MeXCe1dMHYedNdkzS63A"},"_sizeMode":0}],"_contentSize":{"__type__":"cc.Size","width":64,"height":64},"_position":{"__type__":"cc.Vec2","x":110,"y":-110}},{"__type__":"cc.Node","_name":"slider","_parent":{"__id__":72},"_children":[{"__id__":125},{"__id__":126},{"__id__":127},{"__id__":128}],"_components":[{"__id__":130}],"_contentSize":{"__type__":"cc.Size","width":200,"height":20},"_position":{"__type__":"cc.Vec2","x":9.9,"y":-420}},{"__type__":"cc.Node","_name":"sun","_parent":{"__id__":124},"_components":[{"__type__":"cc.Sprite","node":{"__id__":125},"_spriteFrame":{"__uuid__":"08MeXCe1dMHYedNdkzS63A"},"_sizeMode":0}],"_contentSize":{"__type__":"cc.Size","width":32,"height":32},"_position":{"__type__":"cc.Vec2","x":-124,"y":1}},{"__type__":"cc.Node","_name":"sun","_parent":{"__id__":124},"_components":[{"__type__":"cc.Sprite","node":{"__id__":126},"_spriteFrame":{"__uuid__":"08MeXCe1dMHYedNdkzS63A"},"_sizeMode":0}],"_contentSize":{"__type__":"cc.Size","width":86,"height":86},"_position":{"__type__":"cc.Vec2","x":85,"y":67}},{"__type__":"cc.Node","_name":"Background","_parent":{"__id__":124},"_components":[{"__type__":"cc.Sprite","node":{"__id__":127},"_spriteFrame":{"__uuid__":"a2MjXRFdtLlYQ5ouAFv/+R"},"_sizeMode":0}],"_color":{"__type__":"cc.Color","r":121,"g":121,"b":121},"_contentSize":{"__type__":"cc.Size","width":200,"height":20},"_position":{"__type__":"cc.Vec2","y":1}},{"__type__":"cc.Node","_name":"Handle","_parent":{"__id__":124},"_components":[{"__type__":"cc.Sprite","node":{"__id__":128},"_spriteFrame":{"__uuid__":"f0BIwQ8D5Ml7nTNQbh1YlS"},"_type":1,"_sizeMode":0},{"__id__":129}],"_contentSize":{"__type__":"cc.Size","width":20,"height":40},"_position":{"__type__":"cc.Vec2","x":-60,"y":1}},{"__type__":"cc.Button","node":{"__id__":128},"transition":2,"pressedColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"zoomScale":0.1,"_N$enableAutoGrayEffect":true,"_N$normalColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"_N$disabledColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"_N$normalSprite":{"__uuid__":"f0BIwQ8D5Ml7nTNQbh1YlS"},"_N$pressedSprite":{"__uuid__":"e97GVMl6JHh5Ml5qEDdSGa"},"pressedSprite":{"__uuid__":"e97GVMl6JHh5Ml5qEDdSGa"},"_N$hoverSprite":{"__uuid__":"e97GVMl6JHh5Ml5qEDdSGa"},"hoverSprite":{"__uuid__":"e97GVMl6JHh5Ml5qEDdSGa"},"_N$disabledSprite":{"__uuid__":"29FYIk+N1GYaeWH/q1NxQO"},"_N$target":{"__id__":128}},{"__type__":"cc.Slider","node":{"__id__":124},"slideEvents":[{"__type__":"cc.ClickEvent","target":{"__id__":72},"component":"lighter","handler":"reflush"}],"_N$handle":{"__id__":129},"_N$progress":0.2},{"__type__":"cc.Node","_name":"zuo","_parent":{"__id__":3},"_children":[{"__id__":132},{"__id__":133},{"__id__":134},{"__id__":168},{"__id__":180},{"__id__":183},{"__id__":184}],"_components":[{"__type__":"cc.Sprite","node":{"__id__":131},"_spriteFrame":{"__uuid__":"a2MjXRFdtLlYQ5ouAFv/+R"},"_sizeMode":0},{"__type__":"cc.Widget","node":{"__id__":131},"alignMode":2,"_target":{"__id__":3},"_alignFlags":13,"_right":875,"_originalWidth":100,"_originalHeight":100},{"__type__":"8c11b3zCbJK37zCkjWNkHWp","node":{"__id__":131},"bigFaceNode":{"__id__":133},"faceNodes":[{"__id__":136},{"__id__":137},{"__id__":138},{"__id__":139},{"__id__":140},{"__id__":141},{"__id__":142},{"__id__":143},{"__id__":144},{"__id__":145},{"__id__":146},{"__id__":147},{"__id__":148},{"__id__":149},{"__id__":150},{"__id__":151},{"__id__":152},{"__id__":153},{"__id__":154},{"__id__":155},{"__id__":156},{"__id__":157},{"__id__":158},{"__id__":159},{"__id__":160},{"__id__":161},{"__id__":162},{"__id__":163},{"__id__":164},{"__id__":165},{"__id__":166},{"__id__":167}]}],"_color":{"__type__":"cc.Color","r":80,"g":80,"b":80},"_anchorPoint":{"__type__":"cc.Vec2","y":1},"_contentSize":{"__type__":"cc.Size","width":300,"height":1440},"_position":{"__type__":"cc.Vec2","x":-1500,"y":720}},{"__type__":"cc.Node","_name":"logo","_parent":{"__id__":131},"_components":[{"__type__":"cc.Label","node":{"__id__":132},"_useOriginalSize":false,"_actualFontSize":24,"_fontSize":24,"_lineHeight":24,"_N$string":"Style2Paints","_N$verticalAlign":2},{"__type__":"cc.Widget","node":{"__id__":132},"alignMode":2,"_target":{"__id__":131},"_alignFlags":12,"_left":15,"_bottom":10,"_originalWidth":259}],"_color":{"__type__":"cc.Color","r":124,"g":124,"b":124},"_anchorPoint":{"__type__":"cc.Vec2"},"_contentSize":{"__type__":"cc.Size","width":133,"height":24},"_position":{"__type__":"cc.Vec2","x":15,"y":-1430}},{"__type__":"cc.Node","_name":"big_style","_parent":{"__id__":131},"_components":[{"__type__":"cc.Sprite","node":{"__id__":133},"_spriteFrame":{"__uuid__":"c7PZTRM5VBqKm9Nbz2Yepi"},"_sizeMode":0}],"_contentSize":{"__type__":"cc.Size","width":240,"height":240},"_position":{"__type__":"cc.Vec2","x":150,"y":-150}},{"__type__":"cc.Node","_name":"styles","_parent":{"__id__":131},"_children":[{"__id__":135},{"__id__":136},{"__id__":137},{"__id__":138},{"__id__":139},{"__id__":140},{"__id__":141},{"__id__":142},{"__id__":143},{"__id__":144},{"__id__":145},{"__id__":146},{"__id__":147},{"__id__":148},{"__id__":149},{"__id__":150},{"__id__":151},{"__id__":152},{"__id__":153},{"__id__":154},{"__id__":155},{"__id__":156},{"__id__":157},{"__id__":158},{"__id__":159},{"__id__":160},{"__id__":161},{"__id__":162},{"__id__":163},{"__id__":164},{"__id__":165},{"__id__":166},{"__id__":167}],"_position":{"__type__":"cc.Vec2","y":-22}},{"__type__":"cc.Node","_name":"upload_img","_parent":{"__id__":134},"_components":[{"__type__":"cc.Sprite","node":{"__id__":135},"_spriteFrame":{"__uuid__":"3d7rWwYtBD3p3bKpT7hPYw"},"_type":1,"_sizeMode":0,"_isTrimmedMode":false},{"__type__":"cc.Button","node":{"__id__":135},"transition":1,"hoverColor":{"__type__":"cc.Color","g":255},"clickEvents":[{"__type__":"cc.ClickEvent","target":{"__id__":131},"component":"faceSelector","handler":"on_upload"}],"_N$target":{"__id__":135}}],"_color":{"__type__":"cc.Color","r":214,"g":214,"b":214},"_contentSize":{"__type__":"cc.Size","width":80,"height":80},"_position":{"__type__":"cc.Vec2","x":245,"y":-1321}},{"__type__":"cc.Node","_name":"small_style","_parent":{"__id__":134},"_components":[{"__type__":"cc.Sprite","node":{"__id__":136},"_spriteFrame":{"__uuid__":"c7PZTRM5VBqKm9Nbz2Yepi"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":136},"transition":1,"hoverColor":{"__type__":"cc.Color","r":148,"g":148,"b":148},"_N$normalColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"_N$target":{"__id__":136}}],"_contentSize":{"__type__":"cc.Size","width":80,"height":80},"_position":{"__type__":"cc.Vec2","x":55,"y":-321}},{"__type__":"cc.Node","_name":"small_style","_parent":{"__id__":134},"_components":[{"__type__":"cc.Sprite","node":{"__id__":137},"_spriteFrame":{"__uuid__":"c7PZTRM5VBqKm9Nbz2Yepi"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":137},"transition":1,"hoverColor":{"__type__":"cc.Color","r":148,"g":148,"b":148},"_N$normalColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"_N$target":{"__id__":137}}],"_contentSize":{"__type__":"cc.Size","width":80,"height":80},"_position":{"__type__":"cc.Vec2","x":150,"y":-321}},{"__type__":"cc.Node","_name":"small_style","_parent":{"__id__":134},"_components":[{"__type__":"cc.Sprite","node":{"__id__":138},"_spriteFrame":{"__uuid__":"c7PZTRM5VBqKm9Nbz2Yepi"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":138},"transition":1,"hoverColor":{"__type__":"cc.Color","r":148,"g":148,"b":148},"_N$normalColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"_N$target":{"__id__":138}}],"_contentSize":{"__type__":"cc.Size","width":80,"height":80},"_position":{"__type__":"cc.Vec2","x":245,"y":-321}},{"__type__":"cc.Node","_name":"small_style","_parent":{"__id__":134},"_components":[{"__type__":"cc.Sprite","node":{"__id__":139},"_spriteFrame":{"__uuid__":"c7PZTRM5VBqKm9Nbz2Yepi"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":139},"transition":1,"hoverColor":{"__type__":"cc.Color","r":148,"g":148,"b":148},"_N$normalColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"_N$target":{"__id__":139}}],"_contentSize":{"__type__":"cc.Size","width":80,"height":80},"_position":{"__type__":"cc.Vec2","x":55,"y":-421}},{"__type__":"cc.Node","_name":"small_style","_parent":{"__id__":134},"_components":[{"__type__":"cc.Sprite","node":{"__id__":140},"_spriteFrame":{"__uuid__":"c7PZTRM5VBqKm9Nbz2Yepi"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":140},"transition":1,"hoverColor":{"__type__":"cc.Color","r":148,"g":148,"b":148},"_N$normalColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"_N$target":{"__id__":140}}],"_contentSize":{"__type__":"cc.Size","width":80,"height":80},"_position":{"__type__":"cc.Vec2","x":150,"y":-421}},{"__type__":"cc.Node","_name":"small_style","_parent":{"__id__":134},"_components":[{"__type__":"cc.Sprite","node":{"__id__":141},"_spriteFrame":{"__uuid__":"c7PZTRM5VBqKm9Nbz2Yepi"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":141},"transition":1,"hoverColor":{"__type__":"cc.Color","r":148,"g":148,"b":148},"_N$normalColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"_N$target":{"__id__":141}}],"_contentSize":{"__type__":"cc.Size","width":80,"height":80},"_position":{"__type__":"cc.Vec2","x":245,"y":-421}},{"__type__":"cc.Node","_name":"small_style","_parent":{"__id__":134},"_components":[{"__type__":"cc.Sprite","node":{"__id__":142},"_spriteFrame":{"__uuid__":"c7PZTRM5VBqKm9Nbz2Yepi"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":142},"transition":1,"hoverColor":{"__type__":"cc.Color","r":148,"g":148,"b":148},"_N$normalColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"_N$target":{"__id__":142}}],"_contentSize":{"__type__":"cc.Size","width":80,"height":80},"_position":{"__type__":"cc.Vec2","x":55,"y":-521}},{"__type__":"cc.Node","_name":"small_style","_parent":{"__id__":134},"_components":[{"__type__":"cc.Sprite","node":{"__id__":143},"_spriteFrame":{"__uuid__":"c7PZTRM5VBqKm9Nbz2Yepi"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":143},"transition":1,"hoverColor":{"__type__":"cc.Color","r":148,"g":148,"b":148},"_N$normalColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"_N$target":{"__id__":143}}],"_contentSize":{"__type__":"cc.Size","width":80,"height":80},"_position":{"__type__":"cc.Vec2","x":150,"y":-521}},{"__type__":"cc.Node","_name":"small_style","_parent":{"__id__":134},"_components":[{"__type__":"cc.Sprite","node":{"__id__":144},"_spriteFrame":{"__uuid__":"c7PZTRM5VBqKm9Nbz2Yepi"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":144},"transition":1,"hoverColor":{"__type__":"cc.Color","r":148,"g":148,"b":148},"_N$normalColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"_N$target":{"__id__":144}}],"_contentSize":{"__type__":"cc.Size","width":80,"height":80},"_position":{"__type__":"cc.Vec2","x":245,"y":-521}},{"__type__":"cc.Node","_name":"small_style","_parent":{"__id__":134},"_components":[{"__type__":"cc.Sprite","node":{"__id__":145},"_spriteFrame":{"__uuid__":"c7PZTRM5VBqKm9Nbz2Yepi"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":145},"transition":1,"hoverColor":{"__type__":"cc.Color","r":148,"g":148,"b":148},"_N$normalColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"_N$target":{"__id__":145}}],"_contentSize":{"__type__":"cc.Size","width":80,"height":80},"_position":{"__type__":"cc.Vec2","x":55,"y":-621}},{"__type__":"cc.Node","_name":"small_style","_parent":{"__id__":134},"_components":[{"__type__":"cc.Sprite","node":{"__id__":146},"_spriteFrame":{"__uuid__":"c7PZTRM5VBqKm9Nbz2Yepi"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":146},"transition":1,"hoverColor":{"__type__":"cc.Color","r":148,"g":148,"b":148},"_N$normalColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"_N$target":{"__id__":146}}],"_contentSize":{"__type__":"cc.Size","width":80,"height":80},"_position":{"__type__":"cc.Vec2","x":150,"y":-621}},{"__type__":"cc.Node","_name":"small_style","_parent":{"__id__":134},"_components":[{"__type__":"cc.Sprite","node":{"__id__":147},"_spriteFrame":{"__uuid__":"c7PZTRM5VBqKm9Nbz2Yepi"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":147},"transition":1,"hoverColor":{"__type__":"cc.Color","r":148,"g":148,"b":148},"_N$normalColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"_N$target":{"__id__":147}}],"_contentSize":{"__type__":"cc.Size","width":80,"height":80},"_position":{"__type__":"cc.Vec2","x":245,"y":-621}},{"__type__":"cc.Node","_name":"small_style","_parent":{"__id__":134},"_components":[{"__type__":"cc.Sprite","node":{"__id__":148},"_spriteFrame":{"__uuid__":"c7PZTRM5VBqKm9Nbz2Yepi"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":148},"transition":1,"hoverColor":{"__type__":"cc.Color","r":148,"g":148,"b":148},"_N$normalColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"_N$target":{"__id__":148}}],"_contentSize":{"__type__":"cc.Size","width":80,"height":80},"_position":{"__type__":"cc.Vec2","x":55,"y":-721}},{"__type__":"cc.Node","_name":"small_style","_parent":{"__id__":134},"_components":[{"__type__":"cc.Sprite","node":{"__id__":149},"_spriteFrame":{"__uuid__":"c7PZTRM5VBqKm9Nbz2Yepi"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":149},"transition":1,"hoverColor":{"__type__":"cc.Color","r":148,"g":148,"b":148},"_N$normalColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"_N$target":{"__id__":149}}],"_contentSize":{"__type__":"cc.Size","width":80,"height":80},"_position":{"__type__":"cc.Vec2","x":150,"y":-721}},{"__type__":"cc.Node","_name":"small_style","_parent":{"__id__":134},"_components":[{"__type__":"cc.Sprite","node":{"__id__":150},"_spriteFrame":{"__uuid__":"c7PZTRM5VBqKm9Nbz2Yepi"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":150},"transition":1,"hoverColor":{"__type__":"cc.Color","r":148,"g":148,"b":148},"_N$normalColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"_N$target":{"__id__":150}}],"_contentSize":{"__type__":"cc.Size","width":80,"height":80},"_position":{"__type__":"cc.Vec2","x":245,"y":-721}},{"__type__":"cc.Node","_name":"small_style","_parent":{"__id__":134},"_components":[{"__type__":"cc.Sprite","node":{"__id__":151},"_spriteFrame":{"__uuid__":"c7PZTRM5VBqKm9Nbz2Yepi"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":151},"transition":1,"hoverColor":{"__type__":"cc.Color","r":148,"g":148,"b":148},"_N$normalColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"_N$target":{"__id__":151}}],"_contentSize":{"__type__":"cc.Size","width":80,"height":80},"_position":{"__type__":"cc.Vec2","x":55,"y":-821}},{"__type__":"cc.Node","_name":"small_style","_parent":{"__id__":134},"_components":[{"__type__":"cc.Sprite","node":{"__id__":152},"_spriteFrame":{"__uuid__":"c7PZTRM5VBqKm9Nbz2Yepi"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":152},"transition":1,"hoverColor":{"__type__":"cc.Color","r":148,"g":148,"b":148},"_N$normalColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"_N$target":{"__id__":152}}],"_contentSize":{"__type__":"cc.Size","width":80,"height":80},"_position":{"__type__":"cc.Vec2","x":150,"y":-821}},{"__type__":"cc.Node","_name":"small_style","_parent":{"__id__":134},"_components":[{"__type__":"cc.Sprite","node":{"__id__":153},"_spriteFrame":{"__uuid__":"c7PZTRM5VBqKm9Nbz2Yepi"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":153},"transition":1,"hoverColor":{"__type__":"cc.Color","r":148,"g":148,"b":148},"_N$normalColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"_N$target":{"__id__":153}}],"_contentSize":{"__type__":"cc.Size","width":80,"height":80},"_position":{"__type__":"cc.Vec2","x":245,"y":-821}},{"__type__":"cc.Node","_name":"small_style","_parent":{"__id__":134},"_components":[{"__type__":"cc.Sprite","node":{"__id__":154},"_spriteFrame":{"__uuid__":"c7PZTRM5VBqKm9Nbz2Yepi"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":154},"transition":1,"hoverColor":{"__type__":"cc.Color","r":148,"g":148,"b":148},"_N$normalColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"_N$target":{"__id__":154}}],"_contentSize":{"__type__":"cc.Size","width":80,"height":80},"_position":{"__type__":"cc.Vec2","x":55,"y":-921}},{"__type__":"cc.Node","_name":"small_style","_parent":{"__id__":134},"_components":[{"__type__":"cc.Sprite","node":{"__id__":155},"_spriteFrame":{"__uuid__":"c7PZTRM5VBqKm9Nbz2Yepi"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":155},"transition":1,"hoverColor":{"__type__":"cc.Color","r":148,"g":148,"b":148},"_N$normalColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"_N$target":{"__id__":155}}],"_contentSize":{"__type__":"cc.Size","width":80,"height":80},"_position":{"__type__":"cc.Vec2","x":150,"y":-921}},{"__type__":"cc.Node","_name":"small_style","_parent":{"__id__":134},"_components":[{"__type__":"cc.Sprite","node":{"__id__":156},"_spriteFrame":{"__uuid__":"c7PZTRM5VBqKm9Nbz2Yepi"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":156},"transition":1,"hoverColor":{"__type__":"cc.Color","r":148,"g":148,"b":148},"_N$normalColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"_N$target":{"__id__":156}}],"_contentSize":{"__type__":"cc.Size","width":80,"height":80},"_position":{"__type__":"cc.Vec2","x":245,"y":-921}},{"__type__":"cc.Node","_name":"small_style","_parent":{"__id__":134},"_components":[{"__type__":"cc.Sprite","node":{"__id__":157},"_spriteFrame":{"__uuid__":"c7PZTRM5VBqKm9Nbz2Yepi"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":157},"transition":1,"hoverColor":{"__type__":"cc.Color","r":148,"g":148,"b":148},"_N$normalColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"_N$target":{"__id__":157}}],"_contentSize":{"__type__":"cc.Size","width":80,"height":80},"_position":{"__type__":"cc.Vec2","x":55,"y":-1021}},{"__type__":"cc.Node","_name":"small_style","_parent":{"__id__":134},"_components":[{"__type__":"cc.Sprite","node":{"__id__":158},"_spriteFrame":{"__uuid__":"c7PZTRM5VBqKm9Nbz2Yepi"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":158},"transition":1,"hoverColor":{"__type__":"cc.Color","r":148,"g":148,"b":148},"_N$normalColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"_N$target":{"__id__":158}}],"_contentSize":{"__type__":"cc.Size","width":80,"height":80},"_position":{"__type__":"cc.Vec2","x":150,"y":-1021}},{"__type__":"cc.Node","_name":"small_style","_parent":{"__id__":134},"_components":[{"__type__":"cc.Sprite","node":{"__id__":159},"_spriteFrame":{"__uuid__":"c7PZTRM5VBqKm9Nbz2Yepi"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":159},"transition":1,"hoverColor":{"__type__":"cc.Color","r":148,"g":148,"b":148},"_N$normalColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"_N$target":{"__id__":159}}],"_contentSize":{"__type__":"cc.Size","width":80,"height":80},"_position":{"__type__":"cc.Vec2","x":245,"y":-1021}},{"__type__":"cc.Node","_name":"small_style","_parent":{"__id__":134},"_components":[{"__type__":"cc.Sprite","node":{"__id__":160},"_spriteFrame":{"__uuid__":"c7PZTRM5VBqKm9Nbz2Yepi"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":160},"transition":1,"hoverColor":{"__type__":"cc.Color","r":148,"g":148,"b":148},"_N$normalColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"_N$target":{"__id__":160}}],"_contentSize":{"__type__":"cc.Size","width":80,"height":80},"_position":{"__type__":"cc.Vec2","x":55,"y":-1121}},{"__type__":"cc.Node","_name":"small_style","_parent":{"__id__":134},"_components":[{"__type__":"cc.Sprite","node":{"__id__":161},"_spriteFrame":{"__uuid__":"c7PZTRM5VBqKm9Nbz2Yepi"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":161},"transition":1,"hoverColor":{"__type__":"cc.Color","r":148,"g":148,"b":148},"_N$normalColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"_N$target":{"__id__":161}}],"_contentSize":{"__type__":"cc.Size","width":80,"height":80},"_position":{"__type__":"cc.Vec2","x":150,"y":-1121}},{"__type__":"cc.Node","_name":"small_style","_parent":{"__id__":134},"_components":[{"__type__":"cc.Sprite","node":{"__id__":162},"_spriteFrame":{"__uuid__":"c7PZTRM5VBqKm9Nbz2Yepi"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":162},"transition":1,"hoverColor":{"__type__":"cc.Color","r":148,"g":148,"b":148},"_N$normalColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"_N$target":{"__id__":162}}],"_contentSize":{"__type__":"cc.Size","width":80,"height":80},"_position":{"__type__":"cc.Vec2","x":245,"y":-1121}},{"__type__":"cc.Node","_name":"small_style","_parent":{"__id__":134},"_components":[{"__type__":"cc.Sprite","node":{"__id__":163},"_spriteFrame":{"__uuid__":"c7PZTRM5VBqKm9Nbz2Yepi"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":163},"transition":1,"hoverColor":{"__type__":"cc.Color","r":148,"g":148,"b":148},"_N$normalColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"_N$target":{"__id__":163}}],"_contentSize":{"__type__":"cc.Size","width":80,"height":80},"_position":{"__type__":"cc.Vec2","x":55,"y":-1221}},{"__type__":"cc.Node","_name":"small_style","_parent":{"__id__":134},"_components":[{"__type__":"cc.Sprite","node":{"__id__":164},"_spriteFrame":{"__uuid__":"c7PZTRM5VBqKm9Nbz2Yepi"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":164},"transition":1,"hoverColor":{"__type__":"cc.Color","r":148,"g":148,"b":148},"_N$normalColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"_N$target":{"__id__":164}}],"_contentSize":{"__type__":"cc.Size","width":80,"height":80},"_position":{"__type__":"cc.Vec2","x":150,"y":-1221}},{"__type__":"cc.Node","_name":"small_style","_parent":{"__id__":134},"_components":[{"__type__":"cc.Sprite","node":{"__id__":165},"_spriteFrame":{"__uuid__":"c7PZTRM5VBqKm9Nbz2Yepi"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":165},"transition":1,"hoverColor":{"__type__":"cc.Color","r":148,"g":148,"b":148},"_N$normalColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"_N$target":{"__id__":165}}],"_contentSize":{"__type__":"cc.Size","width":80,"height":80},"_position":{"__type__":"cc.Vec2","x":245,"y":-1221}},{"__type__":"cc.Node","_name":"small_style","_parent":{"__id__":134},"_components":[{"__type__":"cc.Sprite","node":{"__id__":166},"_spriteFrame":{"__uuid__":"c7PZTRM5VBqKm9Nbz2Yepi"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":166},"transition":1,"hoverColor":{"__type__":"cc.Color","r":148,"g":148,"b":148},"_N$normalColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"_N$target":{"__id__":166}}],"_contentSize":{"__type__":"cc.Size","width":80,"height":80},"_position":{"__type__":"cc.Vec2","x":55,"y":-1321}},{"__type__":"cc.Node","_name":"small_style","_parent":{"__id__":134},"_components":[{"__type__":"cc.Sprite","node":{"__id__":167},"_spriteFrame":{"__uuid__":"c7PZTRM5VBqKm9Nbz2Yepi"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":167},"transition":1,"hoverColor":{"__type__":"cc.Color","r":148,"g":148,"b":148},"_N$normalColor":{"__type__":"cc.Color","r":255,"g":255,"b":255},"_N$target":{"__id__":167}}],"_contentSize":{"__type__":"cc.Size","width":80,"height":80},"_position":{"__type__":"cc.Vec2","x":150,"y":-1321}},{"__type__":"cc.Node","_name":"toggleContainer","_parent":{"__id__":131},"_children":[{"__id__":169},{"__id__":170},{"__id__":171},{"__id__":176}],"_components":[{"__type__":"cc.ToggleContainer","node":{"__id__":168}}],"_position":{"__type__":"cc.Vec2","x":44,"y":-298.1}},{"__type__":"cc.Node","_name":"label","_parent":{"__id__":168},"_components":[{"__type__":"cc.Label","node":{"__id__":169},"_useOriginalSize":false,"_actualFontSize":32,"_fontSize":32,"_lineHeight":32,"_N$string":"careful","_N$horizontalAlign":1,"_N$verticalAlign":1}],"_contentSize":{"__type__":"cc.Size","width":96,"height":32},"_position":{"__type__":"cc.Vec2","x":-326,"y":-94}},{"__type__":"cc.Node","_name":"label","_parent":{"__id__":168},"_components":[{"__type__":"cc.Label","node":{"__id__":170},"_useOriginalSize":false,"_actualFontSize":32,"_fontSize":32,"_lineHeight":32,"_N$string":"careless","_N$horizontalAlign":1,"_N$verticalAlign":1}],"_contentSize":{"__type__":"cc.Size","width":119,"height":32},"_position":{"__type__":"cc.Vec2","x":-177,"y":-94}},{"__type__":"cc.Node","_name":"toggle1","_parent":{"__id__":168},"_children":[{"__id__":172},{"__id__":173}],"_components":[{"__id__":175}],"_anchorPoint":{"__type__":"cc.Vec2","x":0.1,"y":0.5},"_contentSize":{"__type__":"cc.Size","width":150,"height":28},"_scaleX":0.8,"_scaleY":0.8,"_position":{"__type__":"cc.Vec2","x":-391,"y":-96}},{"__type__":"cc.Node","_name":"Background","_parent":{"__id__":171},"_components":[{"__type__":"cc.Sprite","node":{"__id__":172},"_spriteFrame":{"__uuid__":"e7q6FL+VZEgLJUjVeDLic/"}}],"_contentSize":{"__type__":"cc.Size","width":28,"height":30}},{"__type__":"cc.Node","_name":"checkmark","_parent":{"__id__":171},"_components":[{"__id__":174}],"_contentSize":{"__type__":"cc.Size","width":32,"height":32}},{"__type__":"cc.Sprite","node":{"__id__":173},"_spriteFrame":{"__uuid__":"1aMvx28L1PZpgPVpKcDKCz"},"_sizeMode":2,"_isTrimmedMode":false},{"__type__":"cc.Toggle","node":{"__id__":171},"transition":3,"_N$target":{"__id__":171},"checkMark":{"__id__":174},"checkEvents":[{"__type__":"cc.ClickEvent","target":{"__id__":131},"component":"faceSelector","handler":"on_toggle_v4v2"}]},{"__type__":"cc.Node","_name":"toggle2","_parent":{"__id__":168},"_children":[{"__id__":177},{"__id__":178}],"_components":[{"__type__":"cc.Toggle","node":{"__id__":176},"transition":3,"_N$target":{"__id__":176},"checkMark":{"__id__":179},"checkEvents":[{"__type__":"cc.ClickEvent","target":{"__id__":131},"component":"faceSelector","handler":"on_toggle_v4v2"}],"_N$isChecked":false}],"_anchorPoint":{"__type__":"cc.Vec2","x":0.05,"y":0.5},"_contentSize":{"__type__":"cc.Size","width":180,"height":28},"_scaleX":0.8,"_scaleY":0.8,"_position":{"__type__":"cc.Vec2","x":-252,"y":-96}},{"__type__":"cc.Node","_name":"Background","_parent":{"__id__":176},"_components":[{"__type__":"cc.Sprite","node":{"__id__":177},"_spriteFrame":{"__uuid__":"e7q6FL+VZEgLJUjVeDLic/"}}],"_contentSize":{"__type__":"cc.Size","width":28,"height":30}},{"__type__":"cc.Node","_name":"checkmark","_parent":{"__id__":176},"_active":false,"_components":[{"__id__":179}],"_contentSize":{"__type__":"cc.Size","width":32,"height":32}},{"__type__":"cc.Sprite","node":{"__id__":178},"_spriteFrame":{"__uuid__":"1aMvx28L1PZpgPVpKcDKCz"},"_sizeMode":2,"_isTrimmedMode":false},{"__type__":"cc.Node","_name":"zuo_mask","_parent":{"__id__":131},"_children":[{"__id__":181},{"__id__":182}]},{"__type__":"cc.Node","_name":"bg","_parent":{"__id__":180},"_components":[{"__type__":"cc.Sprite","node":{"__id__":181},"_spriteFrame":{"__uuid__":"6erFCVsFpOfI/2jYl2ny9K"},"_sizeMode":0,"_srcBlendFactor":768},{"__type__":"cc.Button","node":{"__id__":181},"_N$target":{"__id__":181}},{"__type__":"cc.Widget","node":{"__id__":181},"alignMode":2,"_target":{"__id__":131},"_alignFlags":45,"_originalWidth":15,"_originalHeight":18}],"_opacity":127,"_color":{"__type__":"cc.Color"},"_contentSize":{"__type__":"cc.Size","width":300,"height":1440},"_position":{"__type__":"cc.Vec2","x":150,"y":-720}},{"__type__":"cc.Node","_name":"loading","_parent":{"__id__":180},"_components":[{"__type__":"cc.Sprite","node":{"__id__":182},"_spriteFrame":{"__uuid__":"a9WLZTN3hO56gmWW/Zy0mz"},"_sizeMode":0},{"__type__":"985733m0s1I44Gbui8XNyvc","node":{"__id__":182}}],"_contentSize":{"__type__":"cc.Size","width":148,"height":148},"_position":{"__type__":"cc.Vec2","x":150,"y":-150}},{"__type__":"cc.Node","_name":"seven_bf","_parent":{"__id__":131},"_components":[{"__type__":"cc.Sprite","node":{"__id__":183},"_spriteFrame":{"__uuid__":"a2MjXRFdtLlYQ5ouAFv/+R"},"_sizeMode":0},{"__type__":"cc.Widget","node":{"__id__":183},"alignMode":2,"_target":{"__id__":131},"_alignFlags":13,"_left":300,"_right":-152,"_originalWidth":100,"_originalHeight":100}],"_color":{"__type__":"cc.Color","r":30,"g":30,"b":30},"_contentSize":{"__type__":"cc.Size","width":210,"height":1440},"_position":{"__type__":"cc.Vec2","x":405,"y":-720}},{"__type__":"cc.Node","_name":"seven","_parent":{"__id__":131},"_children":[{"__id__":185},{"__id__":186},{"__id__":187},{"__id__":188},{"__id__":189},{"__id__":190},{"__id__":191},{"__id__":192},{"__id__":193},{"__id__":194}],"_components":[{"__type__":"cc.Sprite","node":{"__id__":184},"_spriteFrame":{"__uuid__":"a2MjXRFdtLlYQ5ouAFv/+R"},"_sizeMode":0},{"__type__":"cc.Widget","node":{"__id__":184},"alignMode":2,"_target":{"__id__":131},"_alignFlags":13,"_left":300,"_right":-152,"_originalWidth":100,"_originalHeight":100}],"_color":{"__type__":"cc.Color","r":30,"g":30,"b":30},"_contentSize":{"__type__":"cc.Size","width":210,"height":1440},"_position":{"__type__":"cc.Vec2","x":405,"y":-720}},{"__type__":"cc.Node","_name":"C1","_parent":{"__id__":184},"_components":[{"__type__":"cc.Sprite","node":{"__id__":185},"_spriteFrame":{"__uuid__":"a2MjXRFdtLlYQ5ouAFv/+R"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":185},"transition":1,"clickEvents":[{"__type__":"cc.ClickEvent","target":{"__id__":2},"component":"controller","handler":"on_c0_event"}],"_N$target":{"__id__":185}}],"_color":{"__type__":"cc.Color","r":214,"g":214,"b":214},"_contentSize":{"__type__":"cc.Size","width":140,"height":140},"_position":{"__type__":"cc.Vec2","y":640}},{"__type__":"cc.Node","_name":"C2","_parent":{"__id__":184},"_components":[{"__type__":"cc.Sprite","node":{"__id__":186},"_spriteFrame":{"__uuid__":"a2MjXRFdtLlYQ5ouAFv/+R"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":186},"transition":1,"clickEvents":[{"__type__":"cc.ClickEvent","target":{"__id__":2},"component":"controller","handler":"on_c1_event"}],"_N$target":{"__id__":186}}],"_color":{"__type__":"cc.Color","r":214,"g":214,"b":214},"_contentSize":{"__type__":"cc.Size","width":140,"height":140},"_position":{"__type__":"cc.Vec2","y":480}},{"__type__":"cc.Node","_name":"C3","_parent":{"__id__":184},"_components":[{"__type__":"cc.Sprite","node":{"__id__":187},"_spriteFrame":{"__uuid__":"a2MjXRFdtLlYQ5ouAFv/+R"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":187},"transition":1,"clickEvents":[{"__type__":"cc.ClickEvent","target":{"__id__":2},"component":"controller","handler":"on_c2_event"}],"_N$target":{"__id__":187}}],"_color":{"__type__":"cc.Color","r":214,"g":214,"b":214},"_contentSize":{"__type__":"cc.Size","width":140,"height":140},"_position":{"__type__":"cc.Vec2","y":320}},{"__type__":"cc.Node","_name":"C4","_parent":{"__id__":184},"_components":[{"__type__":"cc.Sprite","node":{"__id__":188},"_spriteFrame":{"__uuid__":"a2MjXRFdtLlYQ5ouAFv/+R"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":188},"transition":1,"clickEvents":[{"__type__":"cc.ClickEvent","target":{"__id__":2},"component":"controller","handler":"on_c3_event"}],"_N$target":{"__id__":188}}],"_color":{"__type__":"cc.Color","r":214,"g":214,"b":214},"_contentSize":{"__type__":"cc.Size","width":140,"height":140},"_position":{"__type__":"cc.Vec2","y":160}},{"__type__":"cc.Node","_name":"C5","_parent":{"__id__":184},"_components":[{"__type__":"cc.Sprite","node":{"__id__":189},"_spriteFrame":{"__uuid__":"a2MjXRFdtLlYQ5ouAFv/+R"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":189},"transition":1,"clickEvents":[{"__type__":"cc.ClickEvent","target":{"__id__":2},"component":"controller","handler":"on_c4_event"}],"_N$target":{"__id__":189}}],"_color":{"__type__":"cc.Color","r":214,"g":214,"b":214},"_contentSize":{"__type__":"cc.Size","width":140,"height":140}},{"__type__":"cc.Node","_name":"C6","_parent":{"__id__":184},"_components":[{"__type__":"cc.Sprite","node":{"__id__":190},"_spriteFrame":{"__uuid__":"a2MjXRFdtLlYQ5ouAFv/+R"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":190},"transition":1,"clickEvents":[{"__type__":"cc.ClickEvent","target":{"__id__":2},"component":"controller","handler":"on_c5_event"}],"_N$target":{"__id__":190}}],"_color":{"__type__":"cc.Color","r":214,"g":214,"b":214},"_contentSize":{"__type__":"cc.Size","width":140,"height":140},"_position":{"__type__":"cc.Vec2","y":-160}},{"__type__":"cc.Node","_name":"C7","_parent":{"__id__":184},"_components":[{"__type__":"cc.Sprite","node":{"__id__":191},"_spriteFrame":{"__uuid__":"a2MjXRFdtLlYQ5ouAFv/+R"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":191},"transition":1,"clickEvents":[{"__type__":"cc.ClickEvent","target":{"__id__":2},"component":"controller","handler":"on_c6_event"}],"_N$target":{"__id__":191}}],"_color":{"__type__":"cc.Color","r":214,"g":214,"b":214},"_contentSize":{"__type__":"cc.Size","width":140,"height":140},"_position":{"__type__":"cc.Vec2","y":-320}},{"__type__":"cc.Node","_name":"C8","_parent":{"__id__":184},"_components":[{"__type__":"cc.Sprite","node":{"__id__":192},"_spriteFrame":{"__uuid__":"a2MjXRFdtLlYQ5ouAFv/+R"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":192},"transition":1,"clickEvents":[{"__type__":"cc.ClickEvent","target":{"__id__":2},"component":"controller","handler":"on_c7_event"}],"_N$target":{"__id__":192}}],"_color":{"__type__":"cc.Color","r":214,"g":214,"b":214},"_contentSize":{"__type__":"cc.Size","width":140,"height":140},"_position":{"__type__":"cc.Vec2","y":-480}},{"__type__":"cc.Node","_name":"C9","_parent":{"__id__":184},"_components":[{"__type__":"cc.Sprite","node":{"__id__":193},"_spriteFrame":{"__uuid__":"a2MjXRFdtLlYQ5ouAFv/+R"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":193},"transition":1,"clickEvents":[{"__type__":"cc.ClickEvent","target":{"__id__":2},"component":"controller","handler":"on_c8_event"}],"_N$target":{"__id__":193}}],"_color":{"__type__":"cc.Color","r":214,"g":214,"b":214},"_contentSize":{"__type__":"cc.Size","width":140,"height":140},"_position":{"__type__":"cc.Vec2","y":-640}},{"__type__":"cc.Node","_name":"left-arrow","_parent":{"__id__":184},"_components":[{"__type__":"cc.Sprite","node":{"__id__":194},"_spriteFrame":{"__uuid__":"7fER+s2OxBVJr1nmf61QA+"}}],"_contentSize":{"__type__":"cc.Size","width":128,"height":108},"_scaleX":0.5,"_scaleY":0.5,"_position":{"__type__":"cc.Vec2","x":140}},{"__type__":"cc.Node","_name":"confirm","_parent":{"__id__":3},"_children":[{"__id__":196},{"__id__":197},{"__id__":199},{"__id__":200},{"__id__":201},{"__id__":202},{"__id__":204},{"__id__":206},{"__id__":207},{"__id__":208},{"__id__":209}],"_components":[{"__type__":"cc.Sprite","node":{"__id__":195},"_spriteFrame":{"__uuid__":"a2MjXRFdtLlYQ5ouAFv/+R"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":195},"_N$target":{"__id__":195}},{"__type__":"cc.Widget","node":{"__id__":195},"alignMode":2,"_target":{"__id__":3},"_alignFlags":45,"_originalWidth":600,"_originalHeight":300}],"_color":{"__type__":"cc.Color","r":80,"g":80,"b":80},"_contentSize":{"__type__":"cc.Size","width":3000,"height":1440}},{"__type__":"cc.Node","_name":"New Label","_parent":{"__id__":195},"_components":[{"__type__":"cc.Label","node":{"__id__":196},"_useOriginalSize":false,"_actualFontSize":42,"_fontSize":42,"_lineHeight":42,"_N$string":"Please select the painting region. Half-body portrait is better than full-body portrait. Please do not leave much blank region. \n请选择绘画区域。半身人像比全身人像更好。请不要留下太多空白区域。\n塗装地域を選択してください。半身の肖像画は全身の肖像よりも優れています。余白をあまり残さないでください。\n","_N$horizontalAlign":1,"_N$verticalAlign":1},{"__type__":"cc.Widget","node":{"__id__":196},"alignMode":2,"_target":{"__id__":195},"_alignFlags":17,"_top":9}],"_contentSize":{"__type__":"cc.Size","width":2290,"height":168},"_position":{"__type__":"cc.Vec2","y":627}},{"__type__":"cc.Node","_name":"preview","_parent":{"__id__":195},"_children":[{"__id__":198}],"_components":[{"__type__":"cc.Sprite","node":{"__id__":197},"_spriteFrame":{"__uuid__":"8c20Sso/ZEn7NUfNSM+EBh"},"_sizeMode":0},{"__type__":"cc.Widget","node":{"__id__":197},"alignMode":2,"_target":{"__id__":195},"_alignFlags":18}],"_contentSize":{"__type__":"cc.Size","width":2900,"height":1140}},{"__type__":"cc.Node","_name":"preview2","_parent":{"__id__":197},"_components":[{"__type__":"cc.Sprite","node":{"__id__":198},"_spriteFrame":{"__uuid__":"8c20Sso/ZEn7NUfNSM+EBh"},"_sizeMode":0},{"__type__":"cc.Widget","node":{"__id__":198},"alignMode":2,"_target":{"__id__":197},"_alignFlags":45,"_originalWidth":2900,"_originalHeight":1140},{"__type__":"cc.Button","node":{"__id__":198},"_N$target":{"__id__":198}},{"__type__":"baf29QBazxFQ4PCL2/AHscA","node":{"__id__":198}}],"_contentSize":{"__type__":"cc.Size","width":2900,"height":1140}},{"__type__":"cc.Node","_name":"twitter","_parent":{"__id__":195},"_components":[{"__type__":"cc.Sprite","node":{"__id__":199},"_spriteFrame":{"__uuid__":"10L7rqO+5OtoYe7G9tTmg1"},"_sizeMode":0,"_isTrimmedMode":false},{"__type__":"cc.Button","node":{"__id__":199},"transition":1,"hoverColor":{"__type__":"cc.Color","g":255},"clickEvents":[{"__type__":"cc.ClickEvent","target":{"__id__":2},"component":"controller","handler":"on_twitter"}],"_N$target":{"__id__":199}},{"__type__":"cc.Widget","node":{"__id__":199},"alignMode":2,"_target":{"__id__":195},"_alignFlags":36,"_right":63.5,"_bottom":4}],"_color":{"__type__":"cc.Color","r":214,"g":214,"b":214},"_contentSize":{"__type__":"cc.Size","width":52,"height":52},"_position":{"__type__":"cc.Vec2","x":1410.5,"y":-690}},{"__type__":"cc.Node","_name":"github","_parent":{"__id__":195},"_components":[{"__type__":"cc.Sprite","node":{"__id__":200},"_spriteFrame":{"__uuid__":"1emZAFMAJDpYid8LTfEewW"},"_sizeMode":0,"_isTrimmedMode":false},{"__type__":"cc.Button","node":{"__id__":200},"transition":1,"hoverColor":{"__type__":"cc.Color","g":255},"clickEvents":[{"__type__":"cc.ClickEvent","target":{"__id__":2},"component":"controller","handler":"on_github"}],"_N$target":{"__id__":200}},{"__type__":"cc.Widget","node":{"__id__":200},"alignMode":2,"_target":{"__id__":195},"_alignFlags":36,"_right":4,"_bottom":4}],"_color":{"__type__":"cc.Color","r":214,"g":214,"b":214},"_contentSize":{"__type__":"cc.Size","width":52,"height":52},"_position":{"__type__":"cc.Vec2","x":1470,"y":-690}},{"__type__":"cc.Node","_name":"fb","_parent":{"__id__":195},"_components":[{"__type__":"cc.Sprite","node":{"__id__":201},"_spriteFrame":{"__uuid__":"a2MjXRFdtLlYQ5ouAFv/+R"},"_sizeMode":0},{"__type__":"cc.Widget","node":{"__id__":201},"alignMode":2,"_target":{"__id__":195},"_alignFlags":20,"_bottom":35,"_horizontalCenter":-120}],"_color":{"__type__":"cc.Color","r":255,"g":221,"b":85},"_contentSize":{"__type__":"cc.Size","width":200,"height":80},"_position":{"__type__":"cc.Vec2","x":-120,"y":-645}},{"__type__":"cc.Node","_name":"fb","_parent":{"__id__":195},"_children":[{"__id__":203}],"_active":false,"_components":[{"__type__":"cc.Sprite","node":{"__id__":202},"_spriteFrame":{"__uuid__":"a2MjXRFdtLlYQ5ouAFv/+R"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":202},"transition":1,"hoverColor":{"__type__":"cc.Color","r":163,"g":255,"b":248},"clickEvents":[{"__type__":"cc.ClickEvent","target":{"__id__":2},"component":"controller","handler":"confirm_ok"}],"_N$normalColor":{"__type__":"cc.Color","r":255,"g":221,"b":85},"_N$target":{"__id__":202}},{"__type__":"cc.Widget","node":{"__id__":202},"_wasAlignOnce":null,"isAlignOnce":null,"_target":{"__id__":195},"_alignFlags":20,"_bottom":35,"_horizontalCenter":-120}],"_color":{"__type__":"cc.Color","r":255,"g":221,"b":85},"_contentSize":{"__type__":"cc.Size","width":200,"height":80},"_position":{"__type__":"cc.Vec2","x":-120,"y":-645}},{"__type__":"cc.Node","_name":"New Label","_parent":{"__id__":202},"_components":[{"__type__":"cc.Label","node":{"__id__":203},"_useOriginalSize":false,"_N$string":"OK","_N$horizontalAlign":1,"_N$verticalAlign":1}],"_color":{"__type__":"cc.Color"},"_contentSize":{"__type__":"cc.Size","width":58,"height":40}},{"__type__":"cc.Node","_name":"fb2","_parent":{"__id__":195},"_children":[{"__id__":205}],"_components":[{"__type__":"cc.Sprite","node":{"__id__":204},"_spriteFrame":{"__uuid__":"a2MjXRFdtLlYQ5ouAFv/+R"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":204},"transition":1,"hoverColor":{"__type__":"cc.Color","r":163,"g":255,"b":248},"clickEvents":[{"__type__":"cc.ClickEvent","target":{"__id__":2},"component":"controller","handler":"confirm_failed"}],"_N$normalColor":{"__type__":"cc.Color","r":255,"g":221,"b":85},"_N$target":{"__id__":204}},{"__type__":"cc.Widget","node":{"__id__":204},"alignMode":2,"_target":{"__id__":195},"_alignFlags":20,"_bottom":35,"_horizontalCenter":120}],"_color":{"__type__":"cc.Color","r":255,"g":221,"b":85},"_contentSize":{"__type__":"cc.Size","width":200,"height":80},"_position":{"__type__":"cc.Vec2","x":120,"y":-645}},{"__type__":"cc.Node","_name":"New Label","_parent":{"__id__":204},"_components":[{"__type__":"cc.Label","node":{"__id__":205},"_useOriginalSize":false,"_N$string":"Cancel","_N$horizontalAlign":1,"_N$verticalAlign":1}],"_color":{"__type__":"cc.Color"},"_contentSize":{"__type__":"cc.Size","width":125,"height":40}},{"__type__":"cc.Node","_name":"filled-circle","_parent":{"__id__":195},"_components":[{"__type__":"cc.Sprite","node":{"__id__":206},"_spriteFrame":{"__uuid__":"2cZUroAXNDYqgiQa6XtTc3"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":206},"_N$target":{"__id__":206}},{"__type__":"050d97BhuFBcogu1X1n+Eah","node":{"__id__":206}}],"_color":{"__type__":"cc.Color","r":40,"g":60,"b":213},"_contentSize":{"__type__":"cc.Size","width":48,"height":48}},{"__type__":"cc.Node","_name":"filled-circle","_parent":{"__id__":195},"_components":[{"__type__":"cc.Sprite","node":{"__id__":207},"_spriteFrame":{"__uuid__":"2cZUroAXNDYqgiQa6XtTc3"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":207},"_N$target":{"__id__":207}},{"__type__":"050d97BhuFBcogu1X1n+Eah","node":{"__id__":207}}],"_color":{"__type__":"cc.Color","r":40,"g":60,"b":213},"_contentSize":{"__type__":"cc.Size","width":48,"height":48},"_position":{"__type__":"cc.Vec2","x":-295,"y":-371}},{"__type__":"cc.Node","_name":"filled-circle","_parent":{"__id__":195},"_components":[{"__type__":"cc.Sprite","node":{"__id__":208},"_spriteFrame":{"__uuid__":"2cZUroAXNDYqgiQa6XtTc3"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":208},"_N$target":{"__id__":208}},{"__type__":"050d97BhuFBcogu1X1n+Eah","node":{"__id__":208}}],"_color":{"__type__":"cc.Color","r":40,"g":60,"b":213},"_contentSize":{"__type__":"cc.Size","width":48,"height":48},"_position":{"__type__":"cc.Vec2","x":-594,"y":4}},{"__type__":"cc.Node","_name":"filled-circle","_parent":{"__id__":195},"_components":[{"__type__":"cc.Sprite","node":{"__id__":209},"_spriteFrame":{"__uuid__":"2cZUroAXNDYqgiQa6XtTc3"},"_sizeMode":0},{"__type__":"cc.Button","node":{"__id__":209},"_N$target":{"__id__":209}},{"__type__":"050d97BhuFBcogu1X1n+Eah","node":{"__id__":209}}],"_color":{"__type__":"cc.Color","r":40,"g":60,"b":213},"_contentSize":{"__type__":"cc.Size","width":48,"height":48},"_position":{"__type__":"cc.Vec2","y":303}},{"__type__":"cc.Node","_name":"ring","_parent":{"__id__":1},"_children":[{"__id__":211}],"_components":[{"__type__":"cc.Sprite","node":{"__id__":210},"_spriteFrame":{"__uuid__":"b1oqXv5YhLeLek/LqyBXpr"}}],"_id":"2cH0SNu0dHfYWx3iZRTKsK","_contentSize":{"__type__":"cc.Size","width":300,"height":300},"_position":{"__type__":"cc.Vec2","x":-200,"y":1290}},{"__type__":"cc.Node","_name":"board","_parent":{"__id__":210},"_components":[{"__type__":"cc.Sprite","node":{"__id__":211},"_spriteFrame":{"__uuid__":"bfD2QsCeBMdJIozPyHybN/"}}],"_contentSize":{"__type__":"cc.Size","width":64,"height":64}}],{"__type__":"cc.SpriteFrame","content":{"name":"girl","texture":"50CbuLH61Mgp0fU9reknk/","rect":[0,0,1024,1024],"offset":[0,0],"originalSize":[1024,1024]}},{"__type__":"cc.SpriteFrame","content":{"name":"pallete","texture":"34n14Pu71Grr1AJOTEM1bi","rect":[0,0,134,135],"offset":[-0.5,0],"originalSize":[135,135]}},{"__type__":"cc.SpriteFrame","content":{"name":"upload_img","texture":"46NQdwGmhIzbOm/xN4AFWm","rect":[12,0,104,128],"offset":[0,0],"originalSize":[128,128]}},{"__type__":"cc.SpriteFrame","content":{"name":"b","texture":"c8da7TtxBFLrBK3p3et/+X","rect":[0,0,15,18],"offset":[0,0],"originalSize":[15,18]}},{"__type__":"cc.SpriteFrame","content":{"name":"downloadh","texture":"06vZFiAAJDZYVKHgAYMkFE","rect":[0,1,128,126],"offset":[0,0],"originalSize":[128,128]}},{"__type__":"cc.SpriteFrame","content":{"name":"right","texture":"eadEprFbtAdbR6H7LC8vTn","rect":[30,3,68,122],"offset":[0,0],"originalSize":[128,128]}},{"__type__":"cc.SpriteFrame","content":{"name":"ai","texture":"7bbDiwUGZMta3uM/wWJTyw","rect":[5,0,118,128],"offset":[0,0],"originalSize":[128,128]}},{"__type__":"cc.SpriteFrame","content":{"name":"eraser","texture":"39yW4Bc9VKJKFRW1gXJnWc","rect":[3,0,128,134],"offset":[-0.5,0.5],"originalSize":[135,135]}},{"__type__":"cc.SpriteFrame","content":{"name":"drag","texture":"00eb2q7hlMj7GXigg5AV5g","rect":[9,0,116,134],"offset":[-0.5,0.5],"originalSize":[135,135]}},{"__type__":"cc.SpriteFrame","content":{"name":"default_toggle_normal","texture":"d2kHe6FidKcpV5e1aiNTQM","rect":[0,0,28,28],"offset":[0,0],"originalSize":[28,28]}},{"__type__":"cc.SpriteFrame","content":{"name":"w","texture":"69O71YbnBB+5PkOtJI2TvR","rect":[0,0,15,18],"offset":[0,0],"originalSize":[15,18]}},{"__type__":"cc.SpriteFrame","content":{"name":"left","texture":"e8UlNj5+dHyIAD1rSaRFQi","rect":[30,3,68,122],"offset":[0,0],"originalSize":[128,128]}},{"__type__":"cc.SpriteFrame","content":{"name":"refresh","texture":"40m4g3hMNNCrwsd8CTt6uQ","rect":[9,0,110,128],"offset":[0,0],"originalSize":[128,128]}},{"__type__":"cc.SpriteFrame","content":{"name":"left-arrow","texture":"f5mgNMKMtLPL1udKc+0Eyt","rect":[36,46,128,108],"offset":[0,0],"originalSize":[200,200]}},{"__type__":"cc.SpriteFrame","content":{"name":"default_sprite","texture":"6eBWFz0oVHPLIGQKf/9Thu","rect":[0,2,40,36],"offset":[0,0],"originalSize":[40,40]}},{"__type__":"cc.SpriteFrame","content":{"name":"default_toggle_checkmark","texture":"73oJA92A5OPKpn+ZlUPAj1","rect":[5,3,20,19],"offset":[1,1.5],"originalSize":[28,28]}},{"__type__":"cc.SpriteFrame","content":{"name":"dropper","texture":"e129YibpJHJKWONYnD1rRC","rect":[0,0,128,128],"offset":[0,0],"originalSize":[128,128]}},{"__type__":"cc.SpriteFrame","content":{"name":"default_sprite_splash","texture":"02delMVqdBD70a/HSD99FK","rect":[0,0,2,2],"offset":[0,0],"originalSize":[2,2]}},{"__type__":"cc.SpriteFrame","content":{"name":"big_logo","texture":"f8/EswgwJFlYr6skAapCKR","rect":[0,0,128,128],"offset":[0,0],"originalSize":[128,128]}},{"__type__":"cc.SpriteFrame","content":{"name":"ring","texture":"a6WA9aHtxCh5YHKRvVP3Xw","rect":[0,0,300,300],"offset":[0,0],"originalSize":[300,300]}},{"__type__":"cc.SpriteFrame","content":{"name":"circle","texture":"03p2MmRKJCdZ5AsjCj7sHN","rect":[0,0,128,128],"offset":[0,0],"originalSize":[128,128]}},{"__type__":"cc.SpriteFrame","content":{"name":"skilled","texture":"d4u6MnLXxBV79+3Hng9oHd","rect":[0,0,24,24],"offset":[0,0],"originalSize":[24,24]}},{"__type__":"cc.SpriteFrame","content":{"name":"board","texture":"226kS492tNIJQrLRGCSmtw","rect":[0,0,64,64],"offset":[0,0],"originalSize":[64,64]}},{"__type__":"cc.SpriteFrame","content":{"name":"1","texture":"0fwe5eFfFEmpa0ZPVR7EtI","rect":[0,0,512,512],"offset":[0,0],"originalSize":[512,512]}},{"__type__":"cc.SpriteFrame","content":{"name":"skills","texture":"9093vD545J6ZUEYzPwhfLK","rect":[0,0,182,22],"offset":[0,0],"originalSize":[182,22]}},{"__type__":"cc.SpriteFrame","content":{"name":"help","texture":"90YtjmdnFIcL8cmAgzp+Tv","rect":[0,0,128,128],"offset":[0,0],"originalSize":[128,128]}},{"__type__":"cc.SpriteFrame","content":{"name":"127","texture":"7cvienAXxBMI2svV3dFolc","rect":[0,0,100,100],"offset":[0,0],"originalSize":[100,100]}},{"__type__":"cc.SpriteFrame","content":{"name":"clear","texture":"65EelgvQxEI4BrVLTDbi2Y","rect":[2,2,130,130],"offset":[-0.5,0.5],"originalSize":[135,135]}},{"__type__":"cc.SpriteFrame","content":{"name":"default_radio_button_off","texture":"56fc2Ai/RFNYpaMT8crweK","rect":[2,2,28,30],"offset":[0,-1],"originalSize":[32,32]}},{"__type__":"cc.SpriteFrame","content":{"name":"default_btn_pressed","texture":"b4P/PCArtIdIH38t6mlw8Y","rect":[0,0,40,40],"offset":[0,0],"originalSize":[40,40],"capInsets":[11,11,11,7]}},{"__type__":"cc.SpriteFrame","content":{"name":"default_btn_normal","texture":"e8Ueib+qJEhL6mXAHdnwbi","rect":[0,0,40,40],"offset":[0,0],"originalSize":[40,40],"capInsets":[8,11,7,9]}},{"__type__":"cc.SpriteFrame","content":{"name":"magic","texture":"de/e4JzelC4Z4eHkP3iE9V","rect":[0,0,128,128],"offset":[0,0],"originalSize":[128,128]}},{"__type__":"cc.SpriteFrame","content":{"name":"uploadh","texture":"a9+i07/8pPYK37OJXM0mCS","rect":[0,1,128,126],"offset":[0,0],"originalSize":[128,128]}},{"__type__":"cc.SpriteFrame","content":{"name":"grids","texture":"679co/+9pO3IQeM+J2lfvH","rect":[1,1,134,134],"offset":[0.5,-0.5],"originalSize":[135,135]}}] \ No newline at end of file diff --git a/ui/web-mobile/res/import/0f/0fab38db5.fcac8.json b/ui/web-mobile/res/import/0f/0fab38db5.fcac8.json new file mode 100644 index 0000000000000000000000000000000000000000..692417291edf0583c3f783512c037149f7ff140d --- /dev/null +++ b/ui/web-mobile/res/import/0f/0fab38db5.fcac8.json @@ -0,0 +1 @@ +{"type":"cc.Texture2D","data":"0|0|0|0|1|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0"} \ No newline at end of file diff --git a/ui/web-mobile/res/raw-assets/00/0079bdaa-ee19-4c8f-b197-8a0839015e60.fca06.png b/ui/web-mobile/res/raw-assets/00/0079bdaa-ee19-4c8f-b197-8a0839015e60.fca06.png new file mode 100644 index 0000000000000000000000000000000000000000..cb463e3e4428db9bac2d1e670d949565ce69c6f6 --- /dev/null +++ b/ui/web-mobile/res/raw-assets/00/0079bdaa-ee19-4c8f-b197-8a0839015e60.fca06.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:62a5691a31c9b24b5ea7b53fb704a50f5927e9a8b5b087cf7688be34d37abd5c +size 18800 diff --git a/ui/web-mobile/res/raw-assets/02/0275e94c-56a7-410f-bd1a-fc7483f7d14a.cea68.png b/ui/web-mobile/res/raw-assets/02/0275e94c-56a7-410f-bd1a-fc7483f7d14a.cea68.png new file mode 100644 index 0000000000000000000000000000000000000000..f4b850ad394a83988c0a2a07f5cf4a11485f1dbc --- /dev/null +++ b/ui/web-mobile/res/raw-assets/02/0275e94c-56a7-410f-bd1a-fc7483f7d14a.cea68.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:83c9b8ce1937570a40bcedde29457a4ab7865ca1db23a46d2d68e6b1949f3c28 +size 82 diff --git a/ui/web-mobile/res/raw-assets/03/03a76326-44a2-4275-9e40-b230a3eec1cd.c837b.png b/ui/web-mobile/res/raw-assets/03/03a76326-44a2-4275-9e40-b230a3eec1cd.c837b.png new file mode 100644 index 0000000000000000000000000000000000000000..c8006c4f2cdf996dfa7ee5fc0312310046900cbb --- /dev/null +++ b/ui/web-mobile/res/raw-assets/03/03a76326-44a2-4275-9e40-b230a3eec1cd.c837b.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d420b7999194572a9addd25831fdbf0f8eb86636e4d0e75c5526a073dbd9446a +size 16879 diff --git a/ui/web-mobile/res/raw-assets/06/06bd9162-0002-4365-854a-1e0018324144.8090a.png b/ui/web-mobile/res/raw-assets/06/06bd9162-0002-4365-854a-1e0018324144.8090a.png new file mode 100644 index 0000000000000000000000000000000000000000..51384d477f86e7c5f55ff53f561e6b58b3eb4339 --- /dev/null +++ b/ui/web-mobile/res/raw-assets/06/06bd9162-0002-4365-854a-1e0018324144.8090a.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c0bae1de2227f90604a757a740ca89a62de326e387b78448e1b24767ccecfcb2 +size 18076 diff --git a/ui/web-mobile/res/raw-assets/0f/0fc1ee5e-15f1-449a-96b4-64f551ec4b48.56ae8.jpg b/ui/web-mobile/res/raw-assets/0f/0fc1ee5e-15f1-449a-96b4-64f551ec4b48.56ae8.jpg new file mode 100644 index 0000000000000000000000000000000000000000..ca35539fb5094718573497c3a6c0dff1e41f6d54 --- /dev/null +++ b/ui/web-mobile/res/raw-assets/0f/0fc1ee5e-15f1-449a-96b4-64f551ec4b48.56ae8.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0dce28125d936f3c5bbf8871b34aa6d038e01889bcc65cbbae49f9bb7a23f1a8 +size 4759 diff --git a/ui/web-mobile/res/raw-assets/22/22ea44b8-f76b-4d20-942b-2d11824a6b70.d8588.png b/ui/web-mobile/res/raw-assets/22/22ea44b8-f76b-4d20-942b-2d11824a6b70.d8588.png new file mode 100644 index 0000000000000000000000000000000000000000..60c82119b838690020e6459eee639fb6df0ca14d --- /dev/null +++ b/ui/web-mobile/res/raw-assets/22/22ea44b8-f76b-4d20-942b-2d11824a6b70.d8588.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9483f602b24f67daf49b3007048554d9e9cbeff243c564c3f9cbfc9e43017a34 +size 257 diff --git a/ui/web-mobile/res/raw-assets/34/349f5e0f-bbbd-46ae-bd40-24e4c43356e2.8d682.png b/ui/web-mobile/res/raw-assets/34/349f5e0f-bbbd-46ae-bd40-24e4c43356e2.8d682.png new file mode 100644 index 0000000000000000000000000000000000000000..69f5912bc45e3b6f5e4135cb06c6b577582d24d5 --- /dev/null +++ b/ui/web-mobile/res/raw-assets/34/349f5e0f-bbbd-46ae-bd40-24e4c43356e2.8d682.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:84ccf449e5b5aef9260144b4131d0489cd51841c1f2c4a73236809ad25399d4d +size 20462 diff --git a/ui/web-mobile/res/raw-assets/39/39c96e01-73d5-4a24-a151-5b581726759c.d45fb.png b/ui/web-mobile/res/raw-assets/39/39c96e01-73d5-4a24-a151-5b581726759c.d45fb.png new file mode 100644 index 0000000000000000000000000000000000000000..08797039a6d6418c8873673a2b41b7646c85d097 --- /dev/null +++ b/ui/web-mobile/res/raw-assets/39/39c96e01-73d5-4a24-a151-5b581726759c.d45fb.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2ae7b99f34e1e7514d8cb24031ab780d735fba9d64a591d4f67784c0e3f16e3e +size 16905 diff --git a/ui/web-mobile/res/raw-assets/40/409b8837-84c3-4d0a-bc2c-77c093b7ab90.33060.png b/ui/web-mobile/res/raw-assets/40/409b8837-84c3-4d0a-bc2c-77c093b7ab90.33060.png new file mode 100644 index 0000000000000000000000000000000000000000..ba48d8c09631027964ec3758f7ef54f83e5f462a --- /dev/null +++ b/ui/web-mobile/res/raw-assets/40/409b8837-84c3-4d0a-bc2c-77c093b7ab90.33060.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2bcb26526357b1bf760d5be92fc570baa7b82bb8f9bc7633ce48c1f71a24e3ac +size 22276 diff --git a/ui/web-mobile/res/raw-assets/46/46350770-1a68-48cd-b3a6-ff13780055a6.81883.png b/ui/web-mobile/res/raw-assets/46/46350770-1a68-48cd-b3a6-ff13780055a6.81883.png new file mode 100644 index 0000000000000000000000000000000000000000..5bae1ef06db9d7d5418cfb603d8bebfef74060a4 --- /dev/null +++ b/ui/web-mobile/res/raw-assets/46/46350770-1a68-48cd-b3a6-ff13780055a6.81883.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7622665575aa1afc353fd7eb86a8d09cba4956a9cf1d3e63d951641972e853db +size 1595 diff --git a/ui/web-mobile/res/raw-assets/50/5009bb8b-1fad-4c82-9d1f-53dade92793f.73b9c.png b/ui/web-mobile/res/raw-assets/50/5009bb8b-1fad-4c82-9d1f-53dade92793f.73b9c.png new file mode 100644 index 0000000000000000000000000000000000000000..af0e4aa8b7a76dd947e0c8c2f59fcd1459539301 --- /dev/null +++ b/ui/web-mobile/res/raw-assets/50/5009bb8b-1fad-4c82-9d1f-53dade92793f.73b9c.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d7eeac2edbb5d9a07bccc422077df3cec2b81e50876a49adbc477685e51c89ec +size 519471 diff --git a/ui/web-mobile/res/raw-assets/56/567dcd80-8bf4-4535-8a5a-313f1caf078a.acdf0.png b/ui/web-mobile/res/raw-assets/56/567dcd80-8bf4-4535-8a5a-313f1caf078a.acdf0.png new file mode 100644 index 0000000000000000000000000000000000000000..91ff6e03508137fa4b136c1db9b12493bd9d50fa --- /dev/null +++ b/ui/web-mobile/res/raw-assets/56/567dcd80-8bf4-4535-8a5a-313f1caf078a.acdf0.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fa106018f24066ff2a9380a38156a564c4c034275cc30f4bde49e92a302a27cd +size 631 diff --git a/ui/web-mobile/res/raw-assets/64/6489523f-0da5-4bb7-855f-ee889a0169ae.955dc.png b/ui/web-mobile/res/raw-assets/64/6489523f-0da5-4bb7-855f-ee889a0169ae.955dc.png new file mode 100644 index 0000000000000000000000000000000000000000..72037b75728aba0a7e536de34abfc902b4cb948c --- /dev/null +++ b/ui/web-mobile/res/raw-assets/64/6489523f-0da5-4bb7-855f-ee889a0169ae.955dc.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:14fda50eaec92a4f2217e2480b4cf4dd0567c101b666fb4923b65479ea7a84c3 +size 2742 diff --git a/ui/web-mobile/res/raw-assets/65/6511e960-bd0c-4423-806b-54b4c36e2d98.0d0ac.png b/ui/web-mobile/res/raw-assets/65/6511e960-bd0c-4423-806b-54b4c36e2d98.0d0ac.png new file mode 100644 index 0000000000000000000000000000000000000000..0adbff0462c458c37e1dd5c698cd361db1fc7693 --- /dev/null +++ b/ui/web-mobile/res/raw-assets/65/6511e960-bd0c-4423-806b-54b4c36e2d98.0d0ac.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f61dfaa7179562f500c5a7bdfb70871f8048802669d03e82292426ca3859440c +size 15667 diff --git a/ui/web-mobile/res/raw-assets/67/67f5ca3f-fbda-4edc-841e-33e27695fbc7.b4ff6.png b/ui/web-mobile/res/raw-assets/67/67f5ca3f-fbda-4edc-841e-33e27695fbc7.b4ff6.png new file mode 100644 index 0000000000000000000000000000000000000000..c3f2851ef2bdec50876b2a0efb7e7da066b2013b --- /dev/null +++ b/ui/web-mobile/res/raw-assets/67/67f5ca3f-fbda-4edc-841e-33e27695fbc7.b4ff6.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:60a88e121f97a3c288ee40421909a9f433286a74979ecd5e2a17f188b8ffc1dd +size 15614 diff --git a/ui/web-mobile/res/raw-assets/69/693bbd58-6e70-41fb-93e4-3ad248d93bd1.e51b8.png b/ui/web-mobile/res/raw-assets/69/693bbd58-6e70-41fb-93e4-3ad248d93bd1.e51b8.png new file mode 100644 index 0000000000000000000000000000000000000000..36ca6d84b7ac190302c8f542cea3765108cac4f2 --- /dev/null +++ b/ui/web-mobile/res/raw-assets/69/693bbd58-6e70-41fb-93e4-3ad248d93bd1.e51b8.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f0af41df383af16cbefa29139fcb5ca8ef51165dfb61a1d48ee3e18914c3aff4 +size 131 diff --git a/ui/web-mobile/res/raw-assets/6e/6e056173-d285-473c-b206-40a7fff5386e.68270.png b/ui/web-mobile/res/raw-assets/6e/6e056173-d285-473c-b206-40a7fff5386e.68270.png new file mode 100644 index 0000000000000000000000000000000000000000..fee9dd34ac736a46d474f97ee92518fd5baac8e6 --- /dev/null +++ b/ui/web-mobile/res/raw-assets/6e/6e056173-d285-473c-b206-40a7fff5386e.68270.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b9d2490b250d3620ae715750d03532ec0d8137d6dbdd0bc686438d11156202a1 +size 464 diff --git a/ui/web-mobile/res/raw-assets/71/71561142-4c83-4933-afca-cb7a17f67053.286c6.png b/ui/web-mobile/res/raw-assets/71/71561142-4c83-4933-afca-cb7a17f67053.286c6.png new file mode 100644 index 0000000000000000000000000000000000000000..4402cfa816c1bbc7cda17b7d663b459901ffaa90 --- /dev/null +++ b/ui/web-mobile/res/raw-assets/71/71561142-4c83-4933-afca-cb7a17f67053.286c6.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:32d5db3672b8eddd9b5a418cfcd8333318ccd5b72ed5ce17e933b3f9fac3a5ed +size 205 diff --git a/ui/web-mobile/res/raw-assets/73/73a0903d-d80e-4e3c-aa67-f999543c08f5.1fc57.png b/ui/web-mobile/res/raw-assets/73/73a0903d-d80e-4e3c-aa67-f999543c08f5.1fc57.png new file mode 100644 index 0000000000000000000000000000000000000000..65d7e88b9c5c2383d4df8b251867d3611b6f80a4 --- /dev/null +++ b/ui/web-mobile/res/raw-assets/73/73a0903d-d80e-4e3c-aa67-f999543c08f5.1fc57.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f8fdd6f8f950018ec57fe18293d6d049e47a9e4f89c04266f77599246ae6a3de +size 493 diff --git a/ui/web-mobile/res/raw-assets/7b/7b6c38b0-5066-4cb5-adee-33fc16253cb0.467e0.png b/ui/web-mobile/res/raw-assets/7b/7b6c38b0-5066-4cb5-adee-33fc16253cb0.467e0.png new file mode 100644 index 0000000000000000000000000000000000000000..0492df44ed8f6cb1aad4054f940c3efa3b0aa728 --- /dev/null +++ b/ui/web-mobile/res/raw-assets/7b/7b6c38b0-5066-4cb5-adee-33fc16253cb0.467e0.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6ff6df797e62b56fb1f5a21691d3b97708f09921455d446917997ac8d2be1ec5 +size 1840 diff --git a/ui/web-mobile/res/raw-assets/7c/7cbe27a7-017c-4130-8dac-bd5ddd16895c.d4792.png b/ui/web-mobile/res/raw-assets/7c/7cbe27a7-017c-4130-8dac-bd5ddd16895c.d4792.png new file mode 100644 index 0000000000000000000000000000000000000000..d4954d5d16547dc8ad9d0a63d957a3218b54474d --- /dev/null +++ b/ui/web-mobile/res/raw-assets/7c/7cbe27a7-017c-4130-8dac-bd5ddd16895c.d4792.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2ee180cbe8710605abfb8a77dce2b77d9215263bfb77cb43fba9fe9c62e9c84e +size 362 diff --git a/ui/web-mobile/res/raw-assets/90/9062d8e6-7671-4870-bf1c-980833a7e4ef.08a70.png b/ui/web-mobile/res/raw-assets/90/9062d8e6-7671-4870-bf1c-980833a7e4ef.08a70.png new file mode 100644 index 0000000000000000000000000000000000000000..5cb7cec8e735f9230d1f746d80820f8840de9d75 --- /dev/null +++ b/ui/web-mobile/res/raw-assets/90/9062d8e6-7671-4870-bf1c-980833a7e4ef.08a70.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e97d336706b1d6dbb3919414ad6cfb2927065793cd84ad3bf9903f097e722c09 +size 2734 diff --git a/ui/web-mobile/res/raw-assets/90/90f77bc3-e78e-49e9-9504-6333f085f2ca.40fe2.png b/ui/web-mobile/res/raw-assets/90/90f77bc3-e78e-49e9-9504-6333f085f2ca.40fe2.png new file mode 100644 index 0000000000000000000000000000000000000000..76552f5f6c64cef7dd6fde96580a66788c2c8486 --- /dev/null +++ b/ui/web-mobile/res/raw-assets/90/90f77bc3-e78e-49e9-9504-6333f085f2ca.40fe2.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0c870d811be5e2d6e42398dc63b357f924a9065083f97cc6f5e112ae5623144e +size 21267 diff --git a/ui/web-mobile/res/raw-assets/9d/9d60001f-b5f4-4726-a629-2659e3ded0b8.94752.png b/ui/web-mobile/res/raw-assets/9d/9d60001f-b5f4-4726-a629-2659e3ded0b8.94752.png new file mode 100644 index 0000000000000000000000000000000000000000..b312c5b06340cb537c2e1787825a96a72924faa4 --- /dev/null +++ b/ui/web-mobile/res/raw-assets/9d/9d60001f-b5f4-4726-a629-2659e3ded0b8.94752.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bc26bce84d7fb82f53bf598476b2fb6dd780a6289813b8a54b4707935ae6cead +size 847 diff --git a/ui/web-mobile/res/raw-assets/a6/a6580f5a-1edc-4287-9607-291bd53f75f0.a089e.png b/ui/web-mobile/res/raw-assets/a6/a6580f5a-1edc-4287-9607-291bd53f75f0.a089e.png new file mode 100644 index 0000000000000000000000000000000000000000..d836b311def9d84a1322b957da0027c8a7069db2 --- /dev/null +++ b/ui/web-mobile/res/raw-assets/a6/a6580f5a-1edc-4287-9607-291bd53f75f0.a089e.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:789a4a9f372e48f03631a45ceca726ea6046ffa80061fc960ede359dc9e31a11 +size 38022 diff --git a/ui/web-mobile/res/raw-assets/a9/a9fa2d3b-ffca-4f60-adfb-3895ccd26092.070d2.png b/ui/web-mobile/res/raw-assets/a9/a9fa2d3b-ffca-4f60-adfb-3895ccd26092.070d2.png new file mode 100644 index 0000000000000000000000000000000000000000..e89efa261201d7ae9eb3b51838733c149828bfea --- /dev/null +++ b/ui/web-mobile/res/raw-assets/a9/a9fa2d3b-ffca-4f60-adfb-3895ccd26092.070d2.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6e74aa0193a4ca9ca6df095d338d9a9c97766bd45810240ac800c3ffc007a327 +size 17997 diff --git a/ui/web-mobile/res/raw-assets/b2/b228cbc0-563c-4bc4-a5f4-4d1f3d34d900.a6fba.png b/ui/web-mobile/res/raw-assets/b2/b228cbc0-563c-4bc4-a5f4-4d1f3d34d900.a6fba.png new file mode 100644 index 0000000000000000000000000000000000000000..4401de5fe4b98ebc256c3f3f13e899841b75a846 --- /dev/null +++ b/ui/web-mobile/res/raw-assets/b2/b228cbc0-563c-4bc4-a5f4-4d1f3d34d900.a6fba.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7902c8aa41f0f2d130cd01ad4bd439d507e401261e3eead2bc2fab5db27f6594 +size 1653 diff --git a/ui/web-mobile/res/raw-assets/b4/b43ff3c2-02bb-4874-81f7-f2dea6970f18.bedf4.png b/ui/web-mobile/res/raw-assets/b4/b43ff3c2-02bb-4874-81f7-f2dea6970f18.bedf4.png new file mode 100644 index 0000000000000000000000000000000000000000..6d4827e1a8483ae3dccea2d5c97c49f40b9598a6 --- /dev/null +++ b/ui/web-mobile/res/raw-assets/b4/b43ff3c2-02bb-4874-81f7-f2dea6970f18.bedf4.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6d81b94e9bc414992de4cba9fc5b183d63943a89a5f39edad0ddae0a07325658 +size 164 diff --git a/ui/web-mobile/res/raw-assets/c8/c875aed3-b710-452e-b04a-de9ddeb7ff97.e3c06.png b/ui/web-mobile/res/raw-assets/c8/c875aed3-b710-452e-b04a-de9ddeb7ff97.e3c06.png new file mode 100644 index 0000000000000000000000000000000000000000..447e43c7a5bf235ec197a303f4f11943199a3027 --- /dev/null +++ b/ui/web-mobile/res/raw-assets/c8/c875aed3-b710-452e-b04a-de9ddeb7ff97.e3c06.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8c18e868a191f1a171643b8a4a5652072683f412d27d7880223876638918bd65 +size 144 diff --git a/ui/web-mobile/res/raw-assets/d2/d29077ba-1627-4a72-9579-7b56a235340c.0791d.png b/ui/web-mobile/res/raw-assets/d2/d29077ba-1627-4a72-9579-7b56a235340c.0791d.png new file mode 100644 index 0000000000000000000000000000000000000000..c358c62e9534d10f8e115315306718bba91b36ee --- /dev/null +++ b/ui/web-mobile/res/raw-assets/d2/d29077ba-1627-4a72-9579-7b56a235340c.0791d.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:941f270f43065712bb3a3cd734e61a81b7a304a0be942c94649116a896e420b0 +size 1174 diff --git a/ui/web-mobile/res/raw-assets/d4/d4bba327-2d7c-4157-bf7e-dc79e0f681dd.c156f.png b/ui/web-mobile/res/raw-assets/d4/d4bba327-2d7c-4157-bf7e-dc79e0f681dd.c156f.png new file mode 100644 index 0000000000000000000000000000000000000000..ddae05a17583b3911980b34c751153af3f884ed1 --- /dev/null +++ b/ui/web-mobile/res/raw-assets/d4/d4bba327-2d7c-4157-bf7e-dc79e0f681dd.c156f.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b33c9d493fd188c20864c96d8e88af3161e95620c1c5078aa9da32454173840d +size 17789 diff --git a/ui/web-mobile/res/raw-assets/de/defdee09-cde9-42e1-9e1e-1e43f7884f55.4ceec.png b/ui/web-mobile/res/raw-assets/de/defdee09-cde9-42e1-9e1e-1e43f7884f55.4ceec.png new file mode 100644 index 0000000000000000000000000000000000000000..2a09b6bfc6d7af2bcc5d073cad0447c15694787d --- /dev/null +++ b/ui/web-mobile/res/raw-assets/de/defdee09-cde9-42e1-9e1e-1e43f7884f55.4ceec.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cfa80908453f821a3fcec9bdd7cbb4badbcb9acb3df476d1965341eb7b696d39 +size 2766 diff --git a/ui/web-mobile/res/raw-assets/e1/e1dbd622-6e92-4724-a58e-3589c3d6b442.85d54.png b/ui/web-mobile/res/raw-assets/e1/e1dbd622-6e92-4724-a58e-3589c3d6b442.85d54.png new file mode 100644 index 0000000000000000000000000000000000000000..117f61a67ffb43f70e799641c792e798f7321d96 --- /dev/null +++ b/ui/web-mobile/res/raw-assets/e1/e1dbd622-6e92-4724-a58e-3589c3d6b442.85d54.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5c746fc669e3e33d74bafe6dbcf9c9e467717024362acf940138f7492020fdcd +size 18438 diff --git a/ui/web-mobile/res/raw-assets/e6/e6d293eb-89f7-44ce-ab8a-d0df4b084fed.b94ef.png b/ui/web-mobile/res/raw-assets/e6/e6d293eb-89f7-44ce-ab8a-d0df4b084fed.b94ef.png new file mode 100644 index 0000000000000000000000000000000000000000..6297c7bc68a928b6824877f95b6d2136f98f6f91 --- /dev/null +++ b/ui/web-mobile/res/raw-assets/e6/e6d293eb-89f7-44ce-ab8a-d0df4b084fed.b94ef.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1305d75fd82ebcdbd2e4951be193be90e0e7a66e166a874ae1d9aa1bf23a8f1c +size 2780 diff --git a/ui/web-mobile/res/raw-assets/e8/e851e89b-faa2-4484-bea6-5c01dd9f06e2.1ecb7.png b/ui/web-mobile/res/raw-assets/e8/e851e89b-faa2-4484-bea6-5c01dd9f06e2.1ecb7.png new file mode 100644 index 0000000000000000000000000000000000000000..d6d835099923fda88aa4bac30103dc7916ea9000 --- /dev/null +++ b/ui/web-mobile/res/raw-assets/e8/e851e89b-faa2-4484-bea6-5c01dd9f06e2.1ecb7.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a218829043b1b177f4d980dcc019a732ccaf75524a54627f15a27d30ee243962 +size 223 diff --git a/ui/web-mobile/res/raw-assets/e8/e8525363-e7e7-47c8-8003-d6b49a445422.10fe6.png b/ui/web-mobile/res/raw-assets/e8/e8525363-e7e7-47c8-8003-d6b49a445422.10fe6.png new file mode 100644 index 0000000000000000000000000000000000000000..0c8070f8a419d53af1451bc05d58e8733c292381 --- /dev/null +++ b/ui/web-mobile/res/raw-assets/e8/e8525363-e7e7-47c8-8003-d6b49a445422.10fe6.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6973ae3b9ec05be4cca2a06a70e8cd00671c3d04373b59b2aa3fdc2cfeb3c567 +size 16571 diff --git a/ui/web-mobile/res/raw-assets/ea/ea1094c1-7c65-4c3f-ab48-e1bd3d97fc42.04fa3.png b/ui/web-mobile/res/raw-assets/ea/ea1094c1-7c65-4c3f-ab48-e1bd3d97fc42.04fa3.png new file mode 100644 index 0000000000000000000000000000000000000000..0a8e88d3a4584b2c3b23e1e0c39881177be54635 --- /dev/null +++ b/ui/web-mobile/res/raw-assets/ea/ea1094c1-7c65-4c3f-ab48-e1bd3d97fc42.04fa3.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:74ae870f63288c1ced1bc01b7caaee18ef7695b9d69f1835a091b9362de3543c +size 17492 diff --git a/ui/web-mobile/res/raw-assets/ea/ea744a6b-15bb-4075-b47a-1fb2c2f2f4e7.5d0c4.png b/ui/web-mobile/res/raw-assets/ea/ea744a6b-15bb-4075-b47a-1fb2c2f2f4e7.5d0c4.png new file mode 100644 index 0000000000000000000000000000000000000000..6364f25be7048a1784bcda3011b3997e1278e053 --- /dev/null +++ b/ui/web-mobile/res/raw-assets/ea/ea744a6b-15bb-4075-b47a-1fb2c2f2f4e7.5d0c4.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e682e50174428be69453ab5533cc04ad2b41e0fc3c166bab1de97964e40f7ada +size 16493 diff --git a/ui/web-mobile/res/raw-assets/ee/ee105f8a-fe6c-4039-915c-879305a55b45.72616.png b/ui/web-mobile/res/raw-assets/ee/ee105f8a-fe6c-4039-915c-879305a55b45.72616.png new file mode 100644 index 0000000000000000000000000000000000000000..d6fc5d3e973f29f58156c4a1b25ace7fa28df8aa --- /dev/null +++ b/ui/web-mobile/res/raw-assets/ee/ee105f8a-fe6c-4039-915c-879305a55b45.72616.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eaa10af572bbd99b65362239b39e00ea1bb7106b9ddc8796fbf938af13a8c543 +size 1659 diff --git a/ui/web-mobile/res/raw-assets/f5/f59a034c-28cb-4b3c-bd6e-74a73ed04cad.b7b3a.png b/ui/web-mobile/res/raw-assets/f5/f59a034c-28cb-4b3c-bd6e-74a73ed04cad.b7b3a.png new file mode 100644 index 0000000000000000000000000000000000000000..562f1459c6c740bc5bd27238e7364008039cd7e5 --- /dev/null +++ b/ui/web-mobile/res/raw-assets/f5/f59a034c-28cb-4b3c-bd6e-74a73ed04cad.b7b3a.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ae9d815a6608d7605de93a06a8edfdc0ef812da1c454e19d603f6f9316d26abe +size 15947 diff --git a/ui/web-mobile/res/raw-assets/f8/f8fc4b30-8302-4595-8afa-b2401aa42291.8f722.png b/ui/web-mobile/res/raw-assets/f8/f8fc4b30-8302-4595-8afa-b2401aa42291.8f722.png new file mode 100644 index 0000000000000000000000000000000000000000..567519dc51568bb6bdda7f8a75ddd536aada3c76 --- /dev/null +++ b/ui/web-mobile/res/raw-assets/f8/f8fc4b30-8302-4595-8afa-b2401aa42291.8f722.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:643664af8e1c0be0d6da4196e1a58c817fef726b5646e0755d5bda472fa98b17 +size 3184 diff --git a/ui/web-mobile/splash.03ce1.png b/ui/web-mobile/splash.03ce1.png new file mode 100644 index 0000000000000000000000000000000000000000..ebfa386a6fda8af0aca6a4bb183ceed0205683ae --- /dev/null +++ b/ui/web-mobile/splash.03ce1.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3e57b760cc4cdc44f57f74b56ea8431de9ad4f013870ce6b1c45a19a7b495040 +size 41484 diff --git a/ui/web-mobile/src/project.3cc6d.js b/ui/web-mobile/src/project.3cc6d.js new file mode 100644 index 0000000000000000000000000000000000000000..1ebc96e285b68ef7069311aa12664fdef16405cb --- /dev/null +++ b/ui/web-mobile/src/project.3cc6d.js @@ -0,0 +1 @@ +__require=function e(n,t,o){function i(r,c){if(!t[r]){if(!n[r]){var d=r.split("/");if(d=d[d.length-1],!n[d]){var w="function"==typeof __require&&__require;if(!c&&w)return w(d,!0);if(a)return a(d,!0);throw new Error("Cannot find module '"+r+"'")}}var s=t[r]={exports:{}};n[r][0].call(s.exports,function(e){return i(n[r][1][e]||e)},s,s.exports,e,n,t,o)}return t[r].exports}for(var a="function"==typeof __require&&__require,r=0;rn.records.length-1&&(n.time_line=n.records.length-1),n.do(),this.flush_bg()},n.do=function(){window.creativeCanvas.points_XYRGBR=JSON.parse(n.records[n.time_line]),n.finish()},n.ini=function(e,t){return n.canvas.width=parseInt(e),n.canvas.height=parseInt(t),n.ctx=n.canvas.getContext("2d"),n.ctx.clearRect(0,0,n.canvas.width,n.canvas.height),n.source=n.ctx.getImageData(0,0,n.canvas.width,n.canvas.height),n.texture2d=new cc.Texture2D,n.spriteFrame.setTexture(n.texture2d),n.texture2d.initWithElement(n.canvas),n.texture2d.handleLoadedTexture(!0),n.records=[JSON.stringify([])],n.points_XYRGBR=[],n.time_line=0,n.finish(),n.spriteFrame},n.ini_image=function(e,t,o){return ctx=n.canvas.getContext("2d"),n.canvas.width=parseInt(t),n.canvas.height=parseInt(o),ctx.drawImage(e,0,0,n.canvas.width,n.canvas.height),n.source=ctx.getImageData(0,0,n.canvas.width,n.canvas.height),n.texture2d=new cc.Texture2D,n.spriteFrame.setTexture(n.texture2d),n.texture2d.initWithElement(n.canvas),n.texture2d.handleLoadedTexture(!0),n.create_k(),this.flush_bg(),n.spriteFrame},n.flush=function(){var e=n.canvas.getContext("2d");n.source=e.getImageData(0,0,n.canvas.width,n.canvas.height)},n.flush_bg=function(){},n.kill_preview=function(){window.pendingNode.active=!1,window.previewNode.opacity=255},n.get_color=function(e,t){if(null==n.source)return new[0,0,0,0];var o=0;return o=parseInt((1-t)*n.canvas.height),o=parseInt(o*n.canvas.width),o=parseInt(o+e*n.canvas.width),o=parseInt(4*o),[n.source.data[o+0],n.source.data[o+1],n.source.data[o+2],n.source.data[o+3]]},n.set_big_point=function(e,t,o,i,a,r,c){n.ctx.fillStyle="rgba("+o+","+i+","+a+","+r+")",n.ctx.fillRect(e-c,t-c,2*c+1,2*c+1)},n.set_line=function(e,t,o,i,a,r,c,d,w){for(var s=Math.abs(o-e),l=Math.abs(i-t),h=e-l&&(g-=l,e+=h),u-1&&n.current_index-1?document.body.style.cursor="move":document.body.style.cursor="auto"},n.if_point_in_color=function(e){var t=n.points_XYRGBR[e],o=t[2],i=t[3],a=t[4];return(1!=o||233!=i||0!=a)&&(0!=o||233!=i||1!=a)},n.finish=function(){if(null!=n.ctx){n.ctx.clearRect(0,0,n.canvas.width,n.canvas.height);for(var e=0;e1024&&parseInt(a)>1024){var r=window.regulator.minRegulate([parseInt(i),parseInt(a)],1024);n.canvas.width=r[0],n.canvas.height=r[1]}else n.canvas.width=parseInt(i),n.canvas.height=parseInt(a);var c=n.canvas.getContext("2d");return c.drawImage(e,t,o,parseInt(i),parseInt(a),0,0,n.canvas.width,n.canvas.height),n.dataurl=n.canvas.toDataURL("image/png"),n.source=c.getImageData(0,0,n.canvas.width,n.canvas.height),n.texture2d=new cc.Texture2D,n.spriteFrame.setTexture(n.texture2d),n.texture2d.initWithElement(n.canvas),n.texture2d.handleLoadedTexture(!0),n.spriteFrame},n.load_canvas=function(e){n.canvas.width=e.width,n.canvas.height=e.height;var t=n.canvas.getContext("2d");return t.drawImage(e,0,0,n.canvas.width,n.canvas.height),n.source=t.getImageData(0,0,n.canvas.width,n.canvas.height),n.texture2d=new cc.Texture2D,n.spriteFrame.setTexture(n.texture2d),n.texture2d.initWithElement(n.canvas),n.texture2d.handleLoadedTexture(!0),n.spriteFrame},n.clear=function(){n.canvas.width=100,n.canvas.height=100;var e=n.canvas.getContext("2d");return e.clearRect(0,0,100,100),n.source=e.getImageData(0,0,n.canvas.width,n.canvas.height),n.texture2d=new cc.Texture2D,n.spriteFrame.setTexture(n.texture2d),n.texture2d.initWithElement(n.canvas),n.texture2d.handleLoadedTexture(!0),n.spriteFrame},n.dark=function(){n.canvas.width=100,n.canvas.height=100;var e=n.canvas.getContext("2d");return e.fillStyle="rgba(0,0,0,0.5)",e.fillRect(0,0,100,100),n.source=e.getImageData(0,0,n.canvas.width,n.canvas.height),n.texture2d=new cc.Texture2D,n.spriteFrame.setTexture(n.texture2d),n.texture2d.initWithElement(n.canvas),n.texture2d.handleLoadedTexture(!0),n.spriteFrame},n.load_alpha=function(){var e=n.canvas.getContext("2d");n.dataurl=n.canvas.toDataURL("image/png"),n.source=e.getImageData(0,0,n.canvas.width,n.canvas.height);for(var t=0;t",i.style.display="none",i.style.visibility="hidden",document.body.appendChild(i),n.image=document.getElementById(o),n.on_process=null,n.on_error=null,n.on_finish=null,n.load_url=function(e,t){console.log(e),n.image.onload=function(){t(document.getElementById(o))},n.image.onerror=function(){null!=n.on_error&&n.on_error()};var i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="arraybuffer",i.onprogress=function(t){t.lengthComputable&&(console.log(e+" - "+t.loaded+" / "+t.total),null!=n.on_process&&n.on_process(t.loaded/t.total))},i.onreadystatechange=function(){if(4==i.readyState&&200==i.status)try{null!=n.on_finish&&(console.log(e+" - on_finish called"),n.on_finish());var t=i.getAllResponseHeaders().match(/^Content-Type\:\s*(.*?)$/im)[1]||"image/png",o=new Blob([this.response],{type:t});console.log(e+" - finished"),n.image.src=window.URL.createObjectURL(o),console.log(e+" - blobed")}catch(e){console.log(e),null!=n.on_error&&n.on_error(),window.controller.net_unlock("error")}else 4==i.readyState&&null!=n.on_error&&n.on_error()};try{i.send(),console.log(e+"->xmlHTTP.send();"),window.controller.net_unlock("finished")}catch(e){console.log(e),null!=n.on_error&&n.on_error(),window.controller.net_unlock("error")}},n.load_result=function(e,t){console.log(e),n.name=e,n.image.onload=function(){t(document.getElementById(o))},n.image.onerror=function(){null!=n.on_error&&n.on_error()};var i=new XMLHttpRequest;i.open("POST",window.server_url.split("/file")[0]+"/run/download_result",!0),i.setRequestHeader("Content-Type","application/json;"),i.onreadystatechange=function(){if(4==i.readyState&&200==i.status){var e=JSON.parse(i.responseText).data[0];n.image.src=e}else 4==i.readyState&&null!=n.on_error&&n.on_error()},i.send(JSON.stringify({data:[JSON.stringify({room:window.current_room,step:window.current_step,name:e}),null]}))},n},cc._RF.pop()},{}],PickCanvas:[function(e,n,t){"use strict";cc._RF.push(n,"076a0aT+NZGT7xs77Y6v1Zy","PickCanvas"),n.exports=function(e){var n=Object();return n.spriteFrame=new cc.SpriteFrame,n.texture2d=null,n.source=null,n.canvas=document.createElement("canvas"),n.canvas.id="canvas_"+e,n.canvas.width=300,n.canvas.height=1078,n.currentColor=new Array(255,230,200),n.floatingColor=new Array(0,255,0),n.bigall=[47079079,112128144,119136153,105105105,169169169,211211211,220220220,176196222,139,25025112,72061139,75000130,205,123104238,65105225,100149237,139187,70130180,30144255,191255,135206250,135206235,173216230,255255,95158160,32178170,102205170,206209,72209204,64224208,176224230,175238238,107142035,85107047,1e5,34139034,46139087,60179113,50205050,154205050,127255212,250154,255127,124252e3,127255e3,173255047,144238144,152251152,139000139,106090205,138043226,148000211,153050204,186085211,147112219,143188143,139e6,139069019,165042042,178034034,160082045,205092092,210105030,189183107,220020060,255020147,255105180,255000255,218112214,238130238,221160221,216191216,188143143,199021133,219112147,233150122,240128128,255160122,255182193,255192203,255069e3,255099071,255079080,250128114,25514e4,255165e3,244164096,230230250,184134011,205133063,218165032,210180140,222184135,255215e3,255228225,224255255,240230140,238232170,250250210,255250205,245245220,255248220,255255224,255218185,245222179,255222173,255228181,255228196,255235205,255239213,250235215,255240245,240221195,234182156,240221208,247206181,238187153,240208182,234169143,221169143,247217214,226199179,247195156,221169130,234208182,240186173,166149141,240221182,234195169,212128107,158139130,234182143,247208195,247182156,235178133,247195169,247208182,240195169,195116077,240208169,234195182,240169130,69042029,247208169,247221195,240182143,236221202,249249249],n.record=[],n.ctx=n.canvas.getContext("2d"),n.ring=null,n.tring=null,n.ini=function(e){return n.ctx.drawImage(e,0,0,300,300),n.ring=n.ctx.getImageData(0,0,300,300),n.tring=n.ctx.getImageData(0,0,164,164),n.source=n.ctx.getImageData(0,0,n.canvas.width,n.canvas.height),n.texture2d=new cc.Texture2D,n.spriteFrame.setTexture(n.texture2d),n.texture2d.initWithElement(n.canvas),n.texture2d.handleLoadedTexture(!0),n.ctx=n.texture2d.getHtmlElementObj().getContext("2d"),n.finish(),n.spriteFrame},n.finish=function(e){if(null!=n.ring){var t=0;n.ctx.fillStyle="rgb(80, 80, 80)",n.ctx.fillRect(0,0,n.canvas.width,n.canvas.height),n.ctx.putImageData(n.ring,0,t),t+=300;for(var o=1*Math.min(Math.min(n.currentColor[0],n.currentColor[1]),n.currentColor[2]),i=1*Math.max(Math.max(n.currentColor[0],n.currentColor[1]),n.currentColor[2])-o+1e-4,a=(1*n.currentColor[0]-o+1e-4)/i*255,r=(1*n.currentColor[1]-o+1e-4)/i*255,c=(1*n.currentColor[2]-o+1e-4)/i*255,d=0;d<164;d++)for(var w=0;w<164;w++){var s=4*(164*d+163-w),l=s+1,h=s+2,p=s+3,g=1*d/164*255,u=1*w/164*(255-g)/255;n.tring.data[s]=g+a*u,n.tring.data[l]=g+r*u,n.tring.data[h]=g+c*u,n.tring.data[p]=255}n.ctx.putImageData(n.tring,68,68),t+=0,n.ctx.fillStyle="rgb("+n.currentColor[0]+","+n.currentColor[1]+", "+n.currentColor[2]+")",n.ctx.fillRect(8,t+5,142,30),n.ctx.fillStyle="rgb("+n.floatingColor[0]+","+n.floatingColor[1]+", "+n.floatingColor[2]+")",n.ctx.fillRect(150,t+5,142,30),t+=40;for(var _=0;_t?(t*=n/o,o=n):(o*=n/t,t=n),[parseInt(t),parseInt(o)]},cc._RF.pop()},{}],TripleCanvas:[function(e,n,t){"use strict";cc._RF.push(n,"7319cMXNsxIhLHpuS9egChN","TripleCanvas"),n.exports=function(e){var n=Object();return n.spriteFrame=new cc.SpriteFrame,n.texture2d=null,n.spriteFrame_p=new cc.SpriteFrame,n.texture2d_p=null,n.source=null,n.source_light=null,n.source_color=null,n.canvas_light=document.createElement("canvas"),n.canvas_light.id="canvas_light"+e,n.canvas_color=document.createElement("canvas"),n.canvas_color.id="canvas_color"+e,n.canvas_shade=document.createElement("canvas"),n.canvas_shade.id="canvas_shade"+e,n.load_local=function(){n.canvas=window.previewImageCanvas.canvas;var e=n.canvas.width,t=n.canvas.height;if(window.hasColor){n.canvas_light.width=parseInt(e),n.canvas_light.height=parseInt(t),n.canvas_color.width=parseInt(e),n.canvas_color.height=parseInt(t);var o=n.canvas.getContext("2d");n.source=o.getImageData(0,0,n.canvas.width,n.canvas.height),n.source_light=o.getImageData(0,0,n.canvas.width,n.canvas.height),n.source_color=o.getImageData(0,0,n.canvas.width,n.canvas.height);for(var i=0;i255&&(I=255),y>255&&(y=255),k>255&&(k=255),n.source.data[_]=parseInt(I),n.source.data[v]=parseInt(y),n.source.data[f]=parseInt(k),n.source.data[m]=255}n.canvas_shade.getContext("2d").putImageData(n.source,0,0)}}},n},cc._RF.pop()},{}],colorpicker:[function(e,n,t){"use strict";cc._RF.push(n,"292e9Clf/5EoYjj7Il6urD/","colorpicker"),Array.prototype.indexOf=function(e){for(var n=0;n-1&&this.splice(n,1)},cc.Class({extends:cc.Component,properties:{dropNode:{default:null,type:cc.Node}},onLoad:function(){window.color_picker_main=this},start:function(){var n=e("./ImageLoader"),t=e("./PickCanvas");window.pickCanvas=t("paletteImage"),window.right_color_picker=this.getComponent("cc.Sprite"),window.right_color_picker_node=this.node,window.color_picker_main=this,window.dropper_node=this.dropNode,this.last_record=0,n("paletteImage").load_url(window.server_url+"/res/Texture/ring.png",function(e){window.right_color_picker.spriteFrame=window.pickCanvas.ini(e),window.right_color_picker_node.on("mousemove",function(e){window.mousePosition=e.getLocation();var n=window.right_color_picker_node,t=(n.convertToWorldSpace(n.position),cc.winSize.width-300),o=window.mousePosition.x-t,i=window.mousePosition.y-362;if(o>0&&i>0&&o0&&a>0&&i<1&&a<1)if(window.creativeCanvas.re=!0,window.creativeCanvas.rex=i,window.creativeCanvas.rey=a,window.creativeCanvas.refresh_current_point_index(),window.creativeCanvas.current_index>-1){var r=window.creativeCanvas.points_XYRGBR[window.creativeCanvas.current_index],c=[r[2],r[3],r[4]];window.color_picker_main.float_do(new cc.color(c[0],c[1],c[2])),window.minecraft.set_cur_color([c[0],c[1],c[2]])}else{var d=window.previewImageCanvas;window.girdNode.active&&(d=window.girdImageCanvas);var w=d.get_color(i,a);window.color_picker_main.float_do(w),window.minecraft.set_cur_color([w.r,w.g,w.b])}else window.creativeCanvas.re=!1}},pick_float:function(){window.controller.on_pen(),window.pickCanvas.currentColor[0]=window.pickCanvas.floatingColor[0],window.pickCanvas.currentColor[1]=window.pickCanvas.floatingColor[1],window.pickCanvas.currentColor[2]=window.pickCanvas.floatingColor[2],window.pickCanvas.finish()},make_record:function(){var e=1e6*window.pickCanvas.currentColor[0]+1e3*window.pickCanvas.currentColor[1]+window.pickCanvas.currentColor[2];this.last_record!=e&&(window.pickCanvas.record.remove(e),window.pickCanvas.record.push(e),window.pickCanvas.finish(),this.last_record=e)}}),cc._RF.pop()},{"./ImageLoader":"ImageLoader","./PickCanvas":"PickCanvas"}],controller:[function(e,n,t){"use strict";cc._RF.push(n,"a55dcSJ4f1CEaD9OSsdYeLl","controller"),cc.Class({extends:cc.Component,properties:{sketchNode:{default:null,type:cc.Node},alphaSketchNode:{default:null,type:cc.Node},hintNode:{default:null,type:cc.Node},bghintNode:{default:null,type:cc.Node},girdNode:{default:null,type:cc.Node},previewNode:{default:null,type:cc.Node},labelNode:{default:null,type:cc.Node},pendingNode:{default:null,type:cc.Node},fileBtnNode:{default:null,type:cc.Node},real_fileBtnNode:{default:null,type:cc.Node},aiBtnNode:{default:null,type:cc.Node},magicBtnNode:{default:null,type:cc.Node},leftNode:{default:null,type:cc.Node},confirmNode:{default:null,type:cc.Node},c9Node:{default:null,type:cc.Node},logoNode:{default:null,type:cc.Node},cpNode:{default:null,type:cc.Node},cpNode2:{default:null,type:cc.Node},lightNode:{default:null,type:cc.Node},processingNode:{default:null,type:cc.Node},V4_toggle:{default:null,type:cc.Toggle},c1BtnNode:{default:null,type:cc.Node},c2BtnNode:{default:null,type:cc.Node},c3BtnNode:{default:null,type:cc.Node},c4BtnNode:{default:null,type:cc.Node},c5BtnNode:{default:null,type:cc.Node},c6BtnNode:{default:null,type:cc.Node},c7BtnNode:{default:null,type:cc.Node},c8BtnNode:{default:null,type:cc.Node},c9BtnNode:{default:null,type:cc.Node},claNode:{default:null,type:cc.Node}},show_light:function(){window.controller.lightNode.y=181,window.in_color=!1,window.bghintNode.active=!0,window.creativeCanvas.finish(),window.minecraft.shift(),window.girdNode.active=!1,0==window.hasRender&&window.faceSeletor.flush_preview_light(),console.log("show_light")},hide_light:function(){window.controller.lightNode.y=4096,window.in_color=!0,window.bghintNode.active=!1,window.creativeCanvas.finish(),window.minecraft.shift(),window.girdNode.active=!1,console.log("hide_light"),window.hasGird&&(window.hasColor||window.faceSeletor.download_gird_color())},to_gird:function(){window.controller.lightNode.y=4096,window.in_color=!0,window.bghintNode.active=!1,window.creativeCanvas.finish(),window.minecraft.shift(),window.girdNode.active=!0,console.log("to_gird"),window.hasGird||window.hasColor&&window.faceSeletor.download_gird_color()},on_pen:function(){window.isPen=!0,window.in_move=!1,window.eraser_masker.active=!1,console.log("on_pen")},on_eraser:function(){window.isPen=!1,window.in_move=!1,window.minecraft.set_index(-233),window.eraser_masker.active=!0,console.log("on_eraser")},on_upload_hints:function(){if(0!=window.hasSketch){var e=prompt("Points?");null!=e&&(window.creativeCanvas.points_XYRGBR=JSON.parse(e),window.creativeCanvas.finish(),window.creativeCanvas.create_k())}},on_download_hints:function(){if(0!=window.hasSketch){var e=window.open("about:blank").document;e.body.style.backgroundColor="#000000",e.writeln(JSON.stringify(window.creativeCanvas.points_XYRGBR))}},on_logo:function(){var e="https://style2paints.github.io/";"zh"==navigator.language.substring(0,2)&&(e="https://style2paints.github.io/README_zh"),"ja"==navigator.language.substring(0,2)&&(e="https://style2paints.github.io/README_ja"),window.open(e)},on_logo_en:function(){window.open("https://style2paints.github.io/")},on_logo_zh:function(){window.open("https://style2paints.github.io/README_zh")},on_logo_ja:function(){window.open("https://style2paints.github.io/README_ja")},on_twitter:function(){window.open("https://twitter.com/hashtag/style2paints?f=tweets&vertical=default")},on_github:function(){window.open("https://github.com/lllyasviel/style2paints")},on_file:function(){window.uploading||window.fileSelector.activate(window.controller.load_sketch)},on_magic:function(){window.faceSeletor.flush_preview()},on_ai:function(){if(!window.uploading&&0!=window.hasSketch){var e=window.open("about:blank").document;window.tripleCanvas.load_local();var n="";n+='',n+='',n+="


";var t=!0,o=!1,i=void 0;try{for(var a,r=window.finImageLoaders.reverse()[Symbol.iterator]();!(t=(a=r.next()).done);t=!0){var c=a.value;if(name==c.name&&""!=c.image.src){var d=c.image.src;n+="

"+c.name+".png

",n+='
'}}}catch(e){o=!0,i=e}finally{try{!t&&r.return&&r.return()}finally{if(o)throw i}}n+="
"+JSON.stringify(window.creativeCanvas.points_XYRGBR)+"
",window.confirmNode.active=!1,e.writeln(''+n+"")}},on_big_error:function(){var e="Network error. Please refresh this page.";"zh"==navigator.language.substring(0,2)&&(e="\u4e25\u91cd\u7f51\u7edc\u9519\u8bef\uff0c\u8bf7\u5237\u65b0\u3002"),"ja"==navigator.language.substring(0,2)&&(e="\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a8\u30e9\u30fc\u3001\u30da\u30fc\u30b8\u3092\u66f4\u65b0\u3057\u3066\u304f\u3060\u3055\u3044\u3002"),alert(e)},net_lock:function(e,n){console.log(e+" - net_lock -"+n),window.uploading=!0,window.fileBtnNode.active=!1,window.aiBtnNode.active=!1,window.magicBtnNode.active=!1,window.processingNode.active=!0,window.state_label.change(e,n)},net_unlock:function(e){try{console.log(e+" - net_unlock"),window.uploading=!1,window.fileBtnNode.active=!0,window.aiBtnNode.active=!0,window.magicBtnNode.active=!0,window.processingNode.active=!1,window.state_label.change(e,1)}catch(e){console.log(e)}},on_c0_event:function(){window.current_cid=0,window.previewSprite.spriteFrame=window.previewImageCanvas.load_canvas(window.finImageCanvass[window.current_cid].canvas),window.claNode.y=window.c1BtnNode.y},on_c1_event:function(){window.current_cid=1,window.previewSprite.spriteFrame=window.previewImageCanvas.load_canvas(window.finImageCanvass[window.current_cid].canvas),window.claNode.y=window.c2BtnNode.y},on_c2_event:function(){window.current_cid=2,window.previewSprite.spriteFrame=window.previewImageCanvas.load_canvas(window.finImageCanvass[window.current_cid].canvas),window.claNode.y=window.c3BtnNode.y},on_c3_event:function(){window.current_cid=3,window.previewSprite.spriteFrame=window.previewImageCanvas.load_canvas(window.finImageCanvass[window.current_cid].canvas),window.claNode.y=window.c4BtnNode.y},on_c4_event:function(){window.current_cid=4,window.previewSprite.spriteFrame=window.previewImageCanvas.load_canvas(window.finImageCanvass[window.current_cid].canvas),window.claNode.y=window.c5BtnNode.y},on_c5_event:function(){window.current_cid=5,window.previewSprite.spriteFrame=window.previewImageCanvas.load_canvas(window.finImageCanvass[window.current_cid].canvas),window.claNode.y=window.c6BtnNode.y},on_c6_event:function(){window.current_cid=6,window.previewSprite.spriteFrame=window.previewImageCanvas.load_canvas(window.finImageCanvass[window.current_cid].canvas),window.claNode.y=window.c7BtnNode.y},on_c7_event:function(){window.current_cid=7,window.previewSprite.spriteFrame=window.previewImageCanvas.load_canvas(window.finImageCanvass[window.current_cid].canvas),window.claNode.y=window.c8BtnNode.y},on_c8_event:function(){window.current_cid=8,window.previewSprite.spriteFrame=window.previewImageCanvas.load_canvas(window.finImageCanvass[window.current_cid].canvas),window.claNode.y=window.c9BtnNode.y},onLoad:function(){window.controller=this,window.uploading=!1,window.server_url=window.location.href.split("/file/")[0]+"/file",window.fileSelector=e("./FileInputs"),window.regulator=e("./SizeRegulator"),window.fileBtnNode=this.fileBtnNode,window.aiBtnNode=this.aiBtnNode,window.magicBtnNode=this.magicBtnNode,window.confirmNode=this.confirmNode,window.c9Node=this.c9Node,window.c1BtnNode=this.c1BtnNode,window.c2BtnNode=this.c2BtnNode,window.c3BtnNode=this.c3BtnNode,window.c4BtnNode=this.c4BtnNode,window.c5BtnNode=this.c5BtnNode,window.c6BtnNode=this.c6BtnNode,window.c7BtnNode=this.c7BtnNode,window.c8BtnNode=this.c8BtnNode,window.c9BtnNode=this.c9BtnNode,window.claNode=this.claNode,window.c1BtnSprite=this.c1BtnNode.getComponent("cc.Sprite"),window.c2BtnSprite=this.c2BtnNode.getComponent("cc.Sprite"),window.c3BtnSprite=this.c3BtnNode.getComponent("cc.Sprite"),window.c4BtnSprite=this.c4BtnNode.getComponent("cc.Sprite"),window.c5BtnSprite=this.c5BtnNode.getComponent("cc.Sprite"),window.c6BtnSprite=this.c6BtnNode.getComponent("cc.Sprite"),window.c7BtnSprite=this.c7BtnNode.getComponent("cc.Sprite"),window.c8BtnSprite=this.c8BtnNode.getComponent("cc.Sprite"),window.c9BtnSprite=this.c9BtnNode.getComponent("cc.Sprite"),window.confirmNode.active=!1,window.c9Node.active=!1,window.sketchNode=this.sketchNode,window.sketchSprite=this.sketchNode.getComponent("cc.Sprite"),window.alphaSketchNode=this.alphaSketchNode,window.alphaSketchSprite=this.alphaSketchNode.getComponent("cc.Sprite"),window.cpNode=this.cpNode,window.cpNodeSprite=this.cpNode.getComponent("cc.Sprite"),window.hasSketch=!1,window.hasGird=!1,window.hasColor=!1,window.hasRender=!1,window.in_color=!0,window.current_cid=0,window.claNode.y=window.c1BtnNode.y,window.hintNode=this.hintNode,window.hintSprite=this.hintNode.getComponent("cc.Sprite"),window.bghintNode=this.bghintNode,window.bghintSprite=this.bghintNode.getComponent("cc.Sprite"),window.bghintNode.active=!1,window.girdNode=this.girdNode,window.girdSprite=this.girdNode.getComponent("cc.Sprite"),window.girdNode.active=!1,window.previewNode=this.previewNode,window.previewSprite=this.previewNode.getComponent("cc.Sprite"),window.cpNode2=this.cpNode2,window.cpNode2Sprite=this.cpNode2.getComponent("cc.Sprite"),window.state_label=this.labelNode.getComponent("fake_bar"),window.pendingNode=this.pendingNode,window.pendingNode.active=!1,window.V4_toggle=this.V4_toggle;var n=e("./ImageLoader"),t=e("./ImageCanvas"),o=e("./BoxCanvas"),i=e("./TripleCanvas");window.finImageLoaders=[n("finImage1"),n("finImage2"),n("finImage3"),n("finImage4"),n("finImage5"),n("finImage6"),n("finImage7"),n("finImage8"),n("finImage9"),n("finImageExtra")],window.finImageLoaders[window.finImageLoaders.length-1].image.hidden=!0,window.finImageCanvass=[t("finImage1"),t("finImage2"),t("finImage3"),t("finImage4"),t("finImage5"),t("finImage6"),t("finImage7"),t("finImage8"),t("finImage9")],window.sketchImageLoader=n("sketchImage"),window.sketchImageCanvas=t("sketchImage"),window.sketchImageCanvas_bf=t("sketchImage_bf"),window.renderImageLoader=n("renderImage"),window.renderImageCanvas=t("renderImage"),window.cropImageLoader=n("cropImage"),window.cropImageCanvas=t("cropImage"),window.cropMaskCanvas=t("cropMask"),window.girdImageLoader=n("girdImage"),window.girdImageCanvas=t("girdImage"),window.sketchBoxCanvas=o("sketchBox"),window.tripleCanvas=i("tripleCanvas"),window.hintImageLoader=n("hintImage"),window.resultImageLoader=n("resultImage"),window.previewImageLoader=n("previewImage"),window.previewImageCanvas=t("previewImage"),window.creativeCanvas=e("./CreativeCanvas"),window.boxLoader=n("boxLoader"),window.boxLoader.load_url(window.server_url+"/res/Texture/board.png",function(e){}),window.leftNode=this.leftNode,window.isPen=!0,window.in_move=!1,window.current_room="new",window.current_step="new",window.logoNode=this.logoNode,window.processingNode=this.processingNode,window.processingNode.active=!1,window.cp_drager=[],window.crop_dragger_A=null},start:function(){setTimeout(this.on_pen,500),setTimeout(this.hide_light,500)},load_sketch:function(e){window.cropImageLoader.load_url(e,function(e){window.confirmNode.active=!0,window.cpNode.width=cc.winSize.width-100,window.cpNode.height=cc.winSize.height-300,window.cpNodeSprite.spriteFrame=window.cropImageCanvas.load_image(e,e.width,e.height),window.cpNode2Sprite.spriteFrame=window.cropMaskCanvas.dark();var n=1*window.cpNode.width/(1*window.cropImageCanvas.canvas.width),t=1*window.cpNode.height/(1*window.cropImageCanvas.canvas.height),o=Math.min(n,t);window.cpNode.width=parseInt(1*window.cropImageCanvas.canvas.width*o),window.cpNode.height=parseInt(1*window.cropImageCanvas.canvas.height*o),window.cp_drager[0].x=-window.cpNode.width/3.23,window.cp_drager[0].y=0,window.cp_drager[1].x=window.cpNode.width/3.23,window.cp_drager[1].y=0,window.cp_drager[2].x=0,window.cp_drager[2].y=-window.cpNode.height/3.23,window.cp_drager[3].x=0,window.cp_drager[3].y=window.cpNode.height/3.23,null!=window.crop_dragger_A&&window.crop_dragger_A.ontiii(null)})},load_hints:function(e){window.sketchImageLoader.load_url(e,function(e){window.previewSprite.spriteFrame=window.previewImageCanvas.clear(),window.hintSprite.spriteFrame=window.creativeCanvas.ini_image(e,e.width,e.height)})},confirm_ok:function(){var e=window.cropImageCanvas.image,n=parseInt(window.sketch_crop_w),t=parseInt(window.sketch_crop_h),o=parseInt(window.sketch_crop_l),i=parseInt(window.cropImageCanvas.canvas.height-window.sketch_crop_u);console.log([o,i,n,t]),window.sketchImageCanvas.load_image_adv(e,o,i,n,t),window.sketchImageCanvas_bf.load_image_adv(e,o,i,n,t),window.alphaSketchSprite.spriteFrame=window.sketchImageCanvas.load_alpha(),window.hasGird=!1,window.hasColor=!1,window.hasRender=!1,window.previewSprite.spriteFrame=window.previewImageCanvas.clear(),window.girdSprite.spriteFrame=window.girdImageCanvas.clear(),window.bghintSprite.spriteFrame=window.renderImageCanvas.clear(),window.current_room="new",window.current_step="new";var a=window.regulator.minRegulate([n,t],2048),r=window.regulator.maxRegulate([n,t],140);window.sketchSprite.spriteFrame=window.sketchBoxCanvas.ini(n,t),window.hintSprite.spriteFrame=window.creativeCanvas.ini(a[0],a[1]),window.sketchNode.width=a[0],window.sketchNode.height=a[1],window.sketchNode.scaleX=1*(cc.winSize.height-420)/window.sketchNode.height*1,window.sketchNode.scaleY=window.sketchNode.scaleX,window.c9Node.active=!0,window.sketchNode.x=105/1440*cc.winSize.height,window.sketchNode.y=.5*cc.winSize.height-window.sketchNode.scaleY*window.sketchNode.height*.5-100,window.hasSketch=!0,window.logoNode.active=!1,window.confirmNode.active=!1,window.c1BtnSprite.spriteFrame=window.finImageCanvass[0].load_image_adv(e,o,i,n,t),window.c1BtnNode.width=r[0],window.c1BtnNode.height=r[1],window.c2BtnSprite.spriteFrame=window.finImageCanvass[1].load_image_adv(e,o,i,n,t),window.c2BtnNode.width=r[0],window.c2BtnNode.height=r[1],window.c3BtnSprite.spriteFrame=window.finImageCanvass[2].load_image_adv(e,o,i,n,t),window.c3BtnNode.width=r[0],window.c3BtnNode.height=r[1],window.c4BtnSprite.spriteFrame=window.finImageCanvass[3].load_image_adv(e,o,i,n,t),window.c4BtnNode.width=r[0],window.c4BtnNode.height=r[1],window.c5BtnSprite.spriteFrame=window.finImageCanvass[4].load_image_adv(e,o,i,n,t),window.c5BtnNode.width=r[0],window.c5BtnNode.height=r[1],window.c6BtnSprite.spriteFrame=window.finImageCanvass[5].load_image_adv(e,o,i,n,t),window.c6BtnNode.width=r[0],window.c6BtnNode.height=r[1],window.c7BtnSprite.spriteFrame=window.finImageCanvass[6].load_image_adv(e,o,i,n,t),window.c7BtnNode.width=r[0],window.c7BtnNode.height=r[1],window.c8BtnSprite.spriteFrame=window.finImageCanvass[7].load_image_adv(e,o,i,n,t),window.c8BtnNode.width=r[0],window.c8BtnNode.height=r[1],window.c9BtnSprite.spriteFrame=window.finImageCanvass[8].load_image_adv(e,o,i,n,t),window.c9BtnNode.width=r[0],window.c9BtnNode.height=r[1],window.controller.uploadSketch()},confirm_failed:function(){window.confirmNode.active=!1},uploadSketch:function(){if(!window.uploading&&null!=window.sketchImageCanvas.source){window.controller.net_lock("initializing",0),window.current_room="new",window.current_step="new",window.creativeCanvas.kill_preview();var e=new XMLHttpRequest;e.open("POST",window.server_url.split("/file")[0]+"/run/upload_sketch",!0),e.setRequestHeader("Content-Type","application/json;"),e.onreadystatechange=function(){if(4==e.readyState&&200==e.status){var n=JSON.parse(e.responseText).data[0].split("_");window.current_room=n[0],window.current_step=n[1],console.log("get room id "+window.current_room),console.log("get step id "+window.current_step),window.controller.net_unlock("finished"),window.current_cid=0,window.claNode.y=window.c1BtnNode.y,window.controller.hide_light(),window.creativeCanvas.flush_bg(),window.faceSeletor.flush_preview()}else 4==e.readyState&&(window.state_label.change("error",1),window.controller.on_big_error(),window.location.reload())},e.send(JSON.stringify({data:[JSON.stringify({room:window.current_room,sketch:window.sketchImageCanvas.dataurl}),null]})),console.log("sketch uploaded")}}}),cc._RF.pop()},{"./BoxCanvas":"BoxCanvas","./CreativeCanvas":"CreativeCanvas","./FileInputs":"FileInputs","./ImageCanvas":"ImageCanvas","./ImageLoader":"ImageLoader","./SizeRegulator":"SizeRegulator","./TripleCanvas":"TripleCanvas"}],dragbox:[function(e,n,t){"use strict";cc._RF.push(n,"6591e257m1DWrS+H2/IDVmm","dragbox"),cc.Class({extends:cc.Component,properties:{},onLoad:function(){window.drag_box=this},start:function(){window.mouse_l=!1,window.mouse_r=!1,window.mouse_m=!1,window.ctrl=!1,window.alt=!1,window.drag_box=this,this.node.on(cc.Node.EventType.MOUSE_DOWN,this.onMouseDown,this),this.node.on(cc.Node.EventType.MOUSE_UP,this.onMouseUp,this),this.node.on(cc.Node.EventType.MOUSE_WHEEL,this.onMouseWheel,this),this.node.on(cc.Node.EventType.TOUCH_MOVE,this.onTouchMove,this),this.node.on("mousemove",function(e){window.mousePosition=e.getLocation();var n=.5*window.leftNode.width+1*window.drag_target.x-.5*window.drag_target.width*window.drag_target.scaleX+300,t=.5*window.leftNode.height+1*window.drag_target.y-.5*window.drag_target.height*window.drag_target.scaleX,o=(window.mousePosition.x-n)/(window.drag_target.width*window.drag_target.scaleX),i=(window.mousePosition.y-t)/(window.drag_target.height*window.drag_target.scaleX);o>0&&i>0&&o<1&&i<1?(window.creativeCanvas.re=!0,window.creativeCanvas.rex=o,window.creativeCanvas.rey=i,window.creativeCanvas.in_drag||window.creativeCanvas.refresh_current_point_index()):window.creativeCanvas.re=!1,window.alt&&(window.mouse_l||window.mouse_r||window.mouse_m||window.in_color&&window.drag_box.do_picking())}),cc.systemEvent.on(cc.SystemEvent.EventType.KEY_DOWN,function(e){e.keyCode==cc.KEY.z&&window.creativeCanvas.undo()}),cc.systemEvent.on(cc.SystemEvent.EventType.KEY_DOWN,function(e){e.keyCode==cc.KEY.y&&window.creativeCanvas.redo()}),cc.systemEvent.on(cc.SystemEvent.EventType.KEY_DOWN,function(e){switch(e.keyCode){case cc.KEY.ctrl:window.ctrl=!0;break;case cc.KEY.alt:window.alt||(window.alt=!0,window.in_color&&(window.drag_box.begin_picking(),window.drag_box.do_picking()))}},this),cc.systemEvent.on(cc.SystemEvent.EventType.KEY_UP,function(e){switch(e.keyCode){case cc.KEY.ctrl:window.ctrl=!1;break;case cc.KEY.alt:window.alt=!1,window.in_color&&window.drag_box.end_picking()}},this)},onTouchMove:function(e){if(void 0!==window.drag_target)if(window.mouse_m||window.mouse_r||window.in_move){var n=e.touch.getDelta();window.drag_target.x+=n.x,window.drag_target.y+=n.y}else window.mouse_l&&(window.isPen?window.creativeCanvas.in_drag&&(window.creativeCanvas.relocate_current_point(),window.creativeCanvas.finish()):(window.creativeCanvas.refresh_current_point_index(),window.creativeCanvas.current_index>-1&&window.creativeCanvas.if_point_in_color(window.creativeCanvas.current_index)==window.in_color&&(window.creativeCanvas.points_XYRGBR.splice(window.creativeCanvas.current_index,1),window.creativeCanvas.finish())))},onMouseDown:function(e){var n=e.getButton();n===cc.Event.EventMouse.BUTTON_LEFT?(window.mouse_l=!0,window.creativeCanvas.re&&0==window.in_move&&(window.isPen?(window.creativeCanvas.current_index<0&&(window.creativeCanvas.add_point(),window.creativeCanvas.finish()),window.creativeCanvas.in_drag=!0):(window.creativeCanvas.refresh_current_point_index(),window.creativeCanvas.current_index>-1&&window.creativeCanvas.if_point_in_color(window.creativeCanvas.current_index)==window.in_color&&(window.creativeCanvas.points_XYRGBR.splice(window.creativeCanvas.current_index,1),window.creativeCanvas.finish())))):n===cc.Event.EventMouse.BUTTON_MIDDLE?window.mouse_m=!0:n===cc.Event.EventMouse.BUTTON_RIGHT&&(window.mouse_r=!0)},onMouseUp:function(e){var n=e.getButton();n===cc.Event.EventMouse.BUTTON_LEFT?(window.mouse_l=!1,window.creativeCanvas.in_drag=!1,window.creativeCanvas.create_k()):n===cc.Event.EventMouse.BUTTON_MIDDLE?window.mouse_m=!1:n===cc.Event.EventMouse.BUTTON_RIGHT&&(window.mouse_r=!1)},onMouseWheel:function(e){void 0!==window.drag_target&&(e.getScrollY()>0?window.drag_target.runAction(cc.scaleTo(.1,1.2*window.drag_target.scaleX)):window.drag_target.runAction(cc.scaleTo(.1,window.drag_target.scaleX/1.2)))},begin_picking:function(){void 0!==window.dropper_node&&window.creativeCanvas.flush()},do_picking:function(){if(void 0!==window.dropper_node){window.dropper_node.x=window.mousePosition.x-cc.winSize.width+150+30,window.dropper_node.y=window.mousePosition.y-cc.winSize.height/2-181+30;var e=.5*window.leftNode.width+1*window.drag_target.x-.5*window.drag_target.width*window.drag_target.scaleX+300,n=.5*window.leftNode.height+1*window.drag_target.y-.5*window.drag_target.height*window.drag_target.scaleX,t=(window.mousePosition.x-e)/(window.drag_target.width*window.drag_target.scaleX),o=(window.mousePosition.y-n)/(window.drag_target.height*window.drag_target.scaleX);if(t>0&&o>0&&t<1&&o<1)if(window.creativeCanvas.re=!0,window.creativeCanvas.rex=t,window.creativeCanvas.rey=o,window.creativeCanvas.refresh_current_point_index(),window.creativeCanvas.current_index>-1){var i=window.creativeCanvas.points_XYRGBR[window.creativeCanvas.current_index],a=[i[2],i[3],i[4]];window.color_picker_main.float_do(new cc.color(a[0],a[1],a[2])),window.minecraft.set_cur_color([a[0],a[1],a[2]]),window.pickCanvas.currentColor[0]=a[0],window.pickCanvas.currentColor[1]=a[1],window.pickCanvas.currentColor[2]=a[2]}else{var r=window.previewImageCanvas;window.girdNode.active&&(r=window.girdImageCanvas);var c=r.get_color(t,o);window.color_picker_main.float_do(c),window.minecraft.set_cur_color([c.r,c.g,c.b]),window.pickCanvas.currentColor[0]=c.r,window.pickCanvas.currentColor[1]=c.g,window.pickCanvas.currentColor[2]=c.b}}},end_picking:function(){void 0!==window.dropper_node&&(this.do_picking(),window.pickCanvas.floatingColor[0]=window.dropper_node.color.r,window.pickCanvas.floatingColor[1]=window.dropper_node.color.g,window.pickCanvas.floatingColor[2]=window.dropper_node.color.b,window.dropper_node.x=122,window.dropper_node.y=268,window.color_picker_main.pick_do())}}),cc._RF.pop()},{}],dragtarget:[function(e,n,t){"use strict";cc._RF.push(n,"16ac9dXjiBLKrkojVzbW1dk","dragtarget"),cc.Class({extends:cc.Component,properties:{},onLoad:function(){window.drag_target=this.node}}),cc._RF.pop()},{}],eraser_masker:[function(e,n,t){"use strict";cc._RF.push(n,"d389dAkX0JBZruQtEeVulcE","eraser_masker"),cc.Class({extends:cc.Component,properties:{},onLoad:function(){window.eraser_masker=this.node},update:function(e){this.node.x=window.mousePosition.x-cc.winSize.width/2,this.node.y=window.mousePosition.y-cc.winSize.height/2}}),cc._RF.pop()},{}],faceSelector:[function(e,n,t){"use strict";cc._RF.push(n,"8c11b3zCbJK37zCkjWNkHWp","faceSelector"),cc.Class({extends:cc.Component,properties:{bigFaceNode:{default:null,type:cc.Node},faceNodes:{default:[],type:cc.Node}},onLoad:function(){window.faceSeletor=this},start:function(){var n=this;window.faceID=-233,window.faceSeletor=this,window.bigFaceNode=this.bigFaceNode,window.bigFaceSprite=this.bigFaceNode.getComponent("cc.Sprite");for(var t=function(e){n.faceNodes[e].getComponent(cc.Sprite).spriteFrame=new cc.SpriteFrame,n.faceNodes[e].getComponent(cc.Sprite).spriteFrame.setTexture(cc.textureCache.addImage(window.server_url+"/res/face_128/"+(e+1)+".jpg")),n.faceNodes[e].on(cc.Node.EventType.MOUSE_UP,function(n){window.faceSeletor.on_face_selected(e)})},o=0;o<32;o++)t(o);var i=e("./ImageLoader"),a=e("./ImageCanvas");window.faceImageLoader=i("faceImage"),window.faceImageCanvas=a("faceImage"),this.on_face_selected(Math.floor(32*Math.random())),this.bigFaceNode.on("mousemove",function(e){window.mousePosition=e.getLocation();var n=150-.5*window.bigFaceNode.width,t=1290-.5*window.bigFaceNode.height,o=(1*window.mousePosition.x-n)/(1*window.bigFaceNode.width),i=(1*window.mousePosition.y-t)/(1*window.bigFaceNode.height);if(o>0&&i>0&&o<1&&i<1){var a=window.faceImageCanvas.get_color(o,i);window.color_picker_main.float_do(a)}}),this.bigFaceNode.on("mousedown",function(e){window.color_picker_main.pick_do()})},on_face_selected:function(e){window.faceID=e,window.faceImageLoader.load_url(window.server_url+"/res/face_512/"+(e+1)+".jpg",function(e){window.bigFaceSprite.spriteFrame=window.faceImageCanvas.load_image(e,240,240),window.bigFaceNode.width=240,window.bigFaceNode.height=240}),window.girdNode.active?window.controller.to_gird():window.controller.hide_light(),window.creativeCanvas.flush_bg(),this.flush_preview()},on_upload:function(){0!=window.hasSketch&&window.fileSelector.activate(window.faceSeletor.load_reference)},flush_preview:function(){window.in_color?this.flush_preview_color():this.flush_preview_light()},on_toggle_v4v2:function(){window.controller.hide_light(),window.faceSeletor.flush_preview()},flush_preview_color:function(){if(!window.uploading&&0!=window.hasSketch){window.hasGird=!1,window.hasColor=!1,window.hasRender=!1,window.controller.net_lock("painting",0);var e=new XMLHttpRequest;e.open("POST",window.server_url.split("/file")[0]+"/run/request_result",!0),e.setRequestHeader("Content-Type","application/json;"),e.onreadystatechange=function(){if(4==e.readyState&&200==e.status){var n=JSON.parse(e.responseText).data[0].split("_");window.current_room=n[0],window.current_step=n[1],console.log("get room id "+window.current_room),console.log("get step id "+window.current_step),window.controller.net_unlock("finished"),window.faceSeletor.download_gird_color()}else 4==e.readyState&&window.controller.net_unlock("error")},e.send(JSON.stringify({data:[JSON.stringify({room:window.current_room,points:JSON.stringify(window.creativeCanvas.points_XYRGBR),face:window.faceID<0?window.faceImageCanvas.canvas.toDataURL("image/png"):null,faceID:window.faceID+65535,need_render:0,skipper:null,inv4:window.V4_toggle.isChecked?1:0,r:window.lighter.color_tog.isChecked?window.lighter.light_R_slider.progress:-1,g:window.lighter.color_tog.isChecked?window.lighter.light_G_slider.progress:-1,b:window.lighter.color_tog.isChecked?window.lighter.light_B_slider.progress:-1,h:window.lighter.light_H_slider.progress,d:window.light_direction}),null]})),console.log("request sended")}},download_gird_color:function(){window.resultImageLoader.on_error=function(e){window.controller.net_unlock("error")},window.resultImageLoader.on_finish=function(e){window.controller.net_unlock("finished")};for(var e=["sketch","flat_careless","blended_flat_careless","smoothed_careless","blended_smoothed_careless","flat_careful","blended_flat_careful","smoothed_careful","blended_smoothed_careful"],n=function(n){window.finImageLoaders[n].load_result(e[n],function(e){window.finImageLoaders[n].hidden||(window.c9BtnSprite.spriteFrame=window.finImageCanvass[n].load_image(e,e.width,e.height),8==window.current_cid&&(window.previewSprite.spriteFrame=window.previewImageCanvas.load_image(e,e.width,e.height),window.alphaSketchSprite.spriteFrame=window.sketchImageCanvas.clear(),window.hasColor=!0,window.controller.net_unlock("finished"),window.controller.hide_light()))})},t=0;t2.5*e.height||e.height>2.5*e.width)){var n=window.regulator.maxRegulate([e.width,e.height],240);window.bigFaceSprite.spriteFrame=window.faceImageCanvas.load_image(e,n[0],n[1]),window.bigFaceNode.width=n[0],window.bigFaceNode.height=n[1],window.faceID=-233,window.controller.hide_light(),window.faceSeletor.flush_preview()}})}}),cc._RF.pop()},{"./ImageCanvas":"ImageCanvas","./ImageLoader":"ImageLoader"}],fake_bar:[function(e,n,t){"use strict";cc._RF.push(n,"61dcdov4D1Nc6gCTDSTIWPe","fake_bar"),cc.Class({extends:cc.Component,properties:{lab:{default:null,type:cc.Label},lab2:{default:null,type:cc.Label},prof:{default:null,type:cc.Node},prob:{default:null,type:cc.Node}},onLoad:function(){window.fake_bar_pro=this,this.text="finished",this.progress=1},change:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.text=e,this.progress=n},update:function(e){this.progress+=2e-4*(1-this.progress),this.progress>1&&(this.progress=1),this.lab.string=this.text+" ("+parseInt(100*this.progress)+"%)",this.lab2.string=this.lab.string,this.prof.width=parseInt(this.prob.width*this.progress),this.prob.active=this.progress<1}}),cc._RF.pop()},{}],lighter:[function(e,n,t){"use strict";cc._RF.push(n,"90b3at5d8FPDJEjfZXvwb7o","lighter"),cc.Class({extends:cc.Component,properties:{light_R_slider:{default:null,type:cc.Slider},light_G_slider:{default:null,type:cc.Slider},light_B_slider:{default:null,type:cc.Slider},light_H_slider:{default:null,type:cc.Slider},light_TT_slider:{default:null,type:cc.Toggle},light_TF_slider:{default:null,type:cc.Toggle},light_FT_slider:{default:null,type:cc.Toggle},light_FF_slider:{default:null,type:cc.Toggle},bgs:{default:null,type:cc.Node},colors:{default:null,type:cc.Node},color_tog:{default:null,type:cc.Toggle}},onLoad:function(){window.lighter=this},start:function(){this.light_R_slider.progress=.99,this.light_G_slider.progress=.83,this.light_B_slider.progress=.66,this.light_H_slider.progress=100/600,window.lighter=this,window.light_direction=0,this.reflush()},light_direction_0:function(){window.light_direction=0},light_direction_1:function(){window.light_direction=1},light_direction_2:function(){window.light_direction=2},light_direction_3:function(){window.light_direction=3},on_shift:function(){window.lighter.color_tog.isChecked?window.lighter.colors.active=!0:window.lighter.colors.active=!1,window.lighter.reflush()},reflush:function(){window.lighter.color_tog.isChecked?this.bgs.color=cc.color(parseInt(255*this.light_R_slider.progress),parseInt(255*this.light_G_slider.progress),parseInt(255*this.light_B_slider.progress),255):this.bgs.color=cc.color(255,255,255,255)}}),cc._RF.pop()},{}],mc:[function(e,n,t){"use strict";cc._RF.push(n,"9f420tBdblH772q0XTCwvMY","mc"),cc.Class({extends:cc.Component,properties:{c0:{default:null,type:cc.Sprite},c1:{default:null,type:cc.Sprite},c2:{default:null,type:cc.Sprite},c3:{default:null,type:cc.Sprite},c4:{default:null,type:cc.Sprite},c5:{default:null,type:cc.Sprite},c6:{default:null,type:cc.Sprite},c7:{default:null,type:cc.Sprite},c8:{default:null,type:cc.Sprite},kuang:{default:null,type:cc.Sprite}},onLoad:function(){window.minecraft=this},start:function(){this.sps=[this.c0,this.c1,this.c2,this.c3,this.c4,this.c5,this.c6,this.c7,this.c8],window.minecraft=this,this.big9=[[255,255,255],[255,230,200],[137,148,170],[150,164,141],[229,202,209],[249,233,218],[0,233,1],[1,233,0],[154,81,255]],this.reload_all(),this.index=4,this.set_index(0),window.in_color=!0,this.shift(),setTimeout("window.pickCanvas.record=window.pickCanvas.bigall;window.pickCanvas.finish();",200)},set_0:function(){this.set_index(0)},set_1:function(){this.set_index(1)},set_2:function(){this.set_index(2)},set_3:function(){this.set_index(3)},set_4:function(){this.set_index(4)},set_5:function(){this.set_index(5)},set_6:function(){this.set_index(6)},set_7:function(){this.set_index(7)},set_8:function(){this.set_index(8)},refresh:function(){for(var e=0;e<9;e++)this.set_color(e,[0,0,0]);setTimeout("window.minecraft.reload_all();window.minecraft.set_index(window.minecraft.index);",100)},reload_all:function(){for(var e=0;e<9;e++)this.set_color(e,this.big9[e])},set_index:function(e){if(-233==e)return this.index=e,void(this.kuang.node.active=!1);this.kuang.node.active=!0,e<0&&(e=0),e>8&&(e=8),this.index=e,this.kuang.node.x=100*e-400,this.index>-1&&this.index<5&&(window.pickCanvas.floatingColor[0]=this.sps[this.index].node.color.r,window.pickCanvas.floatingColor[1]=this.sps[this.index].node.color.g,window.pickCanvas.floatingColor[2]=this.sps[this.index].node.color.b,window.color_picker_main.pick_float(),window.isPen=!0,window.in_move=!1,window.eraser_masker.active=!1),5==this.index&&(window.isPen=!0,window.in_move=!1,window.eraser_masker.active=!1),6==this.index&&(window.isPen=!0,window.in_move=!1,window.eraser_masker.active=!1),7==this.index&&(window.isPen=!0,window.in_move=!0,window.eraser_masker.active=!1),8==this.index&&(window.isPen=!1,window.in_move=!1,window.eraser_masker.active=!0)},set_color:function(e,n){e>-1&&e<5&&(this.sps[e].node.color=cc.color(n[0],n[1],n[2],255))},shift:function(){for(var e=0;e<5;e++)this.sps[e].node.active=window.in_color;for(var n=5;n<7;n++)this.sps[n].node.active=!window.in_color;7!=this.index&&8!=this.index&&(window.in_color&&this.index>4&&this.set_index(0),window.in_color||this.index<5&&this.set_index(5))},go_pen:function(){5!=this.index&&6!=this.index&&7!=this.index&&8!=this.index||(this.index=0,this.kuang.node.x=-400)},set_cur_color:function(e){this.index>-1&&this.index<5&&(this.sps[this.index].node.color=cc.color(e[0],e[1],e[2],255))}}),cc._RF.pop()},{}],movebig:[function(e,n,t){"use strict";cc._RF.push(n,"baf29QBazxFQ4PCL2/AHscA","movebig"),cc.Class({extends:cc.Component,properties:{},onLoad:function(){this.node.on(cc.Node.EventType.TOUCH_MOVE,function(e){if(null!=e){for(var n=e.touch.getDelta(),t=0;t<4;t++)window.cp_drager[t].x+=n.x,window.cp_drager[t].y+=n.y,window.cp_drager[t].x<-window.cpNode.width/2&&(window.cp_drager[t].x=-window.cpNode.width/2),window.cp_drager[t].x>window.cpNode.width/2&&(window.cp_drager[t].x=window.cpNode.width/2),window.cp_drager[t].y<-window.cpNode.height/2&&(window.cp_drager[t].y=-window.cpNode.height/2),window.cp_drager[t].y>window.cpNode.height/2&&(window.cp_drager[t].y=window.cpNode.height/2);window.crop_dragger_A.ontiii(null)}},this.node)},update:function(e){}}),cc._RF.pop()},{}],movertiny:[function(e,n,t){"use strict";cc._RF.push(n,"050d97BhuFBcogu1X1n+Eah","movertiny"),cc.Class({extends:cc.Component,properties:{},onLoad:function(){window.crop_dragger_A=this,self.spriteFrame=new cc.SpriteFrame,self.texture2d=null,window.cp_drager.push(this.node),this.node.on(cc.Node.EventType.TOUCH_MOVE,this.ontiii,this.node),this.ontiii(null)},start:function(){this.ontiii(null)},ontiii:function(e){if(null!=e){var n=e.touch.getDelta();this.x+=n.x,this.y+=n.y}if(!(window.cp_drager.length<4)){this.x<-window.cpNode.width/2&&(this.x=-window.cpNode.width/2),this.x>window.cpNode.width/2&&(this.x=window.cpNode.width/2),this.y<-window.cpNode.height/2&&(this.y=-window.cpNode.height/2),this.y>window.cpNode.height/2&&(this.y=window.cpNode.height/2),window.sketch_crop_l=.5+1*Math.min(window.cp_drager[0].x,window.cp_drager[1].x,window.cp_drager[2].x,window.cp_drager[3].x)/(1*window.cpNode.width),window.sketch_crop_r=.5+1*Math.max(window.cp_drager[0].x,window.cp_drager[1].x,window.cp_drager[2].x,window.cp_drager[3].x)/(1*window.cpNode.width),window.sketch_crop_d=.5+1*Math.min(window.cp_drager[0].y,window.cp_drager[1].y,window.cp_drager[2].y,window.cp_drager[3].y)/(1*window.cpNode.height),window.sketch_crop_u=.5+1*Math.max(window.cp_drager[0].y,window.cp_drager[1].y,window.cp_drager[2].y,window.cp_drager[3].y)/(1*window.cpNode.height),window.sketch_crop_l*=window.cropImageCanvas.canvas.width,window.sketch_crop_r*=window.cropImageCanvas.canvas.width,window.sketch_crop_d*=window.cropImageCanvas.canvas.height,window.sketch_crop_u*=window.cropImageCanvas.canvas.height,window.sketch_crop_w=window.sketch_crop_r-window.sketch_crop_l,window.sketch_crop_h=window.sketch_crop_u-window.sketch_crop_d,window.controller.real_fileBtnNode.active=!0,window.sketch_crop_w>2.6*window.sketch_crop_h&&(window.controller.real_fileBtnNode.active=!1),window.sketch_crop_h>2.6*window.sketch_crop_w&&(window.controller.real_fileBtnNode.active=!1),self.canvas=window.cropMaskCanvas.canvas,self.canvas.width=window.cropImageCanvas.canvas.width,self.canvas.height=window.cropImageCanvas.canvas.height;var t=self.canvas.getContext("2d");t.fillStyle="rgba(0,0,0,0.8)",t.fillRect(0,0,canvas.width,canvas.height);var o=parseInt(window.sketch_crop_w),i=parseInt(window.sketch_crop_h),a=parseInt(window.sketch_crop_l),r=parseInt(window.cropImageCanvas.canvas.height-window.sketch_crop_u);t.clearRect(a,r,o,i),self.texture2d=new cc.Texture2D,self.spriteFrame.setTexture(self.texture2d),self.texture2d.initWithElement(self.canvas),self.texture2d.handleLoadedTexture(!0),window.cpNode2Sprite.spriteFrame=self.spriteFrame}},update:function(e){}}),cc._RF.pop()},{}],selfrot:[function(e,n,t){"use strict";cc._RF.push(n,"985733m0s1I44Gbui8XNyvc","selfrot"),cc.Class({extends:cc.Component,properties:{},start:function(){},update:function(e){this.node.rotation+=30*e}}),cc._RF.pop()},{}],shift50:[function(e,n,t){"use strict";cc._RF.push(n,"e8cf1Q/isJAM4tJYI+kKutU","shift50"),cc.Class({extends:cc.Component,properties:{},onLoad:function(){window.shifter_50=this},up50:function(){this.node.x=50},down50:function(){this.node.x=-50}}),cc._RF.pop()},{}],shiftlr:[function(e,n,t){"use strict";cc._RF.push(n,"ff80e/rKS5NvaF8zKm4aA06","shiftlr"),cc.Class({extends:cc.Component,properties:{btn_show:{default:null,type:cc.Node},btn_hide:{default:null,type:cc.Node},btn_a:{default:null,type:cc.Node},btn_b:{default:null,type:cc.Node}},show:function(){this.btn_show.active=!1,this.btn_hide.active=!0,this.btn_a.active=!0,this.btn_b.active=!0},hide:function(){this.btn_show.active=!0,this.btn_hide.active=!1,this.btn_a.active=!1,this.btn_b.active=!1}}),cc._RF.pop()},{}]},{},["BoxCanvas","CreativeCanvas","FileInputs","ImageCanvas","ImageLoader","PickCanvas","SizeRegulator","TripleCanvas","colorpicker","controller","dragbox","dragtarget","eraser_masker","faceSelector","fake_bar","lighter","mc","movebig","movertiny","selfrot","shift50","shiftlr"]); \ No newline at end of file diff --git a/ui/web-mobile/src/settings.b2ff5.js b/ui/web-mobile/src/settings.b2ff5.js new file mode 100644 index 0000000000000000000000000000000000000000..6f9e28e1c8ee14af8b05e50f7b319e90798c81c5 --- /dev/null +++ b/ui/web-mobile/src/settings.b2ff5.js @@ -0,0 +1 @@ +window._CCSettings={platform:"web-mobile",groupList:["default"],collisionMatrix:[[true]],rawAssets:{assets:{}},assetTypes:[],launchScene:"db://assets/Scene/helloworld.fire",scenes:[{url:"db://assets/Scene/helloworld.fire",uuid:0}],packedAssets:{"0e39b7083":["08MeXCe1dMHYedNdkzS63A","10L7rqO+5OtoYe7G9tTmg1","1aMvx28L1PZpgPVpKcDKCz","1emZAFMAJDpYid8LTfEewW","28PhFLWBlNi7ZOiy6wWfs1","29FYIk+N1GYaeWH/q1NxQO","2cZUroAXNDYqgiQa6XtTc3",0,"33OMyX85RBaboj6DH6pUR4","39MpUyhd1KO5lqkP4gRjGL","3d7rWwYtBD3p3bKpT7hPYw","43+q/0K7tHg7DFdkHh5wdp","47UdQy3DhCMJFip3T7mkbm","51VxMzvpxNt5Eude2ZcZ+H","55/pLEAd1KgqMC+Zu5+CM8","61jjCOw0ZBWLRWB/98eufd","65McWXN3tCy6LVKe64BuuS","68J8oyAQdFUrqy37MXmbtE","6erFCVsFpOfI/2jYl2ny9K","73lcvDzLBNWIH2ElsQuEBW","75qd14DUdM8bm+GF3SMYaT","7fER+s2OxBVJr1nmf61QA+","8c20Sso/ZEn7NUfNSM+EBh","90AErWL21A4ZPvtxQ3XG8G","93A3mAWIRJPqSL2jznn6+j","a2MjXRFdtLlYQ5ouAFv/+R","a9WLZTN3hO56gmWW/Zy0mz","b1oqXv5YhLeLek/LqyBXpr","b4Vu5hV55HcIAV2L1fo5H8","bd4f8weJ9FMqiEvMV+sn+n","bfD2QsCeBMdJIozPyHybN/","c7PZTRM5VBqKm9Nbz2Yepi","cd/TmhtM9J66HH9njOEZ+H","d1MP9xGktN+oMvtBxdLhgq","d2USs4NLxG8IHzH3SpIWwA","e4G5S883RM47WPxkyuPCQ0","e7q6FL+VZEgLJUjVeDLic/","e97GVMl6JHh5Ml5qEDdSGa","f0BIwQ8D5Ml7nTNQbh1YlS","f0tpaN389NEYuM7aul/b8S","f7dd/+nptHoIqUFepAEcrB","fbP12mE1ZDtJzoZK4U6lSU"],"0fab38db5":["00eb2q7hlMj7GXigg5AV5g","02delMVqdBD70a/HSD99FK","03p2MmRKJCdZ5AsjCj7sHN","06vZFiAAJDZYVKHgAYMkFE","0fwe5eFfFEmpa0ZPVR7EtI","226kS492tNIJQrLRGCSmtw","34n14Pu71Grr1AJOTEM1bi","39yW4Bc9VKJKFRW1gXJnWc","40m4g3hMNNCrwsd8CTt6uQ","46NQdwGmhIzbOm/xN4AFWm","50CbuLH61Mgp0fU9reknk/","56fc2Ai/RFNYpaMT8crweK","64iVI/DaVLt4Vf7oiaAWmu","65EelgvQxEI4BrVLTDbi2Y","679co/+9pO3IQeM+J2lfvH","69O71YbnBB+5PkOtJI2TvR","6eBWFz0oVHPLIGQKf/9Thu","71VhFCTINJM6/Ky3oX9nBT","73oJA92A5OPKpn+ZlUPAj1","7bbDiwUGZMta3uM/wWJTyw","7cvienAXxBMI2svV3dFolc","90YtjmdnFIcL8cmAgzp+Tv","9093vD545J6ZUEYzPwhfLK","9dYAAftfRHJqYpJlnj3tC4","a6WA9aHtxCh5YHKRvVP3Xw","a9+i07/8pPYK37OJXM0mCS","b2KMvAVjxLxKX0TR89NNkA","b4P/PCArtIdIH38t6mlw8Y","c8da7TtxBFLrBK3p3et/+X","d2kHe6FidKcpV5e1aiNTQM","d4u6MnLXxBV79+3Hng9oHd","de/e4JzelC4Z4eHkP3iE9V","e129YibpJHJKWONYnD1rRC","e60pPrifdEzquK0N9LCE/t","e8Ueib+qJEhL6mXAHdnwbi","e8UlNj5+dHyIAD1rSaRFQi","eaEJTBfGVMP6tI4b09l/xC","eadEprFbtAdbR6H7LC8vTn","eeEF+K/mxAOZFch5MFpVtF","f5mgNMKMtLPL1udKc+0Eyt","f8/EswgwJFlYr6skAapCKR"]},orientation:"",subpackages:{},uuids:["2dL3kvpAxJu6GJ7RdqJG5J"],md5AssetsMap:{"00/0079bdaa-ee19-4c8f-b197-8a0839015e60.json":"87146","0e/0e39b7083.json":"524e9","0f/0fab38db5.json":"fcac8","assets/00/0079bdaa-ee19-4c8f-b197-8a0839015e60.png":"fca06","assets/02/0275e94c-56a7-410f-bd1a-fc7483f7d14a.png":"cea68","assets/03/03a76326-44a2-4275-9e40-b230a3eec1cd.png":"c837b","assets/06/06bd9162-0002-4365-854a-1e0018324144.png":"8090a","assets/0f/0fc1ee5e-15f1-449a-96b4-64f551ec4b48.jpg":"56ae8","assets/22/22ea44b8-f76b-4d20-942b-2d11824a6b70.png":"d8588","assets/34/349f5e0f-bbbd-46ae-bd40-24e4c43356e2.png":"8d682","assets/39/39c96e01-73d5-4a24-a151-5b581726759c.png":"d45fb","assets/40/409b8837-84c3-4d0a-bc2c-77c093b7ab90.png":"33060","assets/46/46350770-1a68-48cd-b3a6-ff13780055a6.png":"81883","assets/50/5009bb8b-1fad-4c82-9d1f-53dade92793f.png":"73b9c","assets/56/567dcd80-8bf4-4535-8a5a-313f1caf078a.png":"acdf0","assets/64/6489523f-0da5-4bb7-855f-ee889a0169ae.png":"955dc","assets/65/6511e960-bd0c-4423-806b-54b4c36e2d98.png":"0d0ac","assets/67/67f5ca3f-fbda-4edc-841e-33e27695fbc7.png":"b4ff6","assets/69/693bbd58-6e70-41fb-93e4-3ad248d93bd1.png":"e51b8","assets/6e/6e056173-d285-473c-b206-40a7fff5386e.png":"68270","assets/71/71561142-4c83-4933-afca-cb7a17f67053.png":"286c6","assets/73/73a0903d-d80e-4e3c-aa67-f999543c08f5.png":"1fc57","assets/7b/7b6c38b0-5066-4cb5-adee-33fc16253cb0.png":"467e0","assets/7c/7cbe27a7-017c-4130-8dac-bd5ddd16895c.png":"d4792","assets/90/9062d8e6-7671-4870-bf1c-980833a7e4ef.png":"08a70","assets/90/90f77bc3-e78e-49e9-9504-6333f085f2ca.png":"40fe2","assets/9d/9d60001f-b5f4-4726-a629-2659e3ded0b8.png":"94752","assets/a6/a6580f5a-1edc-4287-9607-291bd53f75f0.png":"a089e","assets/a9/a9fa2d3b-ffca-4f60-adfb-3895ccd26092.png":"070d2","assets/b2/b228cbc0-563c-4bc4-a5f4-4d1f3d34d900.png":"a6fba","assets/b4/b43ff3c2-02bb-4874-81f7-f2dea6970f18.png":"bedf4","assets/c8/c875aed3-b710-452e-b04a-de9ddeb7ff97.png":"e3c06","assets/d2/d29077ba-1627-4a72-9579-7b56a235340c.png":"0791d","assets/d4/d4bba327-2d7c-4157-bf7e-dc79e0f681dd.png":"c156f","assets/de/defdee09-cde9-42e1-9e1e-1e43f7884f55.png":"4ceec","assets/e1/e1dbd622-6e92-4724-a58e-3589c3d6b442.png":"85d54","assets/e6/e6d293eb-89f7-44ce-ab8a-d0df4b084fed.png":"b94ef","assets/e8/e851e89b-faa2-4484-bea6-5c01dd9f06e2.png":"1ecb7","assets/e8/e8525363-e7e7-47c8-8003-d6b49a445422.png":"10fe6","assets/ea/ea1094c1-7c65-4c3f-ab48-e1bd3d97fc42.png":"04fa3","assets/ea/ea744a6b-15bb-4075-b47a-1fb2c2f2f4e7.png":"5d0c4","assets/ee/ee105f8a-fe6c-4039-915c-879305a55b45.png":"72616","assets/f5/f59a034c-28cb-4b3c-bd6e-74a73ed04cad.png":"b7b3a","assets/f8/f8fc4b30-8302-4595-8afa-b2401aa42291.png":"8f722"}}; \ No newline at end of file diff --git a/ui/web-mobile/style-desktop.ec961.css b/ui/web-mobile/style-desktop.ec961.css new file mode 100644 index 0000000000000000000000000000000000000000..f2117923e6f8507f0947fe70a2a81aa5e35bf64a --- /dev/null +++ b/ui/web-mobile/style-desktop.ec961.css @@ -0,0 +1,117 @@ +body { + cursor: default; + padding: 0; + border: 0; + margin: 0; + + text-align: center; + background-color: white; + font-family: Helvetica, Verdana, Arial, sans-serif; +} + +body, canvas, div { + outline: none; + -moz-user-select: none; + -webkit-user-select: none; + -ms-user-select: none; + -khtml-user-select: none; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); +} + +/* Remove spin of input type number */ +input::-webkit-outer-spin-button, +input::-webkit-inner-spin-button { + /* display: none; <- Crashes Chrome on hover */ + -webkit-appearance: none; + margin: 0; /* <-- Apparently some margin are still there even though it's hidden */ +} + +#Cocos2dGameContainer { + position: absolute; + margin: 0; + overflow: hidden; + left: 0px; + top: 0px; +} + +canvas { + background-color: rgba(0, 0, 0, 0); +} + +a:link, a:visited { + color: #000; +} + +a:active, a:hover { + color: #666; +} + +p.header { + font-size: small; +} + +p.footer { + font-size: x-small; +} + +#splash { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + + background: #171717 url(./splash.03ce1.png) no-repeat center; + background-size: 40%; +} + +.progress-bar { + background-color: #1a1a1a; + position: absolute; + left: 50%; + top: 80%; + height: 26px; + padding: 5px; + width: 350px; + margin: 0 -175px; + border-radius: 5px; + box-shadow: 0 1px 5px #000 inset, 0 1px 0 #444; +} + +.progress-bar span { + display: block; + height: 100%; + border-radius: 3px; + box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset; + transition: width .4s ease-in-out; + background-color: #34c2e3; +} + +.stripes span { + background-size: 30px 30px; + background-image: linear-gradient(135deg, rgba(255, 255, 255, .15) 25%, transparent 25%, + transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, + transparent 75%, transparent); + + animation: animate-stripes 1s linear infinite; +} + +@keyframes animate-stripes { + 0% {background-position: 0 0;} 100% {background-position: 60px 0;} +} + +h1 { + color: #444; + text-shadow: 3px 3px 15px; +} + +#GameDiv { + width: 800px; + height: 450px; + margin: 0 auto; + background: black; + position:relative; + border:5px solid black; + border-radius: 10px; + box-shadow: 0 5px 50px #333 +} diff --git a/ui/web-mobile/style-mobile.72851.css b/ui/web-mobile/style-mobile.72851.css new file mode 100644 index 0000000000000000000000000000000000000000..122426fc1799e06885e092dfd1aa3fbedc739cf6 --- /dev/null +++ b/ui/web-mobile/style-mobile.72851.css @@ -0,0 +1,122 @@ +html { + -ms-touch-action: none; +} + +body, canvas, div { + display: block; + outline: none; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + + -moz-user-select: none; + -webkit-user-select: none; + -ms-user-select: none; + -khtml-user-select: none; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); +} + +/* Remove spin of input type number */ +input::-webkit-outer-spin-button, +input::-webkit-inner-spin-button { + /* display: none; <- Crashes Chrome on hover */ + -webkit-appearance: none; + margin: 0; /* <-- Apparently some margin are still there even though it's hidden */ +} + +body { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + padding: 0; + border: 0; + margin: 0; + + cursor: default; + color: #888; + background-color: #333; + + text-align: center; + font-family: Helvetica, Verdana, Arial, sans-serif; + + display: flex; + flex-direction: column; +} + +#Cocos2dGameContainer { + position: absolute; + margin: 0; + overflow: hidden; + left: 0px; + top: 0px; + + display: -webkit-box; + -webkit-box-orient: horizontal; + -webkit-box-align: center; + -webkit-box-pack: center; +} + +canvas { + background-color: rgba(0, 0, 0, 0); +} + +a:link, a:visited { + color: #666; +} + +a:active, a:hover { + color: #666; +} + +p.header { + font-size: small; +} + +p.footer { + font-size: x-small; +} + +#splash { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: #171717 url(./splash.03ce1.png) no-repeat center; + background-size: 40%; +} + +.progress-bar { + background-color: #1a1a1a; + position: absolute; + left: 25%; + top: 80%; + height: 15px; + padding: 5px; + width: 50%; + /*margin: 0 -175px; */ + border-radius: 5px; + box-shadow: 0 1px 5px #000 inset, 0 1px 0 #444; +} + +.progress-bar span { + display: block; + height: 100%; + border-radius: 3px; + box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset; + transition: width .4s ease-in-out; + background-color: #34c2e3; +} + +.stripes span { + background-size: 30px 30px; + background-image: linear-gradient(135deg, rgba(255, 255, 255, .15) 25%, transparent 25%, + transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, + transparent 75%, transparent); + + animation: animate-stripes 1s linear infinite; +} + +@keyframes animate-stripes { + 0% {background-position: 0 0;} 100% {background-position: 60px 0;} +}