1 /*
2  * Copyright (c) 2020-2023 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef OHOS_ACELITE_FRAMEWORK_MIN_JS_H
17 #define OHOS_ACELITE_FRAMEWORK_MIN_JS_H
18 
19 // AUTO GENERATED, PLEASE DO NOT EDIT DIRECTLY
20 #include <stdint.h>
21 
22 #ifndef ACELITE_FRAMEWORK_RAW_BUFFER
23 #error THIS FILE CAN ONLY BE INCLUDED BY RAW BUFFER CPP
24 #endif
25 
26 #ifndef OHOS_ACELITE_FRAMEWORK_MIN_JS_BUFFER
27 #define OHOS_ACELITE_FRAMEWORK_MIN_JS_BUFFER
28 const char * const g_frameworkJSBuffer =
29     "!function(t,e){'object'==typeof exports&&'undefined'!=typeof module?module.exports=e():'fun"
30     "ction'==typeof define&&define.amd?define(e):(t=t||self).ViewModel=e()}(this,(function(){'u"
31     "se strict';var t={stack:[],push:function(t){this.stack.push(t)},pop:function(){return this"
32     ".stack.pop()},top:function(){return this.stack[this.stack.length-1]}},e=function(t){return"
33     "'object'==typeof t&&null!==t},n=function(t,e,n){Object.defineProperty(t,e,{enumerable:!1,v"
34     "alue:n})};function i(t,e,n,i){this._ctx=t,this._getter=e,this._fn=n,this._meta=i,this._las"
35     "tValue=this._get()}function o(e){this._hijacking=!0,n(e,'__ob__',this),Array.isArray(e)&&f"
36     "unction(t){s.forEach((function(e){var i=t[e];n(t,e,(function(){var n,s=Array.prototype.sli"
37     "ce.call(arguments);i.apply(this,s),r.PUSH===e||r.UNSHIFT===e?n=s:r.SPLICE===e&&(n=s.slice("
38     "2)),n&&n.length&&n.forEach(o.of);var c=t.__ob__;c&&c.notifyParent()}))}))}(e),Object.keys("
39     "e).forEach((function(n){return function(e,n,i){var r=e.__ob__;Object.defineProperty(e,n,{e"
40     "numerable:!0,get:function(){var e=t.top();e&&e.subscribe(r,n);var s=o.of(i);return o.is(s)"
41     "&&s.setParent(r,n),i},set:function(t){i=t,r.notify(n)}})}(e,n,e[n])}))}i.prototype._get=fu"
42     "nction(){try{return t.push(this),this._getter.call(this._ctx)}finally{t.pop()}},i.prototyp"
43     "e.update=function(){var t=this._lastValue,n=this._get(),i=this._ctx,o=this._meta;(n!==t||e"
44     "(n))&&(this._fn.call(i,n,t,o),this._lastValue=n)},i.prototype.subscribe=function(t,e){var "
45     "n=t.attach(e,this);'function'==typeof n&&(this._detaches||(this._detaches=new Set),this._d"
46     "etaches.add(n))},i.prototype.unsubscribe=function(){var t=this._detaches;t&&(t.forEach((fu"
47     "nction(t){t()})),this._detaches.clear())},o.of=function(t){return t&&e(t)?t.__ob__?t.__ob_"
48     "_:new o(t):t},o.is=function(t){return t&&t._hijacking},o.prototype.attach=function(t,e){if"
49     "(void 0!==t&&e){this._obsMap||(this._obsMap={}),this._obsMap[t]||(this._obsMap[t]=new Set)"
50     ";var n=this._obsMap[t];return n.has(e)?void 0:(n.add(e),function(){n.delete(e)})}},o.proto"
51     "type.notify=function(t){void 0!==t&&this._obsMap&&this._obsMap[t]&&this._obsMap[t].forEach"
52     "((function(t){return t.update()}))},o.prototype.setParent=function(t,e){this._parent=t,thi"
53     "s._key=e},o.prototype.notifyParent=function(){this._parent&&this._parent.notify(this._key)"
54     "};var r={PUSH:'push',POP:'pop',UNSHIFT:'unshift',SHIFT:'shift',SORT:'sort',SPLICE:'splice'"
55     ",REVERSE:'reverse'},s=Object.keys(r).map((function(t){return r[t]}));function c(t){if(!(th"
56     "is instanceof c))return new c(t);var e=this._vm=this;'[object Object]'===Object.prototype."
57     "toString.call(t)&&Object.keys(t).forEach((function(n){var i=t[n];'render'===n?e.$render=i:"
58     "'data'===n?function(t,e){'function'==typeof e&&(e=e.call(t,t));if('undefined'!=typeof __ap"
59     "pVing__&&__appVing__)return void(t.data=e);Object.keys(e).forEach((function(n){return func"
60     "tion(t,e,n){Object.defineProperty(t,n,{enumerable:!1,configurable:!0,get:function(){return"
61     " e[n]},set:function(t){e[n]=t}})}(t,e,n)})),o.of(e)}(e,i):'styleSheet'===n?initStyleSheet("
62     "i):'function'==typeof i&&(e[n]=i.bind(e))}))}return c.prototype.$watch=function(t,e,n){ret"
63     "urn new i(this,t,e,n)},c}));";
64 #endif
65 #endif // OHOS_ACELITE_FRAMEWORK_MIN_JS_H