ibp-max 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.html +1 -1
- package/package.json +1 -1
- package/privacypolicy.js +2 -0
- package/privacypolicy.js.map +1 -0
- package/binder.js +0 -1
package/index.html
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
<!doctype html><html><head><meta name="viewport" content="width=device-width,initial-scale=1"><script defer="defer" src="index.js"></script><link href="index.css" rel="stylesheet"></head><body><div aga-component></div><script src="dist/index.js"></script><script>$(function(){
|
|
1
|
+
<!doctype html><html><head><meta name="viewport" content="width=device-width,initial-scale=1"><script defer="defer" src="index.js"></script><script defer="defer" src="privacypolicy.js"></script><link href="index.css" rel="stylesheet"></head><body><div aga-component></div><script src="dist/index.js"></script><script>$(function(){
|
|
2
2
|
alert('working');
|
|
3
3
|
});</script></body></html>
|
package/package.json
CHANGED
package/privacypolicy.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(()=>{var i={};!function(){var i=new c("div").a("data-privacy-policy","");i.n("style").h('.data-privacy-policy{display:block;width: 100%;background:var(--secondary-color-500);max-height:0;transition: 0.8s cubic-bezier(0.4, 0.0, 0.2, 1) all;}\n .data-privacy-policy.active{max-height:16vh;}\n .data-privacy-policy .content{display:-webkit-flex;display:flex;width:100%;margin:0 auto;max-width:1440px;flex-flow:row wrap;padding:6px;box-sizing:border-box;align-items: center;justify-content: center;}\n .data-privacy-policy .content h2{width:100%;color:var(--primary-color-500);font-size:16px;margin:0 0 6px 0;}\n .data-privacy-policy .content p{color:rgba(255,255,255,0.96);margin:0;font-size:12px;text-align: justify;line-height: 1.4;width: auto;} \n .data-privacy-policy .content p a{color:rgba(255,255,255,0.96);text-decoration: underline;}\n .data-privacy-policy .content .action{display:flex;display:-webkit-flex;padding-left:16px;}\n .data-privacy-policy .content .action a+a{margin-left:16px;background-color: var(--secondary-color-400);}\n .data-privacy-policy .content .action a{color: rgb(255,255,255);background-color: var(--primary-color-500);border: none;border-radius: 2px;position: relative;height: 36px;margin: 0;min-width: 64px;padding: 0 16px;display: inline-block;font-family: ""Roboto"", ""Helvetica"", ""Arial"", sans-serif;font-size: 14px;font-weight: 400;text-transform: capitalize;line-height: 1;letter-spacing: 0;overflow: hidden;will-change: box-shadow;-webkit-transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s cubic-bezier(0.4, 0, 0.2, 1), -webkit-box-shadow 0.2s cubic-bezier(0.4, 0, 1, 1);transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s cubic-bezier(0.4, 0, 0.2, 1), -webkit-box-shadow 0.2s cubic-bezier(0.4, 0, 1, 1);-o-transition: box-shadow 0.2s cubic-bezier(0.4, 0, 1, 1), background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s cubic-bezier(0.4, 0, 0.2, 1);transition: box-shadow 0.2s cubic-bezier(0.4, 0, 1, 1), background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s cubic-bezier(0.4, 0, 0.2, 1);transition: box-shadow 0.2s cubic-bezier(0.4, 0, 1, 1), background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s cubic-bezier(0.4, 0, 0.2, 1), -webkit-box-shadow 0.2s cubic-bezier(0.4, 0, 1, 1);outline: none;cursor: pointer;text-decoration: none;text-align: center;line-height: 36px;vertical-align: middle;} \n .data-privacy-policy .content .action label{color: rgb(255,255,255);background-color: var(--primary-color-500);border: none;border-radius: 2px;position: relative;height: 36px;margin: 0;min-width: 64px;padding: 0 16px;display: inline-block;font-family: ""Roboto"", ""Helvetica"", ""Arial"", sans-serif;font-size: 14px;font-weight: 400;text-transform: capitalize;line-height: 1;letter-spacing: 0;overflow: hidden;will-change: box-shadow;-webkit-transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s cubic-bezier(0.4, 0, 0.2, 1), -webkit-box-shadow 0.2s cubic-bezier(0.4, 0, 1, 1);transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s cubic-bezier(0.4, 0, 0.2, 1), -webkit-box-shadow 0.2s cubic-bezier(0.4, 0, 1, 1);-o-transition: box-shadow 0.2s cubic-bezier(0.4, 0, 1, 1), background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s cubic-bezier(0.4, 0, 0.2, 1);transition: box-shadow 0.2s cubic-bezier(0.4, 0, 1, 1), background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s cubic-bezier(0.4, 0, 0.2, 1);transition: box-shadow 0.2s cubic-bezier(0.4, 0, 1, 1), background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s cubic-bezier(0.4, 0, 0.2, 1), -webkit-box-shadow 0.2s cubic-bezier(0.4, 0, 1, 1);outline: none;cursor: pointer;text-decoration: none;text-align: center;line-height: 36px;vertical-align: middle;} \n @media only screen and (max-width:1024px){.data-privacy-policy .content p{width:100%;text-align: center;}.data-privacy-policy .content .action{width: 100%;padding-top:8px;padding-left:0;justify-content: center;}}');var o=i.n("div").a("class","content").n("p").h('We use cookies to improve your user experience. By continuing to visit our site, you agree to our use of cookies. <a title="" Our Privacy Policy"" href=""/privacy-policy"">Our Privacy Policy</a>').n("div");o.n("p").h('We use cookies to improve your user experience. By continuing to visit our site, you agree to our use of cookies. <a title="" Our Privacy Policy"" href=""/privacy-policy"">Our Privacy Policy</a>'),o.n("div").a("class","action").n("label").cl((function(){window.localStorage.setItem("PrivacyPolicy","1")})).a("class","s-c-p s-bi-lg").a("aria-label","Got it Button").a("data-privacy-policy","1").h("Got it"),document.body.appendChild(i.node)}();var o=exports;for(var e in i)o[e]=i[e];i.__esModule&&Object.defineProperty(o,"__esModule",{value:!0})})();
|
|
2
|
+
//# sourceMappingURL=privacypolicy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"privacypolicy.js","mappings":"gBACA,WACI,IAWIA,EAAgB,IAAIC,EAAE,OAAOC,EAAE,sBAAuB,IAC1DF,EAAcG,EAAE,SAASC,EAZb,g8HAaZ,IAAIC,EAAUL,EAAcG,EAAE,OAAOD,EAAE,QAAS,WAAWC,EAAE,KAAKC,EAAE,sMAAsMD,EAAE,OAC5QE,EAAQF,EAAE,KAAKC,EAAE,sMACjBC,EAAQF,EAAE,OAAOD,EAAE,QAAS,UAAUC,EAAE,SAASG,IAAG,WAAWC,OAAOC,aAAaC,QAAQ,gBAAgB,IAAK,IAAGP,EAAE,QAAS,iBAAiBA,EAAE,aAAc,iBAAiBA,EAAE,sBAAuB,KAAKE,EAAE,UAChNM,SAASC,KAAKC,YAAYZ,EAAca,KAC3C,CAlBD,G","sources":["webpack:///./src/PrivacyPolicy.js"],"sourcesContent":["\r\n(function(){\r\n var style = `.data-privacy-policy{display:block;width: 100%;background:var(--secondary-color-500);max-height:0;transition: 0.8s cubic-bezier(0.4, 0.0, 0.2, 1) all;}\r\n .data-privacy-policy.active{max-height:16vh;}\r\n .data-privacy-policy .content{display:-webkit-flex;display:flex;width:100%;margin:0 auto;max-width:1440px;flex-flow:row wrap;padding:6px;box-sizing:border-box;align-items: center;justify-content: center;}\r\n .data-privacy-policy .content h2{width:100%;color:var(--primary-color-500);font-size:16px;margin:0 0 6px 0;}\r\n .data-privacy-policy .content p{color:rgba(255,255,255,0.96);margin:0;font-size:12px;text-align: justify;line-height: 1.4;width: auto;} \r\n .data-privacy-policy .content p a{color:rgba(255,255,255,0.96);text-decoration: underline;}\r\n .data-privacy-policy .content .action{display:flex;display:-webkit-flex;padding-left:16px;}\r\n .data-privacy-policy .content .action a+a{margin-left:16px;background-color: var(--secondary-color-400);}\r\n .data-privacy-policy .content .action a{color: rgb(255,255,255);background-color: var(--primary-color-500);border: none;border-radius: 2px;position: relative;height: 36px;margin: 0;min-width: 64px;padding: 0 16px;display: inline-block;font-family: \"\"Roboto\"\", \"\"Helvetica\"\", \"\"Arial\"\", sans-serif;font-size: 14px;font-weight: 400;text-transform: capitalize;line-height: 1;letter-spacing: 0;overflow: hidden;will-change: box-shadow;-webkit-transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s cubic-bezier(0.4, 0, 0.2, 1), -webkit-box-shadow 0.2s cubic-bezier(0.4, 0, 1, 1);transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s cubic-bezier(0.4, 0, 0.2, 1), -webkit-box-shadow 0.2s cubic-bezier(0.4, 0, 1, 1);-o-transition: box-shadow 0.2s cubic-bezier(0.4, 0, 1, 1), background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s cubic-bezier(0.4, 0, 0.2, 1);transition: box-shadow 0.2s cubic-bezier(0.4, 0, 1, 1), background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s cubic-bezier(0.4, 0, 0.2, 1);transition: box-shadow 0.2s cubic-bezier(0.4, 0, 1, 1), background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s cubic-bezier(0.4, 0, 0.2, 1), -webkit-box-shadow 0.2s cubic-bezier(0.4, 0, 1, 1);outline: none;cursor: pointer;text-decoration: none;text-align: center;line-height: 36px;vertical-align: middle;} \r\n .data-privacy-policy .content .action label{color: rgb(255,255,255);background-color: var(--primary-color-500);border: none;border-radius: 2px;position: relative;height: 36px;margin: 0;min-width: 64px;padding: 0 16px;display: inline-block;font-family: \"\"Roboto\"\", \"\"Helvetica\"\", \"\"Arial\"\", sans-serif;font-size: 14px;font-weight: 400;text-transform: capitalize;line-height: 1;letter-spacing: 0;overflow: hidden;will-change: box-shadow;-webkit-transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s cubic-bezier(0.4, 0, 0.2, 1), -webkit-box-shadow 0.2s cubic-bezier(0.4, 0, 1, 1);transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s cubic-bezier(0.4, 0, 0.2, 1), -webkit-box-shadow 0.2s cubic-bezier(0.4, 0, 1, 1);-o-transition: box-shadow 0.2s cubic-bezier(0.4, 0, 1, 1), background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s cubic-bezier(0.4, 0, 0.2, 1);transition: box-shadow 0.2s cubic-bezier(0.4, 0, 1, 1), background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s cubic-bezier(0.4, 0, 0.2, 1);transition: box-shadow 0.2s cubic-bezier(0.4, 0, 1, 1), background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s cubic-bezier(0.4, 0, 0.2, 1), -webkit-box-shadow 0.2s cubic-bezier(0.4, 0, 1, 1);outline: none;cursor: pointer;text-decoration: none;text-align: center;line-height: 36px;vertical-align: middle;} \r\n @media only screen and (max-width:1024px){.data-privacy-policy .content p{width:100%;text-align: center;}.data-privacy-policy .content .action{width: 100%;padding-top:8px;padding-left:0;justify-content: center;}}`;\r\n var privacyPolicy = new c('div').a('data-privacy-policy', ''); \r\n privacyPolicy.n('style').h(style);\r\n var content = privacyPolicy.n('div').a('class', 'content').n('p').h('We use cookies to improve your user experience. By continuing to visit our site, you agree to our use of cookies. <a title=\"\" Our Privacy Policy\"\" href=\"\"/privacy-policy\"\">Our Privacy Policy</a>').n('div')\r\n content.n('p').h('We use cookies to improve your user experience. By continuing to visit our site, you agree to our use of cookies. <a title=\"\" Our Privacy Policy\"\" href=\"\"/privacy-policy\"\">Our Privacy Policy</a>');\r\n content.n('div').a('class', 'action').n('label').cl(function(){window.localStorage.setItem('PrivacyPolicy','1');}).a('class', 's-c-p s-bi-lg').a('aria-label', 'Got it Button').a('data-privacy-policy', '1').h('Got it');\r\n document.body.appendChild(privacyPolicy.node);\r\n})();\r\n\r\n\r\n"],"names":["privacyPolicy","c","a","n","h","content","cl","window","localStorage","setItem","document","body","appendChild","node"],"sourceRoot":""}
|
package/binder.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
!async function(){var systemFunctions={};function Interpolation(e,t,n,r=[],i=[],l=(()=>{})){let s=RegExp("\\{\\{[^\\}]+\\}\\}","gi"),o=e=>{l()},u="";for(let e of t.getAttributeNames()){let n=t.getAttribute(e);null!=n&&d(n,(n=>{t.setAttribute(e,n),c(t)}))}function c(e){null!=e&&(e.classList.contains("aga-fake-contains")||e.classList.contains("ag-fake-inline-contains"))&&(e.classList.remove("ag-fake-contains"),e.classList.remove("ag-fake-inline-contains"),1==e.childNodes[0].nodeType&&e.childNodes[0].remove())}function d(e,r){let i=e.match(s),a=()=>"",f=()=>{r(a())};if(null!=i){u=e;let r=[],l=!1;i.forEach((e=>{let i=e.substring(2,e.length-2);u=u.replace(e,`\${typeof(${i})!='undefined'?${i}:''}`);let s=ExtractVariablesTopLevelIdentifiers(i);r.push(...s.filter((e=>0>r.indexOf(e)))),i!=r[r.length-1]&&Watch(t,n,r[r.length-1],((e,t,n)=>{f()})),IsFunction(systemFunctions,i)?(l=!0,ExtractArgumentVariablesForFunctionFromString(i).forEach((e=>{Watch(t,n,e,((e,t,n)=>{f()}))}))):Watch(t,n,i,((e,t,n)=>{f()}))}));let s=Function(`try{const {${r.join(",")}} = this; return \`${u}\`; }catch(e){ console.error(e); }return '';`).bind(l?interpolateObject(n):n);a=()=>s();let m=o;o=e=>{f(),m(e)}}}t.childNodes.forEach((t=>{if(t.nodeType==Node.ELEMENT_NODE){Interpolation(e,t,n,r,i,(()=>{}));let l=t;for(let e of l.getAttributeNames()){let t=l.getAttribute(e);null!=t&&d(t,(t=>{l.setAttribute(e,t),c(l)}))}}t.nodeType==Node.TEXT_NODE&&null!=t.textContent&&t.textContent.trim().length>0&&(0==t.textContent.indexOf("{{")&&t.textContent==t.parentElement.innerText?d(t.textContent,(e=>{c(t.parentElement),t.parentElement.innerHTML=e})):d(t.textContent,(e=>{c(t.parentElement),t.textContent=e})))})),o(n)}function interpolateObject(e){return Object.assign(e,systemFunctions)}function PreInterpolation(e,t){null==t&&(t=e);let n=t.hasAttribute("ag-fake");if(n)for(let t of e.getAttributeNames()){let n=e.getAttribute(t);null!=n&&n.indexOf("{{")>-1&&e.setAttribute(t,n.replace(/(\{\{)|(\}\})/gi,"")),e.classList.add("ag-fake-inline-contains")}e.childNodes.forEach((e=>{if(e.nodeType==Node.ELEMENT_NODE&&"OPTION"!=e.nodeName){if(PreInterpolation(e,t),n)for(let t of e.getAttributeNames()){let n=e.getAttribute(t);null!=n&&n.indexOf("{{")>-1&&e.setAttribute(t,n.replace(/(\{\{)|(\}\})/gi,""))}}else if(e.nodeType==Node.TEXT_NODE&&null!=e.textContent&&e.textContent.indexOf("{{")>-1&&e.textContent.trim().length>0){let t=document.createElement("i");t.classList.add("ag-fake");let r=e.parentElement;null!=r&&!r.classList.contains("ag-fake-contains")&&(r.insertBefore(t,r.firstChild),r.classList.add("ag-fake-contains"),n&&(e.textContent=e.textContent.replace(/(\{\{)|(\}\})/gi,"")))}}))}function Watch(){}function GetValue(e,t){if(0>t.indexOf("(")&&t.indexOf(".")>-1){let n=t.substring(0,t.indexOf(".")),r=t.substring(t.indexOf(".")+1,t.length);return GetValue(e[n],r)}return t.indexOf("(")>-1?getValueFromFunction(e,t):null!=e?e[t]:void 0}function IsFunction(e,t){return t.indexOf("(")>-1&&"function"==typeof e[getFunctionName(t)]}function GetProxyObject(e){if(void 0===e||null==e)return e;let t={};for(let n in e)SetPropertyToProxyObject(e,t,n);return t}function SetPropertyToProxyObject(e,t,n){"function"==typeof e[n]?t[n]=e[n]:Object.defineProperty(t,n,{get:()=>e[n],set(t){e[n]=t,Notify(null,e,n,!0)},enumerable:!0,configurable:!0})}function SetPropertyDescriptorToProxyObject(e,t,n){Object.defineProperty(e,t,n)}function ConverObjectToArgumentArray(e){let t={arguments:[],values:[]};for(let n in e)t.arguments.push(n),t.values.push(e[n]);return t}function insertAfter(e,t){null!=t.parentNode&&t.parentNode.insertBefore(e,t.nextSibling)}function insertBefore(e,t){t.parentNode.insertBefore(e,t)}let variablesFromStringExpression=RegExp("((?<string>([\"'`].*?[\"'`]))|(?<boolean>(true|false))|((?<function>[A-z_][A-z0-9.$]+)[(])|(?<identifier>[A-z_][A-z0-9.$]+))","gi"),variableTopLevelIdentifiersExpression=RegExp("(?<variable>[A-z0-9_\\$]+)(((\\.[^\\s\\=\\&\\|]*)|\\())?","gi");function ExtractVariablesTopLevelIdentifiers(e){let t=[];try{let n=null;for(;null!=(n=variableTopLevelIdentifiersExpression.exec(e));)n.groups&&n.groups.variable&&t.push(n.groups.variable)}catch(e){}return t}function ExtractVariablesFromString(e){let t={functions:[],identifiers:[]};try{let n=null;for(;null!=(n=variablesFromStringExpression.exec(e));)n.groups&&(n.groups.identifier&&t.identifiers.push(n.groups.identifier),n.groups.function&&t.functions.push(n.groups.function))}catch(e){}return t}function ExtractArgumentVariablesForFunctionFromString(e){let t=[],n=e.indexOf("("),r=e.indexOf(")");n>-1&&e.substring(0,n);let i=e.substring(n+1,r).match(RegExp("[^,]+","gi"));return null!=i&&i.forEach((e=>{/^(_|[A-z])(_|[A-z]|[0-9]|\$)+$/.test(e.trim())&&t.push(e.trim())})),t}function getFunctionName(e){let t=-1;return(t=e.indexOf("("))>-1?e.substring(0,t):e}function getValueFromFunction(e,t){let n=[],r=t.indexOf("("),i=t.indexOf(")"),l=r>-1?t.substring(0,r):t,s=t.substring(r+1,i).match(RegExp("[^,]+","gi"));return null!=s&&s.forEach((t=>{n.push(GetValue(e,t))})),"function"==typeof e[l]?e[l].apply(e,n):void 0}function If(e,t,n){t.querySelectorAll("[ag-if]",t).forEach((t=>{let r=[],i=t,l=t.parentElement,s=null,u=[],m="ag-if",p="ag-else-if",h="ag-else";for(;null!=i&&(t==i&&i.hasAttribute(m)||i.hasAttribute(p)||i.hasAttribute(h));){let e=i;e.classList.remove("ag-fake-mask"),i=e.nextElementSibling;let t=e.hasAttribute(m)?m:e.hasAttribute(p)?p:h,n=e.getAttribute(t);e.removeAttribute(t),null!=n&&ExtractVariablesFromString(n).identifiers.forEach((e=>{0>u.indexOf(e)&&u.push(e)})),r.push({node:e.cloneNode(!0),expression:n,position:e.nextSibling,isDefault:t==h}),e.remove()}let x=ConverObjectToArgumentArray(n),g=t=>{for(let i of(x=ConverObjectToArgumentArray(t),null!=s&&s.active.remove(),r)){let t=!1;if(t=i.isDefault?i.isDefault:Function(...x.arguments,`return ${i.expression};`)(...x.values)){s=i;try{let t=b(i.position);if(null!=l){let r=i.node.cloneNode(!0);i.active=r,l.insertBefore(r,t),TransformInternal(e,r,n)}}catch(e){}break}}};function b(e){return null==e||document.contains(e)?e:b(e.previousElementSibling)}for(let e of u)Watch(t,n,e,((e,t,n)=>{t&&g(e)}));g(n)}))}function PreIf(e){let t=e.querySelectorAll("[ag-if]",e),n=e.hasAttribute("ag-fake");t.forEach((e=>{let t=e,r=!1,i="ag-if",l="ag-else-if",s="ag-else";for(;null!=t&&(e==t&&t.hasAttribute(i)||t.hasAttribute(l)||t.hasAttribute(s));){let e=t;!r&&e.hasAttribute("ag-fake")?r=!0:r||!r&&!t.hasAttribute(s)?e.classList.add("ag-fake-mask"):r=!0,n&&(e.removeAttribute(i),e.removeAttribute(l),e.removeAttribute(s)),t=e.nextElementSibling}r||e.classList.remove("ag-fake-mask")}))}function For(html,dom,context){let htmlDocument=html,loops;return dom.querySelectorAll("[ag-for]",dom).forEach((item=>{let expression=RegExp("\\s*([A-z0-9]+)\\s+(in)\\s+([A-z0-9\\.]+)\\s*","gi"),loopConstraint=item.getAttribute("ag-for");if(null==loopConstraint)return;let itratorFinished=item.getAttribute("ag-for-complete"),fieldsAndValue=expression.exec(loopConstraint),itrator=null!=fieldsAndValue?fieldsAndValue[1]:"",collection=null!=fieldsAndValue?fieldsAndValue[3]:"",fakeItem=item.nextElementSibling,fakeItemCount=0,isfakeItemCountReaded=!1,htmlToClone=item.cloneNode(!0),htmlToCloneParent=item.parentElement,htmlToCloneLocation=item.nextSibling;htmlToClone.removeAttribute("ag-for"),item.remove();let itemElements=[],isDirtyFake=!1,collectionContext=getCollectionObject(context,collection),collectionContextField=getCollectionName(collection);try{SetPropertyDescriptorToProxyObject(collectionContext,`${collectionContextField}$for`,{value:0,writable:!0,enumerable:!0})}catch(e){}let render=e=>{for(let e of itemElements)e.remove();let t=GetValue(e,collection),n=0,r=!1;if(Array.isArray(t)){for(let e of(isDirtyFake=!0,htmlToCloneLocation=removePreFor(),t)){let t=GetProxyObject(context);SetPropertyDescriptorToProxyObject(t,itrator,{get:()=>e,set(t){e=t},enumerable:!0}),SetPropertyDescriptorToProxyObject(t,"row$Index",{value:n+1,writable:!0,enumerable:!0}),SetPropertyDescriptorToProxyObject(t,`${itrator}$Index`,{value:n+1,writable:!0,enumerable:!0});let i=htmlToClone.cloneNode(!0);r?insertAfter(i,itemElements[itemElements.length-1]):(htmlToCloneParent?.insertBefore(i,htmlToCloneLocation),r=!0),TransformInternal(htmlDocument,i,t),itemElements.push(i),n++}try{SetPropertyDescriptorToProxyObject(collectionContext,`${collectionContextField}$for`,{value:Date.now(),writable:!0,enumerable:!0});let e=new CustomEvent("ag-for-completed");htmlToCloneParent?.dispatchEvent(e)}catch(e){}}else void 0===t&&null!=fakeItem&&fakeItem.hasAttribute("ag-for-fake")&&isDirtyFake&&(fakeItem=PreForPartial(fakeItem,htmlToCloneParent,htmlToCloneLocation,fakeItemCount))};if(itratorFinished){let functionName="",value=itratorFinished;if(null!=value&&""!=value){let getParameterName=e=>"this"==e?"sender":e.indexOf(".")>-1?e.replace(".","_"):e,getValue=(e,t)=>{if(0>t.indexOf("(")&&t.indexOf(".")>-1){let n=t.substring(0,t.indexOf(".")),r=t.substring(t.indexOf(".")+1,t.length);return getValue(e[n],r)}return t.indexOf("(")>-1?getValueFromFunction(e,t):e[t]},getFunctionFromCollection=(e,t,n)=>()=>{if(null!=e.__proto__[t])return e.__proto__[t](...n);Object.keys(e).forEach((r=>"object"==typeof e[r]?getFunctionFromCollection(e[r],t,n):"function"==typeof e[r]&&r==t?e[r](...n):void 0))},getValueFromFunction=(e,t)=>{let n=[],r=t.indexOf("("),i=t.indexOf(")"),l=r>-1?t.substring(0,r):t,s=t.substring(r+1,i).match(RegExp("[^,]+","gi"));return null!=s&&s.forEach((t=>{n.push(getValue(e,t))})),e[l].apply(e,n)};functionName=value.substring(0,value.indexOf("(")>-1?value.indexOf("("):value.length);let expression=RegExp("(\\((?<params>.*?)\\))");if(expression.test(value)){let paramsString=value.match(expression);if(null!=paramsString&&null!=paramsString&&null!=paramsString.groups){let params=paramsString.groups.params.split(","),paramsItem={};for(let e in params){if("this"==params[e])continue;let t=RegExp("^(\\'|[0-9])").test(params[e]);paramsItem[t?"item_"+e:getParameterName(params[e])]=t}Watch(item,collectionContext,`${collectionContextField}$for`,((data,isChange,isUserChange)=>{let args=[];for(var key in params)if("this"==params[key]||"sender"==params[key])args.push(htmlToCloneParent);else if("data"==params[key])args.push(data);else{let paramValue=paramsItem[getParameterName(params[key])]?eval(params[key]):getValue(data,params[key]);args.push(paramValue)}try{if(null!=data[functionName])data[functionName].apply(data,args);else{let e=getFunctionFromCollection(data,functionName,args);null!=e&&e(args)}}catch(e){}}))}}}}function getCollectionObject(e,t){if(0>t.indexOf("(")&&t.indexOf(".")>-1){let n=t.substring(0,t.indexOf(".")),r=t.substring(t.indexOf(".")+1,t.length);return getCollectionObject(e[n],r)}return t.indexOf("("),e}function getCollectionName(e){return 0>e.indexOf("(")&&e.indexOf(".")>-1?(e.substring(0,e.indexOf(".")),getCollectionName(e.substring(e.indexOf(".")+1,e.length))):e}function removePreFor(){if(null!=fakeItem&&fakeItem.hasAttribute("ag-for-fake")){htmlToClone.classList.remove("ag-fake-mask");let e=fakeItem;for(;null!=e&&e.hasAttribute("ag-for-fake");){!isfakeItemCountReaded&&fakeItemCount++;let t=e;e=e.nextElementSibling,t.remove()}return isfakeItemCountReaded=!0,e}return fakeItem}render(context),Watch(item,context,collection,((e,t,n)=>{t&&render(e)}))})),htmlDocument.innerHTML}function PreForPartial(e,t,n,r){let i=null,l=null,s=!1;for(let u=0;u<r;u++){let r=e.cloneNode(!0);s?insertAfter(r,i):(t?.insertBefore(r,n),s=!0,l=r),i=r}return l}function PreFor(e){e.querySelectorAll("[ag-for][ag-for-fake]:not(.ag-fake-mask)",e).forEach((e=>{if("OPTION"==e.tagName)return;let t=e.cloneNode(!0);t.setAttribute("ag-fake","");let n=1,r=e.getAttribute("ag-for-fake");null!=r?n=parseInt(r):t.setAttribute("ag-for-fake",""),t.removeAttribute("ag-for"),e.removeAttribute("ag-for-fake"),e.classList.add("ag-fake-mask"),PreTransformInternal(t);for(let r=0;r<n;r++)e.parentElement?.appendChild(t.cloneNode(!0))}))}function TransformInternal(e,t,n){For(t,t,n),If(t,t,n),Interpolation(t,t,n)}function PreTransformInternal(e){PreFor(e),PreIf(e),PreInterpolation(e)}async function findRenders(){document.querySelectorAll("[ag-render]:not(.ag-render)").forEach((async function(e,t){attachAction(e)}))}async function attachAction(e){e.classList.add("ag-render");var t=e.getAttribute("ag-render");PreTransformInternal(e);var n="ag.render.hydrate."+t,r=e.innerHTML;document.body.addEventListener(n,(async function(){var n=GetValue(window,t);e.innerHTML=r,TransformInternal(e,e,n)}))}async function requestData(e,t){var n="";for(var r in t)n=n+(""!=n?"&":"")+r+"="+t[r];return(await fetch(e+=e.indexOf("?")>-1?"&":"?"+n,{method:"GET",mode:"cors",cache:"no-cache",headers:{"Content-Type":"application/json"}})).json()}async function initPage(e,t,n,r){n||(n={}),n.PageSize||(n.PageSize=12),n.PageNumber||(n.PageNumber=1);var i=await requestData(t,n);window[e]=i,window.agRender.hydrate(e)}async function nextPage(e,t,n,r){n.PageNumber+=1;var i=await requestData(t,n);window[e]=i,window.agRender.hydrate(e)}async function previousPage(e,t,n,r){if(n.PageNumber>1){n.PageNumber-=1;var i=await requestData(t,n);window[e]=i,window.agRender.hydrate(e)}}async function morePage(e,t,n,r){n.PageNumber+=1;var i=await requestData(t,n);window[e].Items.push(...i.Items),window.agRender.hydrate(e)}async function init(){document.body.addEventListener("ag.render.refresh",findRenders),document.body.addEventListener("ag.refresh",findRenders);var e=new CustomEvent("ag.render.refresh");document.body.dispatchEvent(e),window.agRender={hydrate:function(e){var t=new CustomEvent("ag.render.hydrate."+e);document.body.dispatchEvent(t);t=new CustomEvent("ag.lazy.refresh");document.body.dispatchEvent(t)},next:function(e){var t=new CustomEvent("ag.render."+e+".page.next");document.body.dispatchEvent(t)},previous:function(e){var t=new CustomEvent("ag.render."+e+".page.previous");document.body.dispatchEvent(t)},more:function(e){var t=new CustomEvent("ag.render."+e+".page.more");document.body.dispatchEvent(t)},pagedResult:function(e,t,n,r){document.body.addEventListener("ag.render."+e+".page.next",(function(){nextPage(e,t,n,r)})),document.body.addEventListener("ag.render."+e+".page.previous",(function(){previousPage(e,t,n,r)})),document.body.addEventListener("ag.render."+e+".page.more",(function(){morePage(e,t,n,r)})),initPage(e,t,n,r)}}}init()}();
|