/*!
 * @ikrong/frontend-framework-compiler v1.0.10
 * (c) 2022-2023 ikrong
 * Released under the MIT License.
 * Generated: 2023-11-18
 * Dependencies: None
 */
(function(exports){"use strict";var __assign=function(){return __assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},__assign.apply(this,arguments)};function normalizeArray(e,t){for(var r=0,n=e.length-1;n>=0;n--){var i=e[n];"."===i?e.splice(n,1):".."===i?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,splitPath=function(e){return splitPathRe.exec(e).slice(1)};function resolve(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n=r>=0?arguments[r]:"/";if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");n&&(e=n+"/"+e,t="/"===n.charAt(0))}return(t?"/":"")+(e=normalizeArray(filter(e.split("/"),(function(e){return!!e})),!t).join("/"))||"."}function normalize(e){var t=isAbsolute(e),r="/"===substr(e,-1);return(e=normalizeArray(filter(e.split("/"),(function(e){return!!e})),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e}function isAbsolute(e){return"/"===e.charAt(0)}function join(){var e=Array.prototype.slice.call(arguments,0);return normalize(filter(e,(function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))}function relative(e,t){function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=resolve(e).substr(1),t=resolve(t).substr(1);for(var n=r(e.split("/")),i=r(t.split("/")),o=Math.min(n.length,i.length),s=o,u=0;u<o;u++)if(n[u]!==i[u]){s=u;break}var l=[];for(u=s;u<n.length;u++)l.push("..");return(l=l.concat(i.slice(s))).join("/")}var sep="/",delimiter=":";function dirname(e){var t=splitPath(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."}function basename(e,t){var r=splitPath(e)[2];return t&&r.substr(-1*t.length)===t&&(r=r.substr(0,r.length-t.length)),r}function extname(e){return splitPath(e)[3]}var path={extname:extname,basename:basename,dirname:dirname,sep:sep,delimiter:delimiter,relative:relative,join:join,isAbsolute:isAbsolute,normalize:normalize,resolve:resolve};function filter(e,t){if(e.filter)return e.filter(t);for(var r=[],n=0;n<e.length;n++)t(e[n],n,e)&&r.push(e[n]);return r}var substr="b"==="ab".substr(-1)?function(e,t,r){return e.substr(t,r)}:function(e,t,r){return t<0&&(t=e.length+t),e.substr(t,r)};function getFilePath(e,t,r){t=path.resolve("/",r?path.dirname(r):"/",t);var n=["",".ts",".js","/index.ts","/index.js"].find((function(r){return e[""+t+r]}));if("string"==typeof n)return""+t+n}function formatFiles(e){return Object.keys(e).reduce((function(t,r){return t[path.resolve(r)]=e[r],t}),{})}var Render=function(){function Render(e,t){void 0===e&&(e={}),this.compiledFiles=e,this.staicModules={},this.moduleStore={},this.compiledFiles=formatFiles(e),(null==t?void 0:t.modules)&&(this.staicModules=t.modules||{},this.moduleStore=t.moduleStore||{})}return Render.prototype.get=function(e){return e=path.resolve(e),this.getModule(e)},Render.prototype.getVueModule=function(e){var t,r=this,n=this.compiledFiles[e],i=n.script,o=n.template,s=n.styles,u=n.components,l=n.vueId,a=0,d=this.getCmJSModule(i,e),c=this.getCmJSModule(o,e),p=Object.assign(d&&d.default?d.default:d||{},c&&c.default?c.default:c||{},u?{components:Object.keys(u).reduce((function(e,t){var n;return __assign(__assign({},e),((n={})[t]=r.getVueModule(u[t]),n))}),{})}:{},(null==s?void 0:s.length)?{mixins:[{mounted:function(){var e,r;t||(t=s.map((function(e){var t=document.createElement("style");return t.textContent=e,t})));var n=(null===(r=null===(e=this.$el)||void 0===e?void 0:e.getRootNode)||void 0===r?void 0:r.call(e))===document?document.head:this.$el.getRootNode();t.map((function(e){return n.append(e)})),a++},unmounted:function(){0==--a&&t.map((function(e){return e.remove()}))}}]}:{},l?{__scopeId:"data-v-"+l}:{});return p},Render.prototype.getJSModule=function(e){return this.getCmJSModule(this.compiledFiles[e].script,e)},Render.prototype.getCmJSModule=function(code,parentFile){var modules={exports:{}};return eval("(function(exports, require, module){;"+code+"\n})")(modules.exports,this.resolveDeps.bind(this,parentFile),modules),modules.exports},Render.prototype.resolveDeps=function(e,t){var r=getFilePath(this.compiledFiles,t,e);return this.staicModules[t]?this.staicModules[t]:this.moduleStore[t]?this.moduleStore[t]:this.compiledFiles[t]?this.getModule(t):this.compiledFiles[r]?this.getModule(r):void 0},Render.prototype.getModule=function(e){var t;return e.endsWith(".vue")?t=this.getVueModule(e):this.compiledFiles[e].script&&(t=this.getJSModule(e)),t&&(this.moduleStore[e]=t),t},Render}(),Vue3Render=Render;exports.Vue3Render=Vue3Render,Object.defineProperty(exports,"__esModule",{value:!0})})(this.FE=this.FE||{});
